17
17
package com .google .cloud .retail .v2 ;
18
18
19
19
import com .google .api .gax .core .BackgroundResource ;
20
+ import com .google .api .gax .httpjson .longrunning .OperationsClient ;
20
21
import com .google .api .gax .longrunning .OperationFuture ;
21
22
import com .google .api .gax .rpc .OperationCallable ;
22
23
import com .google .api .gax .rpc .UnaryCallable ;
23
24
import com .google .cloud .retail .v2 .stub .CompletionServiceStub ;
24
25
import com .google .cloud .retail .v2 .stub .CompletionServiceStubSettings ;
25
26
import com .google .longrunning .Operation ;
26
- import com .google .longrunning .OperationsClient ;
27
27
import java .io .IOException ;
28
28
import java .util .concurrent .TimeUnit ;
29
29
import javax .annotation .Generated ;
107
107
* CompletionServiceClient.create(completionServiceSettings);
108
108
* }</pre>
109
109
*
110
+ * <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
111
+ * the wire:
112
+ *
113
+ * <pre>{@code
114
+ * // This snippet has been automatically generated for illustrative purposes only.
115
+ * // It may require modifications to work in your environment.
116
+ * CompletionServiceSettings completionServiceSettings =
117
+ * CompletionServiceSettings.newBuilder()
118
+ * .setTransportChannelProvider(
119
+ * CompletionServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
120
+ * .build();
121
+ * CompletionServiceClient completionServiceClient =
122
+ * CompletionServiceClient.create(completionServiceSettings);
123
+ * }</pre>
124
+ *
110
125
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
111
126
*/
112
127
@ Generated ("by gapic-generator-java" )
113
128
public class CompletionServiceClient implements BackgroundResource {
114
129
private final CompletionServiceSettings settings ;
115
130
private final CompletionServiceStub stub ;
116
- private final OperationsClient operationsClient ;
131
+ private final OperationsClient httpJsonOperationsClient ;
132
+ private final com .google .longrunning .OperationsClient operationsClient ;
117
133
118
134
/** Constructs an instance of CompletionServiceClient with default settings. */
119
135
public static final CompletionServiceClient create () throws IOException {
@@ -145,13 +161,17 @@ public static final CompletionServiceClient create(CompletionServiceStub stub) {
145
161
protected CompletionServiceClient (CompletionServiceSettings settings ) throws IOException {
146
162
this .settings = settings ;
147
163
this .stub = ((CompletionServiceStubSettings ) settings .getStubSettings ()).createStub ();
148
- this .operationsClient = OperationsClient .create (this .stub .getOperationsStub ());
164
+ this .operationsClient =
165
+ com .google .longrunning .OperationsClient .create (this .stub .getOperationsStub ());
166
+ this .httpJsonOperationsClient = OperationsClient .create (this .stub .getHttpJsonOperationsStub ());
149
167
}
150
168
151
169
protected CompletionServiceClient (CompletionServiceStub stub ) {
152
170
this .settings = null ;
153
171
this .stub = stub ;
154
- this .operationsClient = OperationsClient .create (this .stub .getOperationsStub ());
172
+ this .operationsClient =
173
+ com .google .longrunning .OperationsClient .create (this .stub .getOperationsStub ());
174
+ this .httpJsonOperationsClient = OperationsClient .create (this .stub .getHttpJsonOperationsStub ());
155
175
}
156
176
157
177
public final CompletionServiceSettings getSettings () {
@@ -166,10 +186,18 @@ public CompletionServiceStub getStub() {
166
186
* Returns the OperationsClient that can be used to query the status of a long-running operation
167
187
* returned by another API method call.
168
188
*/
169
- public final OperationsClient getOperationsClient () {
189
+ public final com . google . longrunning . OperationsClient getOperationsClient () {
170
190
return operationsClient ;
171
191
}
172
192
193
+ /**
194
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
195
+ * returned by another API method call.
196
+ */
197
+ public final OperationsClient getHttpJsonOperationsClient () {
198
+ return httpJsonOperationsClient ;
199
+ }
200
+
173
201
// AUTO-GENERATED DOCUMENTATION AND METHOD.
174
202
/**
175
203
* Completes the specified prefix with keyword suggestions.
0 commit comments