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 .batch .v1 .stub .BatchServiceStubSettings ;
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 java .io .IOException ;
36
36
import java .util .List ;
39
39
40
40
// AUTO-GENERATED DOCUMENTATION AND CLASS.
41
41
/**
42
- * Service Description: Google Cloud Batch Service. The service manages user submitted batch jobs
43
- * and allocates Google Compute Engine VM instances to run the jobs.
42
+ * Service Description: Google Batch Service. The service manages user submitted batch jobs and
43
+ * allocates Google Compute Engine VM instances to run the jobs.
44
44
*
45
45
* <p>This class provides the ability to make remote calls to the backing service through method
46
46
* calls that map to API methods. Sample code to get started:
104
104
* BatchServiceClient batchServiceClient = BatchServiceClient.create(batchServiceSettings);
105
105
* }</pre>
106
106
*
107
+ * <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
108
+ * the wire:
109
+ *
110
+ * <pre>{@code
111
+ * // This snippet has been automatically generated for illustrative purposes only.
112
+ * // It may require modifications to work in your environment.
113
+ * BatchServiceSettings batchServiceSettings =
114
+ * BatchServiceSettings.newBuilder()
115
+ * .setTransportChannelProvider(
116
+ * BatchServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
117
+ * .build();
118
+ * BatchServiceClient batchServiceClient = BatchServiceClient.create(batchServiceSettings);
119
+ * }</pre>
120
+ *
107
121
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
108
122
*/
109
123
@ Generated ("by gapic-generator-java" )
110
124
public class BatchServiceClient implements BackgroundResource {
111
125
private final BatchServiceSettings settings ;
112
126
private final BatchServiceStub stub ;
113
- private final OperationsClient operationsClient ;
127
+ private final OperationsClient httpJsonOperationsClient ;
128
+ private final com .google .longrunning .OperationsClient operationsClient ;
114
129
115
130
/** Constructs an instance of BatchServiceClient with default settings. */
116
131
public static final BatchServiceClient create () throws IOException {
@@ -141,13 +156,17 @@ public static final BatchServiceClient create(BatchServiceStub stub) {
141
156
protected BatchServiceClient (BatchServiceSettings settings ) throws IOException {
142
157
this .settings = settings ;
143
158
this .stub = ((BatchServiceStubSettings ) settings .getStubSettings ()).createStub ();
144
- 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 ());
145
162
}
146
163
147
164
protected BatchServiceClient (BatchServiceStub stub ) {
148
165
this .settings = null ;
149
166
this .stub = stub ;
150
- 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 ());
151
170
}
152
171
153
172
public final BatchServiceSettings getSettings () {
@@ -162,10 +181,18 @@ public BatchServiceStub getStub() {
162
181
* Returns the OperationsClient that can be used to query the status of a long-running operation
163
182
* returned by another API method call.
164
183
*/
165
- public final OperationsClient getOperationsClient () {
184
+ public final com . google . longrunning . OperationsClient getOperationsClient () {
166
185
return operationsClient ;
167
186
}
168
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
+ public final OperationsClient getHttpJsonOperationsClient () {
193
+ return httpJsonOperationsClient ;
194
+ }
195
+
169
196
// AUTO-GENERATED DOCUMENTATION AND METHOD.
170
197
/**
171
198
* Create a Job.
@@ -183,8 +210,8 @@ public final OperationsClient getOperationsClient() {
183
210
* }
184
211
* }</pre>
185
212
*
186
- * @param parent Required. The parent resource name where the Job will be created. Format :
187
- * projects/{project}/locations/{location}
213
+ * @param parent Required. The parent resource name where the Job will be created. Pattern :
214
+ * " projects/{project}/locations/{location}"
188
215
* @param job Required. The Job to create.
189
216
* @param jobId ID used to uniquely identify the Job within its parent scope. This field should
190
217
* contain at most 63 characters. Only alphanumeric characters or '-' are accepted. The '-'
@@ -221,8 +248,8 @@ public final Job createJob(LocationName parent, Job job, String jobId) {
221
248
* }
222
249
* }</pre>
223
250
*
224
- * @param parent Required. The parent resource name where the Job will be created. Format :
225
- * projects/{project}/locations/{location}
251
+ * @param parent Required. The parent resource name where the Job will be created. Pattern :
252
+ * " projects/{project}/locations/{location}"
226
253
* @param job Required. The Job to create.
227
254
* @param jobId ID used to uniquely identify the Job within its parent scope. This field should
228
255
* contain at most 63 characters. Only alphanumeric characters or '-' are accepted. The '-'
@@ -495,7 +522,7 @@ public final UnaryCallable<DeleteJobRequest, Operation> deleteJobCallable() {
495
522
496
523
// AUTO-GENERATED DOCUMENTATION AND METHOD.
497
524
/**
498
- * List all Jobs for a project.
525
+ * List all Jobs for a project within a region .
499
526
*
500
527
* <p>Sample code:
501
528
*
@@ -520,7 +547,7 @@ public final ListJobsPagedResponse listJobs(String parent) {
520
547
521
548
// AUTO-GENERATED DOCUMENTATION AND METHOD.
522
549
/**
523
- * List all Jobs for a project.
550
+ * List all Jobs for a project within a region .
524
551
*
525
552
* <p>Sample code:
526
553
*
@@ -550,7 +577,7 @@ public final ListJobsPagedResponse listJobs(ListJobsRequest request) {
550
577
551
578
// AUTO-GENERATED DOCUMENTATION AND METHOD.
552
579
/**
553
- * List all Jobs for a project.
580
+ * List all Jobs for a project within a region .
554
581
*
555
582
* <p>Sample code:
556
583
*
@@ -579,7 +606,7 @@ public final UnaryCallable<ListJobsRequest, ListJobsPagedResponse> listJobsPaged
579
606
580
607
// AUTO-GENERATED DOCUMENTATION AND METHOD.
581
608
/**
582
- * List all Jobs for a project.
609
+ * List all Jobs for a project within a region .
583
610
*
584
611
* <p>Sample code:
585
612
*
@@ -731,7 +758,8 @@ public final UnaryCallable<GetTaskRequest, Task> getTaskCallable() {
731
758
* }
732
759
* }</pre>
733
760
*
734
- * @param parent Required. Path of the TaskGroup from which Tasks are being requested.
761
+ * @param parent Required. Name of a TaskGroup from which Tasks are being requested. Pattern:
762
+ * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
735
763
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
736
764
*/
737
765
public final ListTasksPagedResponse listTasks (TaskGroupName parent ) {
@@ -758,7 +786,8 @@ public final ListTasksPagedResponse listTasks(TaskGroupName parent) {
758
786
* }
759
787
* }</pre>
760
788
*
761
- * @param parent Required. Path of the TaskGroup from which Tasks are being requested.
789
+ * @param parent Required. Name of a TaskGroup from which Tasks are being requested. Pattern:
790
+ * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
762
791
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
763
792
*/
764
793
public final ListTasksPagedResponse listTasks (String parent ) {
0 commit comments