Skip to content

Commit 46fa9ba

Browse files
chore: update googleapis commit at Thu May 9 02:17:34 UTC 2024 (#10815)
* chore: update googleapis commit at Thu May 9 02:17:34 UTC 2024 * chore: generate libraries at Thu May 9 02:20:41 UTC 2024 * chore: update googleapis commit at Thu May 9 02:33:33 UTC 2024 * chore: update googleapis commit at Thu May 9 02:43:57 UTC 2024 * chore: update googleapis commit at Thu May 9 02:53:03 UTC 2024 * chore: update googleapis commit at Thu May 9 03:03:03 UTC 2024
1 parent 017296b commit 46fa9ba

File tree

133 files changed

+8944
-2524
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+8944
-2524
lines changed

generation_config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
gapic_generator_version: 2.40.0
22
protoc_version: '25.3'
3-
googleapis_commitish: e5b8ffad92c2cda2de65ee6e466cd53f3334837e
3+
googleapis_commitish: 25a1a57957d9e4bf431897d280b2569b26dc9165
44
libraries_bom_version: 26.38.0
55
owlbot_cli_image: sha256:623647ee79ac605858d09e60c1382a716c125fb776f69301b72de1cd35d49409
66
synthtool_commitish: 63cc541da2c45fcfca2136c43e638da1fbae174d

java-batch/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
201201
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
202202
[stability-image]: https://img.shields.io/badge/stability-preview-yellow
203203
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-batch.svg
204-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-batch/0.42.0
204+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-batch/0.43.0
205205
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
206206
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
207207
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceClient.java

+108
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,24 @@
133133
* </td>
134134
* </tr>
135135
* <tr>
136+
* <td><p> UpdateJob</td>
137+
* <td><p> Update a Job.</td>
138+
* <td>
139+
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
140+
* <ul>
141+
* <li><p> updateJob(UpdateJobRequest request)
142+
* </ul>
143+
* <p>"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.</p>
144+
* <ul>
145+
* <li><p> updateJob(Job job, FieldMask updateMask)
146+
* </ul>
147+
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
148+
* <ul>
149+
* <li><p> updateJobCallable()
150+
* </ul>
151+
* </td>
152+
* </tr>
153+
* <tr>
136154
* <td><p> ListJobs</td>
137155
* <td><p> List all Jobs for a project within a region.</td>
138156
* <td>
@@ -807,6 +825,96 @@ public final UnaryCallable<DeleteJobRequest, Operation> deleteJobCallable() {
807825
return stub.deleteJobCallable();
808826
}
809827

828+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
829+
/**
830+
* Update a Job.
831+
*
832+
* <p>Sample code:
833+
*
834+
* <pre>{@code
835+
* // This snippet has been automatically generated and should be regarded as a code template only.
836+
* // It will require modifications to work:
837+
* // - It may require correct/in-range values for request initialization.
838+
* // - It may require specifying regional endpoints when creating the service client as shown in
839+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
840+
* try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
841+
* Job job = Job.newBuilder().build();
842+
* FieldMask updateMask = FieldMask.newBuilder().build();
843+
* Job response = batchServiceClient.updateJob(job, updateMask);
844+
* }
845+
* }</pre>
846+
*
847+
* @param job Required. The Job to update. Only fields specified in `update_mask` are updated.
848+
* @param updateMask Required. Mask of fields to update.
849+
* <p>UpdateJob request now only supports update on `task_count` field in a job's first task
850+
* group. Other fields will be ignored.
851+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
852+
*/
853+
public final Job updateJob(Job job, FieldMask updateMask) {
854+
UpdateJobRequest request =
855+
UpdateJobRequest.newBuilder().setJob(job).setUpdateMask(updateMask).build();
856+
return updateJob(request);
857+
}
858+
859+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
860+
/**
861+
* Update a Job.
862+
*
863+
* <p>Sample code:
864+
*
865+
* <pre>{@code
866+
* // This snippet has been automatically generated and should be regarded as a code template only.
867+
* // It will require modifications to work:
868+
* // - It may require correct/in-range values for request initialization.
869+
* // - It may require specifying regional endpoints when creating the service client as shown in
870+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
871+
* try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
872+
* UpdateJobRequest request =
873+
* UpdateJobRequest.newBuilder()
874+
* .setJob(Job.newBuilder().build())
875+
* .setUpdateMask(FieldMask.newBuilder().build())
876+
* .setRequestId("requestId693933066")
877+
* .build();
878+
* Job response = batchServiceClient.updateJob(request);
879+
* }
880+
* }</pre>
881+
*
882+
* @param request The request object containing all of the parameters for the API call.
883+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
884+
*/
885+
public final Job updateJob(UpdateJobRequest request) {
886+
return updateJobCallable().call(request);
887+
}
888+
889+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
890+
/**
891+
* Update a Job.
892+
*
893+
* <p>Sample code:
894+
*
895+
* <pre>{@code
896+
* // This snippet has been automatically generated and should be regarded as a code template only.
897+
* // It will require modifications to work:
898+
* // - It may require correct/in-range values for request initialization.
899+
* // - It may require specifying regional endpoints when creating the service client as shown in
900+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
901+
* try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
902+
* UpdateJobRequest request =
903+
* UpdateJobRequest.newBuilder()
904+
* .setJob(Job.newBuilder().build())
905+
* .setUpdateMask(FieldMask.newBuilder().build())
906+
* .setRequestId("requestId693933066")
907+
* .build();
908+
* ApiFuture<Job> future = batchServiceClient.updateJobCallable().futureCall(request);
909+
* // Do something.
910+
* Job response = future.get();
911+
* }
912+
* }</pre>
913+
*/
914+
public final UnaryCallable<UpdateJobRequest, Job> updateJobCallable() {
915+
return stub.updateJobCallable();
916+
}
917+
810918
// AUTO-GENERATED DOCUMENTATION AND METHOD.
811919
/**
812920
* List all Jobs for a project within a region.

java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceSettings.java

+10
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ public UnaryCallSettings<DeleteJobRequest, Operation> deleteJobSettings() {
106106
return ((BatchServiceStubSettings) getStubSettings()).deleteJobOperationSettings();
107107
}
108108

109+
/** Returns the object with the settings used for calls to updateJob. */
110+
public UnaryCallSettings<UpdateJobRequest, Job> updateJobSettings() {
111+
return ((BatchServiceStubSettings) getStubSettings()).updateJobSettings();
112+
}
113+
109114
/** Returns the object with the settings used for calls to listJobs. */
110115
public PagedCallSettings<ListJobsRequest, ListJobsResponse, ListJobsPagedResponse>
111116
listJobsSettings() {
@@ -307,6 +312,11 @@ public UnaryCallSettings.Builder<DeleteJobRequest, Operation> deleteJobSettings(
307312
return getStubSettingsBuilder().deleteJobOperationSettings();
308313
}
309314

315+
/** Returns the builder for the settings used for calls to updateJob. */
316+
public UnaryCallSettings.Builder<UpdateJobRequest, Job> updateJobSettings() {
317+
return getStubSettingsBuilder().updateJobSettings();
318+
}
319+
310320
/** Returns the builder for the settings used for calls to listJobs. */
311321
public PagedCallSettings.Builder<ListJobsRequest, ListJobsResponse, ListJobsPagedResponse>
312322
listJobsSettings() {

java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/gapic_metadata.json

+3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
"ListTasks": {
4747
"methods": ["listTasks", "listTasks", "listTasks", "listTasksPagedCallable", "listTasksCallable"]
4848
},
49+
"UpdateJob": {
50+
"methods": ["updateJob", "updateJob", "updateJobCallable"]
51+
},
4952
"UpdateResourceAllowance": {
5053
"methods": ["updateResourceAllowance", "updateResourceAllowance", "updateResourceAllowanceCallable"]
5154
}

java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/BatchServiceStub.java

+5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import com.google.cloud.batch.v1alpha.OperationMetadata;
4343
import com.google.cloud.batch.v1alpha.ResourceAllowance;
4444
import com.google.cloud.batch.v1alpha.Task;
45+
import com.google.cloud.batch.v1alpha.UpdateJobRequest;
4546
import com.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest;
4647
import com.google.cloud.location.GetLocationRequest;
4748
import com.google.cloud.location.ListLocationsRequest;
@@ -87,6 +88,10 @@ public UnaryCallable<DeleteJobRequest, Operation> deleteJobCallable() {
8788
throw new UnsupportedOperationException("Not implemented: deleteJobCallable()");
8889
}
8990

91+
public UnaryCallable<UpdateJobRequest, Job> updateJobCallable() {
92+
throw new UnsupportedOperationException("Not implemented: updateJobCallable()");
93+
}
94+
9095
public UnaryCallable<ListJobsRequest, ListJobsPagedResponse> listJobsPagedCallable() {
9196
throw new UnsupportedOperationException("Not implemented: listJobsPagedCallable()");
9297
}

java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/BatchServiceStubSettings.java

+23
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
import com.google.cloud.batch.v1alpha.OperationMetadata;
6868
import com.google.cloud.batch.v1alpha.ResourceAllowance;
6969
import com.google.cloud.batch.v1alpha.Task;
70+
import com.google.cloud.batch.v1alpha.UpdateJobRequest;
7071
import com.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest;
7172
import com.google.cloud.location.GetLocationRequest;
7273
import com.google.cloud.location.ListLocationsRequest;
@@ -132,6 +133,7 @@ public class BatchServiceStubSettings extends StubSettings<BatchServiceStubSetti
132133
private final UnaryCallSettings<DeleteJobRequest, Operation> deleteJobSettings;
133134
private final OperationCallSettings<DeleteJobRequest, Empty, OperationMetadata>
134135
deleteJobOperationSettings;
136+
private final UnaryCallSettings<UpdateJobRequest, Job> updateJobSettings;
135137
private final PagedCallSettings<ListJobsRequest, ListJobsResponse, ListJobsPagedResponse>
136138
listJobsSettings;
137139
private final UnaryCallSettings<GetTaskRequest, Task> getTaskSettings;
@@ -406,6 +408,11 @@ public UnaryCallSettings<DeleteJobRequest, Operation> deleteJobSettings() {
406408
return deleteJobOperationSettings;
407409
}
408410

411+
/** Returns the object with the settings used for calls to updateJob. */
412+
public UnaryCallSettings<UpdateJobRequest, Job> updateJobSettings() {
413+
return updateJobSettings;
414+
}
415+
409416
/** Returns the object with the settings used for calls to listJobs. */
410417
public PagedCallSettings<ListJobsRequest, ListJobsResponse, ListJobsPagedResponse>
411418
listJobsSettings() {
@@ -587,6 +594,7 @@ protected BatchServiceStubSettings(Builder settingsBuilder) throws IOException {
587594
getJobSettings = settingsBuilder.getJobSettings().build();
588595
deleteJobSettings = settingsBuilder.deleteJobSettings().build();
589596
deleteJobOperationSettings = settingsBuilder.deleteJobOperationSettings().build();
597+
updateJobSettings = settingsBuilder.updateJobSettings().build();
590598
listJobsSettings = settingsBuilder.listJobsSettings().build();
591599
getTaskSettings = settingsBuilder.getTaskSettings().build();
592600
listTasksSettings = settingsBuilder.listTasksSettings().build();
@@ -609,6 +617,7 @@ public static class Builder extends StubSettings.Builder<BatchServiceStubSetting
609617
private final UnaryCallSettings.Builder<DeleteJobRequest, Operation> deleteJobSettings;
610618
private final OperationCallSettings.Builder<DeleteJobRequest, Empty, OperationMetadata>
611619
deleteJobOperationSettings;
620+
private final UnaryCallSettings.Builder<UpdateJobRequest, Job> updateJobSettings;
612621
private final PagedCallSettings.Builder<
613622
ListJobsRequest, ListJobsResponse, ListJobsPagedResponse>
614623
listJobsSettings;
@@ -691,6 +700,7 @@ protected Builder(ClientContext clientContext) {
691700
getJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
692701
deleteJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
693702
deleteJobOperationSettings = OperationCallSettings.newBuilder();
703+
updateJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
694704
listJobsSettings = PagedCallSettings.newBuilder(LIST_JOBS_PAGE_STR_FACT);
695705
getTaskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
696706
listTasksSettings = PagedCallSettings.newBuilder(LIST_TASKS_PAGE_STR_FACT);
@@ -709,6 +719,7 @@ protected Builder(ClientContext clientContext) {
709719
createJobSettings,
710720
getJobSettings,
711721
deleteJobSettings,
722+
updateJobSettings,
712723
listJobsSettings,
713724
getTaskSettings,
714725
listTasksSettings,
@@ -729,6 +740,7 @@ protected Builder(BatchServiceStubSettings settings) {
729740
getJobSettings = settings.getJobSettings.toBuilder();
730741
deleteJobSettings = settings.deleteJobSettings.toBuilder();
731742
deleteJobOperationSettings = settings.deleteJobOperationSettings.toBuilder();
743+
updateJobSettings = settings.updateJobSettings.toBuilder();
732744
listJobsSettings = settings.listJobsSettings.toBuilder();
733745
getTaskSettings = settings.getTaskSettings.toBuilder();
734746
listTasksSettings = settings.listTasksSettings.toBuilder();
@@ -747,6 +759,7 @@ protected Builder(BatchServiceStubSettings settings) {
747759
createJobSettings,
748760
getJobSettings,
749761
deleteJobSettings,
762+
updateJobSettings,
750763
listJobsSettings,
751764
getTaskSettings,
752765
listTasksSettings,
@@ -799,6 +812,11 @@ private static Builder initDefaults(Builder builder) {
799812
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
800813
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
801814

815+
builder
816+
.updateJobSettings()
817+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
818+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
819+
802820
builder
803821
.listJobsSettings()
804822
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
@@ -935,6 +953,11 @@ public UnaryCallSettings.Builder<DeleteJobRequest, Operation> deleteJobSettings(
935953
return deleteJobOperationSettings;
936954
}
937955

956+
/** Returns the builder for the settings used for calls to updateJob. */
957+
public UnaryCallSettings.Builder<UpdateJobRequest, Job> updateJobSettings() {
958+
return updateJobSettings;
959+
}
960+
938961
/** Returns the builder for the settings used for calls to listJobs. */
939962
public PagedCallSettings.Builder<ListJobsRequest, ListJobsResponse, ListJobsPagedResponse>
940963
listJobsSettings() {

java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/GrpcBatchServiceStub.java

+28
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import com.google.cloud.batch.v1alpha.OperationMetadata;
4848
import com.google.cloud.batch.v1alpha.ResourceAllowance;
4949
import com.google.cloud.batch.v1alpha.Task;
50+
import com.google.cloud.batch.v1alpha.UpdateJobRequest;
5051
import com.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest;
5152
import com.google.cloud.location.GetLocationRequest;
5253
import com.google.cloud.location.ListLocationsRequest;
@@ -94,6 +95,14 @@ public class GrpcBatchServiceStub extends BatchServiceStub {
9495
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
9596
.build();
9697

98+
private static final MethodDescriptor<UpdateJobRequest, Job> updateJobMethodDescriptor =
99+
MethodDescriptor.<UpdateJobRequest, Job>newBuilder()
100+
.setType(MethodDescriptor.MethodType.UNARY)
101+
.setFullMethodName("google.cloud.batch.v1alpha.BatchService/UpdateJob")
102+
.setRequestMarshaller(ProtoUtils.marshaller(UpdateJobRequest.getDefaultInstance()))
103+
.setResponseMarshaller(ProtoUtils.marshaller(Job.getDefaultInstance()))
104+
.build();
105+
97106
private static final MethodDescriptor<ListJobsRequest, ListJobsResponse>
98107
listJobsMethodDescriptor =
99108
MethodDescriptor.<ListJobsRequest, ListJobsResponse>newBuilder()
@@ -197,6 +206,7 @@ public class GrpcBatchServiceStub extends BatchServiceStub {
197206
private final UnaryCallable<DeleteJobRequest, Operation> deleteJobCallable;
198207
private final OperationCallable<DeleteJobRequest, Empty, OperationMetadata>
199208
deleteJobOperationCallable;
209+
private final UnaryCallable<UpdateJobRequest, Job> updateJobCallable;
200210
private final UnaryCallable<ListJobsRequest, ListJobsResponse> listJobsCallable;
201211
private final UnaryCallable<ListJobsRequest, ListJobsPagedResponse> listJobsPagedCallable;
202212
private final UnaryCallable<GetTaskRequest, Task> getTaskCallable;
@@ -293,6 +303,16 @@ protected GrpcBatchServiceStub(
293303
return builder.build();
294304
})
295305
.build();
306+
GrpcCallSettings<UpdateJobRequest, Job> updateJobTransportSettings =
307+
GrpcCallSettings.<UpdateJobRequest, Job>newBuilder()
308+
.setMethodDescriptor(updateJobMethodDescriptor)
309+
.setParamsExtractor(
310+
request -> {
311+
RequestParamsBuilder builder = RequestParamsBuilder.create();
312+
builder.add("job.name", String.valueOf(request.getJob().getName()));
313+
return builder.build();
314+
})
315+
.build();
296316
GrpcCallSettings<ListJobsRequest, ListJobsResponse> listJobsTransportSettings =
297317
GrpcCallSettings.<ListJobsRequest, ListJobsResponse>newBuilder()
298318
.setMethodDescriptor(listJobsMethodDescriptor)
@@ -417,6 +437,9 @@ protected GrpcBatchServiceStub(
417437
settings.deleteJobOperationSettings(),
418438
clientContext,
419439
operationsStub);
440+
this.updateJobCallable =
441+
callableFactory.createUnaryCallable(
442+
updateJobTransportSettings, settings.updateJobSettings(), clientContext);
420443
this.listJobsCallable =
421444
callableFactory.createUnaryCallable(
422445
listJobsTransportSettings, settings.listJobsSettings(), clientContext);
@@ -507,6 +530,11 @@ public UnaryCallable<DeleteJobRequest, Operation> deleteJobCallable() {
507530
return deleteJobOperationCallable;
508531
}
509532

533+
@Override
534+
public UnaryCallable<UpdateJobRequest, Job> updateJobCallable() {
535+
return updateJobCallable;
536+
}
537+
510538
@Override
511539
public UnaryCallable<ListJobsRequest, ListJobsResponse> listJobsCallable() {
512540
return listJobsCallable;

0 commit comments

Comments
 (0)