Skip to content

Commit

Permalink
chore: update googleapis commit at Thu May 9 02:17:34 UTC 2024 (#10815)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
cloud-java-bot committed May 9, 2024
1 parent 017296b commit 46fa9ba
Show file tree
Hide file tree
Showing 133 changed files with 8,944 additions and 2,524 deletions.
2 changes: 1 addition & 1 deletion generation_config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
gapic_generator_version: 2.40.0
protoc_version: '25.3'
googleapis_commitish: e5b8ffad92c2cda2de65ee6e466cd53f3334837e
googleapis_commitish: 25a1a57957d9e4bf431897d280b2569b26dc9165
libraries_bom_version: 26.38.0
owlbot_cli_image: sha256:623647ee79ac605858d09e60c1382a716c125fb776f69301b72de1cd35d49409
synthtool_commitish: 63cc541da2c45fcfca2136c43e638da1fbae174d
Expand Down
2 changes: 1 addition & 1 deletion java-batch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-preview-yellow
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-batch.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-batch/0.42.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-batch/0.43.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,24 @@
* </td>
* </tr>
* <tr>
* <td><p> UpdateJob</td>
* <td><p> Update a Job.</td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
* <li><p> updateJob(UpdateJobRequest request)
* </ul>
* <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>
* <ul>
* <li><p> updateJob(Job job, FieldMask updateMask)
* </ul>
* <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>
* <ul>
* <li><p> updateJobCallable()
* </ul>
* </td>
* </tr>
* <tr>
* <td><p> ListJobs</td>
* <td><p> List all Jobs for a project within a region.</td>
* <td>
Expand Down Expand Up @@ -807,6 +825,96 @@ public final UnaryCallable<DeleteJobRequest, Operation> deleteJobCallable() {
return stub.deleteJobCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Update a Job.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
* Job job = Job.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* Job response = batchServiceClient.updateJob(job, updateMask);
* }
* }</pre>
*
* @param job Required. The Job to update. Only fields specified in `update_mask` are updated.
* @param updateMask Required. Mask of fields to update.
* <p>UpdateJob request now only supports update on `task_count` field in a job's first task
* group. Other fields will be ignored.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Job updateJob(Job job, FieldMask updateMask) {
UpdateJobRequest request =
UpdateJobRequest.newBuilder().setJob(job).setUpdateMask(updateMask).build();
return updateJob(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Update a Job.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
* UpdateJobRequest request =
* UpdateJobRequest.newBuilder()
* .setJob(Job.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* Job response = batchServiceClient.updateJob(request);
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Job updateJob(UpdateJobRequest request) {
return updateJobCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Update a Job.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
* UpdateJobRequest request =
* UpdateJobRequest.newBuilder()
* .setJob(Job.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* ApiFuture<Job> future = batchServiceClient.updateJobCallable().futureCall(request);
* // Do something.
* Job response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<UpdateJobRequest, Job> updateJobCallable() {
return stub.updateJobCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* List all Jobs for a project within a region.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ public UnaryCallSettings<DeleteJobRequest, Operation> deleteJobSettings() {
return ((BatchServiceStubSettings) getStubSettings()).deleteJobOperationSettings();
}

/** Returns the object with the settings used for calls to updateJob. */
public UnaryCallSettings<UpdateJobRequest, Job> updateJobSettings() {
return ((BatchServiceStubSettings) getStubSettings()).updateJobSettings();
}

/** Returns the object with the settings used for calls to listJobs. */
public PagedCallSettings<ListJobsRequest, ListJobsResponse, ListJobsPagedResponse>
listJobsSettings() {
Expand Down Expand Up @@ -307,6 +312,11 @@ public UnaryCallSettings.Builder<DeleteJobRequest, Operation> deleteJobSettings(
return getStubSettingsBuilder().deleteJobOperationSettings();
}

/** Returns the builder for the settings used for calls to updateJob. */
public UnaryCallSettings.Builder<UpdateJobRequest, Job> updateJobSettings() {
return getStubSettingsBuilder().updateJobSettings();
}

/** Returns the builder for the settings used for calls to listJobs. */
public PagedCallSettings.Builder<ListJobsRequest, ListJobsResponse, ListJobsPagedResponse>
listJobsSettings() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
"ListTasks": {
"methods": ["listTasks", "listTasks", "listTasks", "listTasksPagedCallable", "listTasksCallable"]
},
"UpdateJob": {
"methods": ["updateJob", "updateJob", "updateJobCallable"]
},
"UpdateResourceAllowance": {
"methods": ["updateResourceAllowance", "updateResourceAllowance", "updateResourceAllowanceCallable"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import com.google.cloud.batch.v1alpha.OperationMetadata;
import com.google.cloud.batch.v1alpha.ResourceAllowance;
import com.google.cloud.batch.v1alpha.Task;
import com.google.cloud.batch.v1alpha.UpdateJobRequest;
import com.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
Expand Down Expand Up @@ -87,6 +88,10 @@ public UnaryCallable<DeleteJobRequest, Operation> deleteJobCallable() {
throw new UnsupportedOperationException("Not implemented: deleteJobCallable()");
}

public UnaryCallable<UpdateJobRequest, Job> updateJobCallable() {
throw new UnsupportedOperationException("Not implemented: updateJobCallable()");
}

public UnaryCallable<ListJobsRequest, ListJobsPagedResponse> listJobsPagedCallable() {
throw new UnsupportedOperationException("Not implemented: listJobsPagedCallable()");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import com.google.cloud.batch.v1alpha.OperationMetadata;
import com.google.cloud.batch.v1alpha.ResourceAllowance;
import com.google.cloud.batch.v1alpha.Task;
import com.google.cloud.batch.v1alpha.UpdateJobRequest;
import com.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
Expand Down Expand Up @@ -132,6 +133,7 @@ public class BatchServiceStubSettings extends StubSettings<BatchServiceStubSetti
private final UnaryCallSettings<DeleteJobRequest, Operation> deleteJobSettings;
private final OperationCallSettings<DeleteJobRequest, Empty, OperationMetadata>
deleteJobOperationSettings;
private final UnaryCallSettings<UpdateJobRequest, Job> updateJobSettings;
private final PagedCallSettings<ListJobsRequest, ListJobsResponse, ListJobsPagedResponse>
listJobsSettings;
private final UnaryCallSettings<GetTaskRequest, Task> getTaskSettings;
Expand Down Expand Up @@ -406,6 +408,11 @@ public UnaryCallSettings<DeleteJobRequest, Operation> deleteJobSettings() {
return deleteJobOperationSettings;
}

/** Returns the object with the settings used for calls to updateJob. */
public UnaryCallSettings<UpdateJobRequest, Job> updateJobSettings() {
return updateJobSettings;
}

/** Returns the object with the settings used for calls to listJobs. */
public PagedCallSettings<ListJobsRequest, ListJobsResponse, ListJobsPagedResponse>
listJobsSettings() {
Expand Down Expand Up @@ -587,6 +594,7 @@ protected BatchServiceStubSettings(Builder settingsBuilder) throws IOException {
getJobSettings = settingsBuilder.getJobSettings().build();
deleteJobSettings = settingsBuilder.deleteJobSettings().build();
deleteJobOperationSettings = settingsBuilder.deleteJobOperationSettings().build();
updateJobSettings = settingsBuilder.updateJobSettings().build();
listJobsSettings = settingsBuilder.listJobsSettings().build();
getTaskSettings = settingsBuilder.getTaskSettings().build();
listTasksSettings = settingsBuilder.listTasksSettings().build();
Expand All @@ -609,6 +617,7 @@ public static class Builder extends StubSettings.Builder<BatchServiceStubSetting
private final UnaryCallSettings.Builder<DeleteJobRequest, Operation> deleteJobSettings;
private final OperationCallSettings.Builder<DeleteJobRequest, Empty, OperationMetadata>
deleteJobOperationSettings;
private final UnaryCallSettings.Builder<UpdateJobRequest, Job> updateJobSettings;
private final PagedCallSettings.Builder<
ListJobsRequest, ListJobsResponse, ListJobsPagedResponse>
listJobsSettings;
Expand Down Expand Up @@ -691,6 +700,7 @@ protected Builder(ClientContext clientContext) {
getJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteJobOperationSettings = OperationCallSettings.newBuilder();
updateJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listJobsSettings = PagedCallSettings.newBuilder(LIST_JOBS_PAGE_STR_FACT);
getTaskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listTasksSettings = PagedCallSettings.newBuilder(LIST_TASKS_PAGE_STR_FACT);
Expand All @@ -709,6 +719,7 @@ protected Builder(ClientContext clientContext) {
createJobSettings,
getJobSettings,
deleteJobSettings,
updateJobSettings,
listJobsSettings,
getTaskSettings,
listTasksSettings,
Expand All @@ -729,6 +740,7 @@ protected Builder(BatchServiceStubSettings settings) {
getJobSettings = settings.getJobSettings.toBuilder();
deleteJobSettings = settings.deleteJobSettings.toBuilder();
deleteJobOperationSettings = settings.deleteJobOperationSettings.toBuilder();
updateJobSettings = settings.updateJobSettings.toBuilder();
listJobsSettings = settings.listJobsSettings.toBuilder();
getTaskSettings = settings.getTaskSettings.toBuilder();
listTasksSettings = settings.listTasksSettings.toBuilder();
Expand All @@ -747,6 +759,7 @@ protected Builder(BatchServiceStubSettings settings) {
createJobSettings,
getJobSettings,
deleteJobSettings,
updateJobSettings,
listJobsSettings,
getTaskSettings,
listTasksSettings,
Expand Down Expand Up @@ -799,6 +812,11 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));

builder
.updateJobSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));

builder
.listJobsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
Expand Down Expand Up @@ -935,6 +953,11 @@ public UnaryCallSettings.Builder<DeleteJobRequest, Operation> deleteJobSettings(
return deleteJobOperationSettings;
}

/** Returns the builder for the settings used for calls to updateJob. */
public UnaryCallSettings.Builder<UpdateJobRequest, Job> updateJobSettings() {
return updateJobSettings;
}

/** Returns the builder for the settings used for calls to listJobs. */
public PagedCallSettings.Builder<ListJobsRequest, ListJobsResponse, ListJobsPagedResponse>
listJobsSettings() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import com.google.cloud.batch.v1alpha.OperationMetadata;
import com.google.cloud.batch.v1alpha.ResourceAllowance;
import com.google.cloud.batch.v1alpha.Task;
import com.google.cloud.batch.v1alpha.UpdateJobRequest;
import com.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
Expand Down Expand Up @@ -94,6 +95,14 @@ public class GrpcBatchServiceStub extends BatchServiceStub {
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();

private static final MethodDescriptor<UpdateJobRequest, Job> updateJobMethodDescriptor =
MethodDescriptor.<UpdateJobRequest, Job>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.batch.v1alpha.BatchService/UpdateJob")
.setRequestMarshaller(ProtoUtils.marshaller(UpdateJobRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Job.getDefaultInstance()))
.build();

private static final MethodDescriptor<ListJobsRequest, ListJobsResponse>
listJobsMethodDescriptor =
MethodDescriptor.<ListJobsRequest, ListJobsResponse>newBuilder()
Expand Down Expand Up @@ -197,6 +206,7 @@ public class GrpcBatchServiceStub extends BatchServiceStub {
private final UnaryCallable<DeleteJobRequest, Operation> deleteJobCallable;
private final OperationCallable<DeleteJobRequest, Empty, OperationMetadata>
deleteJobOperationCallable;
private final UnaryCallable<UpdateJobRequest, Job> updateJobCallable;
private final UnaryCallable<ListJobsRequest, ListJobsResponse> listJobsCallable;
private final UnaryCallable<ListJobsRequest, ListJobsPagedResponse> listJobsPagedCallable;
private final UnaryCallable<GetTaskRequest, Task> getTaskCallable;
Expand Down Expand Up @@ -293,6 +303,16 @@ protected GrpcBatchServiceStub(
return builder.build();
})
.build();
GrpcCallSettings<UpdateJobRequest, Job> updateJobTransportSettings =
GrpcCallSettings.<UpdateJobRequest, Job>newBuilder()
.setMethodDescriptor(updateJobMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("job.name", String.valueOf(request.getJob().getName()));
return builder.build();
})
.build();
GrpcCallSettings<ListJobsRequest, ListJobsResponse> listJobsTransportSettings =
GrpcCallSettings.<ListJobsRequest, ListJobsResponse>newBuilder()
.setMethodDescriptor(listJobsMethodDescriptor)
Expand Down Expand Up @@ -417,6 +437,9 @@ protected GrpcBatchServiceStub(
settings.deleteJobOperationSettings(),
clientContext,
operationsStub);
this.updateJobCallable =
callableFactory.createUnaryCallable(
updateJobTransportSettings, settings.updateJobSettings(), clientContext);
this.listJobsCallable =
callableFactory.createUnaryCallable(
listJobsTransportSettings, settings.listJobsSettings(), clientContext);
Expand Down Expand Up @@ -507,6 +530,11 @@ public UnaryCallable<DeleteJobRequest, Operation> deleteJobCallable() {
return deleteJobOperationCallable;
}

@Override
public UnaryCallable<UpdateJobRequest, Job> updateJobCallable() {
return updateJobCallable;
}

@Override
public UnaryCallable<ListJobsRequest, ListJobsResponse> listJobsCallable() {
return listJobsCallable;
Expand Down

0 comments on commit 46fa9ba

Please sign in to comment.