Class ApiHubDependenciesClient

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

@Generated("by gapic-generator-java") public class ApiHubDependenciesClient extends Object implements BackgroundResource
Service Description: This service provides methods for various operations related to a [Dependency][google.cloud.apihub.v1.Dependency] in the API hub.

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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Dependency dependency = Dependency.newBuilder().build();
   String dependencyId = "dependencyId503788998";
   Dependency response =
       apiHubDependenciesClient.createDependency(parent, dependency, dependencyId);
 }
 

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

CreateDependency

Create a dependency between two entities in the API hub.

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

  • createDependency(CreateDependencyRequest request)

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

  • createDependency(LocationName parent, Dependency dependency, String dependencyId)

  • createDependency(String parent, Dependency dependency, String dependencyId)

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

  • createDependencyCallable()

GetDependency

Get details about a dependency resource in the API hub.

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

  • getDependency(GetDependencyRequest request)

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

  • getDependency(DependencyName name)

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

  • getDependencyCallable()

UpdateDependency

Update a dependency based on the [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] provided in the request.

The following fields in the [dependency][google.cloud.apihub.v1.Dependency] can be updated:

  • [description][google.cloud.apihub.v1.Dependency.description]

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

  • updateDependency(UpdateDependencyRequest request)

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

  • updateDependency(Dependency dependency, 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.

  • updateDependencyCallable()

DeleteDependency

Delete the dependency resource.

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

  • deleteDependency(DeleteDependencyRequest request)

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

  • deleteDependency(DependencyName name)

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

  • deleteDependencyCallable()

ListDependencies

List dependencies based on the provided filter and pagination parameters.

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

  • listDependencies(ListDependenciesRequest request)

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

  • listDependencies(LocationName parent)

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

  • listDependenciesPagedCallable()

  • listDependenciesCallable()

ListLocations

Lists information about the supported locations for this service.

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

  • listLocations(ListLocationsRequest request)

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

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

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

  • getLocation(GetLocationRequest request)

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

  • getLocationCallable()

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of ApiHubDependenciesSettings 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
 ApiHubDependenciesSettings apiHubDependenciesSettings =
     ApiHubDependenciesSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 ApiHubDependenciesClient apiHubDependenciesClient =
     ApiHubDependenciesClient.create(apiHubDependenciesSettings);
 

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
 ApiHubDependenciesSettings apiHubDependenciesSettings =
     ApiHubDependenciesSettings.newBuilder().setEndpoint(myEndpoint).build();
 ApiHubDependenciesClient apiHubDependenciesClient =
     ApiHubDependenciesClient.create(apiHubDependenciesSettings);
 

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

  • Constructor Details

    • ApiHubDependenciesClient

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

      protected ApiHubDependenciesClient(ApiHubDependenciesStub stub)
  • Method Details

    • create

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

      public static final ApiHubDependenciesClient create(ApiHubDependenciesSettings settings) throws IOException
      Constructs an instance of ApiHubDependenciesClient, 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 ApiHubDependenciesClient create(ApiHubDependenciesStub stub)
      Constructs an instance of ApiHubDependenciesClient, using the given stub for making calls. This is for advanced usage - prefer using create(ApiHubDependenciesSettings).
    • getSettings

      public final ApiHubDependenciesSettings getSettings()
    • getStub

      public ApiHubDependenciesStub getStub()
    • createDependency

      public final Dependency createDependency(LocationName parent, Dependency dependency, String dependencyId)
      Create a dependency between two entities in the API hub.

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         Dependency dependency = Dependency.newBuilder().build();
         String dependencyId = "dependencyId503788998";
         Dependency response =
             apiHubDependenciesClient.createDependency(parent, dependency, dependencyId);
       }
       
      Parameters:
      parent - Required. The parent resource for the dependency resource. Format: `projects/{project}/locations/{location}`
      dependency - Required. The dependency resource to create.
      dependencyId - Optional. The ID to use for the dependency resource, which will become the final component of the dependency's resource name. This field is optional.
      • If provided, the same will be used. The service will throw an error if duplicate id is provided by the client.
      • If not provided, a system generated id will be used.

      This value should be 4-500 characters, and valid characters are `[a-z][A-Z][0-9]-_`.

      Throws:
      ApiException - if the remote call fails
    • createDependency

      public final Dependency createDependency(String parent, Dependency dependency, String dependencyId)
      Create a dependency between two entities in the API hub.

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         Dependency dependency = Dependency.newBuilder().build();
         String dependencyId = "dependencyId503788998";
         Dependency response =
             apiHubDependenciesClient.createDependency(parent, dependency, dependencyId);
       }
       
      Parameters:
      parent - Required. The parent resource for the dependency resource. Format: `projects/{project}/locations/{location}`
      dependency - Required. The dependency resource to create.
      dependencyId - Optional. The ID to use for the dependency resource, which will become the final component of the dependency's resource name. This field is optional.
      • If provided, the same will be used. The service will throw an error if duplicate id is provided by the client.
      • If not provided, a system generated id will be used.

      This value should be 4-500 characters, and valid characters are `[a-z][A-Z][0-9]-_`.

      Throws:
      ApiException - if the remote call fails
    • createDependency

      public final Dependency createDependency(CreateDependencyRequest request)
      Create a dependency between two entities in the API hub.

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         CreateDependencyRequest request =
             CreateDependencyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setDependencyId("dependencyId503788998")
                 .setDependency(Dependency.newBuilder().build())
                 .build();
         Dependency response = apiHubDependenciesClient.createDependency(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createDependencyCallable

      public final UnaryCallable<CreateDependencyRequest,Dependency> createDependencyCallable()
      Create a dependency between two entities in the API hub.

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         CreateDependencyRequest request =
             CreateDependencyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setDependencyId("dependencyId503788998")
                 .setDependency(Dependency.newBuilder().build())
                 .build();
         ApiFuture<Dependency> future =
             apiHubDependenciesClient.createDependencyCallable().futureCall(request);
         // Do something.
         Dependency response = future.get();
       }
       
    • getDependency

      public final Dependency getDependency(DependencyName name)
      Get details about a dependency resource in the API hub.

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         DependencyName name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]");
         Dependency response = apiHubDependenciesClient.getDependency(name);
       }
       
      Parameters:
      name - Required. The name of the dependency resource to retrieve. Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
      Throws:
      ApiException - if the remote call fails
    • getDependency

      public final Dependency getDependency(String name)
      Get details about a dependency resource in the API hub.

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         String name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString();
         Dependency response = apiHubDependenciesClient.getDependency(name);
       }
       
      Parameters:
      name - Required. The name of the dependency resource to retrieve. Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
      Throws:
      ApiException - if the remote call fails
    • getDependency

      public final Dependency getDependency(GetDependencyRequest request)
      Get details about a dependency resource in the API hub.

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         GetDependencyRequest request =
             GetDependencyRequest.newBuilder()
                 .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString())
                 .build();
         Dependency response = apiHubDependenciesClient.getDependency(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getDependencyCallable

      public final UnaryCallable<GetDependencyRequest,Dependency> getDependencyCallable()
      Get details about a dependency resource in the API hub.

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         GetDependencyRequest request =
             GetDependencyRequest.newBuilder()
                 .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString())
                 .build();
         ApiFuture<Dependency> future =
             apiHubDependenciesClient.getDependencyCallable().futureCall(request);
         // Do something.
         Dependency response = future.get();
       }
       
    • updateDependency

      public final Dependency updateDependency(Dependency dependency, com.google.protobuf.FieldMask updateMask)
      Update a dependency based on the [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] provided in the request.

      The following fields in the [dependency][google.cloud.apihub.v1.Dependency] can be updated:

      • [description][google.cloud.apihub.v1.Dependency.description]

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         Dependency dependency = Dependency.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         Dependency response = apiHubDependenciesClient.updateDependency(dependency, updateMask);
       }
       
      Parameters:
      dependency - Required. The dependency resource to update.

      The dependency's `name` field is used to identify the dependency to update. Format: `projects/{project}/locations/{location}/dependencies/{dependency}`

      updateMask - Required. The list of fields to update.
      Throws:
      ApiException - if the remote call fails
    • updateDependency

      public final Dependency updateDependency(UpdateDependencyRequest request)
      Update a dependency based on the [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] provided in the request.

      The following fields in the [dependency][google.cloud.apihub.v1.Dependency] can be updated:

      • [description][google.cloud.apihub.v1.Dependency.description]

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         UpdateDependencyRequest request =
             UpdateDependencyRequest.newBuilder()
                 .setDependency(Dependency.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         Dependency response = apiHubDependenciesClient.updateDependency(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateDependencyCallable

      public final UnaryCallable<UpdateDependencyRequest,Dependency> updateDependencyCallable()
      Update a dependency based on the [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] provided in the request.

      The following fields in the [dependency][google.cloud.apihub.v1.Dependency] can be updated:

      • [description][google.cloud.apihub.v1.Dependency.description]

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         UpdateDependencyRequest request =
             UpdateDependencyRequest.newBuilder()
                 .setDependency(Dependency.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         ApiFuture<Dependency> future =
             apiHubDependenciesClient.updateDependencyCallable().futureCall(request);
         // Do something.
         Dependency response = future.get();
       }
       
    • deleteDependency

      public final void deleteDependency(DependencyName name)
      Delete the dependency resource.

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         DependencyName name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]");
         apiHubDependenciesClient.deleteDependency(name);
       }
       
      Parameters:
      name - Required. The name of the dependency resource to delete. Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
      Throws:
      ApiException - if the remote call fails
    • deleteDependency

      public final void deleteDependency(String name)
      Delete the dependency resource.

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         String name = DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString();
         apiHubDependenciesClient.deleteDependency(name);
       }
       
      Parameters:
      name - Required. The name of the dependency resource to delete. Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
      Throws:
      ApiException - if the remote call fails
    • deleteDependency

      public final void deleteDependency(DeleteDependencyRequest request)
      Delete the dependency resource.

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         DeleteDependencyRequest request =
             DeleteDependencyRequest.newBuilder()
                 .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString())
                 .build();
         apiHubDependenciesClient.deleteDependency(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteDependencyCallable

      public final UnaryCallable<DeleteDependencyRequest,com.google.protobuf.Empty> deleteDependencyCallable()
      Delete the dependency resource.

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         DeleteDependencyRequest request =
             DeleteDependencyRequest.newBuilder()
                 .setName(DependencyName.of("[PROJECT]", "[LOCATION]", "[DEPENDENCY]").toString())
                 .build();
         ApiFuture<Empty> future =
             apiHubDependenciesClient.deleteDependencyCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listDependencies

      List dependencies based on the provided filter and pagination parameters.

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (Dependency element : apiHubDependenciesClient.listDependencies(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent which owns this collection of dependency resources. Format: `projects/{project}/locations/{location}`
      Throws:
      ApiException - if the remote call fails
    • listDependencies

      public final ApiHubDependenciesClient.ListDependenciesPagedResponse listDependencies(String parent)
      List dependencies based on the provided filter and pagination parameters.

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (Dependency element : apiHubDependenciesClient.listDependencies(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent which owns this collection of dependency resources. Format: `projects/{project}/locations/{location}`
      Throws:
      ApiException - if the remote call fails
    • listDependencies

      List dependencies based on the provided filter and pagination parameters.

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         ListDependenciesRequest request =
             ListDependenciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (Dependency element : apiHubDependenciesClient.listDependencies(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
    • listDependenciesPagedCallable

      List dependencies based on the provided filter and pagination parameters.

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         ListDependenciesRequest request =
             ListDependenciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<Dependency> future =
             apiHubDependenciesClient.listDependenciesPagedCallable().futureCall(request);
         // Do something.
         for (Dependency element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listDependenciesCallable

      public final UnaryCallable<ListDependenciesRequest,ListDependenciesResponse> listDependenciesCallable()
      List dependencies based on the provided filter and pagination parameters.

      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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         ListDependenciesRequest request =
             ListDependenciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListDependenciesResponse response =
               apiHubDependenciesClient.listDependenciesCallable().call(request);
           for (Dependency element : response.getDependenciesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • listLocations

      Lists information about the supported locations for this service.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (Location element : apiHubDependenciesClient.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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<Location> future =
             apiHubDependenciesClient.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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListLocationsResponse response =
               apiHubDependenciesClient.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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         Location response = apiHubDependenciesClient.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 (ApiHubDependenciesClient apiHubDependenciesClient = ApiHubDependenciesClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         ApiFuture<Location> future =
             apiHubDependenciesClient.getLocationCallable().futureCall(request);
         // Do something.
         Location response = future.get();
       }
       
    • close

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

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

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

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

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

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