All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient Maven / Gradle / Ivy

Go to download

API hub API API hub lets you consolidate and organize information about all of the APIs of interest to your organization. API hub lets you capture critical information about APIs that allows developers to discover and evaluate them easily and leverage the work of other teams wherever possible. API platform teams can use API hub to have visibility into and manage their portfolio of APIs.

There is a newer version: 0.7.0
Show newest version
/*
 * Copyright 2024 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.apihub.v1;

import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.apihub.v1.stub.RuntimeProjectAttachmentServiceStub;
import com.google.cloud.apihub.v1.stub.RuntimeProjectAttachmentServiceStubSettings;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
import com.google.cloud.location.ListLocationsResponse;
import com.google.cloud.location.Location;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.protobuf.Empty;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
 * Service Description: This service is used for managing the runtime project attachments.
 *
 * 

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
 *     RuntimeProjectAttachmentServiceClient.create()) {
 *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
 *   RuntimeProjectAttachment runtimeProjectAttachment =
 *       RuntimeProjectAttachment.newBuilder().build();
 *   String runtimeProjectAttachmentId = "runtimeProjectAttachmentId-753213345";
 *   RuntimeProjectAttachment response =
 *       runtimeProjectAttachmentServiceClient.createRuntimeProjectAttachment(
 *           parent, runtimeProjectAttachment, runtimeProjectAttachmentId);
 * }
 * }
* *

Note: close() needs to be called on the RuntimeProjectAttachmentServiceClient object to clean * up resources such as threads. In the example above, try-with-resources is used, which * automatically calls close(). * *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Methods
MethodDescriptionMethod Variants

CreateRuntimeProjectAttachment

Attaches a runtime project to the host project.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • createRuntimeProjectAttachment(CreateRuntimeProjectAttachmentRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • createRuntimeProjectAttachment(LocationName parent, RuntimeProjectAttachment runtimeProjectAttachment, String runtimeProjectAttachmentId) *

  • createRuntimeProjectAttachment(String parent, RuntimeProjectAttachment runtimeProjectAttachment, String runtimeProjectAttachmentId) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • createRuntimeProjectAttachmentCallable() *

*

GetRuntimeProjectAttachment

Gets a runtime project attachment.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • getRuntimeProjectAttachment(GetRuntimeProjectAttachmentRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • getRuntimeProjectAttachment(RuntimeProjectAttachmentName name) *

  • getRuntimeProjectAttachment(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • getRuntimeProjectAttachmentCallable() *

*

ListRuntimeProjectAttachments

List runtime projects attached to the host project.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • listRuntimeProjectAttachments(ListRuntimeProjectAttachmentsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • listRuntimeProjectAttachments(LocationName parent) *

  • listRuntimeProjectAttachments(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • listRuntimeProjectAttachmentsPagedCallable() *

  • listRuntimeProjectAttachmentsCallable() *

*

DeleteRuntimeProjectAttachment

Delete a runtime project attachment in the API Hub. This call will detach the runtime project from the host project.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • deleteRuntimeProjectAttachment(DeleteRuntimeProjectAttachmentRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • deleteRuntimeProjectAttachment(RuntimeProjectAttachmentName name) *

  • deleteRuntimeProjectAttachment(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • deleteRuntimeProjectAttachmentCallable() *

*

LookupRuntimeProjectAttachment

Look up a runtime project attachment. This API can be called in the context of any project.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • lookupRuntimeProjectAttachment(LookupRuntimeProjectAttachmentRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    *
  • lookupRuntimeProjectAttachment(LocationName name) *

  • lookupRuntimeProjectAttachment(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • lookupRuntimeProjectAttachmentCallable() *

*

ListLocations

Lists information about the supported locations for this service.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • listLocations(ListLocationsRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • listLocationsPagedCallable() *

  • listLocationsCallable() *

*

GetLocation

Gets information about a location.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    *
  • getLocation(GetLocationRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    *
  • getLocationCallable() *

*
* *

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 * RuntimeProjectAttachmentServiceSettings 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
 * RuntimeProjectAttachmentServiceSettings runtimeProjectAttachmentServiceSettings =
 *     RuntimeProjectAttachmentServiceSettings.newBuilder()
 *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
 *         .build();
 * RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
 *     RuntimeProjectAttachmentServiceClient.create(runtimeProjectAttachmentServiceSettings);
 * }
* *

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
 * RuntimeProjectAttachmentServiceSettings runtimeProjectAttachmentServiceSettings =
 *     RuntimeProjectAttachmentServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 * RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
 *     RuntimeProjectAttachmentServiceClient.create(runtimeProjectAttachmentServiceSettings);
 * }
* *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") public class RuntimeProjectAttachmentServiceClient implements BackgroundResource { private final RuntimeProjectAttachmentServiceSettings settings; private final RuntimeProjectAttachmentServiceStub stub; /** Constructs an instance of RuntimeProjectAttachmentServiceClient with default settings. */ public static final RuntimeProjectAttachmentServiceClient create() throws IOException { return create(RuntimeProjectAttachmentServiceSettings.newBuilder().build()); } /** * Constructs an instance of RuntimeProjectAttachmentServiceClient, 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 RuntimeProjectAttachmentServiceClient create( RuntimeProjectAttachmentServiceSettings settings) throws IOException { return new RuntimeProjectAttachmentServiceClient(settings); } /** * Constructs an instance of RuntimeProjectAttachmentServiceClient, using the given stub for * making calls. This is for advanced usage - prefer using * create(RuntimeProjectAttachmentServiceSettings). */ public static final RuntimeProjectAttachmentServiceClient create( RuntimeProjectAttachmentServiceStub stub) { return new RuntimeProjectAttachmentServiceClient(stub); } /** * Constructs an instance of RuntimeProjectAttachmentServiceClient, 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 RuntimeProjectAttachmentServiceClient(RuntimeProjectAttachmentServiceSettings settings) throws IOException { this.settings = settings; this.stub = ((RuntimeProjectAttachmentServiceStubSettings) settings.getStubSettings()).createStub(); } protected RuntimeProjectAttachmentServiceClient(RuntimeProjectAttachmentServiceStub stub) { this.settings = null; this.stub = stub; } public final RuntimeProjectAttachmentServiceSettings getSettings() { return settings; } public RuntimeProjectAttachmentServiceStub getStub() { return stub; } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Attaches a runtime project to the host project. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   *   RuntimeProjectAttachment runtimeProjectAttachment =
   *       RuntimeProjectAttachment.newBuilder().build();
   *   String runtimeProjectAttachmentId = "runtimeProjectAttachmentId-753213345";
   *   RuntimeProjectAttachment response =
   *       runtimeProjectAttachmentServiceClient.createRuntimeProjectAttachment(
   *           parent, runtimeProjectAttachment, runtimeProjectAttachmentId);
   * }
   * }
* * @param parent Required. The parent resource for the Runtime Project Attachment. Format: * `projects/{project}/locations/{location}` * @param runtimeProjectAttachment Required. The Runtime Project Attachment to create. * @param runtimeProjectAttachmentId Required. The ID to use for the Runtime Project Attachment, * which will become the final component of the Runtime Project Attachment's name. The ID must * be the same as the project ID of the Google cloud project specified in the * runtime_project_attachment.runtime_project field. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final RuntimeProjectAttachment createRuntimeProjectAttachment( LocationName parent, RuntimeProjectAttachment runtimeProjectAttachment, String runtimeProjectAttachmentId) { CreateRuntimeProjectAttachmentRequest request = CreateRuntimeProjectAttachmentRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setRuntimeProjectAttachment(runtimeProjectAttachment) .setRuntimeProjectAttachmentId(runtimeProjectAttachmentId) .build(); return createRuntimeProjectAttachment(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Attaches a runtime project to the host project. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   *   RuntimeProjectAttachment runtimeProjectAttachment =
   *       RuntimeProjectAttachment.newBuilder().build();
   *   String runtimeProjectAttachmentId = "runtimeProjectAttachmentId-753213345";
   *   RuntimeProjectAttachment response =
   *       runtimeProjectAttachmentServiceClient.createRuntimeProjectAttachment(
   *           parent, runtimeProjectAttachment, runtimeProjectAttachmentId);
   * }
   * }
* * @param parent Required. The parent resource for the Runtime Project Attachment. Format: * `projects/{project}/locations/{location}` * @param runtimeProjectAttachment Required. The Runtime Project Attachment to create. * @param runtimeProjectAttachmentId Required. The ID to use for the Runtime Project Attachment, * which will become the final component of the Runtime Project Attachment's name. The ID must * be the same as the project ID of the Google cloud project specified in the * runtime_project_attachment.runtime_project field. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final RuntimeProjectAttachment createRuntimeProjectAttachment( String parent, RuntimeProjectAttachment runtimeProjectAttachment, String runtimeProjectAttachmentId) { CreateRuntimeProjectAttachmentRequest request = CreateRuntimeProjectAttachmentRequest.newBuilder() .setParent(parent) .setRuntimeProjectAttachment(runtimeProjectAttachment) .setRuntimeProjectAttachmentId(runtimeProjectAttachmentId) .build(); return createRuntimeProjectAttachment(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Attaches a runtime project to the host project. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   CreateRuntimeProjectAttachmentRequest request =
   *       CreateRuntimeProjectAttachmentRequest.newBuilder()
   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
   *           .setRuntimeProjectAttachmentId("runtimeProjectAttachmentId-753213345")
   *           .setRuntimeProjectAttachment(RuntimeProjectAttachment.newBuilder().build())
   *           .build();
   *   RuntimeProjectAttachment response =
   *       runtimeProjectAttachmentServiceClient.createRuntimeProjectAttachment(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 RuntimeProjectAttachment createRuntimeProjectAttachment( CreateRuntimeProjectAttachmentRequest request) { return createRuntimeProjectAttachmentCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Attaches a runtime project to the host project. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   CreateRuntimeProjectAttachmentRequest request =
   *       CreateRuntimeProjectAttachmentRequest.newBuilder()
   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
   *           .setRuntimeProjectAttachmentId("runtimeProjectAttachmentId-753213345")
   *           .setRuntimeProjectAttachment(RuntimeProjectAttachment.newBuilder().build())
   *           .build();
   *   ApiFuture future =
   *       runtimeProjectAttachmentServiceClient
   *           .createRuntimeProjectAttachmentCallable()
   *           .futureCall(request);
   *   // Do something.
   *   RuntimeProjectAttachment response = future.get();
   * }
   * }
*/ public final UnaryCallable createRuntimeProjectAttachmentCallable() { return stub.createRuntimeProjectAttachmentCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets a runtime project attachment. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   RuntimeProjectAttachmentName name =
   *       RuntimeProjectAttachmentName.of(
   *           "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]");
   *   RuntimeProjectAttachment response =
   *       runtimeProjectAttachmentServiceClient.getRuntimeProjectAttachment(name);
   * }
   * }
* * @param name Required. The name of the API resource to retrieve. Format: * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final RuntimeProjectAttachment getRuntimeProjectAttachment( RuntimeProjectAttachmentName name) { GetRuntimeProjectAttachmentRequest request = GetRuntimeProjectAttachmentRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); return getRuntimeProjectAttachment(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets a runtime project attachment. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   String name =
   *       RuntimeProjectAttachmentName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]")
   *           .toString();
   *   RuntimeProjectAttachment response =
   *       runtimeProjectAttachmentServiceClient.getRuntimeProjectAttachment(name);
   * }
   * }
* * @param name Required. The name of the API resource to retrieve. Format: * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final RuntimeProjectAttachment getRuntimeProjectAttachment(String name) { GetRuntimeProjectAttachmentRequest request = GetRuntimeProjectAttachmentRequest.newBuilder().setName(name).build(); return getRuntimeProjectAttachment(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets a runtime project attachment. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   GetRuntimeProjectAttachmentRequest request =
   *       GetRuntimeProjectAttachmentRequest.newBuilder()
   *           .setName(
   *               RuntimeProjectAttachmentName.of(
   *                       "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]")
   *                   .toString())
   *           .build();
   *   RuntimeProjectAttachment response =
   *       runtimeProjectAttachmentServiceClient.getRuntimeProjectAttachment(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 RuntimeProjectAttachment getRuntimeProjectAttachment( GetRuntimeProjectAttachmentRequest request) { return getRuntimeProjectAttachmentCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets a runtime project attachment. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   GetRuntimeProjectAttachmentRequest request =
   *       GetRuntimeProjectAttachmentRequest.newBuilder()
   *           .setName(
   *               RuntimeProjectAttachmentName.of(
   *                       "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]")
   *                   .toString())
   *           .build();
   *   ApiFuture future =
   *       runtimeProjectAttachmentServiceClient
   *           .getRuntimeProjectAttachmentCallable()
   *           .futureCall(request);
   *   // Do something.
   *   RuntimeProjectAttachment response = future.get();
   * }
   * }
*/ public final UnaryCallable getRuntimeProjectAttachmentCallable() { return stub.getRuntimeProjectAttachmentCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List runtime projects attached to the host project. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   *   for (RuntimeProjectAttachment element :
   *       runtimeProjectAttachmentServiceClient
   *           .listRuntimeProjectAttachments(parent)
   *           .iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
* * @param parent Required. The parent, which owns this collection of runtime project attachments. * Format: `projects/{project}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListRuntimeProjectAttachmentsPagedResponse listRuntimeProjectAttachments( LocationName parent) { ListRuntimeProjectAttachmentsRequest request = ListRuntimeProjectAttachmentsRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); return listRuntimeProjectAttachments(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List runtime projects attached to the host project. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   *   for (RuntimeProjectAttachment element :
   *       runtimeProjectAttachmentServiceClient
   *           .listRuntimeProjectAttachments(parent)
   *           .iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
* * @param parent Required. The parent, which owns this collection of runtime project attachments. * Format: `projects/{project}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListRuntimeProjectAttachmentsPagedResponse listRuntimeProjectAttachments( String parent) { ListRuntimeProjectAttachmentsRequest request = ListRuntimeProjectAttachmentsRequest.newBuilder().setParent(parent).build(); return listRuntimeProjectAttachments(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List runtime projects attached to the host project. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   ListRuntimeProjectAttachmentsRequest request =
   *       ListRuntimeProjectAttachmentsRequest.newBuilder()
   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .setFilter("filter-1274492040")
   *           .setOrderBy("orderBy-1207110587")
   *           .build();
   *   for (RuntimeProjectAttachment element :
   *       runtimeProjectAttachmentServiceClient
   *           .listRuntimeProjectAttachments(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 ListRuntimeProjectAttachmentsPagedResponse listRuntimeProjectAttachments( ListRuntimeProjectAttachmentsRequest request) { return listRuntimeProjectAttachmentsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List runtime projects attached to the host project. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   ListRuntimeProjectAttachmentsRequest request =
   *       ListRuntimeProjectAttachmentsRequest.newBuilder()
   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .setFilter("filter-1274492040")
   *           .setOrderBy("orderBy-1207110587")
   *           .build();
   *   ApiFuture future =
   *       runtimeProjectAttachmentServiceClient
   *           .listRuntimeProjectAttachmentsPagedCallable()
   *           .futureCall(request);
   *   // Do something.
   *   for (RuntimeProjectAttachment element : future.get().iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
*/ public final UnaryCallable< ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsPagedResponse> listRuntimeProjectAttachmentsPagedCallable() { return stub.listRuntimeProjectAttachmentsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List runtime projects attached to the host project. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   ListRuntimeProjectAttachmentsRequest request =
   *       ListRuntimeProjectAttachmentsRequest.newBuilder()
   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .setFilter("filter-1274492040")
   *           .setOrderBy("orderBy-1207110587")
   *           .build();
   *   while (true) {
   *     ListRuntimeProjectAttachmentsResponse response =
   *         runtimeProjectAttachmentServiceClient
   *             .listRuntimeProjectAttachmentsCallable()
   *             .call(request);
   *     for (RuntimeProjectAttachment element : response.getRuntimeProjectAttachmentsList()) {
   *       // doThingsWith(element);
   *     }
   *     String nextPageToken = response.getNextPageToken();
   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
   *       request = request.toBuilder().setPageToken(nextPageToken).build();
   *     } else {
   *       break;
   *     }
   *   }
   * }
   * }
*/ public final UnaryCallable< ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsResponse> listRuntimeProjectAttachmentsCallable() { return stub.listRuntimeProjectAttachmentsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a runtime project attachment in the API Hub. This call will detach the runtime project * from the host project. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   RuntimeProjectAttachmentName name =
   *       RuntimeProjectAttachmentName.of(
   *           "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]");
   *   runtimeProjectAttachmentServiceClient.deleteRuntimeProjectAttachment(name);
   * }
   * }
* * @param name Required. The name of the Runtime Project Attachment to delete. Format: * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteRuntimeProjectAttachment(RuntimeProjectAttachmentName name) { DeleteRuntimeProjectAttachmentRequest request = DeleteRuntimeProjectAttachmentRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); deleteRuntimeProjectAttachment(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a runtime project attachment in the API Hub. This call will detach the runtime project * from the host project. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   String name =
   *       RuntimeProjectAttachmentName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]")
   *           .toString();
   *   runtimeProjectAttachmentServiceClient.deleteRuntimeProjectAttachment(name);
   * }
   * }
* * @param name Required. The name of the Runtime Project Attachment to delete. Format: * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteRuntimeProjectAttachment(String name) { DeleteRuntimeProjectAttachmentRequest request = DeleteRuntimeProjectAttachmentRequest.newBuilder().setName(name).build(); deleteRuntimeProjectAttachment(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a runtime project attachment in the API Hub. This call will detach the runtime project * from the host project. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   DeleteRuntimeProjectAttachmentRequest request =
   *       DeleteRuntimeProjectAttachmentRequest.newBuilder()
   *           .setName(
   *               RuntimeProjectAttachmentName.of(
   *                       "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]")
   *                   .toString())
   *           .build();
   *   runtimeProjectAttachmentServiceClient.deleteRuntimeProjectAttachment(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 deleteRuntimeProjectAttachment(DeleteRuntimeProjectAttachmentRequest request) { deleteRuntimeProjectAttachmentCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Delete a runtime project attachment in the API Hub. This call will detach the runtime project * from the host project. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   DeleteRuntimeProjectAttachmentRequest request =
   *       DeleteRuntimeProjectAttachmentRequest.newBuilder()
   *           .setName(
   *               RuntimeProjectAttachmentName.of(
   *                       "[PROJECT]", "[LOCATION]", "[RUNTIME_PROJECT_ATTACHMENT]")
   *                   .toString())
   *           .build();
   *   ApiFuture future =
   *       runtimeProjectAttachmentServiceClient
   *           .deleteRuntimeProjectAttachmentCallable()
   *           .futureCall(request);
   *   // Do something.
   *   future.get();
   * }
   * }
*/ public final UnaryCallable deleteRuntimeProjectAttachmentCallable() { return stub.deleteRuntimeProjectAttachmentCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Look up a runtime project attachment. This API can be called in the context of any project. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   LocationName name = LocationName.of("[PROJECT]", "[LOCATION]");
   *   LookupRuntimeProjectAttachmentResponse response =
   *       runtimeProjectAttachmentServiceClient.lookupRuntimeProjectAttachment(name);
   * }
   * }
* * @param name Required. Runtime project ID to look up runtime project attachment for. Lookup * happens across all regions. Expected format: `projects/{project}/locations/{location}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final LookupRuntimeProjectAttachmentResponse lookupRuntimeProjectAttachment( LocationName name) { LookupRuntimeProjectAttachmentRequest request = LookupRuntimeProjectAttachmentRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); return lookupRuntimeProjectAttachment(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Look up a runtime project attachment. This API can be called in the context of any project. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   String name = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   *   LookupRuntimeProjectAttachmentResponse response =
   *       runtimeProjectAttachmentServiceClient.lookupRuntimeProjectAttachment(name);
   * }
   * }
* * @param name Required. Runtime project ID to look up runtime project attachment for. Lookup * happens across all regions. Expected format: `projects/{project}/locations/{location}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final LookupRuntimeProjectAttachmentResponse lookupRuntimeProjectAttachment(String name) { LookupRuntimeProjectAttachmentRequest request = LookupRuntimeProjectAttachmentRequest.newBuilder().setName(name).build(); return lookupRuntimeProjectAttachment(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Look up a runtime project attachment. This API can be called in the context of any project. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   LookupRuntimeProjectAttachmentRequest request =
   *       LookupRuntimeProjectAttachmentRequest.newBuilder()
   *           .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString())
   *           .build();
   *   LookupRuntimeProjectAttachmentResponse response =
   *       runtimeProjectAttachmentServiceClient.lookupRuntimeProjectAttachment(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 LookupRuntimeProjectAttachmentResponse lookupRuntimeProjectAttachment( LookupRuntimeProjectAttachmentRequest request) { return lookupRuntimeProjectAttachmentCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Look up a runtime project attachment. This API can be called in the context of any project. * *

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 (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   LookupRuntimeProjectAttachmentRequest request =
   *       LookupRuntimeProjectAttachmentRequest.newBuilder()
   *           .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString())
   *           .build();
   *   ApiFuture future =
   *       runtimeProjectAttachmentServiceClient
   *           .lookupRuntimeProjectAttachmentCallable()
   *           .futureCall(request);
   *   // Do something.
   *   LookupRuntimeProjectAttachmentResponse response = future.get();
   * }
   * }
*/ public final UnaryCallable< LookupRuntimeProjectAttachmentRequest, LookupRuntimeProjectAttachmentResponse> lookupRuntimeProjectAttachmentCallable() { return stub.lookupRuntimeProjectAttachmentCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists information about the supported locations for this service. * *

Sample code: * *

{@code
   * // This snippet has been automatically generated and should be regarded as a code template only.
   * // It will require modifications to work:
   * // - It may require correct/in-range values for request initialization.
   * // - It may require specifying regional endpoints when creating the service client as shown in
   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   ListLocationsRequest request =
   *       ListLocationsRequest.newBuilder()
   *           .setName("name3373707")
   *           .setFilter("filter-1274492040")
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .build();
   *   for (Location element :
   *       runtimeProjectAttachmentServiceClient.listLocations(request).iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { return listLocationsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists information about the supported locations for this service. * *

Sample code: * *

{@code
   * // This snippet has been automatically generated and should be regarded as a code template only.
   * // It will require modifications to work:
   * // - It may require correct/in-range values for request initialization.
   * // - It may require specifying regional endpoints when creating the service client as shown in
   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   ListLocationsRequest request =
   *       ListLocationsRequest.newBuilder()
   *           .setName("name3373707")
   *           .setFilter("filter-1274492040")
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .build();
   *   ApiFuture future =
   *       runtimeProjectAttachmentServiceClient.listLocationsPagedCallable().futureCall(request);
   *   // Do something.
   *   for (Location element : future.get().iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
*/ public final UnaryCallable listLocationsPagedCallable() { return stub.listLocationsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists information about the supported locations for this service. * *

Sample code: * *

{@code
   * // This snippet has been automatically generated and should be regarded as a code template only.
   * // It will require modifications to work:
   * // - It may require correct/in-range values for request initialization.
   * // - It may require specifying regional endpoints when creating the service client as shown in
   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   ListLocationsRequest request =
   *       ListLocationsRequest.newBuilder()
   *           .setName("name3373707")
   *           .setFilter("filter-1274492040")
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .build();
   *   while (true) {
   *     ListLocationsResponse response =
   *         runtimeProjectAttachmentServiceClient.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 listLocationsCallable() { return stub.listLocationsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets information about a location. * *

Sample code: * *

{@code
   * // This snippet has been automatically generated and should be regarded as a code template only.
   * // It will require modifications to work:
   * // - It may require correct/in-range values for request initialization.
   * // - It may require specifying regional endpoints when creating the service client as shown in
   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   *   Location response = runtimeProjectAttachmentServiceClient.getLocation(request);
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Location getLocation(GetLocationRequest request) { return getLocationCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets information about a location. * *

Sample code: * *

{@code
   * // This snippet has been automatically generated and should be regarded as a code template only.
   * // It will require modifications to work:
   * // - It may require correct/in-range values for request initialization.
   * // - It may require specifying regional endpoints when creating the service client as shown in
   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
   * try (RuntimeProjectAttachmentServiceClient runtimeProjectAttachmentServiceClient =
   *     RuntimeProjectAttachmentServiceClient.create()) {
   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   *   ApiFuture future =
   *       runtimeProjectAttachmentServiceClient.getLocationCallable().futureCall(request);
   *   // Do something.
   *   Location response = future.get();
   * }
   * }
*/ public final UnaryCallable getLocationCallable() { return stub.getLocationCallable(); } @Override public final void close() { stub.close(); } @Override public void shutdown() { stub.shutdown(); } @Override public boolean isShutdown() { return stub.isShutdown(); } @Override public boolean isTerminated() { return stub.isTerminated(); } @Override public void shutdownNow() { stub.shutdownNow(); } @Override public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return stub.awaitTermination(duration, unit); } public static class ListRuntimeProjectAttachmentsPagedResponse extends AbstractPagedListResponse< ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsResponse, RuntimeProjectAttachment, ListRuntimeProjectAttachmentsPage, ListRuntimeProjectAttachmentsFixedSizeCollection> { public static ApiFuture createAsync( PageContext< ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsResponse, RuntimeProjectAttachment> context, ApiFuture futureResponse) { ApiFuture futurePage = ListRuntimeProjectAttachmentsPage.createEmptyPage() .createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, input -> new ListRuntimeProjectAttachmentsPagedResponse(input), MoreExecutors.directExecutor()); } private ListRuntimeProjectAttachmentsPagedResponse(ListRuntimeProjectAttachmentsPage page) { super(page, ListRuntimeProjectAttachmentsFixedSizeCollection.createEmptyCollection()); } } public static class ListRuntimeProjectAttachmentsPage extends AbstractPage< ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsResponse, RuntimeProjectAttachment, ListRuntimeProjectAttachmentsPage> { private ListRuntimeProjectAttachmentsPage( PageContext< ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsResponse, RuntimeProjectAttachment> context, ListRuntimeProjectAttachmentsResponse response) { super(context, response); } private static ListRuntimeProjectAttachmentsPage createEmptyPage() { return new ListRuntimeProjectAttachmentsPage(null, null); } @Override protected ListRuntimeProjectAttachmentsPage createPage( PageContext< ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsResponse, RuntimeProjectAttachment> context, ListRuntimeProjectAttachmentsResponse response) { return new ListRuntimeProjectAttachmentsPage(context, response); } @Override public ApiFuture createPageAsync( PageContext< ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsResponse, RuntimeProjectAttachment> context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } } public static class ListRuntimeProjectAttachmentsFixedSizeCollection extends AbstractFixedSizeCollection< ListRuntimeProjectAttachmentsRequest, ListRuntimeProjectAttachmentsResponse, RuntimeProjectAttachment, ListRuntimeProjectAttachmentsPage, ListRuntimeProjectAttachmentsFixedSizeCollection> { private ListRuntimeProjectAttachmentsFixedSizeCollection( List pages, int collectionSize) { super(pages, collectionSize); } private static ListRuntimeProjectAttachmentsFixedSizeCollection createEmptyCollection() { return new ListRuntimeProjectAttachmentsFixedSizeCollection(null, 0); } @Override protected ListRuntimeProjectAttachmentsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListRuntimeProjectAttachmentsFixedSizeCollection(pages, collectionSize); } } public static class ListLocationsPagedResponse extends AbstractPagedListResponse< ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage, ListLocationsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, input -> new ListLocationsPagedResponse(input), MoreExecutors.directExecutor()); } private ListLocationsPagedResponse(ListLocationsPage page) { super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); } } public static class ListLocationsPage extends AbstractPage< ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { private ListLocationsPage( PageContext context, ListLocationsResponse response) { super(context, response); } private static ListLocationsPage createEmptyPage() { return new ListLocationsPage(null, null); } @Override protected ListLocationsPage createPage( PageContext context, ListLocationsResponse response) { return new ListLocationsPage(context, response); } @Override public ApiFuture createPageAsync( PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } } public static class ListLocationsFixedSizeCollection extends AbstractFixedSizeCollection< ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage, ListLocationsFixedSizeCollection> { private ListLocationsFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } private static ListLocationsFixedSizeCollection createEmptyCollection() { return new ListLocationsFixedSizeCollection(null, 0); } @Override protected ListLocationsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListLocationsFixedSizeCollection(pages, collectionSize); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy