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 (ConfigClient configClient = ConfigClient.create()) {
+ * DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+ * Deployment response = configClient.getDeployment(name);
+ * }
+ * }
+ *
+ * Note: close() needs to be called on the ConfigClient 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 ConfigSettings 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
+ * ConfigSettings configSettings =
+ * ConfigSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * ConfigClient configClient = ConfigClient.create(configSettings);
+ * }
+ *
+ * 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
+ * ConfigSettings configSettings = ConfigSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ConfigClient configClient = ConfigClient.create(configSettings);
+ * }
+ *
+ * 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
+ * ConfigSettings configSettings = ConfigSettings.newHttpJsonBuilder().build();
+ * ConfigClient configClient = ConfigClient.create(configSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class ConfigClient implements BackgroundResource { + private final ConfigSettings settings; + private final ConfigStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of ConfigClient with default settings. */ + public static final ConfigClient create() throws IOException { + return create(ConfigSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ConfigClient, 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 ConfigClient create(ConfigSettings settings) throws IOException { + return new ConfigClient(settings); + } + + /** + * Constructs an instance of ConfigClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(ConfigSettings). + */ + public static final ConfigClient create(ConfigStub stub) { + return new ConfigClient(stub); + } + + /** + * Constructs an instance of ConfigClient, 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 ConfigClient(ConfigSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ConfigStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected ConfigClient(ConfigStub 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 ConfigSettings getSettings() { + return settings; + } + + public ConfigStub 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 [Deployment][google.cloud.config.v1.Deployment]s 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 (ConfigClient configClient = ConfigClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (Deployment element : configClient.listDeployments(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent in whose context the Deployments are listed. The parent
+ * value is in the format: 'projects/{project_id}/locations/{location}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListDeploymentsPagedResponse listDeployments(LocationName parent) {
+ ListDeploymentsRequest request =
+ ListDeploymentsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listDeployments(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists [Deployment][google.cloud.config.v1.Deployment]s 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 (ConfigClient configClient = ConfigClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (Deployment element : configClient.listDeployments(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent in whose context the Deployments are listed. The parent
+ * value is in the format: 'projects/{project_id}/locations/{location}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListDeploymentsPagedResponse listDeployments(String parent) {
+ ListDeploymentsRequest request = ListDeploymentsRequest.newBuilder().setParent(parent).build();
+ return listDeployments(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists [Deployment][google.cloud.config.v1.Deployment]s 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 (ConfigClient configClient = ConfigClient.create()) {
+ * ListDeploymentsRequest request =
+ * ListDeploymentsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * for (Deployment element : configClient.listDeployments(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 ListDeploymentsPagedResponse listDeployments(ListDeploymentsRequest request) {
+ return listDeploymentsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists [Deployment][google.cloud.config.v1.Deployment]s 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 (ConfigClient configClient = ConfigClient.create()) {
+ * ListDeploymentsRequest request =
+ * ListDeploymentsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * ApiFuture future =
+ * configClient.listDeploymentsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Deployment element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (ConfigClient configClient = ConfigClient.create()) {
+ * ListDeploymentsRequest request =
+ * ListDeploymentsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * while (true) {
+ * ListDeploymentsResponse response = configClient.listDeploymentsCallable().call(request);
+ * for (Deployment element : response.getDeploymentsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (ConfigClient configClient = ConfigClient.create()) {
+ * DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+ * Deployment response = configClient.getDeployment(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the deployment. Format:
+ * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Deployment getDeployment(DeploymentName name) {
+ GetDeploymentRequest request =
+ GetDeploymentRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getDeployment(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details about a [Deployment][google.cloud.config.v1.Deployment].
+ *
+ * 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 (ConfigClient configClient = ConfigClient.create()) {
+ * String name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+ * Deployment response = configClient.getDeployment(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the deployment. Format:
+ * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Deployment getDeployment(String name) {
+ GetDeploymentRequest request = GetDeploymentRequest.newBuilder().setName(name).build();
+ return getDeployment(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details about a [Deployment][google.cloud.config.v1.Deployment].
+ *
+ * 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 (ConfigClient configClient = ConfigClient.create()) {
+ * GetDeploymentRequest request =
+ * GetDeploymentRequest.newBuilder()
+ * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .build();
+ * Deployment response = configClient.getDeployment(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 Deployment getDeployment(GetDeploymentRequest request) {
+ return getDeploymentCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details about a [Deployment][google.cloud.config.v1.Deployment].
+ *
+ * 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 (ConfigClient configClient = ConfigClient.create()) {
+ * GetDeploymentRequest request =
+ * GetDeploymentRequest.newBuilder()
+ * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .build();
+ * ApiFuture future = configClient.getDeploymentCallable().futureCall(request);
+ * // Do something.
+ * Deployment response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (ConfigClient configClient = ConfigClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * Deployment deployment = Deployment.newBuilder().build();
+ * String deploymentId = "deploymentId-136894784";
+ * Deployment response =
+ * configClient.createDeploymentAsync(parent, deployment, deploymentId).get();
+ * }
+ * }
+ *
+ * @param parent Required. The parent in whose context the Deployment is created. The parent value
+ * is in the format: 'projects/{project_id}/locations/{location}'.
+ * @param deployment Required. [Deployment][google.cloud.config.v1.Deployment] resource to be
+ * created.
+ * @param deploymentId Required. The Deployment ID.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (ConfigClient configClient = ConfigClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * Deployment deployment = Deployment.newBuilder().build();
+ * String deploymentId = "deploymentId-136894784";
+ * Deployment response =
+ * configClient.createDeploymentAsync(parent, deployment, deploymentId).get();
+ * }
+ * }
+ *
+ * @param parent Required. The parent in whose context the Deployment is created. The parent value
+ * is in the format: 'projects/{project_id}/locations/{location}'.
+ * @param deployment Required. [Deployment][google.cloud.config.v1.Deployment] resource to be
+ * created.
+ * @param deploymentId Required. The Deployment ID.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (ConfigClient configClient = ConfigClient.create()) {
+ * CreateDeploymentRequest request =
+ * CreateDeploymentRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setDeploymentId("deploymentId-136894784")
+ * .setDeployment(Deployment.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * Deployment response = configClient.createDeploymentAsync(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 OperationFutureSample 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 (ConfigClient configClient = ConfigClient.create()) {
+ * CreateDeploymentRequest request =
+ * CreateDeploymentRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setDeploymentId("deploymentId-136894784")
+ * .setDeployment(Deployment.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * OperationFuture future =
+ * configClient.createDeploymentOperationCallable().futureCall(request);
+ * // Do something.
+ * Deployment response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample 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 (ConfigClient configClient = ConfigClient.create()) {
+ * CreateDeploymentRequest request =
+ * CreateDeploymentRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setDeploymentId("deploymentId-136894784")
+ * .setDeployment(Deployment.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * ApiFuture future = configClient.createDeploymentCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (ConfigClient configClient = ConfigClient.create()) {
+ * Deployment deployment = Deployment.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Deployment response = configClient.updateDeploymentAsync(deployment, updateMask).get();
+ * }
+ * }
+ *
+ * @param deployment Required. [Deployment][google.cloud.config.v1.Deployment] to update.
+ * The deployment's `name` field is used to identify the resource to be updated. Format: + * `projects/{project}/locations/{location}/deployments/{deployment}` + * @param updateMask Optional. Field mask used to specify the fields to be overwritten in the + * Deployment 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:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ * Sample code:
+ *
+ * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * 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:
+ *
+ * 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:
+ *
+ * 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 getDeployment to 30 seconds:
+ *
+ * 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.
+ *
+ * ======================= ConfigClient =======================
+ *
+ * Service Description: Infrastructure Manager is a managed service that automates the deployment
+ * and management of Google Cloud infrastructure resources.
+ *
+ * Sample for ConfigClient:
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public abstract class ConfigStub 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 getDeployment 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 (ConfigClient configClient = ConfigClient.create()) {
+ * UpdateDeploymentRequest request =
+ * UpdateDeploymentRequest.newBuilder()
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setDeployment(Deployment.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * Deployment response = configClient.updateDeploymentAsync(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{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * UpdateDeploymentRequest request =
+ * UpdateDeploymentRequest.newBuilder()
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setDeployment(Deployment.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * UpdateDeploymentRequest request =
+ * UpdateDeploymentRequest.newBuilder()
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setDeployment(Deployment.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+ * Deployment response = configClient.deleteDeploymentAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the Deployment in the format:
+ * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * String name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+ * Deployment response = configClient.deleteDeploymentAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the Deployment in the format:
+ * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * DeleteDeploymentRequest request =
+ * DeleteDeploymentRequest.newBuilder()
+ * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setRequestId("requestId693933066")
+ * .setForce(true)
+ * .build();
+ * Deployment response = configClient.deleteDeploymentAsync(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{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * DeleteDeploymentRequest request =
+ * DeleteDeploymentRequest.newBuilder()
+ * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setRequestId("requestId693933066")
+ * .setForce(true)
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * DeleteDeploymentRequest request =
+ * DeleteDeploymentRequest.newBuilder()
+ * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setRequestId("requestId693933066")
+ * .setForce(true)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * DeploymentName parent = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+ * for (Revision element : configClient.listRevisions(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent in whose context the Revisions are listed. The parent value
+ * is in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListRevisionsPagedResponse listRevisions(DeploymentName parent) {
+ ListRevisionsRequest request =
+ ListRevisionsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listRevisions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists [Revision][google.cloud.config.v1.Revision]s of a deployment.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * String parent = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+ * for (Revision element : configClient.listRevisions(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent in whose context the Revisions are listed. The parent value
+ * is in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListRevisionsPagedResponse listRevisions(String parent) {
+ ListRevisionsRequest request = ListRevisionsRequest.newBuilder().setParent(parent).build();
+ return listRevisions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists [Revision][google.cloud.config.v1.Revision]s of a deployment.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * ListRevisionsRequest request =
+ * ListRevisionsRequest.newBuilder()
+ * .setParent(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * for (Revision element : configClient.listRevisions(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 ListRevisionsPagedResponse listRevisions(ListRevisionsRequest request) {
+ return listRevisionsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists [Revision][google.cloud.config.v1.Revision]s of a deployment.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * ListRevisionsRequest request =
+ * ListRevisionsRequest.newBuilder()
+ * .setParent(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * ListRevisionsRequest request =
+ * ListRevisionsRequest.newBuilder()
+ * .setParent(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * while (true) {
+ * ListRevisionsResponse response = configClient.listRevisionsCallable().call(request);
+ * for (Revision element : response.getRevisionsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * RevisionName name = RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]");
+ * Revision response = configClient.getRevision(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the Revision in the format:
+ * 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Revision getRevision(RevisionName name) {
+ GetRevisionRequest request =
+ GetRevisionRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getRevision(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details about a [Revision][google.cloud.config.v1.Revision].
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * String name =
+ * RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]").toString();
+ * Revision response = configClient.getRevision(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the Revision in the format:
+ * 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Revision getRevision(String name) {
+ GetRevisionRequest request = GetRevisionRequest.newBuilder().setName(name).build();
+ return getRevision(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details about a [Revision][google.cloud.config.v1.Revision].
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * GetRevisionRequest request =
+ * GetRevisionRequest.newBuilder()
+ * .setName(
+ * RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]")
+ * .toString())
+ * .build();
+ * Revision response = configClient.getRevision(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 Revision getRevision(GetRevisionRequest request) {
+ return getRevisionCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details about a [Revision][google.cloud.config.v1.Revision].
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * GetRevisionRequest request =
+ * GetRevisionRequest.newBuilder()
+ * .setName(
+ * RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * ResourceName name =
+ * ResourceName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]", "[RESOURCE]");
+ * Resource response = configClient.getResource(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the Resource in the format:
+ * 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}/resource/{resource}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Resource getResource(ResourceName name) {
+ GetResourceRequest request =
+ GetResourceRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getResource(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details about a [Resource][google.cloud.config.v1.Resource] deployed by Infra Manager.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * String name =
+ * ResourceName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]", "[RESOURCE]")
+ * .toString();
+ * Resource response = configClient.getResource(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the Resource in the format:
+ * 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}/resource/{resource}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Resource getResource(String name) {
+ GetResourceRequest request = GetResourceRequest.newBuilder().setName(name).build();
+ return getResource(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details about a [Resource][google.cloud.config.v1.Resource] deployed by Infra Manager.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * GetResourceRequest request =
+ * GetResourceRequest.newBuilder()
+ * .setName(
+ * ResourceName.of(
+ * "[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]", "[RESOURCE]")
+ * .toString())
+ * .build();
+ * Resource response = configClient.getResource(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 Resource getResource(GetResourceRequest request) {
+ return getResourceCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details about a [Resource][google.cloud.config.v1.Resource] deployed by Infra Manager.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * GetResourceRequest request =
+ * GetResourceRequest.newBuilder()
+ * .setName(
+ * ResourceName.of(
+ * "[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]", "[RESOURCE]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * RevisionName parent =
+ * RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]");
+ * for (Resource element : configClient.listResources(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent in whose context the Resources are listed. The parent value
+ * is in the format:
+ * 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListResourcesPagedResponse listResources(RevisionName parent) {
+ ListResourcesRequest request =
+ ListResourcesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listResources(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists [Resource][google.cloud.config.v1.Resource]s in a given revision.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * String parent =
+ * RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]").toString();
+ * for (Resource element : configClient.listResources(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent in whose context the Resources are listed. The parent value
+ * is in the format:
+ * 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListResourcesPagedResponse listResources(String parent) {
+ ListResourcesRequest request = ListResourcesRequest.newBuilder().setParent(parent).build();
+ return listResources(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists [Resource][google.cloud.config.v1.Resource]s in a given revision.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * ListResourcesRequest request =
+ * ListResourcesRequest.newBuilder()
+ * .setParent(
+ * RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]")
+ * .toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * for (Resource element : configClient.listResources(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 ListResourcesPagedResponse listResources(ListResourcesRequest request) {
+ return listResourcesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists [Resource][google.cloud.config.v1.Resource]s in a given revision.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * ListResourcesRequest request =
+ * ListResourcesRequest.newBuilder()
+ * .setParent(
+ * RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]")
+ * .toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * ListResourcesRequest request =
+ * ListResourcesRequest.newBuilder()
+ * .setParent(
+ * RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]")
+ * .toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * while (true) {
+ * ListResourcesResponse response = configClient.listResourcesCallable().call(request);
+ * for (Resource element : response.getResourcesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * ExportDeploymentStatefileRequest request =
+ * ExportDeploymentStatefileRequest.newBuilder()
+ * .setParent(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setDraft(true)
+ * .build();
+ * Statefile response = configClient.exportDeploymentStatefile(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 Statefile exportDeploymentStatefile(ExportDeploymentStatefileRequest request) {
+ return exportDeploymentStatefileCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Exports Terraform state file from a given deployment.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * ExportDeploymentStatefileRequest request =
+ * ExportDeploymentStatefileRequest.newBuilder()
+ * .setParent(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setDraft(true)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * ExportRevisionStatefileRequest request =
+ * ExportRevisionStatefileRequest.newBuilder()
+ * .setParent(
+ * RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]")
+ * .toString())
+ * .build();
+ * Statefile response = configClient.exportRevisionStatefile(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 Statefile exportRevisionStatefile(ExportRevisionStatefileRequest request) {
+ return exportRevisionStatefileCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Exports Terraform state file from a given revision.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * ExportRevisionStatefileRequest request =
+ * ExportRevisionStatefileRequest.newBuilder()
+ * .setParent(
+ * RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * DeploymentName parent = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+ * long lockId = 338696367;
+ * Statefile response = configClient.importStatefile(parent, lockId);
+ * }
+ * }
+ *
+ * @param parent Required. The parent in whose context the statefile is listed. The parent value
+ * is in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
+ * @param lockId Required. Lock ID of the lock file to verify that the user who is importing the
+ * state file previously locked the Deployment.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Statefile importStatefile(DeploymentName parent, long lockId) {
+ ImportStatefileRequest request =
+ ImportStatefileRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setLockId(lockId)
+ .build();
+ return importStatefile(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Imports Terraform state file in a given deployment. The state file does not take effect until
+ * the Deployment has been unlocked.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * String parent = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+ * long lockId = 338696367;
+ * Statefile response = configClient.importStatefile(parent, lockId);
+ * }
+ * }
+ *
+ * @param parent Required. The parent in whose context the statefile is listed. The parent value
+ * is in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
+ * @param lockId Required. Lock ID of the lock file to verify that the user who is importing the
+ * state file previously locked the Deployment.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Statefile importStatefile(String parent, long lockId) {
+ ImportStatefileRequest request =
+ ImportStatefileRequest.newBuilder().setParent(parent).setLockId(lockId).build();
+ return importStatefile(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Imports Terraform state file in a given deployment. The state file does not take effect until
+ * the Deployment has been unlocked.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * ImportStatefileRequest request =
+ * ImportStatefileRequest.newBuilder()
+ * .setParent(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setLockId(338696367)
+ * .setSkipDraft(true)
+ * .build();
+ * Statefile response = configClient.importStatefile(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 Statefile importStatefile(ImportStatefileRequest request) {
+ return importStatefileCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Imports Terraform state file in a given deployment. The state file does not take effect until
+ * the Deployment has been unlocked.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * ImportStatefileRequest request =
+ * ImportStatefileRequest.newBuilder()
+ * .setParent(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setLockId(338696367)
+ * .setSkipDraft(true)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+ * configClient.deleteStatefile(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the deployment in the format:
+ * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteStatefile(DeploymentName name) {
+ DeleteStatefileRequest request =
+ DeleteStatefileRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteStatefile(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes Terraform state file in a given deployment.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * String name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+ * configClient.deleteStatefile(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the deployment in the format:
+ * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteStatefile(String name) {
+ DeleteStatefileRequest request = DeleteStatefileRequest.newBuilder().setName(name).build();
+ deleteStatefile(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes Terraform state file in a given deployment.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * DeleteStatefileRequest request =
+ * DeleteStatefileRequest.newBuilder()
+ * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setLockId(338696367)
+ * .build();
+ * configClient.deleteStatefile(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 void deleteStatefile(DeleteStatefileRequest request) {
+ deleteStatefileCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes Terraform state file in a given deployment.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * DeleteStatefileRequest request =
+ * DeleteStatefileRequest.newBuilder()
+ * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setLockId(338696367)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+ * Deployment response = configClient.lockDeploymentAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the deployment in the format:
+ * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * String name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+ * Deployment response = configClient.lockDeploymentAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the deployment in the format:
+ * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * LockDeploymentRequest request =
+ * LockDeploymentRequest.newBuilder()
+ * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .build();
+ * Deployment response = configClient.lockDeploymentAsync(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{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * LockDeploymentRequest request =
+ * LockDeploymentRequest.newBuilder()
+ * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * LockDeploymentRequest request =
+ * LockDeploymentRequest.newBuilder()
+ * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+ * long lockId = 338696367;
+ * Deployment response = configClient.unlockDeploymentAsync(name, lockId).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the deployment in the format:
+ * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
+ * @param lockId Required. Lock ID of the lock file to be unlocked.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * String name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+ * long lockId = 338696367;
+ * Deployment response = configClient.unlockDeploymentAsync(name, lockId).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the deployment in the format:
+ * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
+ * @param lockId Required. Lock ID of the lock file to be unlocked.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * UnlockDeploymentRequest request =
+ * UnlockDeploymentRequest.newBuilder()
+ * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setLockId(338696367)
+ * .build();
+ * Deployment response = configClient.unlockDeploymentAsync(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{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * UnlockDeploymentRequest request =
+ * UnlockDeploymentRequest.newBuilder()
+ * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setLockId(338696367)
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * UnlockDeploymentRequest request =
+ * UnlockDeploymentRequest.newBuilder()
+ * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setLockId(338696367)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+ * LockInfo response = configClient.exportLockInfo(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the deployment in the format:
+ * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LockInfo exportLockInfo(DeploymentName name) {
+ ExportLockInfoRequest request =
+ ExportLockInfoRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return exportLockInfo(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Exports the lock info on a locked deployment.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * String name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+ * LockInfo response = configClient.exportLockInfo(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the deployment in the format:
+ * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LockInfo exportLockInfo(String name) {
+ ExportLockInfoRequest request = ExportLockInfoRequest.newBuilder().setName(name).build();
+ return exportLockInfo(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Exports the lock info on a locked deployment.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * ExportLockInfoRequest request =
+ * ExportLockInfoRequest.newBuilder()
+ * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .build();
+ * LockInfo response = configClient.exportLockInfo(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 LockInfo exportLockInfo(ExportLockInfoRequest request) {
+ return exportLockInfoCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Exports the lock info on a locked deployment.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * ExportLockInfoRequest request =
+ * ExportLockInfoRequest.newBuilder()
+ * .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Location element : configClient.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.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListLocationsResponse response = configClient.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{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * Location response = configClient.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.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Policy response = configClient.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.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * Policy response = configClient.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.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * TestIamPermissionsRequest request =
+ * TestIamPermissionsRequest.newBuilder()
+ * .setResource(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").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.
+ *
+ * {@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 (ConfigClient configClient = ConfigClient.create()) {
+ * TestIamPermissionsRequest request =
+ * TestIamPermissionsRequest.newBuilder()
+ * .setResource(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+ * .addAllPermissions(new ArrayList
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@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
+ * ConfigSettings.Builder configSettingsBuilder = ConfigSettings.newBuilder();
+ * configSettingsBuilder
+ * .getDeploymentSettings()
+ * .setRetrySettings(
+ * configSettingsBuilder
+ * .getDeploymentSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * ConfigSettings configSettings = configSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class ConfigSettings extends ClientSettings{@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 (ConfigClient configClient = ConfigClient.create()) {
+ * DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+ * Deployment response = configClient.getDeployment(name);
+ * }
+ * }
+ */
+@Generated("by gapic-generator-java")
+package com.google.cloud.config.v1;
+
+import javax.annotation.Generated;
diff --git a/java-infra-manager/google-cloud-infra-manager/src/main/java/com/google/cloud/config/v1/stub/ConfigStub.java b/java-infra-manager/google-cloud-infra-manager/src/main/java/com/google/cloud/config/v1/stub/ConfigStub.java
new file mode 100644
index 000000000000..e75e815867ff
--- /dev/null
+++ b/java-infra-manager/google-cloud-infra-manager/src/main/java/com/google/cloud/config/v1/stub/ConfigStub.java
@@ -0,0 +1,217 @@
+/*
+ * Copyright 2023 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.config.v1.stub;
+
+import static com.google.cloud.config.v1.ConfigClient.ListDeploymentsPagedResponse;
+import static com.google.cloud.config.v1.ConfigClient.ListLocationsPagedResponse;
+import static com.google.cloud.config.v1.ConfigClient.ListResourcesPagedResponse;
+import static com.google.cloud.config.v1.ConfigClient.ListRevisionsPagedResponse;
+
+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.config.v1.CreateDeploymentRequest;
+import com.google.cloud.config.v1.DeleteDeploymentRequest;
+import com.google.cloud.config.v1.DeleteStatefileRequest;
+import com.google.cloud.config.v1.Deployment;
+import com.google.cloud.config.v1.ExportDeploymentStatefileRequest;
+import com.google.cloud.config.v1.ExportLockInfoRequest;
+import com.google.cloud.config.v1.ExportRevisionStatefileRequest;
+import com.google.cloud.config.v1.GetDeploymentRequest;
+import com.google.cloud.config.v1.GetResourceRequest;
+import com.google.cloud.config.v1.GetRevisionRequest;
+import com.google.cloud.config.v1.ImportStatefileRequest;
+import com.google.cloud.config.v1.ListDeploymentsRequest;
+import com.google.cloud.config.v1.ListDeploymentsResponse;
+import com.google.cloud.config.v1.ListResourcesRequest;
+import com.google.cloud.config.v1.ListResourcesResponse;
+import com.google.cloud.config.v1.ListRevisionsRequest;
+import com.google.cloud.config.v1.ListRevisionsResponse;
+import com.google.cloud.config.v1.LockDeploymentRequest;
+import com.google.cloud.config.v1.LockInfo;
+import com.google.cloud.config.v1.OperationMetadata;
+import com.google.cloud.config.v1.Resource;
+import com.google.cloud.config.v1.Revision;
+import com.google.cloud.config.v1.Statefile;
+import com.google.cloud.config.v1.UnlockDeploymentRequest;
+import com.google.cloud.config.v1.UpdateDeploymentRequest;
+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 Config 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
+ * ConfigStubSettings.Builder configSettingsBuilder = ConfigStubSettings.newBuilder();
+ * configSettingsBuilder
+ * .getDeploymentSettings()
+ * .setRetrySettings(
+ * configSettingsBuilder
+ * .getDeploymentSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * ConfigStubSettings configSettings = configSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class ConfigStubSettings extends StubSettings