diff --git a/owl-bot-staging/java-deploy/v1/google-cloud-deploy/src/main/java/com/google/cloud/deploy/v1/CloudDeployClient.java b/owl-bot-staging/java-deploy/v1/google-cloud-deploy/src/main/java/com/google/cloud/deploy/v1/CloudDeployClient.java new file mode 100644 index 000000000000..5884c9eb8cce --- /dev/null +++ b/owl-bot-staging/java-deploy/v1/google-cloud-deploy/src/main/java/com/google/cloud/deploy/v1/CloudDeployClient.java @@ -0,0 +1,4378 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.deploy.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.deploy.v1.stub.CloudDeployStub; +import com.google.cloud.deploy.v1.stub.CloudDeployStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: CloudDeploy service creates and manages Continuous Delivery operations on + * Google Cloud Platform via Skaffold (https://skaffold.dev). + * + *
This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * DeliveryPipelineName name = + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]"); + * DeliveryPipeline response = cloudDeployClient.getDeliveryPipeline(name); + * } + * }+ * + *
Note: close() needs to be called on the CloudDeployClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *
The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *
See the individual methods for example code. + * + *
Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *
This class can be customized by passing in a custom instance of CloudDeploySettings to + * create(). For example: + * + *
To customize credentials: + * + *
{@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 + * CloudDeploySettings cloudDeploySettings = + * CloudDeploySettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * CloudDeployClient cloudDeployClient = CloudDeployClient.create(cloudDeploySettings); + * }+ * + *
To customize the endpoint: + * + *
{@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 + * CloudDeploySettings cloudDeploySettings = + * CloudDeploySettings.newBuilder().setEndpoint(myEndpoint).build(); + * CloudDeployClient cloudDeployClient = CloudDeployClient.create(cloudDeploySettings); + * }+ * + *
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *
{@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 + * CloudDeploySettings cloudDeploySettings = + * CloudDeploySettings.newBuilder() + * .setTransportChannelProvider( + * CloudDeploySettings.defaultHttpJsonTransportProviderBuilder().build()) + * .build(); + * CloudDeployClient cloudDeployClient = CloudDeployClient.create(cloudDeploySettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class CloudDeployClient implements BackgroundResource { + private final CloudDeploySettings settings; + private final CloudDeployStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of CloudDeployClient with default settings. */ + public static final CloudDeployClient create() throws IOException { + return create(CloudDeploySettings.newBuilder().build()); + } + + /** + * Constructs an instance of CloudDeployClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final CloudDeployClient create(CloudDeploySettings settings) throws IOException { + return new CloudDeployClient(settings); + } + + /** + * Constructs an instance of CloudDeployClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(CloudDeploySettings). + */ + public static final CloudDeployClient create(CloudDeployStub stub) { + return new CloudDeployClient(stub); + } + + /** + * Constructs an instance of CloudDeployClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected CloudDeployClient(CloudDeploySettings settings) throws IOException { + this.settings = settings; + this.stub = ((CloudDeployStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected CloudDeployClient(CloudDeployStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final CloudDeploySettings getSettings() { + return settings; + } + + public CloudDeployStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists DeliveryPipelines in a given project and location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (DeliveryPipeline element : + * cloudDeployClient.listDeliveryPipelines(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDeliveryPipelinesPagedResponse listDeliveryPipelines(LocationName parent) { + ListDeliveryPipelinesRequest request = + ListDeliveryPipelinesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listDeliveryPipelines(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists DeliveryPipelines in a given project and location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (DeliveryPipeline element : + * cloudDeployClient.listDeliveryPipelines(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDeliveryPipelinesPagedResponse listDeliveryPipelines(String parent) { + ListDeliveryPipelinesRequest request = + ListDeliveryPipelinesRequest.newBuilder().setParent(parent).build(); + return listDeliveryPipelines(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists DeliveryPipelines in a given project and location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ListDeliveryPipelinesRequest request = + * ListDeliveryPipelinesRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") + * .build(); + * for (DeliveryPipeline element : + * cloudDeployClient.listDeliveryPipelines(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @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 ListDeliveryPipelinesPagedResponse listDeliveryPipelines( + ListDeliveryPipelinesRequest request) { + return listDeliveryPipelinesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists DeliveryPipelines in a given project and location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ListDeliveryPipelinesRequest request = + * ListDeliveryPipelinesRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * cloudDeployClient.listDeliveryPipelinesPagedCallable().futureCall(request); + * // Do something. + * for (DeliveryPipeline element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ListDeliveryPipelinesRequest request = + * ListDeliveryPipelinesRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") + * .build(); + * while (true) { + * ListDeliveryPipelinesResponse response = + * cloudDeployClient.listDeliveryPipelinesCallable().call(request); + * for (DeliveryPipeline element : response.getDeliveryPipelinesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * DeliveryPipelineName name = + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]"); + * DeliveryPipeline response = cloudDeployClient.getDeliveryPipeline(name); + * } + * }+ * + * @param name Required. Name of the `DeliveryPipeline`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DeliveryPipeline getDeliveryPipeline(DeliveryPipelineName name) { + GetDeliveryPipelineRequest request = + GetDeliveryPipelineRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getDeliveryPipeline(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single DeliveryPipeline. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String name = + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]").toString(); + * DeliveryPipeline response = cloudDeployClient.getDeliveryPipeline(name); + * } + * }+ * + * @param name Required. Name of the `DeliveryPipeline`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DeliveryPipeline getDeliveryPipeline(String name) { + GetDeliveryPipelineRequest request = + GetDeliveryPipelineRequest.newBuilder().setName(name).build(); + return getDeliveryPipeline(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single DeliveryPipeline. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * GetDeliveryPipelineRequest request = + * GetDeliveryPipelineRequest.newBuilder() + * .setName( + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]") + * .toString()) + * .build(); + * DeliveryPipeline response = cloudDeployClient.getDeliveryPipeline(request); + * } + * }+ * + * @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 DeliveryPipeline getDeliveryPipeline(GetDeliveryPipelineRequest request) { + return getDeliveryPipelineCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single DeliveryPipeline. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * GetDeliveryPipelineRequest request = + * GetDeliveryPipelineRequest.newBuilder() + * .setName( + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * cloudDeployClient.getDeliveryPipelineCallable().futureCall(request); + * // Do something. + * DeliveryPipeline response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * DeliveryPipeline deliveryPipeline = DeliveryPipeline.newBuilder().build(); + * String deliveryPipelineId = "deliveryPipelineId-632411535"; + * DeliveryPipeline response = + * cloudDeployClient + * .createDeliveryPipelineAsync(parent, deliveryPipeline, deliveryPipelineId) + * .get(); + * } + * }+ * + * @param parent Required. The parent collection in which the `DeliveryPipeline` should be + * created. Format should be projects/{project_id}/locations/{location_name}. + * @param deliveryPipeline Required. The `DeliveryPipeline` to create. + * @param deliveryPipelineId Required. ID of the `DeliveryPipeline`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * DeliveryPipeline deliveryPipeline = DeliveryPipeline.newBuilder().build(); + * String deliveryPipelineId = "deliveryPipelineId-632411535"; + * DeliveryPipeline response = + * cloudDeployClient + * .createDeliveryPipelineAsync(parent, deliveryPipeline, deliveryPipelineId) + * .get(); + * } + * }+ * + * @param parent Required. The parent collection in which the `DeliveryPipeline` should be + * created. Format should be projects/{project_id}/locations/{location_name}. + * @param deliveryPipeline Required. The `DeliveryPipeline` to create. + * @param deliveryPipelineId Required. ID of the `DeliveryPipeline`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * CreateDeliveryPipelineRequest request = + * CreateDeliveryPipelineRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDeliveryPipelineId("deliveryPipelineId-632411535") + * .setDeliveryPipeline(DeliveryPipeline.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setValidateOnly(true) + * .build(); + * DeliveryPipeline response = cloudDeployClient.createDeliveryPipelineAsync(request).get(); + * } + * }+ * + * @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 OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * CreateDeliveryPipelineRequest request = + * CreateDeliveryPipelineRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDeliveryPipelineId("deliveryPipelineId-632411535") + * .setDeliveryPipeline(DeliveryPipeline.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setValidateOnly(true) + * .build(); + * OperationFuture+ */ + public final OperationCallablefuture = + * cloudDeployClient.createDeliveryPipelineOperationCallable().futureCall(request); + * // Do something. + * DeliveryPipeline response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * CreateDeliveryPipelineRequest request = + * CreateDeliveryPipelineRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDeliveryPipelineId("deliveryPipelineId-632411535") + * .setDeliveryPipeline(DeliveryPipeline.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setValidateOnly(true) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * cloudDeployClient.createDeliveryPipelineCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * DeliveryPipeline deliveryPipeline = DeliveryPipeline.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * DeliveryPipeline response = + * cloudDeployClient.updateDeliveryPipelineAsync(deliveryPipeline, updateMask).get(); + * } + * }+ * + * @param deliveryPipeline Required. The `DeliveryPipeline` to update. + * @param updateMask Required. Field mask is used to specify the fields to be overwritten in the + * `DeliveryPipeline` resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten if it is in the + * mask. If the user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * UpdateDeliveryPipelineRequest request = + * UpdateDeliveryPipelineRequest.newBuilder() + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setDeliveryPipeline(DeliveryPipeline.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setAllowMissing(true) + * .setValidateOnly(true) + * .build(); + * DeliveryPipeline response = cloudDeployClient.updateDeliveryPipelineAsync(request).get(); + * } + * }+ * + * @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 OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * UpdateDeliveryPipelineRequest request = + * UpdateDeliveryPipelineRequest.newBuilder() + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setDeliveryPipeline(DeliveryPipeline.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setAllowMissing(true) + * .setValidateOnly(true) + * .build(); + * OperationFuture+ */ + public final OperationCallablefuture = + * cloudDeployClient.updateDeliveryPipelineOperationCallable().futureCall(request); + * // Do something. + * DeliveryPipeline response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * UpdateDeliveryPipelineRequest request = + * UpdateDeliveryPipelineRequest.newBuilder() + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setDeliveryPipeline(DeliveryPipeline.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setAllowMissing(true) + * .setValidateOnly(true) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * cloudDeployClient.updateDeliveryPipelineCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * DeliveryPipelineName name = + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]"); + * cloudDeployClient.deleteDeliveryPipelineAsync(name).get(); + * } + * }+ * + * @param name Required. The name of the `DeliveryPipeline` to delete. Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String name = + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]").toString(); + * cloudDeployClient.deleteDeliveryPipelineAsync(name).get(); + * } + * }+ * + * @param name Required. The name of the `DeliveryPipeline` to delete. Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * DeleteDeliveryPipelineRequest request = + * DeleteDeliveryPipelineRequest.newBuilder() + * .setName( + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]") + * .toString()) + * .setRequestId("requestId693933066") + * .setAllowMissing(true) + * .setValidateOnly(true) + * .setForce(true) + * .setEtag("etag3123477") + * .build(); + * cloudDeployClient.deleteDeliveryPipelineAsync(request).get(); + * } + * }+ * + * @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 OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * DeleteDeliveryPipelineRequest request = + * DeleteDeliveryPipelineRequest.newBuilder() + * .setName( + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]") + * .toString()) + * .setRequestId("requestId693933066") + * .setAllowMissing(true) + * .setValidateOnly(true) + * .setForce(true) + * .setEtag("etag3123477") + * .build(); + * OperationFuture+ */ + public final OperationCallablefuture = + * cloudDeployClient.deleteDeliveryPipelineOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * DeleteDeliveryPipelineRequest request = + * DeleteDeliveryPipelineRequest.newBuilder() + * .setName( + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]") + * .toString()) + * .setRequestId("requestId693933066") + * .setAllowMissing(true) + * .setValidateOnly(true) + * .setForce(true) + * .setEtag("etag3123477") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * cloudDeployClient.deleteDeliveryPipelineCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (Target element : cloudDeployClient.listTargets(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent, which owns this collection of targets. Format must be + * projects/{project_id}/locations/{location_name}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTargetsPagedResponse listTargets(LocationName parent) { + ListTargetsRequest request = + ListTargetsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listTargets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Targets in a given project and location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (Target element : cloudDeployClient.listTargets(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent, which owns this collection of targets. Format must be + * projects/{project_id}/locations/{location_name}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTargetsPagedResponse listTargets(String parent) { + ListTargetsRequest request = ListTargetsRequest.newBuilder().setParent(parent).build(); + return listTargets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Targets in a given project and location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ListTargetsRequest request = + * ListTargetsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") + * .build(); + * for (Target element : cloudDeployClient.listTargets(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @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 ListTargetsPagedResponse listTargets(ListTargetsRequest request) { + return listTargetsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Targets in a given project and location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ListTargetsRequest request = + * ListTargetsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = cloudDeployClient.listTargetsPagedCallable().futureCall(request); + * // Do something. + * for (Target element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ListTargetsRequest request = + * ListTargetsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") + * .build(); + * while (true) { + * ListTargetsResponse response = cloudDeployClient.listTargetsCallable().call(request); + * for (Target element : response.getTargetsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * TargetName name = TargetName.of("[PROJECT]", "[LOCATION]", "[TARGET]"); + * Target response = cloudDeployClient.getTarget(name); + * } + * }+ * + * @param name Required. Name of the `Target`. Format must be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Target getTarget(TargetName name) { + GetTargetRequest request = + GetTargetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getTarget(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Target. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String name = TargetName.of("[PROJECT]", "[LOCATION]", "[TARGET]").toString(); + * Target response = cloudDeployClient.getTarget(name); + * } + * }+ * + * @param name Required. Name of the `Target`. Format must be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Target getTarget(String name) { + GetTargetRequest request = GetTargetRequest.newBuilder().setName(name).build(); + return getTarget(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Target. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * GetTargetRequest request = + * GetTargetRequest.newBuilder() + * .setName(TargetName.of("[PROJECT]", "[LOCATION]", "[TARGET]").toString()) + * .build(); + * Target response = cloudDeployClient.getTarget(request); + * } + * }+ * + * @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 Target getTarget(GetTargetRequest request) { + return getTargetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Target. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * GetTargetRequest request = + * GetTargetRequest.newBuilder() + * .setName(TargetName.of("[PROJECT]", "[LOCATION]", "[TARGET]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = cloudDeployClient.getTargetCallable().futureCall(request); + * // Do something. + * Target response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Target target = Target.newBuilder().build(); + * String targetId = "targetId-441951604"; + * Target response = cloudDeployClient.createTargetAsync(parent, target, targetId).get(); + * } + * }+ * + * @param parent Required. The parent collection in which the `Target` should be created. Format + * should be projects/{project_id}/locations/{location_name}. + * @param target Required. The `Target` to create. + * @param targetId Required. ID of the `Target`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * Target target = Target.newBuilder().build(); + * String targetId = "targetId-441951604"; + * Target response = cloudDeployClient.createTargetAsync(parent, target, targetId).get(); + * } + * }+ * + * @param parent Required. The parent collection in which the `Target` should be created. Format + * should be projects/{project_id}/locations/{location_name}. + * @param target Required. The `Target` to create. + * @param targetId Required. ID of the `Target`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * CreateTargetRequest request = + * CreateTargetRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setTargetId("targetId-441951604") + * .setTarget(Target.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setValidateOnly(true) + * .build(); + * Target response = cloudDeployClient.createTargetAsync(request).get(); + * } + * }+ * + * @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 OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * CreateTargetRequest request = + * CreateTargetRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setTargetId("targetId-441951604") + * .setTarget(Target.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setValidateOnly(true) + * .build(); + * OperationFuture+ */ + public final OperationCallablefuture = + * cloudDeployClient.createTargetOperationCallable().futureCall(request); + * // Do something. + * Target response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * CreateTargetRequest request = + * CreateTargetRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setTargetId("targetId-441951604") + * .setTarget(Target.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setValidateOnly(true) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = cloudDeployClient.createTargetCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * Target target = Target.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Target response = cloudDeployClient.updateTargetAsync(target, updateMask).get(); + * } + * }+ * + * @param target Required. The `Target` to update. + * @param updateMask Required. Field mask is used to specify the fields to be overwritten in the + * Target resource by the update. The fields specified in the update_mask are relative to the + * resource, not the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * UpdateTargetRequest request = + * UpdateTargetRequest.newBuilder() + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setTarget(Target.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setAllowMissing(true) + * .setValidateOnly(true) + * .build(); + * Target response = cloudDeployClient.updateTargetAsync(request).get(); + * } + * }+ * + * @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 OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * UpdateTargetRequest request = + * UpdateTargetRequest.newBuilder() + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setTarget(Target.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setAllowMissing(true) + * .setValidateOnly(true) + * .build(); + * OperationFuture+ */ + public final OperationCallablefuture = + * cloudDeployClient.updateTargetOperationCallable().futureCall(request); + * // Do something. + * Target response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * UpdateTargetRequest request = + * UpdateTargetRequest.newBuilder() + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setTarget(Target.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setAllowMissing(true) + * .setValidateOnly(true) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = cloudDeployClient.updateTargetCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * TargetName name = TargetName.of("[PROJECT]", "[LOCATION]", "[TARGET]"); + * cloudDeployClient.deleteTargetAsync(name).get(); + * } + * }+ * + * @param name Required. The name of the `Target` to delete. Format should be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String name = TargetName.of("[PROJECT]", "[LOCATION]", "[TARGET]").toString(); + * cloudDeployClient.deleteTargetAsync(name).get(); + * } + * }+ * + * @param name Required. The name of the `Target` to delete. Format should be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * DeleteTargetRequest request = + * DeleteTargetRequest.newBuilder() + * .setName(TargetName.of("[PROJECT]", "[LOCATION]", "[TARGET]").toString()) + * .setRequestId("requestId693933066") + * .setAllowMissing(true) + * .setValidateOnly(true) + * .setEtag("etag3123477") + * .build(); + * cloudDeployClient.deleteTargetAsync(request).get(); + * } + * }+ * + * @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 OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * DeleteTargetRequest request = + * DeleteTargetRequest.newBuilder() + * .setName(TargetName.of("[PROJECT]", "[LOCATION]", "[TARGET]").toString()) + * .setRequestId("requestId693933066") + * .setAllowMissing(true) + * .setValidateOnly(true) + * .setEtag("etag3123477") + * .build(); + * OperationFuture+ */ + public final OperationCallablefuture = + * cloudDeployClient.deleteTargetOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * DeleteTargetRequest request = + * DeleteTargetRequest.newBuilder() + * .setName(TargetName.of("[PROJECT]", "[LOCATION]", "[TARGET]").toString()) + * .setRequestId("requestId693933066") + * .setAllowMissing(true) + * .setValidateOnly(true) + * .setEtag("etag3123477") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = cloudDeployClient.deleteTargetCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * DeliveryPipelineName parent = + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]"); + * for (Release element : cloudDeployClient.listReleases(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The `DeliveryPipeline` which owns this collection of `Release` objects. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListReleasesPagedResponse listReleases(DeliveryPipelineName parent) { + ListReleasesRequest request = + ListReleasesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listReleases(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Releases in a given project and location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String parent = + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]").toString(); + * for (Release element : cloudDeployClient.listReleases(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The `DeliveryPipeline` which owns this collection of `Release` objects. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListReleasesPagedResponse listReleases(String parent) { + ListReleasesRequest request = ListReleasesRequest.newBuilder().setParent(parent).build(); + return listReleases(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Releases in a given project and location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ListReleasesRequest request = + * ListReleasesRequest.newBuilder() + * .setParent( + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") + * .build(); + * for (Release element : cloudDeployClient.listReleases(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @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 ListReleasesPagedResponse listReleases(ListReleasesRequest request) { + return listReleasesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Releases in a given project and location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ListReleasesRequest request = + * ListReleasesRequest.newBuilder() + * .setParent( + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = cloudDeployClient.listReleasesPagedCallable().futureCall(request); + * // Do something. + * for (Release element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ListReleasesRequest request = + * ListReleasesRequest.newBuilder() + * .setParent( + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") + * .build(); + * while (true) { + * ListReleasesResponse response = cloudDeployClient.listReleasesCallable().call(request); + * for (Release element : response.getReleasesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ReleaseName name = + * ReleaseName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]"); + * Release response = cloudDeployClient.getRelease(name); + * } + * }+ * + * @param name Required. Name of the `Release`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Release getRelease(ReleaseName name) { + GetReleaseRequest request = + GetReleaseRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getRelease(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Release. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String name = + * ReleaseName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]").toString(); + * Release response = cloudDeployClient.getRelease(name); + * } + * }+ * + * @param name Required. Name of the `Release`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Release getRelease(String name) { + GetReleaseRequest request = GetReleaseRequest.newBuilder().setName(name).build(); + return getRelease(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Release. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * GetReleaseRequest request = + * GetReleaseRequest.newBuilder() + * .setName( + * ReleaseName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]") + * .toString()) + * .build(); + * Release response = cloudDeployClient.getRelease(request); + * } + * }+ * + * @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 Release getRelease(GetReleaseRequest request) { + return getReleaseCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Release. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * GetReleaseRequest request = + * GetReleaseRequest.newBuilder() + * .setName( + * ReleaseName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = cloudDeployClient.getReleaseCallable().futureCall(request); + * // Do something. + * Release response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * DeliveryPipelineName parent = + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]"); + * Release release = Release.newBuilder().build(); + * String releaseId = "releaseId89607042"; + * Release response = cloudDeployClient.createReleaseAsync(parent, release, releaseId).get(); + * } + * }+ * + * @param parent Required. The parent collection in which the `Release` should be created. Format + * should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * @param release Required. The `Release` to create. + * @param releaseId Required. ID of the `Release`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String parent = + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]").toString(); + * Release release = Release.newBuilder().build(); + * String releaseId = "releaseId89607042"; + * Release response = cloudDeployClient.createReleaseAsync(parent, release, releaseId).get(); + * } + * }+ * + * @param parent Required. The parent collection in which the `Release` should be created. Format + * should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * @param release Required. The `Release` to create. + * @param releaseId Required. ID of the `Release`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * CreateReleaseRequest request = + * CreateReleaseRequest.newBuilder() + * .setParent( + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]") + * .toString()) + * .setReleaseId("releaseId89607042") + * .setRelease(Release.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setValidateOnly(true) + * .build(); + * Release response = cloudDeployClient.createReleaseAsync(request).get(); + * } + * }+ * + * @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 OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * CreateReleaseRequest request = + * CreateReleaseRequest.newBuilder() + * .setParent( + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]") + * .toString()) + * .setReleaseId("releaseId89607042") + * .setRelease(Release.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setValidateOnly(true) + * .build(); + * OperationFuture+ */ + public final OperationCallablefuture = + * cloudDeployClient.createReleaseOperationCallable().futureCall(request); + * // Do something. + * Release response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * CreateReleaseRequest request = + * CreateReleaseRequest.newBuilder() + * .setParent( + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]") + * .toString()) + * .setReleaseId("releaseId89607042") + * .setRelease(Release.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setValidateOnly(true) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = cloudDeployClient.createReleaseCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ReleaseName name = + * ReleaseName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]"); + * AbandonReleaseResponse response = cloudDeployClient.abandonRelease(name); + * } + * }+ * + * @param name Required. Name of the Release. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AbandonReleaseResponse abandonRelease(ReleaseName name) { + AbandonReleaseRequest request = + AbandonReleaseRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return abandonRelease(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Abandons a Release in the Delivery Pipeline. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String name = + * ReleaseName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]").toString(); + * AbandonReleaseResponse response = cloudDeployClient.abandonRelease(name); + * } + * }+ * + * @param name Required. Name of the Release. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AbandonReleaseResponse abandonRelease(String name) { + AbandonReleaseRequest request = AbandonReleaseRequest.newBuilder().setName(name).build(); + return abandonRelease(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Abandons a Release in the Delivery Pipeline. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * AbandonReleaseRequest request = + * AbandonReleaseRequest.newBuilder() + * .setName( + * ReleaseName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]") + * .toString()) + * .build(); + * AbandonReleaseResponse response = cloudDeployClient.abandonRelease(request); + * } + * }+ * + * @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 AbandonReleaseResponse abandonRelease(AbandonReleaseRequest request) { + return abandonReleaseCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Abandons a Release in the Delivery Pipeline. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * AbandonReleaseRequest request = + * AbandonReleaseRequest.newBuilder() + * .setName( + * ReleaseName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * cloudDeployClient.abandonReleaseCallable().futureCall(request); + * // Do something. + * AbandonReleaseResponse response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * RolloutName name = + * RolloutName.of( + * "[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]", "[ROLLOUT]"); + * ApproveRolloutResponse response = cloudDeployClient.approveRollout(name); + * } + * }+ * + * @param name Required. Name of the Rollout. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/{rollout}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ApproveRolloutResponse approveRollout(RolloutName name) { + ApproveRolloutRequest request = + ApproveRolloutRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return approveRollout(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Approves a Rollout. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String name = + * RolloutName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]", "[ROLLOUT]") + * .toString(); + * ApproveRolloutResponse response = cloudDeployClient.approveRollout(name); + * } + * }+ * + * @param name Required. Name of the Rollout. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/{rollout}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ApproveRolloutResponse approveRollout(String name) { + ApproveRolloutRequest request = ApproveRolloutRequest.newBuilder().setName(name).build(); + return approveRollout(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Approves a Rollout. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ApproveRolloutRequest request = + * ApproveRolloutRequest.newBuilder() + * .setName( + * RolloutName.of( + * "[PROJECT]", + * "[LOCATION]", + * "[DELIVERY_PIPELINE]", + * "[RELEASE]", + * "[ROLLOUT]") + * .toString()) + * .setApproved(true) + * .build(); + * ApproveRolloutResponse response = cloudDeployClient.approveRollout(request); + * } + * }+ * + * @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 ApproveRolloutResponse approveRollout(ApproveRolloutRequest request) { + return approveRolloutCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Approves a Rollout. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ApproveRolloutRequest request = + * ApproveRolloutRequest.newBuilder() + * .setName( + * RolloutName.of( + * "[PROJECT]", + * "[LOCATION]", + * "[DELIVERY_PIPELINE]", + * "[RELEASE]", + * "[ROLLOUT]") + * .toString()) + * .setApproved(true) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * cloudDeployClient.approveRolloutCallable().futureCall(request); + * // Do something. + * ApproveRolloutResponse response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ReleaseName parent = + * ReleaseName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]"); + * for (Rollout element : cloudDeployClient.listRollouts(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The `Release` which owns this collection of `Rollout` objects. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListRolloutsPagedResponse listRollouts(ReleaseName parent) { + ListRolloutsRequest request = + ListRolloutsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listRollouts(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Rollouts in a given project and location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String parent = + * ReleaseName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]").toString(); + * for (Rollout element : cloudDeployClient.listRollouts(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The `Release` which owns this collection of `Rollout` objects. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListRolloutsPagedResponse listRollouts(String parent) { + ListRolloutsRequest request = ListRolloutsRequest.newBuilder().setParent(parent).build(); + return listRollouts(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Rollouts in a given project and location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ListRolloutsRequest request = + * ListRolloutsRequest.newBuilder() + * .setParent( + * ReleaseName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") + * .build(); + * for (Rollout element : cloudDeployClient.listRollouts(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @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 ListRolloutsPagedResponse listRollouts(ListRolloutsRequest request) { + return listRolloutsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Rollouts in a given project and location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ListRolloutsRequest request = + * ListRolloutsRequest.newBuilder() + * .setParent( + * ReleaseName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = cloudDeployClient.listRolloutsPagedCallable().futureCall(request); + * // Do something. + * for (Rollout element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ListRolloutsRequest request = + * ListRolloutsRequest.newBuilder() + * .setParent( + * ReleaseName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") + * .build(); + * while (true) { + * ListRolloutsResponse response = cloudDeployClient.listRolloutsCallable().call(request); + * for (Rollout element : response.getRolloutsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * RolloutName name = + * RolloutName.of( + * "[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]", "[ROLLOUT]"); + * Rollout response = cloudDeployClient.getRollout(name); + * } + * }+ * + * @param name Required. Name of the `Rollout`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Rollout getRollout(RolloutName name) { + GetRolloutRequest request = + GetRolloutRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getRollout(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Rollout. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String name = + * RolloutName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]", "[ROLLOUT]") + * .toString(); + * Rollout response = cloudDeployClient.getRollout(name); + * } + * }+ * + * @param name Required. Name of the `Rollout`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Rollout getRollout(String name) { + GetRolloutRequest request = GetRolloutRequest.newBuilder().setName(name).build(); + return getRollout(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Rollout. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * GetRolloutRequest request = + * GetRolloutRequest.newBuilder() + * .setName( + * RolloutName.of( + * "[PROJECT]", + * "[LOCATION]", + * "[DELIVERY_PIPELINE]", + * "[RELEASE]", + * "[ROLLOUT]") + * .toString()) + * .build(); + * Rollout response = cloudDeployClient.getRollout(request); + * } + * }+ * + * @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 Rollout getRollout(GetRolloutRequest request) { + return getRolloutCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Rollout. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * GetRolloutRequest request = + * GetRolloutRequest.newBuilder() + * .setName( + * RolloutName.of( + * "[PROJECT]", + * "[LOCATION]", + * "[DELIVERY_PIPELINE]", + * "[RELEASE]", + * "[ROLLOUT]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = cloudDeployClient.getRolloutCallable().futureCall(request); + * // Do something. + * Rollout response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ReleaseName parent = + * ReleaseName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]"); + * Rollout rollout = Rollout.newBuilder().build(); + * String rolloutId = "rolloutId551248556"; + * Rollout response = cloudDeployClient.createRolloutAsync(parent, rollout, rolloutId).get(); + * } + * }+ * + * @param parent Required. The parent collection in which the `Rollout` should be created. Format + * should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * @param rollout Required. The `Rollout` to create. + * @param rolloutId Required. ID of the `Rollout`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String parent = + * ReleaseName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]").toString(); + * Rollout rollout = Rollout.newBuilder().build(); + * String rolloutId = "rolloutId551248556"; + * Rollout response = cloudDeployClient.createRolloutAsync(parent, rollout, rolloutId).get(); + * } + * }+ * + * @param parent Required. The parent collection in which the `Rollout` should be created. Format + * should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * @param rollout Required. The `Rollout` to create. + * @param rolloutId Required. ID of the `Rollout`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * CreateRolloutRequest request = + * CreateRolloutRequest.newBuilder() + * .setParent( + * ReleaseName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]") + * .toString()) + * .setRolloutId("rolloutId551248556") + * .setRollout(Rollout.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setValidateOnly(true) + * .build(); + * Rollout response = cloudDeployClient.createRolloutAsync(request).get(); + * } + * }+ * + * @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 OperationFuture
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * CreateRolloutRequest request = + * CreateRolloutRequest.newBuilder() + * .setParent( + * ReleaseName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]") + * .toString()) + * .setRolloutId("rolloutId551248556") + * .setRollout(Rollout.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setValidateOnly(true) + * .build(); + * OperationFuture+ */ + public final OperationCallablefuture = + * cloudDeployClient.createRolloutOperationCallable().futureCall(request); + * // Do something. + * Rollout response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * CreateRolloutRequest request = + * CreateRolloutRequest.newBuilder() + * .setParent( + * ReleaseName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]") + * .toString()) + * .setRolloutId("rolloutId551248556") + * .setRollout(Rollout.newBuilder().build()) + * .setRequestId("requestId693933066") + * .setValidateOnly(true) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = cloudDeployClient.createRolloutCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * RolloutName rollout = + * RolloutName.of( + * "[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]", "[ROLLOUT]"); + * String phaseId = "phaseId-608264202"; + * String jobId = "jobId101296568"; + * RetryJobResponse response = cloudDeployClient.retryJob(rollout, phaseId, jobId); + * } + * }+ * + * @param rollout Required. Name of the Rollout. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/{rollout}. + * @param phaseId Required. The phase ID the Job to retry belongs to. + * @param jobId Required. The job ID for the Job to retry. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RetryJobResponse retryJob(RolloutName rollout, String phaseId, String jobId) { + RetryJobRequest request = + RetryJobRequest.newBuilder() + .setRollout(rollout == null ? null : rollout.toString()) + .setPhaseId(phaseId) + .setJobId(jobId) + .build(); + return retryJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retries the specified Job in a Rollout. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String rollout = + * RolloutName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]", "[ROLLOUT]") + * .toString(); + * String phaseId = "phaseId-608264202"; + * String jobId = "jobId101296568"; + * RetryJobResponse response = cloudDeployClient.retryJob(rollout, phaseId, jobId); + * } + * }+ * + * @param rollout Required. Name of the Rollout. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/{rollout}. + * @param phaseId Required. The phase ID the Job to retry belongs to. + * @param jobId Required. The job ID for the Job to retry. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RetryJobResponse retryJob(String rollout, String phaseId, String jobId) { + RetryJobRequest request = + RetryJobRequest.newBuilder() + .setRollout(rollout) + .setPhaseId(phaseId) + .setJobId(jobId) + .build(); + return retryJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retries the specified Job in a Rollout. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * RetryJobRequest request = + * RetryJobRequest.newBuilder() + * .setRollout( + * RolloutName.of( + * "[PROJECT]", + * "[LOCATION]", + * "[DELIVERY_PIPELINE]", + * "[RELEASE]", + * "[ROLLOUT]") + * .toString()) + * .setPhaseId("phaseId-608264202") + * .setJobId("jobId101296568") + * .build(); + * RetryJobResponse response = cloudDeployClient.retryJob(request); + * } + * }+ * + * @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 RetryJobResponse retryJob(RetryJobRequest request) { + return retryJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retries the specified Job in a Rollout. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * RetryJobRequest request = + * RetryJobRequest.newBuilder() + * .setRollout( + * RolloutName.of( + * "[PROJECT]", + * "[LOCATION]", + * "[DELIVERY_PIPELINE]", + * "[RELEASE]", + * "[ROLLOUT]") + * .toString()) + * .setPhaseId("phaseId-608264202") + * .setJobId("jobId101296568") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = cloudDeployClient.retryJobCallable().futureCall(request); + * // Do something. + * RetryJobResponse response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * RolloutName parent = + * RolloutName.of( + * "[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]", "[ROLLOUT]"); + * for (JobRun element : cloudDeployClient.listJobRuns(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The `Rollout` which owns this collection of `JobRun` objects. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListJobRunsPagedResponse listJobRuns(RolloutName parent) { + ListJobRunsRequest request = + ListJobRunsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listJobRuns(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists JobRuns in a given project and location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String parent = + * RolloutName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]", "[RELEASE]", "[ROLLOUT]") + * .toString(); + * for (JobRun element : cloudDeployClient.listJobRuns(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The `Rollout` which owns this collection of `JobRun` objects. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListJobRunsPagedResponse listJobRuns(String parent) { + ListJobRunsRequest request = ListJobRunsRequest.newBuilder().setParent(parent).build(); + return listJobRuns(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists JobRuns in a given project and location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ListJobRunsRequest request = + * ListJobRunsRequest.newBuilder() + * .setParent( + * RolloutName.of( + * "[PROJECT]", + * "[LOCATION]", + * "[DELIVERY_PIPELINE]", + * "[RELEASE]", + * "[ROLLOUT]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") + * .build(); + * for (JobRun element : cloudDeployClient.listJobRuns(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @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 ListJobRunsPagedResponse listJobRuns(ListJobRunsRequest request) { + return listJobRunsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists JobRuns in a given project and location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ListJobRunsRequest request = + * ListJobRunsRequest.newBuilder() + * .setParent( + * RolloutName.of( + * "[PROJECT]", + * "[LOCATION]", + * "[DELIVERY_PIPELINE]", + * "[RELEASE]", + * "[ROLLOUT]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = cloudDeployClient.listJobRunsPagedCallable().futureCall(request); + * // Do something. + * for (JobRun element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ListJobRunsRequest request = + * ListJobRunsRequest.newBuilder() + * .setParent( + * RolloutName.of( + * "[PROJECT]", + * "[LOCATION]", + * "[DELIVERY_PIPELINE]", + * "[RELEASE]", + * "[ROLLOUT]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") + * .build(); + * while (true) { + * ListJobRunsResponse response = cloudDeployClient.listJobRunsCallable().call(request); + * for (JobRun element : response.getJobRunsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * JobRunName name = + * JobRunName.of( + * "[PROJECT]", + * "[LOCATION]", + * "[DELIVERY_PIPELINE]", + * "[RELEASE]", + * "[ROLLOUT]", + * "[JOB_RUN]"); + * JobRun response = cloudDeployClient.getJobRun(name); + * } + * }+ * + * @param name Required. Name of the `JobRun`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final JobRun getJobRun(JobRunName name) { + GetJobRunRequest request = + GetJobRunRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getJobRun(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single JobRun. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String name = + * JobRunName.of( + * "[PROJECT]", + * "[LOCATION]", + * "[DELIVERY_PIPELINE]", + * "[RELEASE]", + * "[ROLLOUT]", + * "[JOB_RUN]") + * .toString(); + * JobRun response = cloudDeployClient.getJobRun(name); + * } + * }+ * + * @param name Required. Name of the `JobRun`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final JobRun getJobRun(String name) { + GetJobRunRequest request = GetJobRunRequest.newBuilder().setName(name).build(); + return getJobRun(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single JobRun. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * GetJobRunRequest request = + * GetJobRunRequest.newBuilder() + * .setName( + * JobRunName.of( + * "[PROJECT]", + * "[LOCATION]", + * "[DELIVERY_PIPELINE]", + * "[RELEASE]", + * "[ROLLOUT]", + * "[JOB_RUN]") + * .toString()) + * .build(); + * JobRun response = cloudDeployClient.getJobRun(request); + * } + * }+ * + * @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 JobRun getJobRun(GetJobRunRequest request) { + return getJobRunCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single JobRun. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * GetJobRunRequest request = + * GetJobRunRequest.newBuilder() + * .setName( + * JobRunName.of( + * "[PROJECT]", + * "[LOCATION]", + * "[DELIVERY_PIPELINE]", + * "[RELEASE]", + * "[ROLLOUT]", + * "[JOB_RUN]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = cloudDeployClient.getJobRunCallable().futureCall(request); + * // Do something. + * JobRun response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ConfigName name = ConfigName.of("[PROJECT]", "[LOCATION]"); + * Config response = cloudDeployClient.getConfig(name); + * } + * }+ * + * @param name Required. Name of requested configuration. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Config getConfig(ConfigName name) { + GetConfigRequest request = + GetConfigRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the configuration for a location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * String name = ConfigName.of("[PROJECT]", "[LOCATION]").toString(); + * Config response = cloudDeployClient.getConfig(name); + * } + * }+ * + * @param name Required. Name of requested configuration. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Config getConfig(String name) { + GetConfigRequest request = GetConfigRequest.newBuilder().setName(name).build(); + return getConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the configuration for a location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * GetConfigRequest request = + * GetConfigRequest.newBuilder() + * .setName(ConfigName.of("[PROJECT]", "[LOCATION]").toString()) + * .build(); + * Config response = cloudDeployClient.getConfig(request); + * } + * }+ * + * @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 Config getConfig(GetConfigRequest request) { + return getConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the configuration for a location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * GetConfigRequest request = + * GetConfigRequest.newBuilder() + * .setName(ConfigName.of("[PROJECT]", "[LOCATION]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = cloudDeployClient.getConfigCallable().futureCall(request); + * // Do something. + * Config response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Location element : cloudDeployClient.listLocations(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * cloudDeployClient.listLocationsPagedCallable().futureCall(request); + * // Do something. + * for (Location element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListLocationsResponse response = cloudDeployClient.listLocationsCallable().call(request); + * for (Location element : response.getLocationsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + * Location response = cloudDeployClient.getLocation(request); + * } + * }+ * + * @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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + * ApiFuture+ */ + public final UnaryCallablefuture = cloudDeployClient.getLocationCallable().futureCall(request); + * // Do something. + * Location response = future.get(); + * } + * }
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * SetIamPolicyRequest request = + * SetIamPolicyRequest.newBuilder() + * .setResource( + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]") + * .toString()) + * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Policy response = cloudDeployClient.setIamPolicy(request); + * } + * }+ * + * @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 Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * SetIamPolicyRequest request = + * SetIamPolicyRequest.newBuilder() + * .setResource( + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]") + * .toString()) + * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = cloudDeployClient.setIamPolicyCallable().futureCall(request); + * // Do something. + * Policy response = future.get(); + * } + * }
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * GetIamPolicyRequest request = + * GetIamPolicyRequest.newBuilder() + * .setResource( + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]") + * .toString()) + * .setOptions(GetPolicyOptions.newBuilder().build()) + * .build(); + * Policy response = cloudDeployClient.getIamPolicy(request); + * } + * }+ * + * @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 Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * GetIamPolicyRequest request = + * GetIamPolicyRequest.newBuilder() + * .setResource( + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]") + * .toString()) + * .setOptions(GetPolicyOptions.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = cloudDeployClient.getIamPolicyCallable().futureCall(request); + * // Do something. + * Policy response = future.get(); + * } + * }
Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * TestIamPermissionsRequest request = + * TestIamPermissionsRequest.newBuilder() + * .setResource( + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]") + * .toString()) + * .addAllPermissions(new ArrayList+ * + * @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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *()) + * .build(); + * TestIamPermissionsResponse response = cloudDeployClient.testIamPermissions(request); + * } + * }
Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *
Sample code: + * + *
{@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) { + * TestIamPermissionsRequest request = + * TestIamPermissionsRequest.newBuilder() + * .setResource( + * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]") + * .toString()) + * .addAllPermissions(new ArrayList+ */ + public final UnaryCallable()) + * .build(); + * ApiFuture future = + * cloudDeployClient.testIamPermissionsCallable().futureCall(request); + * // Do something. + * TestIamPermissionsResponse response = future.get(); + * } + * }
The default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of getDeliveryPipeline to 30 seconds: + * + *
{@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 + * CloudDeploySettings.Builder cloudDeploySettingsBuilder = CloudDeploySettings.newBuilder(); + * cloudDeploySettingsBuilder + * .getDeliveryPipelineSettings() + * .setRetrySettings( + * cloudDeploySettingsBuilder.getDeliveryPipelineSettings().getRetrySettings().toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); + * CloudDeploySettings cloudDeploySettings = cloudDeploySettingsBuilder.build(); + * }+ */ +@Generated("by gapic-generator-java") +public class CloudDeploySettings extends ClientSettings
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * ======================= CloudDeployClient =======================
+ *
+ * Service Description: CloudDeploy service creates and manages Continuous Delivery operations on
+ * Google Cloud Platform via Skaffold (https://skaffold.dev).
+ *
+ * Sample for CloudDeployClient:
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public abstract class CloudDeployStub implements BackgroundResource {
+
+ public OperationsStub getOperationsStub() {
+ return null;
+ }
+
+ public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+ return null;
+ }
+
+ public UnaryCallable The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the total timeout of getDeliveryPipeline to 30 seconds:
+ *
+ * {@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 (CloudDeployClient cloudDeployClient = CloudDeployClient.create()) {
+ * DeliveryPipelineName name =
+ * DeliveryPipelineName.of("[PROJECT]", "[LOCATION]", "[DELIVERY_PIPELINE]");
+ * DeliveryPipeline response = cloudDeployClient.getDeliveryPipeline(name);
+ * }
+ * }
+ */
+@Generated("by gapic-generator-java")
+package com.google.cloud.deploy.v1;
+
+import javax.annotation.Generated;
diff --git a/owl-bot-staging/java-deploy/v1/google-cloud-deploy/src/main/java/com/google/cloud/deploy/v1/stub/CloudDeployStub.java b/owl-bot-staging/java-deploy/v1/google-cloud-deploy/src/main/java/com/google/cloud/deploy/v1/stub/CloudDeployStub.java
new file mode 100644
index 000000000000..6ba4947864f3
--- /dev/null
+++ b/owl-bot-staging/java-deploy/v1/google-cloud-deploy/src/main/java/com/google/cloud/deploy/v1/stub/CloudDeployStub.java
@@ -0,0 +1,279 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.deploy.v1.stub;
+
+import static com.google.cloud.deploy.v1.CloudDeployClient.ListDeliveryPipelinesPagedResponse;
+import static com.google.cloud.deploy.v1.CloudDeployClient.ListJobRunsPagedResponse;
+import static com.google.cloud.deploy.v1.CloudDeployClient.ListLocationsPagedResponse;
+import static com.google.cloud.deploy.v1.CloudDeployClient.ListReleasesPagedResponse;
+import static com.google.cloud.deploy.v1.CloudDeployClient.ListRolloutsPagedResponse;
+import static com.google.cloud.deploy.v1.CloudDeployClient.ListTargetsPagedResponse;
+
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.deploy.v1.AbandonReleaseRequest;
+import com.google.cloud.deploy.v1.AbandonReleaseResponse;
+import com.google.cloud.deploy.v1.ApproveRolloutRequest;
+import com.google.cloud.deploy.v1.ApproveRolloutResponse;
+import com.google.cloud.deploy.v1.Config;
+import com.google.cloud.deploy.v1.CreateDeliveryPipelineRequest;
+import com.google.cloud.deploy.v1.CreateReleaseRequest;
+import com.google.cloud.deploy.v1.CreateRolloutRequest;
+import com.google.cloud.deploy.v1.CreateTargetRequest;
+import com.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest;
+import com.google.cloud.deploy.v1.DeleteTargetRequest;
+import com.google.cloud.deploy.v1.DeliveryPipeline;
+import com.google.cloud.deploy.v1.GetConfigRequest;
+import com.google.cloud.deploy.v1.GetDeliveryPipelineRequest;
+import com.google.cloud.deploy.v1.GetJobRunRequest;
+import com.google.cloud.deploy.v1.GetReleaseRequest;
+import com.google.cloud.deploy.v1.GetRolloutRequest;
+import com.google.cloud.deploy.v1.GetTargetRequest;
+import com.google.cloud.deploy.v1.JobRun;
+import com.google.cloud.deploy.v1.ListDeliveryPipelinesRequest;
+import com.google.cloud.deploy.v1.ListDeliveryPipelinesResponse;
+import com.google.cloud.deploy.v1.ListJobRunsRequest;
+import com.google.cloud.deploy.v1.ListJobRunsResponse;
+import com.google.cloud.deploy.v1.ListReleasesRequest;
+import com.google.cloud.deploy.v1.ListReleasesResponse;
+import com.google.cloud.deploy.v1.ListRolloutsRequest;
+import com.google.cloud.deploy.v1.ListRolloutsResponse;
+import com.google.cloud.deploy.v1.ListTargetsRequest;
+import com.google.cloud.deploy.v1.ListTargetsResponse;
+import com.google.cloud.deploy.v1.OperationMetadata;
+import com.google.cloud.deploy.v1.Release;
+import com.google.cloud.deploy.v1.RetryJobRequest;
+import com.google.cloud.deploy.v1.RetryJobResponse;
+import com.google.cloud.deploy.v1.Rollout;
+import com.google.cloud.deploy.v1.Target;
+import com.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest;
+import com.google.cloud.deploy.v1.UpdateTargetRequest;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.iam.v1.GetIamPolicyRequest;
+import com.google.iam.v1.Policy;
+import com.google.iam.v1.SetIamPolicyRequest;
+import com.google.iam.v1.TestIamPermissionsRequest;
+import com.google.iam.v1.TestIamPermissionsResponse;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
+import com.google.protobuf.Empty;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Base stub class for the CloudDeploy service API.
+ *
+ *
+ *
+ *
+ * {@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
+ * CloudDeployStubSettings.Builder cloudDeploySettingsBuilder =
+ * CloudDeployStubSettings.newBuilder();
+ * cloudDeploySettingsBuilder
+ * .getDeliveryPipelineSettings()
+ * .setRetrySettings(
+ * cloudDeploySettingsBuilder.getDeliveryPipelineSettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * CloudDeployStubSettings cloudDeploySettings = cloudDeploySettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class CloudDeployStubSettings extends StubSettings