Class RuntimeProjectAttachmentServiceClient

java.lang.Object
com.google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@Generated("by gapic-generator-java") public class RuntimeProjectAttachmentServiceClient extends Object implements BackgroundResource
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:


 // 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
Method Description Method 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:


 // 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:


 // 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.

  • Constructor Details

    • RuntimeProjectAttachmentServiceClient

      protected RuntimeProjectAttachmentServiceClient(RuntimeProjectAttachmentServiceSettings settings) throws IOException
      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.
      Throws:
      IOException
    • RuntimeProjectAttachmentServiceClient

      protected RuntimeProjectAttachmentServiceClient(RuntimeProjectAttachmentServiceStub stub)
  • Method Details

    • create

      public static final RuntimeProjectAttachmentServiceClient create() throws IOException
      Constructs an instance of RuntimeProjectAttachmentServiceClient with default settings.
      Throws:
      IOException
    • create

      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.
      Throws:
      IOException
    • create

      Constructs an instance of RuntimeProjectAttachmentServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(RuntimeProjectAttachmentServiceSettings).
    • getSettings

      public final RuntimeProjectAttachmentServiceSettings getSettings()
    • getStub

    • createRuntimeProjectAttachment

      public final RuntimeProjectAttachment createRuntimeProjectAttachment(LocationName parent, RuntimeProjectAttachment runtimeProjectAttachment, String runtimeProjectAttachmentId)
      Attaches a runtime project to the host project.

      Sample 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);
       }
       
      Parameters:
      parent - Required. The parent resource for the Runtime Project Attachment. Format: `projects/{project}/locations/{location}`
      runtimeProjectAttachment - Required. The Runtime Project Attachment to create.
      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:
      ApiException - if the remote call fails
    • createRuntimeProjectAttachment

      public final RuntimeProjectAttachment createRuntimeProjectAttachment(String parent, RuntimeProjectAttachment runtimeProjectAttachment, String runtimeProjectAttachmentId)
      Attaches a runtime project to the host project.

      Sample 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);
       }
       
      Parameters:
      parent - Required. The parent resource for the Runtime Project Attachment. Format: `projects/{project}/locations/{location}`
      runtimeProjectAttachment - Required. The Runtime Project Attachment to create.
      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:
      ApiException - if the remote call fails
    • createRuntimeProjectAttachment

      public final RuntimeProjectAttachment createRuntimeProjectAttachment(CreateRuntimeProjectAttachmentRequest request)
      Attaches a runtime project to the host project.

      Sample 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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createRuntimeProjectAttachmentCallable

      public final UnaryCallable<CreateRuntimeProjectAttachmentRequest,RuntimeProjectAttachment> createRuntimeProjectAttachmentCallable()
      Attaches a runtime project to the host project.

      Sample 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<RuntimeProjectAttachment> future =
             runtimeProjectAttachmentServiceClient
                 .createRuntimeProjectAttachmentCallable()
                 .futureCall(request);
         // Do something.
         RuntimeProjectAttachment response = future.get();
       }
       
    • getRuntimeProjectAttachment

      public final RuntimeProjectAttachment getRuntimeProjectAttachment(RuntimeProjectAttachmentName name)
      Gets a runtime project attachment.

      Sample 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);
       }
       
      Parameters:
      name - Required. The name of the API resource to retrieve. Format: `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
      Throws:
      ApiException - if the remote call fails
    • getRuntimeProjectAttachment

      public final RuntimeProjectAttachment getRuntimeProjectAttachment(String name)
      Gets a runtime project attachment.

      Sample 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);
       }
       
      Parameters:
      name - Required. The name of the API resource to retrieve. Format: `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
      Throws:
      ApiException - if the remote call fails
    • getRuntimeProjectAttachment

      public final RuntimeProjectAttachment getRuntimeProjectAttachment(GetRuntimeProjectAttachmentRequest request)
      Gets a runtime project attachment.

      Sample 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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getRuntimeProjectAttachmentCallable

      public final UnaryCallable<GetRuntimeProjectAttachmentRequest,RuntimeProjectAttachment> getRuntimeProjectAttachmentCallable()
      Gets a runtime project attachment.

      Sample 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<RuntimeProjectAttachment> future =
             runtimeProjectAttachmentServiceClient
                 .getRuntimeProjectAttachmentCallable()
                 .futureCall(request);
         // Do something.
         RuntimeProjectAttachment response = future.get();
       }
       
    • listRuntimeProjectAttachments

      List runtime projects attached to the host project.

      Sample 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);
         }
       }
       
      Parameters:
      parent - Required. The parent, which owns this collection of runtime project attachments. Format: `projects/{project}/locations/{location}`
      Throws:
      ApiException - if the remote call fails
    • listRuntimeProjectAttachments

      List runtime projects attached to the host project.

      Sample 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);
         }
       }
       
      Parameters:
      parent - Required. The parent, which owns this collection of runtime project attachments. Format: `projects/{project}/locations/{location}`
      Throws:
      ApiException - if the remote call fails
    • listRuntimeProjectAttachments

      List runtime projects attached to the host project.

      Sample 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);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listRuntimeProjectAttachmentsPagedCallable

      List runtime projects attached to the host project.

      Sample 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<RuntimeProjectAttachment> future =
             runtimeProjectAttachmentServiceClient
                 .listRuntimeProjectAttachmentsPagedCallable()
                 .futureCall(request);
         // Do something.
         for (RuntimeProjectAttachment element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listRuntimeProjectAttachmentsCallable

      public final UnaryCallable<ListRuntimeProjectAttachmentsRequest,ListRuntimeProjectAttachmentsResponse> listRuntimeProjectAttachmentsCallable()
      List runtime projects attached to the host project.

      Sample 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;
           }
         }
       }
       
    • deleteRuntimeProjectAttachment

      public final void deleteRuntimeProjectAttachment(RuntimeProjectAttachmentName name)
      Delete a runtime project attachment in the API Hub. This call will detach the runtime project from the host project.

      Sample 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);
       }
       
      Parameters:
      name - Required. The name of the Runtime Project Attachment to delete. Format: `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
      Throws:
      ApiException - if the remote call fails
    • deleteRuntimeProjectAttachment

      public final void deleteRuntimeProjectAttachment(String name)
      Delete a runtime project attachment in the API Hub. This call will detach the runtime project from the host project.

      Sample 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);
       }
       
      Parameters:
      name - Required. The name of the Runtime Project Attachment to delete. Format: `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
      Throws:
      ApiException - if the remote call fails
    • deleteRuntimeProjectAttachment

      public final void deleteRuntimeProjectAttachment(DeleteRuntimeProjectAttachmentRequest request)
      Delete a runtime project attachment in the API Hub. This call will detach the runtime project from the host project.

      Sample 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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteRuntimeProjectAttachmentCallable

      public final UnaryCallable<DeleteRuntimeProjectAttachmentRequest,com.google.protobuf.Empty> deleteRuntimeProjectAttachmentCallable()
      Delete a runtime project attachment in the API Hub. This call will detach the runtime project from the host project.

      Sample 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<Empty> future =
             runtimeProjectAttachmentServiceClient
                 .deleteRuntimeProjectAttachmentCallable()
                 .futureCall(request);
         // Do something.
         future.get();
       }
       
    • lookupRuntimeProjectAttachment

      public final LookupRuntimeProjectAttachmentResponse lookupRuntimeProjectAttachment(LocationName name)
      Look up a runtime project attachment. This API can be called in the context of any project.

      Sample 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);
       }
       
      Parameters:
      name - Required. Runtime project ID to look up runtime project attachment for. Lookup happens across all regions. Expected format: `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • lookupRuntimeProjectAttachment

      public final LookupRuntimeProjectAttachmentResponse lookupRuntimeProjectAttachment(String name)
      Look up a runtime project attachment. This API can be called in the context of any project.

      Sample 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);
       }
       
      Parameters:
      name - Required. Runtime project ID to look up runtime project attachment for. Lookup happens across all regions. Expected format: `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • lookupRuntimeProjectAttachment

      public final LookupRuntimeProjectAttachmentResponse lookupRuntimeProjectAttachment(LookupRuntimeProjectAttachmentRequest request)
      Look up a runtime project attachment. This API can be called in the context of any project.

      Sample 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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • lookupRuntimeProjectAttachmentCallable

      public final UnaryCallable<LookupRuntimeProjectAttachmentRequest,LookupRuntimeProjectAttachmentResponse> lookupRuntimeProjectAttachmentCallable()
      Look up a runtime project attachment. This API can be called in the context of any project.

      Sample 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<LookupRuntimeProjectAttachmentResponse> future =
             runtimeProjectAttachmentServiceClient
                 .lookupRuntimeProjectAttachmentCallable()
                 .futureCall(request);
         // Do something.
         LookupRuntimeProjectAttachmentResponse response = future.get();
       }
       
    • listLocations

      Lists information about the supported locations for this service.

      Sample 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);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listLocationsPagedCallable

      Lists information about the supported locations for this service.

      Sample 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<Location> future =
             runtimeProjectAttachmentServiceClient.listLocationsPagedCallable().futureCall(request);
         // Do something.
         for (Location element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listLocationsCallable

      public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()
      Lists information about the supported locations for this service.

      Sample 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;
           }
         }
       }
       
    • getLocation

      public final Location getLocation(GetLocationRequest request)
      Gets information about a location.

      Sample 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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getLocationCallable

      public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()
      Gets information about a location.

      Sample 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<Location> future =
             runtimeProjectAttachmentServiceClient.getLocationCallable().futureCall(request);
         // Do something.
         Location response = future.get();
       }
       
    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface BackgroundResource
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface BackgroundResource
    • isTerminated

      public boolean isTerminated()
      Specified by:
      isTerminated in interface BackgroundResource
    • shutdownNow

      public void shutdownNow()
      Specified by:
      shutdownNow in interface BackgroundResource
    • awaitTermination

      public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
      Specified by:
      awaitTermination in interface BackgroundResource
      Throws:
      InterruptedException