19
19
import com .google .api .core .ApiFuture ;
20
20
import com .google .api .core .ApiFutures ;
21
21
import com .google .api .gax .core .BackgroundResource ;
22
+ import com .google .api .gax .httpjson .longrunning .OperationsClient ;
22
23
import com .google .api .gax .longrunning .OperationFuture ;
23
24
import com .google .api .gax .paging .AbstractFixedSizeCollection ;
24
25
import com .google .api .gax .paging .AbstractPage ;
30
31
import com .google .cloud .dialogflow .v2 .stub .AgentsStubSettings ;
31
32
import com .google .common .util .concurrent .MoreExecutors ;
32
33
import com .google .longrunning .Operation ;
33
- import com .google .longrunning .OperationsClient ;
34
34
import com .google .protobuf .Empty ;
35
35
import com .google .protobuf .Struct ;
36
36
import java .io .IOException ;
101
101
* AgentsClient agentsClient = AgentsClient.create(agentsSettings);
102
102
* }</pre>
103
103
*
104
+ * <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
105
+ * the wire:
106
+ *
107
+ * <pre>{@code
108
+ * // This snippet has been automatically generated for illustrative purposes only.
109
+ * // It may require modifications to work in your environment.
110
+ * AgentsSettings agentsSettings =
111
+ * AgentsSettings.newBuilder()
112
+ * .setTransportChannelProvider(
113
+ * AgentsSettings.defaultHttpJsonTransportProviderBuilder().build())
114
+ * .build();
115
+ * AgentsClient agentsClient = AgentsClient.create(agentsSettings);
116
+ * }</pre>
117
+ *
104
118
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
105
119
*/
106
120
@ Generated ("by gapic-generator-java" )
107
121
public class AgentsClient implements BackgroundResource {
108
122
private final AgentsSettings settings ;
109
123
private final AgentsStub stub ;
110
- private final OperationsClient operationsClient ;
124
+ private final OperationsClient httpJsonOperationsClient ;
125
+ private final com .google .longrunning .OperationsClient operationsClient ;
111
126
112
127
/** Constructs an instance of AgentsClient with default settings. */
113
128
public static final AgentsClient create () throws IOException {
@@ -137,13 +152,17 @@ public static final AgentsClient create(AgentsStub stub) {
137
152
protected AgentsClient (AgentsSettings settings ) throws IOException {
138
153
this .settings = settings ;
139
154
this .stub = ((AgentsStubSettings ) settings .getStubSettings ()).createStub ();
140
- this .operationsClient = OperationsClient .create (this .stub .getOperationsStub ());
155
+ this .operationsClient =
156
+ com .google .longrunning .OperationsClient .create (this .stub .getOperationsStub ());
157
+ this .httpJsonOperationsClient = OperationsClient .create (this .stub .getHttpJsonOperationsStub ());
141
158
}
142
159
143
160
protected AgentsClient (AgentsStub stub ) {
144
161
this .settings = null ;
145
162
this .stub = stub ;
146
- this .operationsClient = OperationsClient .create (this .stub .getOperationsStub ());
163
+ this .operationsClient =
164
+ com .google .longrunning .OperationsClient .create (this .stub .getOperationsStub ());
165
+ this .httpJsonOperationsClient = OperationsClient .create (this .stub .getHttpJsonOperationsStub ());
147
166
}
148
167
149
168
public final AgentsSettings getSettings () {
@@ -158,10 +177,18 @@ public AgentsStub getStub() {
158
177
* Returns the OperationsClient that can be used to query the status of a long-running operation
159
178
* returned by another API method call.
160
179
*/
161
- public final OperationsClient getOperationsClient () {
180
+ public final com . google . longrunning . OperationsClient getOperationsClient () {
162
181
return operationsClient ;
163
182
}
164
183
184
+ /**
185
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
186
+ * returned by another API method call.
187
+ */
188
+ public final OperationsClient getHttpJsonOperationsClient () {
189
+ return httpJsonOperationsClient ;
190
+ }
191
+
165
192
// AUTO-GENERATED DOCUMENTATION AND METHOD.
166
193
/**
167
194
* Retrieves the specified agent.
0 commit comments