18
18
19
19
import com .google .api .core .ApiFuture ;
20
20
import com .google .api .core .ApiFutures ;
21
+ import com .google .api .core .BetaApi ;
21
22
import com .google .api .gax .core .BackgroundResource ;
23
+ import com .google .api .gax .httpjson .longrunning .OperationsClient ;
22
24
import com .google .api .gax .longrunning .OperationFuture ;
23
25
import com .google .api .gax .paging .AbstractFixedSizeCollection ;
24
26
import com .google .api .gax .paging .AbstractPage ;
30
32
import com .google .cloud .talent .v4 .stub .JobServiceStubSettings ;
31
33
import com .google .common .util .concurrent .MoreExecutors ;
32
34
import com .google .longrunning .Operation ;
33
- import com .google .longrunning .OperationsClient ;
34
35
import com .google .protobuf .Empty ;
35
36
import com .google .protobuf .FieldMask ;
36
37
import java .io .IOException ;
104
105
* JobServiceClient jobServiceClient = JobServiceClient.create(jobServiceSettings);
105
106
* }</pre>
106
107
*
108
+ * <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
109
+ * the wire:
110
+ *
111
+ * <pre>{@code
112
+ * // This snippet has been automatically generated for illustrative purposes only.
113
+ * // It may require modifications to work in your environment.
114
+ * JobServiceSettings jobServiceSettings =
115
+ * JobServiceSettings.newBuilder()
116
+ * .setTransportChannelProvider(
117
+ * JobServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
118
+ * .build();
119
+ * JobServiceClient jobServiceClient = JobServiceClient.create(jobServiceSettings);
120
+ * }</pre>
121
+ *
107
122
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
108
123
*/
109
124
@ Generated ("by gapic-generator-java" )
110
125
public class JobServiceClient implements BackgroundResource {
111
126
private final JobServiceSettings settings ;
112
127
private final JobServiceStub stub ;
113
- private final OperationsClient operationsClient ;
128
+ private final OperationsClient httpJsonOperationsClient ;
129
+ private final com .google .longrunning .OperationsClient operationsClient ;
114
130
115
131
/** Constructs an instance of JobServiceClient with default settings. */
116
132
public static final JobServiceClient create () throws IOException {
@@ -140,13 +156,17 @@ public static final JobServiceClient create(JobServiceStub stub) {
140
156
protected JobServiceClient (JobServiceSettings settings ) throws IOException {
141
157
this .settings = settings ;
142
158
this .stub = ((JobServiceStubSettings ) settings .getStubSettings ()).createStub ();
143
- this .operationsClient = OperationsClient .create (this .stub .getOperationsStub ());
159
+ this .operationsClient =
160
+ com .google .longrunning .OperationsClient .create (this .stub .getOperationsStub ());
161
+ this .httpJsonOperationsClient = OperationsClient .create (this .stub .getHttpJsonOperationsStub ());
144
162
}
145
163
146
164
protected JobServiceClient (JobServiceStub stub ) {
147
165
this .settings = null ;
148
166
this .stub = stub ;
149
- this .operationsClient = OperationsClient .create (this .stub .getOperationsStub ());
167
+ this .operationsClient =
168
+ com .google .longrunning .OperationsClient .create (this .stub .getOperationsStub ());
169
+ this .httpJsonOperationsClient = OperationsClient .create (this .stub .getHttpJsonOperationsStub ());
150
170
}
151
171
152
172
public final JobServiceSettings getSettings () {
@@ -161,10 +181,19 @@ public JobServiceStub getStub() {
161
181
* Returns the OperationsClient that can be used to query the status of a long-running operation
162
182
* returned by another API method call.
163
183
*/
164
- public final OperationsClient getOperationsClient () {
184
+ public final com . google . longrunning . OperationsClient getOperationsClient () {
165
185
return operationsClient ;
166
186
}
167
187
188
+ /**
189
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
190
+ * returned by another API method call.
191
+ */
192
+ @ BetaApi
193
+ public final OperationsClient getHttpJsonOperationsClient () {
194
+ return httpJsonOperationsClient ;
195
+ }
196
+
168
197
// AUTO-GENERATED DOCUMENTATION AND METHOD.
169
198
/**
170
199
* Creates a new job.
@@ -1197,7 +1226,7 @@ public final UnaryCallable<ListJobsRequest, ListJobsPagedResponse> listJobsPaged
1197
1226
* .build();
1198
1227
* while (true) {
1199
1228
* ListJobsResponse response = jobServiceClient.listJobsCallable().call(request);
1200
- * for (Job element : response.getResponsesList ()) {
1229
+ * for (Job element : response.getJobsList ()) {
1201
1230
* // doThingsWith(element);
1202
1231
* }
1203
1232
* String nextPageToken = response.getNextPageToken();
0 commit comments