Class AppHubClient

java.lang.Object
com.google.cloud.apphub.v1.AppHubClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@Generated("by gapic-generator-java") public class AppHubClient extends Object implements BackgroundResource
Service Description: The App Hub API allows you to manage App Hub resources.

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 (AppHubClient appHubClient = AppHubClient.create()) {
   LocationName name = LocationName.of("[PROJECT]", "[LOCATION]");
   LookupServiceProjectAttachmentResponse response =
       appHubClient.lookupServiceProjectAttachment(name);
 }
 

Note: close() needs to be called on the AppHubClient 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

LookupServiceProjectAttachment

Lists a service project attachment for a given service project. You can call this API from any project to find if it is attached to a host project.

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

  • lookupServiceProjectAttachment(LookupServiceProjectAttachmentRequest request)

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

  • lookupServiceProjectAttachment(LocationName name)

  • lookupServiceProjectAttachment(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.

  • lookupServiceProjectAttachmentCallable()

ListServiceProjectAttachments

Lists service projects attached to the host project.

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

  • listServiceProjectAttachments(ListServiceProjectAttachmentsRequest request)

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

  • listServiceProjectAttachments(LocationName parent)

  • listServiceProjectAttachments(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.

  • listServiceProjectAttachmentsPagedCallable()

  • listServiceProjectAttachmentsCallable()

CreateServiceProjectAttachment

Attaches a service project to the host project.

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

  • createServiceProjectAttachmentAsync(CreateServiceProjectAttachmentRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createServiceProjectAttachmentAsync(LocationName parent, ServiceProjectAttachment serviceProjectAttachment, String serviceProjectAttachmentId)

  • createServiceProjectAttachmentAsync(String parent, ServiceProjectAttachment serviceProjectAttachment, String serviceProjectAttachmentId)

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

  • createServiceProjectAttachmentOperationCallable()

  • createServiceProjectAttachmentCallable()

GetServiceProjectAttachment

Gets a service project attachment.

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

  • getServiceProjectAttachment(GetServiceProjectAttachmentRequest request)

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

  • getServiceProjectAttachment(ServiceProjectAttachmentName name)

  • getServiceProjectAttachment(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.

  • getServiceProjectAttachmentCallable()

DeleteServiceProjectAttachment

Deletes a service project attachment.

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

  • deleteServiceProjectAttachmentAsync(DeleteServiceProjectAttachmentRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteServiceProjectAttachmentAsync(ServiceProjectAttachmentName name)

  • deleteServiceProjectAttachmentAsync(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.

  • deleteServiceProjectAttachmentOperationCallable()

  • deleteServiceProjectAttachmentCallable()

DetachServiceProjectAttachment

Detaches a service project from a host project. You can call this API from any service project without needing access to the host project that it is attached to.

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

  • detachServiceProjectAttachment(DetachServiceProjectAttachmentRequest request)

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

  • detachServiceProjectAttachment(LocationName name)

  • detachServiceProjectAttachment(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.

  • detachServiceProjectAttachmentCallable()

ListDiscoveredServices

Lists Discovered Services that can be added to an Application in a host project and location.

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

  • listDiscoveredServices(ListDiscoveredServicesRequest request)

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

  • listDiscoveredServices(LocationName parent)

  • listDiscoveredServices(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.

  • listDiscoveredServicesPagedCallable()

  • listDiscoveredServicesCallable()

GetDiscoveredService

Gets a Discovered Service in a host project and location.

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

  • getDiscoveredService(GetDiscoveredServiceRequest request)

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

  • getDiscoveredService(DiscoveredServiceName name)

  • getDiscoveredService(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.

  • getDiscoveredServiceCallable()

LookupDiscoveredService

Lists a Discovered Service in a host project and location, with a given resource URI.

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

  • lookupDiscoveredService(LookupDiscoveredServiceRequest request)

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

  • lookupDiscoveredService(LocationName parent, String uri)

  • lookupDiscoveredService(String parent, String uri)

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

  • lookupDiscoveredServiceCallable()

ListServices

Lists Services in an Application.

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

  • listServices(ListServicesRequest request)

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

  • listServices(ApplicationName parent)

  • listServices(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.

  • listServicesPagedCallable()

  • listServicesCallable()

CreateService

Creates a Service in an Application.

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

  • createServiceAsync(CreateServiceRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createServiceAsync(ApplicationName parent, Service service, String serviceId)

  • createServiceAsync(String parent, Service service, String serviceId)

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

  • createServiceOperationCallable()

  • createServiceCallable()

GetService

Gets a Service in an Application.

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

  • getService(GetServiceRequest request)

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

  • getService(ServiceName name)

  • getService(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.

  • getServiceCallable()

UpdateService

Updates a Service in an Application.

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

  • updateServiceAsync(UpdateServiceRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateServiceAsync(Service service, FieldMask updateMask)

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

  • updateServiceOperationCallable()

  • updateServiceCallable()

DeleteService

Deletes a Service from an Application.

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

  • deleteServiceAsync(DeleteServiceRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteServiceAsync(ServiceName name)

  • deleteServiceAsync(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.

  • deleteServiceOperationCallable()

  • deleteServiceCallable()

ListDiscoveredWorkloads

Lists Discovered Workloads that can be added to an Application in a host project and location.

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

  • listDiscoveredWorkloads(ListDiscoveredWorkloadsRequest request)

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

  • listDiscoveredWorkloads(LocationName parent)

  • listDiscoveredWorkloads(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.

  • listDiscoveredWorkloadsPagedCallable()

  • listDiscoveredWorkloadsCallable()

GetDiscoveredWorkload

Gets a Discovered Workload in a host project and location.

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

  • getDiscoveredWorkload(GetDiscoveredWorkloadRequest request)

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

  • getDiscoveredWorkload(DiscoveredWorkloadName name)

  • getDiscoveredWorkload(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.

  • getDiscoveredWorkloadCallable()

LookupDiscoveredWorkload

Lists a Discovered Workload in a host project and location, with a given resource URI.

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

  • lookupDiscoveredWorkload(LookupDiscoveredWorkloadRequest request)

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

  • lookupDiscoveredWorkload(LocationName parent, String uri)

  • lookupDiscoveredWorkload(String parent, String uri)

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

  • lookupDiscoveredWorkloadCallable()

ListWorkloads

Lists Workloads in an Application.

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

  • listWorkloads(ListWorkloadsRequest request)

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

  • listWorkloads(ApplicationName parent)

  • listWorkloads(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.

  • listWorkloadsPagedCallable()

  • listWorkloadsCallable()

CreateWorkload

Creates a Workload in an Application.

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

  • createWorkloadAsync(CreateWorkloadRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createWorkloadAsync(ApplicationName parent, Workload workload, String workloadId)

  • createWorkloadAsync(String parent, Workload workload, String workloadId)

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

  • createWorkloadOperationCallable()

  • createWorkloadCallable()

GetWorkload

Gets a Workload in an Application.

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

  • getWorkload(GetWorkloadRequest request)

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

  • getWorkload(WorkloadName name)

  • getWorkload(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.

  • getWorkloadCallable()

UpdateWorkload

Updates a Workload in an Application.

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

  • updateWorkloadAsync(UpdateWorkloadRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateWorkloadAsync(Workload workload, FieldMask updateMask)

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

  • updateWorkloadOperationCallable()

  • updateWorkloadCallable()

DeleteWorkload

Deletes a Workload from an Application.

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

  • deleteWorkloadAsync(DeleteWorkloadRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteWorkloadAsync(WorkloadName name)

  • deleteWorkloadAsync(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.

  • deleteWorkloadOperationCallable()

  • deleteWorkloadCallable()

ListApplications

Lists Applications in a host project and location.

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

  • listApplications(ListApplicationsRequest request)

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

  • listApplications(LocationName parent)

  • listApplications(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.

  • listApplicationsPagedCallable()

  • listApplicationsCallable()

CreateApplication

Creates an Application in a host project and location.

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

  • createApplicationAsync(CreateApplicationRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createApplicationAsync(LocationName parent, Application application, String applicationId)

  • createApplicationAsync(String parent, Application application, String applicationId)

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

  • createApplicationOperationCallable()

  • createApplicationCallable()

GetApplication

Gets an Application in a host project and location.

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

  • getApplication(GetApplicationRequest request)

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

  • getApplication(ApplicationName name)

  • getApplication(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.

  • getApplicationCallable()

UpdateApplication

Updates an Application in a host project and location.

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

  • updateApplicationAsync(UpdateApplicationRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateApplicationAsync(Application application, FieldMask updateMask)

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

  • updateApplicationOperationCallable()

  • updateApplicationCallable()

DeleteApplication

Deletes an Application in a host project and location.

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

  • deleteApplicationAsync(DeleteApplicationRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteApplicationAsync(ApplicationName name)

  • deleteApplicationAsync(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.

  • deleteApplicationOperationCallable()

  • deleteApplicationCallable()

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()

SetIamPolicy

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

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

  • setIamPolicy(SetIamPolicyRequest request)

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

  • setIamPolicyCallable()

GetIamPolicy

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

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

  • getIamPolicy(GetIamPolicyRequest request)

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

  • getIamPolicyCallable()

TestIamPermissions

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

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

  • testIamPermissions(TestIamPermissionsRequest request)

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

  • testIamPermissionsCallable()

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 AppHubSettings 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
 AppHubSettings appHubSettings =
     AppHubSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 AppHubClient appHubClient = AppHubClient.create(appHubSettings);
 

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
 AppHubSettings appHubSettings = AppHubSettings.newBuilder().setEndpoint(myEndpoint).build();
 AppHubClient appHubClient = AppHubClient.create(appHubSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 AppHubSettings appHubSettings = AppHubSettings.newHttpJsonBuilder().build();
 AppHubClient appHubClient = AppHubClient.create(appHubSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

  • Constructor Details

    • AppHubClient

      protected AppHubClient(AppHubSettings settings) throws IOException
      Constructs an instance of AppHubClient, 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
    • AppHubClient

      protected AppHubClient(AppHubStub stub)
  • Method Details

    • create

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

      public static final AppHubClient create(AppHubSettings settings) throws IOException
      Constructs an instance of AppHubClient, 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

      public static final AppHubClient create(AppHubStub stub)
      Constructs an instance of AppHubClient, using the given stub for making calls. This is for advanced usage - prefer using create(AppHubSettings).
    • getSettings

      public final AppHubSettings getSettings()
    • getStub

      public AppHubStub getStub()
    • getOperationsClient

      public final OperationsClient getOperationsClient()
      Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
    • getHttpJsonOperationsClient

      @BetaApi public final OperationsClient getHttpJsonOperationsClient()
      Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
    • lookupServiceProjectAttachment

      public final LookupServiceProjectAttachmentResponse lookupServiceProjectAttachment(LocationName name)
      Lists a service project attachment for a given service project. You can call this API from any project to find if it is attached to a 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 (AppHubClient appHubClient = AppHubClient.create()) {
         LocationName name = LocationName.of("[PROJECT]", "[LOCATION]");
         LookupServiceProjectAttachmentResponse response =
             appHubClient.lookupServiceProjectAttachment(name);
       }
       
      Parameters:
      name - Required. Service project ID and location to lookup service project attachment for. Only global location is supported. Expected format: `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • lookupServiceProjectAttachment

      public final LookupServiceProjectAttachmentResponse lookupServiceProjectAttachment(String name)
      Lists a service project attachment for a given service project. You can call this API from any project to find if it is attached to a 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 (AppHubClient appHubClient = AppHubClient.create()) {
         String name = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         LookupServiceProjectAttachmentResponse response =
             appHubClient.lookupServiceProjectAttachment(name);
       }
       
      Parameters:
      name - Required. Service project ID and location to lookup service project attachment for. Only global location is supported. Expected format: `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • lookupServiceProjectAttachment

      public final LookupServiceProjectAttachmentResponse lookupServiceProjectAttachment(LookupServiceProjectAttachmentRequest request)
      Lists a service project attachment for a given service project. You can call this API from any project to find if it is attached to a 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 (AppHubClient appHubClient = AppHubClient.create()) {
         LookupServiceProjectAttachmentRequest request =
             LookupServiceProjectAttachmentRequest.newBuilder()
                 .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .build();
         LookupServiceProjectAttachmentResponse response =
             appHubClient.lookupServiceProjectAttachment(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • lookupServiceProjectAttachmentCallable

      public final UnaryCallable<LookupServiceProjectAttachmentRequest,LookupServiceProjectAttachmentResponse> lookupServiceProjectAttachmentCallable()
      Lists a service project attachment for a given service project. You can call this API from any project to find if it is attached to a 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 (AppHubClient appHubClient = AppHubClient.create()) {
         LookupServiceProjectAttachmentRequest request =
             LookupServiceProjectAttachmentRequest.newBuilder()
                 .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .build();
         ApiFuture<LookupServiceProjectAttachmentResponse> future =
             appHubClient.lookupServiceProjectAttachmentCallable().futureCall(request);
         // Do something.
         LookupServiceProjectAttachmentResponse response = future.get();
       }
       
    • listServiceProjectAttachments

      public final AppHubClient.ListServiceProjectAttachmentsPagedResponse listServiceProjectAttachments(LocationName parent)
      Lists service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (ServiceProjectAttachment element :
             appHubClient.listServiceProjectAttachments(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Host project ID and location to list service project attachments. Only global location is supported. Expected format: `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listServiceProjectAttachments

      public final AppHubClient.ListServiceProjectAttachmentsPagedResponse listServiceProjectAttachments(String parent)
      Lists service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (ServiceProjectAttachment element :
             appHubClient.listServiceProjectAttachments(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Host project ID and location to list service project attachments. Only global location is supported. Expected format: `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listServiceProjectAttachments

      Lists service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListServiceProjectAttachmentsRequest request =
             ListServiceProjectAttachmentsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (ServiceProjectAttachment element :
             appHubClient.listServiceProjectAttachments(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
    • listServiceProjectAttachmentsPagedCallable

      Lists service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListServiceProjectAttachmentsRequest request =
             ListServiceProjectAttachmentsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<ServiceProjectAttachment> future =
             appHubClient.listServiceProjectAttachmentsPagedCallable().futureCall(request);
         // Do something.
         for (ServiceProjectAttachment element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listServiceProjectAttachmentsCallable

      public final UnaryCallable<ListServiceProjectAttachmentsRequest,ListServiceProjectAttachmentsResponse> listServiceProjectAttachmentsCallable()
      Lists service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListServiceProjectAttachmentsRequest request =
             ListServiceProjectAttachmentsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListServiceProjectAttachmentsResponse response =
               appHubClient.listServiceProjectAttachmentsCallable().call(request);
           for (ServiceProjectAttachment element : response.getServiceProjectAttachmentsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • createServiceProjectAttachmentAsync

      public final OperationFuture<ServiceProjectAttachment,OperationMetadata> createServiceProjectAttachmentAsync(LocationName parent, ServiceProjectAttachment serviceProjectAttachment, String serviceProjectAttachmentId)
      Attaches a service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         ServiceProjectAttachment serviceProjectAttachment =
             ServiceProjectAttachment.newBuilder().build();
         String serviceProjectAttachmentId = "serviceProjectAttachmentId-1738589598";
         ServiceProjectAttachment response =
             appHubClient
                 .createServiceProjectAttachmentAsync(
                     parent, serviceProjectAttachment, serviceProjectAttachmentId)
                 .get();
       }
       
      Parameters:
      parent - Required. Host project ID and location to which service project is being attached. Only global location is supported. Expected format: `projects/{project}/locations/{location}`.
      serviceProjectAttachment - Required. The resource being created.
      serviceProjectAttachmentId - Required. The service project attachment identifier must contain the project id of the service project specified in the service_project_attachment.service_project field.
      Throws:
      ApiException - if the remote call fails
    • createServiceProjectAttachmentAsync

      public final OperationFuture<ServiceProjectAttachment,OperationMetadata> createServiceProjectAttachmentAsync(String parent, ServiceProjectAttachment serviceProjectAttachment, String serviceProjectAttachmentId)
      Attaches a service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         ServiceProjectAttachment serviceProjectAttachment =
             ServiceProjectAttachment.newBuilder().build();
         String serviceProjectAttachmentId = "serviceProjectAttachmentId-1738589598";
         ServiceProjectAttachment response =
             appHubClient
                 .createServiceProjectAttachmentAsync(
                     parent, serviceProjectAttachment, serviceProjectAttachmentId)
                 .get();
       }
       
      Parameters:
      parent - Required. Host project ID and location to which service project is being attached. Only global location is supported. Expected format: `projects/{project}/locations/{location}`.
      serviceProjectAttachment - Required. The resource being created.
      serviceProjectAttachmentId - Required. The service project attachment identifier must contain the project id of the service project specified in the service_project_attachment.service_project field.
      Throws:
      ApiException - if the remote call fails
    • createServiceProjectAttachmentAsync

      public final OperationFuture<ServiceProjectAttachment,OperationMetadata> createServiceProjectAttachmentAsync(CreateServiceProjectAttachmentRequest request)
      Attaches a service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         CreateServiceProjectAttachmentRequest request =
             CreateServiceProjectAttachmentRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setServiceProjectAttachmentId("serviceProjectAttachmentId-1738589598")
                 .setServiceProjectAttachment(ServiceProjectAttachment.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ServiceProjectAttachment response =
             appHubClient.createServiceProjectAttachmentAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createServiceProjectAttachmentOperationCallable

      public final OperationCallable<CreateServiceProjectAttachmentRequest,ServiceProjectAttachment,OperationMetadata> createServiceProjectAttachmentOperationCallable()
      Attaches a service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         CreateServiceProjectAttachmentRequest request =
             CreateServiceProjectAttachmentRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setServiceProjectAttachmentId("serviceProjectAttachmentId-1738589598")
                 .setServiceProjectAttachment(ServiceProjectAttachment.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<ServiceProjectAttachment, OperationMetadata> future =
             appHubClient.createServiceProjectAttachmentOperationCallable().futureCall(request);
         // Do something.
         ServiceProjectAttachment response = future.get();
       }
       
    • createServiceProjectAttachmentCallable

      public final UnaryCallable<CreateServiceProjectAttachmentRequest,Operation> createServiceProjectAttachmentCallable()
      Attaches a service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         CreateServiceProjectAttachmentRequest request =
             CreateServiceProjectAttachmentRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setServiceProjectAttachmentId("serviceProjectAttachmentId-1738589598")
                 .setServiceProjectAttachment(ServiceProjectAttachment.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             appHubClient.createServiceProjectAttachmentCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • getServiceProjectAttachment

      public final ServiceProjectAttachment getServiceProjectAttachment(ServiceProjectAttachmentName name)
      Gets a service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         ServiceProjectAttachmentName name =
             ServiceProjectAttachmentName.of(
                 "[PROJECT]", "[LOCATION]", "[SERVICE_PROJECT_ATTACHMENT]");
         ServiceProjectAttachment response = appHubClient.getServiceProjectAttachment(name);
       }
       
      Parameters:
      name - Required. Fully qualified name of the service project attachment to retrieve. Expected format: `projects/{project}/locations/{location}/serviceProjectAttachments/{serviceProjectAttachment}`.
      Throws:
      ApiException - if the remote call fails
    • getServiceProjectAttachment

      public final ServiceProjectAttachment getServiceProjectAttachment(String name)
      Gets a service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         String name =
             ServiceProjectAttachmentName.of("[PROJECT]", "[LOCATION]", "[SERVICE_PROJECT_ATTACHMENT]")
                 .toString();
         ServiceProjectAttachment response = appHubClient.getServiceProjectAttachment(name);
       }
       
      Parameters:
      name - Required. Fully qualified name of the service project attachment to retrieve. Expected format: `projects/{project}/locations/{location}/serviceProjectAttachments/{serviceProjectAttachment}`.
      Throws:
      ApiException - if the remote call fails
    • getServiceProjectAttachment

      public final ServiceProjectAttachment getServiceProjectAttachment(GetServiceProjectAttachmentRequest request)
      Gets a service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         GetServiceProjectAttachmentRequest request =
             GetServiceProjectAttachmentRequest.newBuilder()
                 .setName(
                     ServiceProjectAttachmentName.of(
                             "[PROJECT]", "[LOCATION]", "[SERVICE_PROJECT_ATTACHMENT]")
                         .toString())
                 .build();
         ServiceProjectAttachment response = appHubClient.getServiceProjectAttachment(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getServiceProjectAttachmentCallable

      public final UnaryCallable<GetServiceProjectAttachmentRequest,ServiceProjectAttachment> getServiceProjectAttachmentCallable()
      Gets a service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         GetServiceProjectAttachmentRequest request =
             GetServiceProjectAttachmentRequest.newBuilder()
                 .setName(
                     ServiceProjectAttachmentName.of(
                             "[PROJECT]", "[LOCATION]", "[SERVICE_PROJECT_ATTACHMENT]")
                         .toString())
                 .build();
         ApiFuture<ServiceProjectAttachment> future =
             appHubClient.getServiceProjectAttachmentCallable().futureCall(request);
         // Do something.
         ServiceProjectAttachment response = future.get();
       }
       
    • deleteServiceProjectAttachmentAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceProjectAttachmentAsync(ServiceProjectAttachmentName name)
      Deletes a service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         ServiceProjectAttachmentName name =
             ServiceProjectAttachmentName.of(
                 "[PROJECT]", "[LOCATION]", "[SERVICE_PROJECT_ATTACHMENT]");
         appHubClient.deleteServiceProjectAttachmentAsync(name).get();
       }
       
      Parameters:
      name - Required. Fully qualified name of the service project attachment to delete. Expected format: `projects/{project}/locations/{location}/serviceProjectAttachments/{serviceProjectAttachment}`.
      Throws:
      ApiException - if the remote call fails
    • deleteServiceProjectAttachmentAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceProjectAttachmentAsync(String name)
      Deletes a service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         String name =
             ServiceProjectAttachmentName.of("[PROJECT]", "[LOCATION]", "[SERVICE_PROJECT_ATTACHMENT]")
                 .toString();
         appHubClient.deleteServiceProjectAttachmentAsync(name).get();
       }
       
      Parameters:
      name - Required. Fully qualified name of the service project attachment to delete. Expected format: `projects/{project}/locations/{location}/serviceProjectAttachments/{serviceProjectAttachment}`.
      Throws:
      ApiException - if the remote call fails
    • deleteServiceProjectAttachmentAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceProjectAttachmentAsync(DeleteServiceProjectAttachmentRequest request)
      Deletes a service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         DeleteServiceProjectAttachmentRequest request =
             DeleteServiceProjectAttachmentRequest.newBuilder()
                 .setName(
                     ServiceProjectAttachmentName.of(
                             "[PROJECT]", "[LOCATION]", "[SERVICE_PROJECT_ATTACHMENT]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         appHubClient.deleteServiceProjectAttachmentAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteServiceProjectAttachmentOperationCallable

      public final OperationCallable<DeleteServiceProjectAttachmentRequest,com.google.protobuf.Empty,OperationMetadata> deleteServiceProjectAttachmentOperationCallable()
      Deletes a service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         DeleteServiceProjectAttachmentRequest request =
             DeleteServiceProjectAttachmentRequest.newBuilder()
                 .setName(
                     ServiceProjectAttachmentName.of(
                             "[PROJECT]", "[LOCATION]", "[SERVICE_PROJECT_ATTACHMENT]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             appHubClient.deleteServiceProjectAttachmentOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteServiceProjectAttachmentCallable

      public final UnaryCallable<DeleteServiceProjectAttachmentRequest,Operation> deleteServiceProjectAttachmentCallable()
      Deletes a service 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 (AppHubClient appHubClient = AppHubClient.create()) {
         DeleteServiceProjectAttachmentRequest request =
             DeleteServiceProjectAttachmentRequest.newBuilder()
                 .setName(
                     ServiceProjectAttachmentName.of(
                             "[PROJECT]", "[LOCATION]", "[SERVICE_PROJECT_ATTACHMENT]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             appHubClient.deleteServiceProjectAttachmentCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • detachServiceProjectAttachment

      public final DetachServiceProjectAttachmentResponse detachServiceProjectAttachment(LocationName name)
      Detaches a service project from a host project. You can call this API from any service project without needing access to the host project that it is attached to.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         LocationName name = LocationName.of("[PROJECT]", "[LOCATION]");
         DetachServiceProjectAttachmentResponse response =
             appHubClient.detachServiceProjectAttachment(name);
       }
       
      Parameters:
      name - Required. Service project id and location to detach from a host project. Only global location is supported. Expected format: `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • detachServiceProjectAttachment

      public final DetachServiceProjectAttachmentResponse detachServiceProjectAttachment(String name)
      Detaches a service project from a host project. You can call this API from any service project without needing access to the host project that it is attached to.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         String name = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         DetachServiceProjectAttachmentResponse response =
             appHubClient.detachServiceProjectAttachment(name);
       }
       
      Parameters:
      name - Required. Service project id and location to detach from a host project. Only global location is supported. Expected format: `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • detachServiceProjectAttachment

      public final DetachServiceProjectAttachmentResponse detachServiceProjectAttachment(DetachServiceProjectAttachmentRequest request)
      Detaches a service project from a host project. You can call this API from any service project without needing access to the host project that it is attached to.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         DetachServiceProjectAttachmentRequest request =
             DetachServiceProjectAttachmentRequest.newBuilder()
                 .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .build();
         DetachServiceProjectAttachmentResponse response =
             appHubClient.detachServiceProjectAttachment(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • detachServiceProjectAttachmentCallable

      public final UnaryCallable<DetachServiceProjectAttachmentRequest,DetachServiceProjectAttachmentResponse> detachServiceProjectAttachmentCallable()
      Detaches a service project from a host project. You can call this API from any service project without needing access to the host project that it is attached to.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         DetachServiceProjectAttachmentRequest request =
             DetachServiceProjectAttachmentRequest.newBuilder()
                 .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .build();
         ApiFuture<DetachServiceProjectAttachmentResponse> future =
             appHubClient.detachServiceProjectAttachmentCallable().futureCall(request);
         // Do something.
         DetachServiceProjectAttachmentResponse response = future.get();
       }
       
    • listDiscoveredServices

      public final AppHubClient.ListDiscoveredServicesPagedResponse listDiscoveredServices(LocationName parent)
      Lists Discovered Services that can be added to an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (DiscoveredService element : appHubClient.listDiscoveredServices(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Project and location to list Discovered Services on. Expected format: `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listDiscoveredServices

      public final AppHubClient.ListDiscoveredServicesPagedResponse listDiscoveredServices(String parent)
      Lists Discovered Services that can be added to an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (DiscoveredService element : appHubClient.listDiscoveredServices(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Project and location to list Discovered Services on. Expected format: `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listDiscoveredServices

      Lists Discovered Services that can be added to an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListDiscoveredServicesRequest request =
             ListDiscoveredServicesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (DiscoveredService element : appHubClient.listDiscoveredServices(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
    • listDiscoveredServicesPagedCallable

      Lists Discovered Services that can be added to an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListDiscoveredServicesRequest request =
             ListDiscoveredServicesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<DiscoveredService> future =
             appHubClient.listDiscoveredServicesPagedCallable().futureCall(request);
         // Do something.
         for (DiscoveredService element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listDiscoveredServicesCallable

      public final UnaryCallable<ListDiscoveredServicesRequest,ListDiscoveredServicesResponse> listDiscoveredServicesCallable()
      Lists Discovered Services that can be added to an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListDiscoveredServicesRequest request =
             ListDiscoveredServicesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListDiscoveredServicesResponse response =
               appHubClient.listDiscoveredServicesCallable().call(request);
           for (DiscoveredService element : response.getDiscoveredServicesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getDiscoveredService

      public final DiscoveredService getDiscoveredService(DiscoveredServiceName name)
      Gets a Discovered Service in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         DiscoveredServiceName name =
             DiscoveredServiceName.of("[PROJECT]", "[LOCATION]", "[DISCOVERED_SERVICE]");
         DiscoveredService response = appHubClient.getDiscoveredService(name);
       }
       
      Parameters:
      name - Required. Fully qualified name of the Discovered Service to fetch. Expected format: `projects/{project}/locations/{location}/discoveredServices/{discoveredService}`.
      Throws:
      ApiException - if the remote call fails
    • getDiscoveredService

      public final DiscoveredService getDiscoveredService(String name)
      Gets a Discovered Service in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         String name =
             DiscoveredServiceName.of("[PROJECT]", "[LOCATION]", "[DISCOVERED_SERVICE]").toString();
         DiscoveredService response = appHubClient.getDiscoveredService(name);
       }
       
      Parameters:
      name - Required. Fully qualified name of the Discovered Service to fetch. Expected format: `projects/{project}/locations/{location}/discoveredServices/{discoveredService}`.
      Throws:
      ApiException - if the remote call fails
    • getDiscoveredService

      public final DiscoveredService getDiscoveredService(GetDiscoveredServiceRequest request)
      Gets a Discovered Service in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         GetDiscoveredServiceRequest request =
             GetDiscoveredServiceRequest.newBuilder()
                 .setName(
                     DiscoveredServiceName.of("[PROJECT]", "[LOCATION]", "[DISCOVERED_SERVICE]")
                         .toString())
                 .build();
         DiscoveredService response = appHubClient.getDiscoveredService(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getDiscoveredServiceCallable

      public final UnaryCallable<GetDiscoveredServiceRequest,DiscoveredService> getDiscoveredServiceCallable()
      Gets a Discovered Service in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         GetDiscoveredServiceRequest request =
             GetDiscoveredServiceRequest.newBuilder()
                 .setName(
                     DiscoveredServiceName.of("[PROJECT]", "[LOCATION]", "[DISCOVERED_SERVICE]")
                         .toString())
                 .build();
         ApiFuture<DiscoveredService> future =
             appHubClient.getDiscoveredServiceCallable().futureCall(request);
         // Do something.
         DiscoveredService response = future.get();
       }
       
    • lookupDiscoveredService

      public final LookupDiscoveredServiceResponse lookupDiscoveredService(LocationName parent, String uri)
      Lists a Discovered Service in a host project and location, with a given resource URI.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         String uri = "uri116076";
         LookupDiscoveredServiceResponse response = appHubClient.lookupDiscoveredService(parent, uri);
       }
       
      Parameters:
      parent - Required. Host project ID and location to lookup Discovered Service in. Expected format: `projects/{project}/locations/{location}`.
      uri - Required. Resource URI to find DiscoveredService for. Accepts both project number and project ID and does translation when needed.
      Throws:
      ApiException - if the remote call fails
    • lookupDiscoveredService

      public final LookupDiscoveredServiceResponse lookupDiscoveredService(String parent, String uri)
      Lists a Discovered Service in a host project and location, with a given resource URI.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         String uri = "uri116076";
         LookupDiscoveredServiceResponse response = appHubClient.lookupDiscoveredService(parent, uri);
       }
       
      Parameters:
      parent - Required. Host project ID and location to lookup Discovered Service in. Expected format: `projects/{project}/locations/{location}`.
      uri - Required. Resource URI to find DiscoveredService for. Accepts both project number and project ID and does translation when needed.
      Throws:
      ApiException - if the remote call fails
    • lookupDiscoveredService

      public final LookupDiscoveredServiceResponse lookupDiscoveredService(LookupDiscoveredServiceRequest request)
      Lists a Discovered Service in a host project and location, with a given resource URI.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         LookupDiscoveredServiceRequest request =
             LookupDiscoveredServiceRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setUri("uri116076")
                 .build();
         LookupDiscoveredServiceResponse response = appHubClient.lookupDiscoveredService(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • lookupDiscoveredServiceCallable

      public final UnaryCallable<LookupDiscoveredServiceRequest,LookupDiscoveredServiceResponse> lookupDiscoveredServiceCallable()
      Lists a Discovered Service in a host project and location, with a given resource URI.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         LookupDiscoveredServiceRequest request =
             LookupDiscoveredServiceRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setUri("uri116076")
                 .build();
         ApiFuture<LookupDiscoveredServiceResponse> future =
             appHubClient.lookupDiscoveredServiceCallable().futureCall(request);
         // Do something.
         LookupDiscoveredServiceResponse response = future.get();
       }
       
    • listServices

      public final AppHubClient.ListServicesPagedResponse listServices(ApplicationName parent)
      Lists Services in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         ApplicationName parent = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]");
         for (Service element : appHubClient.listServices(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Fully qualified name of the parent Application to list Services for. Expected format: `projects/{project}/locations/{location}/applications/{application}`.
      Throws:
      ApiException - if the remote call fails
    • listServices

      public final AppHubClient.ListServicesPagedResponse listServices(String parent)
      Lists Services in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         String parent = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString();
         for (Service element : appHubClient.listServices(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Fully qualified name of the parent Application to list Services for. Expected format: `projects/{project}/locations/{location}/applications/{application}`.
      Throws:
      ApiException - if the remote call fails
    • listServices

      public final AppHubClient.ListServicesPagedResponse listServices(ListServicesRequest request)
      Lists Services in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListServicesRequest request =
             ListServicesRequest.newBuilder()
                 .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (Service element : appHubClient.listServices(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
    • listServicesPagedCallable

      Lists Services in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListServicesRequest request =
             ListServicesRequest.newBuilder()
                 .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<Service> future = appHubClient.listServicesPagedCallable().futureCall(request);
         // Do something.
         for (Service element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listServicesCallable

      public final UnaryCallable<ListServicesRequest,ListServicesResponse> listServicesCallable()
      Lists Services in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListServicesRequest request =
             ListServicesRequest.newBuilder()
                 .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListServicesResponse response = appHubClient.listServicesCallable().call(request);
           for (Service element : response.getServicesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • createServiceAsync

      public final OperationFuture<Service,OperationMetadata> createServiceAsync(ApplicationName parent, Service service, String serviceId)
      Creates a Service in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         ApplicationName parent = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]");
         Service service = Service.newBuilder().build();
         String serviceId = "serviceId-194185552";
         Service response = appHubClient.createServiceAsync(parent, service, serviceId).get();
       }
       
      Parameters:
      parent - Required. Fully qualified name of the parent Application to create the Service in. Expected format: `projects/{project}/locations/{location}/applications/{application}`.
      service - Required. The resource being created.
      serviceId - Required. The Service identifier. Must contain only lowercase letters, numbers or hyphens, with the first character a letter, the last a letter or a number, and a 63 character maximum.
      Throws:
      ApiException - if the remote call fails
    • createServiceAsync

      public final OperationFuture<Service,OperationMetadata> createServiceAsync(String parent, Service service, String serviceId)
      Creates a Service in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         String parent = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString();
         Service service = Service.newBuilder().build();
         String serviceId = "serviceId-194185552";
         Service response = appHubClient.createServiceAsync(parent, service, serviceId).get();
       }
       
      Parameters:
      parent - Required. Fully qualified name of the parent Application to create the Service in. Expected format: `projects/{project}/locations/{location}/applications/{application}`.
      service - Required. The resource being created.
      serviceId - Required. The Service identifier. Must contain only lowercase letters, numbers or hyphens, with the first character a letter, the last a letter or a number, and a 63 character maximum.
      Throws:
      ApiException - if the remote call fails
    • createServiceAsync

      public final OperationFuture<Service,OperationMetadata> createServiceAsync(CreateServiceRequest request)
      Creates a Service in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         CreateServiceRequest request =
             CreateServiceRequest.newBuilder()
                 .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setServiceId("serviceId-194185552")
                 .setService(Service.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         Service response = appHubClient.createServiceAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createServiceOperationCallable

      public final OperationCallable<CreateServiceRequest,Service,OperationMetadata> createServiceOperationCallable()
      Creates a Service in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         CreateServiceRequest request =
             CreateServiceRequest.newBuilder()
                 .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setServiceId("serviceId-194185552")
                 .setService(Service.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Service, OperationMetadata> future =
             appHubClient.createServiceOperationCallable().futureCall(request);
         // Do something.
         Service response = future.get();
       }
       
    • createServiceCallable

      public final UnaryCallable<CreateServiceRequest,Operation> createServiceCallable()
      Creates a Service in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         CreateServiceRequest request =
             CreateServiceRequest.newBuilder()
                 .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setServiceId("serviceId-194185552")
                 .setService(Service.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = appHubClient.createServiceCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • getService

      public final Service getService(ServiceName name)
      Gets a Service in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[SERVICE]");
         Service response = appHubClient.getService(name);
       }
       
      Parameters:
      name - Required. Fully qualified name of the Service to fetch. Expected format: `projects/{project}/locations/{location}/applications/{application}/services/{service}`.
      Throws:
      ApiException - if the remote call fails
    • getService

      public final Service getService(String name)
      Gets a Service in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         String name =
             ServiceName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[SERVICE]").toString();
         Service response = appHubClient.getService(name);
       }
       
      Parameters:
      name - Required. Fully qualified name of the Service to fetch. Expected format: `projects/{project}/locations/{location}/applications/{application}/services/{service}`.
      Throws:
      ApiException - if the remote call fails
    • getService

      public final Service getService(GetServiceRequest request)
      Gets a Service in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         GetServiceRequest request =
             GetServiceRequest.newBuilder()
                 .setName(
                     ServiceName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[SERVICE]")
                         .toString())
                 .build();
         Service response = appHubClient.getService(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getServiceCallable

      public final UnaryCallable<GetServiceRequest,Service> getServiceCallable()
      Gets a Service in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         GetServiceRequest request =
             GetServiceRequest.newBuilder()
                 .setName(
                     ServiceName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[SERVICE]")
                         .toString())
                 .build();
         ApiFuture<Service> future = appHubClient.getServiceCallable().futureCall(request);
         // Do something.
         Service response = future.get();
       }
       
    • updateServiceAsync

      public final OperationFuture<Service,OperationMetadata> updateServiceAsync(Service service, com.google.protobuf.FieldMask updateMask)
      Updates a Service in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         Service service = Service.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         Service response = appHubClient.updateServiceAsync(service, updateMask).get();
       }
       
      Parameters:
      service - Required. The resource being updated.
      updateMask - Required. Field mask is used to specify the fields to be overwritten in the Service resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. The API changes the values of the fields as specified in the update_mask. The API ignores the values of all fields not covered by the update_mask. You can also unset a field by not specifying it in the updated message, but adding the field to the mask. This clears whatever value the field previously had.
      Throws:
      ApiException - if the remote call fails
    • updateServiceAsync

      public final OperationFuture<Service,OperationMetadata> updateServiceAsync(UpdateServiceRequest request)
      Updates a Service in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         UpdateServiceRequest request =
             UpdateServiceRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setService(Service.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         Service response = appHubClient.updateServiceAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateServiceOperationCallable

      public final OperationCallable<UpdateServiceRequest,Service,OperationMetadata> updateServiceOperationCallable()
      Updates a Service in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         UpdateServiceRequest request =
             UpdateServiceRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setService(Service.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Service, OperationMetadata> future =
             appHubClient.updateServiceOperationCallable().futureCall(request);
         // Do something.
         Service response = future.get();
       }
       
    • updateServiceCallable

      public final UnaryCallable<UpdateServiceRequest,Operation> updateServiceCallable()
      Updates a Service in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         UpdateServiceRequest request =
             UpdateServiceRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setService(Service.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = appHubClient.updateServiceCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteServiceAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceAsync(ServiceName name)
      Deletes a Service from an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[SERVICE]");
         appHubClient.deleteServiceAsync(name).get();
       }
       
      Parameters:
      name - Required. Fully qualified name of the Service to delete from an Application. Expected format: `projects/{project}/locations/{location}/applications/{application}/services/{service}`.
      Throws:
      ApiException - if the remote call fails
    • deleteServiceAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceAsync(String name)
      Deletes a Service from an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         String name =
             ServiceName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[SERVICE]").toString();
         appHubClient.deleteServiceAsync(name).get();
       }
       
      Parameters:
      name - Required. Fully qualified name of the Service to delete from an Application. Expected format: `projects/{project}/locations/{location}/applications/{application}/services/{service}`.
      Throws:
      ApiException - if the remote call fails
    • deleteServiceAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceAsync(DeleteServiceRequest request)
      Deletes a Service from an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         DeleteServiceRequest request =
             DeleteServiceRequest.newBuilder()
                 .setName(
                     ServiceName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[SERVICE]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         appHubClient.deleteServiceAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteServiceOperationCallable

      public final OperationCallable<DeleteServiceRequest,com.google.protobuf.Empty,OperationMetadata> deleteServiceOperationCallable()
      Deletes a Service from an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         DeleteServiceRequest request =
             DeleteServiceRequest.newBuilder()
                 .setName(
                     ServiceName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[SERVICE]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             appHubClient.deleteServiceOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteServiceCallable

      public final UnaryCallable<DeleteServiceRequest,Operation> deleteServiceCallable()
      Deletes a Service from an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         DeleteServiceRequest request =
             DeleteServiceRequest.newBuilder()
                 .setName(
                     ServiceName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[SERVICE]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = appHubClient.deleteServiceCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listDiscoveredWorkloads

      public final AppHubClient.ListDiscoveredWorkloadsPagedResponse listDiscoveredWorkloads(LocationName parent)
      Lists Discovered Workloads that can be added to an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (DiscoveredWorkload element : appHubClient.listDiscoveredWorkloads(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Project and location to list Discovered Workloads on. Expected format: `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listDiscoveredWorkloads

      public final AppHubClient.ListDiscoveredWorkloadsPagedResponse listDiscoveredWorkloads(String parent)
      Lists Discovered Workloads that can be added to an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (DiscoveredWorkload element : appHubClient.listDiscoveredWorkloads(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Project and location to list Discovered Workloads on. Expected format: `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listDiscoveredWorkloads

      Lists Discovered Workloads that can be added to an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListDiscoveredWorkloadsRequest request =
             ListDiscoveredWorkloadsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (DiscoveredWorkload element :
             appHubClient.listDiscoveredWorkloads(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
    • listDiscoveredWorkloadsPagedCallable

      Lists Discovered Workloads that can be added to an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListDiscoveredWorkloadsRequest request =
             ListDiscoveredWorkloadsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<DiscoveredWorkload> future =
             appHubClient.listDiscoveredWorkloadsPagedCallable().futureCall(request);
         // Do something.
         for (DiscoveredWorkload element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listDiscoveredWorkloadsCallable

      public final UnaryCallable<ListDiscoveredWorkloadsRequest,ListDiscoveredWorkloadsResponse> listDiscoveredWorkloadsCallable()
      Lists Discovered Workloads that can be added to an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListDiscoveredWorkloadsRequest request =
             ListDiscoveredWorkloadsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListDiscoveredWorkloadsResponse response =
               appHubClient.listDiscoveredWorkloadsCallable().call(request);
           for (DiscoveredWorkload element : response.getDiscoveredWorkloadsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getDiscoveredWorkload

      public final DiscoveredWorkload getDiscoveredWorkload(DiscoveredWorkloadName name)
      Gets a Discovered Workload in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         DiscoveredWorkloadName name =
             DiscoveredWorkloadName.of("[PROJECT]", "[LOCATION]", "[DISCOVERED_WORKLOAD]");
         DiscoveredWorkload response = appHubClient.getDiscoveredWorkload(name);
       }
       
      Parameters:
      name - Required. Fully qualified name of the Discovered Workload to fetch. Expected format: `projects/{project}/locations/{location}/discoveredWorkloads/{discoveredWorkload}`.
      Throws:
      ApiException - if the remote call fails
    • getDiscoveredWorkload

      public final DiscoveredWorkload getDiscoveredWorkload(String name)
      Gets a Discovered Workload in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         String name =
             DiscoveredWorkloadName.of("[PROJECT]", "[LOCATION]", "[DISCOVERED_WORKLOAD]").toString();
         DiscoveredWorkload response = appHubClient.getDiscoveredWorkload(name);
       }
       
      Parameters:
      name - Required. Fully qualified name of the Discovered Workload to fetch. Expected format: `projects/{project}/locations/{location}/discoveredWorkloads/{discoveredWorkload}`.
      Throws:
      ApiException - if the remote call fails
    • getDiscoveredWorkload

      public final DiscoveredWorkload getDiscoveredWorkload(GetDiscoveredWorkloadRequest request)
      Gets a Discovered Workload in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         GetDiscoveredWorkloadRequest request =
             GetDiscoveredWorkloadRequest.newBuilder()
                 .setName(
                     DiscoveredWorkloadName.of("[PROJECT]", "[LOCATION]", "[DISCOVERED_WORKLOAD]")
                         .toString())
                 .build();
         DiscoveredWorkload response = appHubClient.getDiscoveredWorkload(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getDiscoveredWorkloadCallable

      public final UnaryCallable<GetDiscoveredWorkloadRequest,DiscoveredWorkload> getDiscoveredWorkloadCallable()
      Gets a Discovered Workload in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         GetDiscoveredWorkloadRequest request =
             GetDiscoveredWorkloadRequest.newBuilder()
                 .setName(
                     DiscoveredWorkloadName.of("[PROJECT]", "[LOCATION]", "[DISCOVERED_WORKLOAD]")
                         .toString())
                 .build();
         ApiFuture<DiscoveredWorkload> future =
             appHubClient.getDiscoveredWorkloadCallable().futureCall(request);
         // Do something.
         DiscoveredWorkload response = future.get();
       }
       
    • lookupDiscoveredWorkload

      public final LookupDiscoveredWorkloadResponse lookupDiscoveredWorkload(LocationName parent, String uri)
      Lists a Discovered Workload in a host project and location, with a given resource URI.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         String uri = "uri116076";
         LookupDiscoveredWorkloadResponse response =
             appHubClient.lookupDiscoveredWorkload(parent, uri);
       }
       
      Parameters:
      parent - Required. Host project ID and location to lookup Discovered Workload in. Expected format: `projects/{project}/locations/{location}`.
      uri - Required. Resource URI to find Discovered Workload for. Accepts both project number and project ID and does translation when needed.
      Throws:
      ApiException - if the remote call fails
    • lookupDiscoveredWorkload

      public final LookupDiscoveredWorkloadResponse lookupDiscoveredWorkload(String parent, String uri)
      Lists a Discovered Workload in a host project and location, with a given resource URI.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         String uri = "uri116076";
         LookupDiscoveredWorkloadResponse response =
             appHubClient.lookupDiscoveredWorkload(parent, uri);
       }
       
      Parameters:
      parent - Required. Host project ID and location to lookup Discovered Workload in. Expected format: `projects/{project}/locations/{location}`.
      uri - Required. Resource URI to find Discovered Workload for. Accepts both project number and project ID and does translation when needed.
      Throws:
      ApiException - if the remote call fails
    • lookupDiscoveredWorkload

      public final LookupDiscoveredWorkloadResponse lookupDiscoveredWorkload(LookupDiscoveredWorkloadRequest request)
      Lists a Discovered Workload in a host project and location, with a given resource URI.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         LookupDiscoveredWorkloadRequest request =
             LookupDiscoveredWorkloadRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setUri("uri116076")
                 .build();
         LookupDiscoveredWorkloadResponse response = appHubClient.lookupDiscoveredWorkload(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • lookupDiscoveredWorkloadCallable

      public final UnaryCallable<LookupDiscoveredWorkloadRequest,LookupDiscoveredWorkloadResponse> lookupDiscoveredWorkloadCallable()
      Lists a Discovered Workload in a host project and location, with a given resource URI.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         LookupDiscoveredWorkloadRequest request =
             LookupDiscoveredWorkloadRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setUri("uri116076")
                 .build();
         ApiFuture<LookupDiscoveredWorkloadResponse> future =
             appHubClient.lookupDiscoveredWorkloadCallable().futureCall(request);
         // Do something.
         LookupDiscoveredWorkloadResponse response = future.get();
       }
       
    • listWorkloads

      public final AppHubClient.ListWorkloadsPagedResponse listWorkloads(ApplicationName parent)
      Lists Workloads in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         ApplicationName parent = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]");
         for (Workload element : appHubClient.listWorkloads(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Fully qualified name of the parent Application to list Workloads for. Expected format: `projects/{project}/locations/{location}/applications/{application}`.
      Throws:
      ApiException - if the remote call fails
    • listWorkloads

      public final AppHubClient.ListWorkloadsPagedResponse listWorkloads(String parent)
      Lists Workloads in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         String parent = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString();
         for (Workload element : appHubClient.listWorkloads(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Fully qualified name of the parent Application to list Workloads for. Expected format: `projects/{project}/locations/{location}/applications/{application}`.
      Throws:
      ApiException - if the remote call fails
    • listWorkloads

      public final AppHubClient.ListWorkloadsPagedResponse listWorkloads(ListWorkloadsRequest request)
      Lists Workloads in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListWorkloadsRequest request =
             ListWorkloadsRequest.newBuilder()
                 .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (Workload element : appHubClient.listWorkloads(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
    • listWorkloadsPagedCallable

      Lists Workloads in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListWorkloadsRequest request =
             ListWorkloadsRequest.newBuilder()
                 .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<Workload> future = appHubClient.listWorkloadsPagedCallable().futureCall(request);
         // Do something.
         for (Workload element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listWorkloadsCallable

      public final UnaryCallable<ListWorkloadsRequest,ListWorkloadsResponse> listWorkloadsCallable()
      Lists Workloads in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListWorkloadsRequest request =
             ListWorkloadsRequest.newBuilder()
                 .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListWorkloadsResponse response = appHubClient.listWorkloadsCallable().call(request);
           for (Workload element : response.getWorkloadsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • createWorkloadAsync

      public final OperationFuture<Workload,OperationMetadata> createWorkloadAsync(ApplicationName parent, Workload workload, String workloadId)
      Creates a Workload in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         ApplicationName parent = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]");
         Workload workload = Workload.newBuilder().build();
         String workloadId = "workloadId-186277134";
         Workload response = appHubClient.createWorkloadAsync(parent, workload, workloadId).get();
       }
       
      Parameters:
      parent - Required. Fully qualified name of the Application to create Workload in. Expected format: `projects/{project}/locations/{location}/applications/{application}`.
      workload - Required. The resource being created.
      workloadId - Required. The Workload identifier. Must contain only lowercase letters, numbers or hyphens, with the first character a letter, the last a letter or a number, and a 63 character maximum.
      Throws:
      ApiException - if the remote call fails
    • createWorkloadAsync

      public final OperationFuture<Workload,OperationMetadata> createWorkloadAsync(String parent, Workload workload, String workloadId)
      Creates a Workload in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         String parent = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString();
         Workload workload = Workload.newBuilder().build();
         String workloadId = "workloadId-186277134";
         Workload response = appHubClient.createWorkloadAsync(parent, workload, workloadId).get();
       }
       
      Parameters:
      parent - Required. Fully qualified name of the Application to create Workload in. Expected format: `projects/{project}/locations/{location}/applications/{application}`.
      workload - Required. The resource being created.
      workloadId - Required. The Workload identifier. Must contain only lowercase letters, numbers or hyphens, with the first character a letter, the last a letter or a number, and a 63 character maximum.
      Throws:
      ApiException - if the remote call fails
    • createWorkloadAsync

      public final OperationFuture<Workload,OperationMetadata> createWorkloadAsync(CreateWorkloadRequest request)
      Creates a Workload in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         CreateWorkloadRequest request =
             CreateWorkloadRequest.newBuilder()
                 .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setWorkloadId("workloadId-186277134")
                 .setWorkload(Workload.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         Workload response = appHubClient.createWorkloadAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createWorkloadOperationCallable

      public final OperationCallable<CreateWorkloadRequest,Workload,OperationMetadata> createWorkloadOperationCallable()
      Creates a Workload in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         CreateWorkloadRequest request =
             CreateWorkloadRequest.newBuilder()
                 .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setWorkloadId("workloadId-186277134")
                 .setWorkload(Workload.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Workload, OperationMetadata> future =
             appHubClient.createWorkloadOperationCallable().futureCall(request);
         // Do something.
         Workload response = future.get();
       }
       
    • createWorkloadCallable

      public final UnaryCallable<CreateWorkloadRequest,Operation> createWorkloadCallable()
      Creates a Workload in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         CreateWorkloadRequest request =
             CreateWorkloadRequest.newBuilder()
                 .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setWorkloadId("workloadId-186277134")
                 .setWorkload(Workload.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = appHubClient.createWorkloadCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • getWorkload

      public final Workload getWorkload(WorkloadName name)
      Gets a Workload in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         WorkloadName name = WorkloadName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[WORKLOAD]");
         Workload response = appHubClient.getWorkload(name);
       }
       
      Parameters:
      name - Required. Fully qualified name of the Workload to fetch. Expected format: `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.
      Throws:
      ApiException - if the remote call fails
    • getWorkload

      public final Workload getWorkload(String name)
      Gets a Workload in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         String name =
             WorkloadName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[WORKLOAD]").toString();
         Workload response = appHubClient.getWorkload(name);
       }
       
      Parameters:
      name - Required. Fully qualified name of the Workload to fetch. Expected format: `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.
      Throws:
      ApiException - if the remote call fails
    • getWorkload

      public final Workload getWorkload(GetWorkloadRequest request)
      Gets a Workload in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         GetWorkloadRequest request =
             GetWorkloadRequest.newBuilder()
                 .setName(
                     WorkloadName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[WORKLOAD]")
                         .toString())
                 .build();
         Workload response = appHubClient.getWorkload(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getWorkloadCallable

      public final UnaryCallable<GetWorkloadRequest,Workload> getWorkloadCallable()
      Gets a Workload in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         GetWorkloadRequest request =
             GetWorkloadRequest.newBuilder()
                 .setName(
                     WorkloadName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[WORKLOAD]")
                         .toString())
                 .build();
         ApiFuture<Workload> future = appHubClient.getWorkloadCallable().futureCall(request);
         // Do something.
         Workload response = future.get();
       }
       
    • updateWorkloadAsync

      public final OperationFuture<Workload,OperationMetadata> updateWorkloadAsync(Workload workload, com.google.protobuf.FieldMask updateMask)
      Updates a Workload in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         Workload workload = Workload.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         Workload response = appHubClient.updateWorkloadAsync(workload, updateMask).get();
       }
       
      Parameters:
      workload - Required. The resource being updated.
      updateMask - Required. Field mask is used to specify the fields to be overwritten in the Workload resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. The API changes the values of the fields as specified in the update_mask. The API ignores the values of all fields not covered by the update_mask. You can also unset a field by not specifying it in the updated message, but adding the field to the mask. This clears whatever value the field previously had.
      Throws:
      ApiException - if the remote call fails
    • updateWorkloadAsync

      public final OperationFuture<Workload,OperationMetadata> updateWorkloadAsync(UpdateWorkloadRequest request)
      Updates a Workload in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         UpdateWorkloadRequest request =
             UpdateWorkloadRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setWorkload(Workload.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         Workload response = appHubClient.updateWorkloadAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateWorkloadOperationCallable

      public final OperationCallable<UpdateWorkloadRequest,Workload,OperationMetadata> updateWorkloadOperationCallable()
      Updates a Workload in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         UpdateWorkloadRequest request =
             UpdateWorkloadRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setWorkload(Workload.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Workload, OperationMetadata> future =
             appHubClient.updateWorkloadOperationCallable().futureCall(request);
         // Do something.
         Workload response = future.get();
       }
       
    • updateWorkloadCallable

      public final UnaryCallable<UpdateWorkloadRequest,Operation> updateWorkloadCallable()
      Updates a Workload in an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         UpdateWorkloadRequest request =
             UpdateWorkloadRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setWorkload(Workload.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = appHubClient.updateWorkloadCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteWorkloadAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteWorkloadAsync(WorkloadName name)
      Deletes a Workload from an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         WorkloadName name = WorkloadName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[WORKLOAD]");
         appHubClient.deleteWorkloadAsync(name).get();
       }
       
      Parameters:
      name - Required. Fully qualified name of the Workload to delete from an Application. Expected format: `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.
      Throws:
      ApiException - if the remote call fails
    • deleteWorkloadAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteWorkloadAsync(String name)
      Deletes a Workload from an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         String name =
             WorkloadName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[WORKLOAD]").toString();
         appHubClient.deleteWorkloadAsync(name).get();
       }
       
      Parameters:
      name - Required. Fully qualified name of the Workload to delete from an Application. Expected format: `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.
      Throws:
      ApiException - if the remote call fails
    • deleteWorkloadAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteWorkloadAsync(DeleteWorkloadRequest request)
      Deletes a Workload from an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         DeleteWorkloadRequest request =
             DeleteWorkloadRequest.newBuilder()
                 .setName(
                     WorkloadName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[WORKLOAD]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         appHubClient.deleteWorkloadAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteWorkloadOperationCallable

      public final OperationCallable<DeleteWorkloadRequest,com.google.protobuf.Empty,OperationMetadata> deleteWorkloadOperationCallable()
      Deletes a Workload from an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         DeleteWorkloadRequest request =
             DeleteWorkloadRequest.newBuilder()
                 .setName(
                     WorkloadName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[WORKLOAD]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             appHubClient.deleteWorkloadOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteWorkloadCallable

      public final UnaryCallable<DeleteWorkloadRequest,Operation> deleteWorkloadCallable()
      Deletes a Workload from an Application.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         DeleteWorkloadRequest request =
             DeleteWorkloadRequest.newBuilder()
                 .setName(
                     WorkloadName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[WORKLOAD]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = appHubClient.deleteWorkloadCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listApplications

      public final AppHubClient.ListApplicationsPagedResponse listApplications(LocationName parent)
      Lists Applications in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (Application element : appHubClient.listApplications(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Project and location to list Applications on. Expected format: `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listApplications

      public final AppHubClient.ListApplicationsPagedResponse listApplications(String parent)
      Lists Applications in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (Application element : appHubClient.listApplications(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Project and location to list Applications on. Expected format: `projects/{project}/locations/{location}`.
      Throws:
      ApiException - if the remote call fails
    • listApplications

      Lists Applications in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListApplicationsRequest request =
             ListApplicationsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (Application element : appHubClient.listApplications(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
    • listApplicationsPagedCallable

      Lists Applications in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListApplicationsRequest request =
             ListApplicationsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<Application> future =
             appHubClient.listApplicationsPagedCallable().futureCall(request);
         // Do something.
         for (Application element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listApplicationsCallable

      public final UnaryCallable<ListApplicationsRequest,ListApplicationsResponse> listApplicationsCallable()
      Lists Applications in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListApplicationsRequest request =
             ListApplicationsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListApplicationsResponse response = appHubClient.listApplicationsCallable().call(request);
           for (Application element : response.getApplicationsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • createApplicationAsync

      public final OperationFuture<Application,OperationMetadata> createApplicationAsync(LocationName parent, Application application, String applicationId)
      Creates an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         Application application = Application.newBuilder().build();
         String applicationId = "applicationId-1011352949";
         Application response =
             appHubClient.createApplicationAsync(parent, application, applicationId).get();
       }
       
      Parameters:
      parent - Required. Project and location to create Application in. Expected format: `projects/{project}/locations/{location}`.
      application - Required. The resource being created
      applicationId - Required. The Application identifier. Must contain only lowercase letters, numbers or hyphens, with the first character a letter, the last a letter or a number, and a 63 character maximum.
      Throws:
      ApiException - if the remote call fails
    • createApplicationAsync

      public final OperationFuture<Application,OperationMetadata> createApplicationAsync(String parent, Application application, String applicationId)
      Creates an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         Application application = Application.newBuilder().build();
         String applicationId = "applicationId-1011352949";
         Application response =
             appHubClient.createApplicationAsync(parent, application, applicationId).get();
       }
       
      Parameters:
      parent - Required. Project and location to create Application in. Expected format: `projects/{project}/locations/{location}`.
      application - Required. The resource being created
      applicationId - Required. The Application identifier. Must contain only lowercase letters, numbers or hyphens, with the first character a letter, the last a letter or a number, and a 63 character maximum.
      Throws:
      ApiException - if the remote call fails
    • createApplicationAsync

      public final OperationFuture<Application,OperationMetadata> createApplicationAsync(CreateApplicationRequest request)
      Creates an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         CreateApplicationRequest request =
             CreateApplicationRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setApplicationId("applicationId-1011352949")
                 .setApplication(Application.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         Application response = appHubClient.createApplicationAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createApplicationOperationCallable

      public final OperationCallable<CreateApplicationRequest,Application,OperationMetadata> createApplicationOperationCallable()
      Creates an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         CreateApplicationRequest request =
             CreateApplicationRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setApplicationId("applicationId-1011352949")
                 .setApplication(Application.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Application, OperationMetadata> future =
             appHubClient.createApplicationOperationCallable().futureCall(request);
         // Do something.
         Application response = future.get();
       }
       
    • createApplicationCallable

      public final UnaryCallable<CreateApplicationRequest,Operation> createApplicationCallable()
      Creates an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         CreateApplicationRequest request =
             CreateApplicationRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setApplicationId("applicationId-1011352949")
                 .setApplication(Application.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = appHubClient.createApplicationCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • getApplication

      public final Application getApplication(ApplicationName name)
      Gets an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         ApplicationName name = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]");
         Application response = appHubClient.getApplication(name);
       }
       
      Parameters:
      name - Required. Fully qualified name of the Application to fetch. Expected format: `projects/{project}/locations/{location}/applications/{application}`.
      Throws:
      ApiException - if the remote call fails
    • getApplication

      public final Application getApplication(String name)
      Gets an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         String name = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString();
         Application response = appHubClient.getApplication(name);
       }
       
      Parameters:
      name - Required. Fully qualified name of the Application to fetch. Expected format: `projects/{project}/locations/{location}/applications/{application}`.
      Throws:
      ApiException - if the remote call fails
    • getApplication

      public final Application getApplication(GetApplicationRequest request)
      Gets an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         GetApplicationRequest request =
             GetApplicationRequest.newBuilder()
                 .setName(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .build();
         Application response = appHubClient.getApplication(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getApplicationCallable

      public final UnaryCallable<GetApplicationRequest,Application> getApplicationCallable()
      Gets an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         GetApplicationRequest request =
             GetApplicationRequest.newBuilder()
                 .setName(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .build();
         ApiFuture<Application> future = appHubClient.getApplicationCallable().futureCall(request);
         // Do something.
         Application response = future.get();
       }
       
    • updateApplicationAsync

      public final OperationFuture<Application,OperationMetadata> updateApplicationAsync(Application application, com.google.protobuf.FieldMask updateMask)
      Updates an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         Application application = Application.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         Application response = appHubClient.updateApplicationAsync(application, updateMask).get();
       }
       
      Parameters:
      application - Required. The resource being updated.
      updateMask - Required. Field mask is used to specify the fields to be overwritten in the Application resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. The API changes the values of the fields as specified in the update_mask. The API ignores the values of all fields not covered by the update_mask. You can also unset a field by not specifying it in the updated message, but adding the field to the mask. This clears whatever value the field previously had.
      Throws:
      ApiException - if the remote call fails
    • updateApplicationAsync

      public final OperationFuture<Application,OperationMetadata> updateApplicationAsync(UpdateApplicationRequest request)
      Updates an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         UpdateApplicationRequest request =
             UpdateApplicationRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setApplication(Application.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         Application response = appHubClient.updateApplicationAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateApplicationOperationCallable

      public final OperationCallable<UpdateApplicationRequest,Application,OperationMetadata> updateApplicationOperationCallable()
      Updates an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         UpdateApplicationRequest request =
             UpdateApplicationRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setApplication(Application.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Application, OperationMetadata> future =
             appHubClient.updateApplicationOperationCallable().futureCall(request);
         // Do something.
         Application response = future.get();
       }
       
    • updateApplicationCallable

      public final UnaryCallable<UpdateApplicationRequest,Operation> updateApplicationCallable()
      Updates an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         UpdateApplicationRequest request =
             UpdateApplicationRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setApplication(Application.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = appHubClient.updateApplicationCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteApplicationAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteApplicationAsync(ApplicationName name)
      Deletes an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         ApplicationName name = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]");
         appHubClient.deleteApplicationAsync(name).get();
       }
       
      Parameters:
      name - Required. Fully qualified name of the Application to delete. Expected format: `projects/{project}/locations/{location}/applications/{application}`.
      Throws:
      ApiException - if the remote call fails
    • deleteApplicationAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteApplicationAsync(String name)
      Deletes an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         String name = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString();
         appHubClient.deleteApplicationAsync(name).get();
       }
       
      Parameters:
      name - Required. Fully qualified name of the Application to delete. Expected format: `projects/{project}/locations/{location}/applications/{application}`.
      Throws:
      ApiException - if the remote call fails
    • deleteApplicationAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteApplicationAsync(DeleteApplicationRequest request)
      Deletes an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         DeleteApplicationRequest request =
             DeleteApplicationRequest.newBuilder()
                 .setName(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         appHubClient.deleteApplicationAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteApplicationOperationCallable

      public final OperationCallable<DeleteApplicationRequest,com.google.protobuf.Empty,OperationMetadata> deleteApplicationOperationCallable()
      Deletes an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         DeleteApplicationRequest request =
             DeleteApplicationRequest.newBuilder()
                 .setName(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             appHubClient.deleteApplicationOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteApplicationCallable

      public final UnaryCallable<DeleteApplicationRequest,Operation> deleteApplicationCallable()
      Deletes an Application in a host project and 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 (AppHubClient appHubClient = AppHubClient.create()) {
         DeleteApplicationRequest request =
             DeleteApplicationRequest.newBuilder()
                 .setName(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = appHubClient.deleteApplicationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listLocations

      public final AppHubClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)
      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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (Location element : appHubClient.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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<Location> future = appHubClient.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 (AppHubClient appHubClient = AppHubClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListLocationsResponse response = appHubClient.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 (AppHubClient appHubClient = AppHubClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         Location response = appHubClient.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 (AppHubClient appHubClient = AppHubClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         ApiFuture<Location> future = appHubClient.getLocationCallable().futureCall(request);
         // Do something.
         Location response = future.get();
       }
       
    • setIamPolicy

      public final Policy setIamPolicy(SetIamPolicyRequest request)
      Sets the access control policy on the specified resource. Replacesany existing policy.

      Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         SetIamPolicyRequest request =
             SetIamPolicyRequest.newBuilder()
                 .setResource(
                     ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setPolicy(Policy.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         Policy response = appHubClient.setIamPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • setIamPolicyCallable

      public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()
      Sets the access control policy on the specified resource. Replacesany existing policy.

      Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         SetIamPolicyRequest request =
             SetIamPolicyRequest.newBuilder()
                 .setResource(
                     ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setPolicy(Policy.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         ApiFuture<Policy> future = appHubClient.setIamPolicyCallable().futureCall(request);
         // Do something.
         Policy response = future.get();
       }
       
    • getIamPolicy

      public final Policy getIamPolicy(GetIamPolicyRequest request)
      Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         GetIamPolicyRequest request =
             GetIamPolicyRequest.newBuilder()
                 .setResource(
                     ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setOptions(GetPolicyOptions.newBuilder().build())
                 .build();
         Policy response = appHubClient.getIamPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getIamPolicyCallable

      public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()
      Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

      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 (AppHubClient appHubClient = AppHubClient.create()) {
         GetIamPolicyRequest request =
             GetIamPolicyRequest.newBuilder()
                 .setResource(
                     ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .setOptions(GetPolicyOptions.newBuilder().build())
                 .build();
         ApiFuture<Policy> future = appHubClient.getIamPolicyCallable().futureCall(request);
         // Do something.
         Policy response = future.get();
       }
       
    • testIamPermissions

      public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)
      Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.

      Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require 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 (AppHubClient appHubClient = AppHubClient.create()) {
         TestIamPermissionsRequest request =
             TestIamPermissionsRequest.newBuilder()
                 .setResource(
                     ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .addAllPermissions(new ArrayList<String>())
                 .build();
         TestIamPermissionsResponse response = appHubClient.testIamPermissions(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • testIamPermissionsCallable

      public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()
      Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.

      Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require 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 (AppHubClient appHubClient = AppHubClient.create()) {
         TestIamPermissionsRequest request =
             TestIamPermissionsRequest.newBuilder()
                 .setResource(
                     ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString())
                 .addAllPermissions(new ArrayList<String>())
                 .build();
         ApiFuture<TestIamPermissionsResponse> future =
             appHubClient.testIamPermissionsCallable().futureCall(request);
         // Do something.
         TestIamPermissionsResponse 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