Class ApiHubDependenciesClient (0.8.0)

GitHub RepositoryProduct Reference

Service Description: This service provides methods for various operations related to a 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 provided in the request.

The following fields in the dependency can be updated:

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

Inheritance

java.lang.Object > ApiHubDependenciesClient

Static Methods

create()

public static final ApiHubDependenciesClient create()

Constructs an instance of ApiHubDependenciesClient with default settings.

Returns
Type Description
ApiHubDependenciesClient
Exceptions
Type Description
IOException

create(ApiHubDependenciesSettings settings)

public static final ApiHubDependenciesClient create(ApiHubDependenciesSettings settings)

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.

Parameter
Name Description
settings ApiHubDependenciesSettings
Returns
Type Description
ApiHubDependenciesClient
Exceptions
Type Description
IOException

create(ApiHubDependenciesStub stub)

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

Parameter
Name Description
stub ApiHubDependenciesStub
Returns
Type Description
ApiHubDependenciesClient

Constructors

ApiHubDependenciesClient(ApiHubDependenciesSettings settings)

protected ApiHubDependenciesClient(ApiHubDependenciesSettings settings)

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.

Parameter
Name Description
settings ApiHubDependenciesSettings

ApiHubDependenciesClient(ApiHubDependenciesStub stub)

protected ApiHubDependenciesClient(ApiHubDependenciesStub stub)
Parameter
Name Description
stub ApiHubDependenciesStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

close()

public final void close()

createDependency(CreateDependencyRequest request)

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);
 }
 
Parameter
Name Description
request CreateDependencyRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Dependency

createDependency(LocationName parent, Dependency dependency, String dependencyId)

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
Name Description
parent LocationName

Required. The parent resource for the dependency resource. Format: projects/{project}/locations/{location}

dependency Dependency

Required. The dependency resource to create.

dependencyId String

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[0-9]-_.

Returns
Type Description
Dependency

createDependency(String parent, Dependency dependency, String dependencyId)

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
Name Description
parent String

Required. The parent resource for the dependency resource. Format: projects/{project}/locations/{location}

dependency Dependency

Required. The dependency resource to create.

dependencyId String

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[0-9]-_.

Returns
Type Description
Dependency

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();
 }
 
Returns
Type Description
UnaryCallable<CreateDependencyRequest,Dependency>

deleteDependency(DeleteDependencyRequest request)

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);
 }
 
Parameter
Name Description
request DeleteDependencyRequest

The request object containing all of the parameters for the API call.

deleteDependency(DependencyName name)

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);
 }
 
Parameter
Name Description
name DependencyName

Required. The name of the dependency resource to delete. Format: projects/{project}/locations/{location}/dependencies/{dependency}

deleteDependency(String name)

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);
 }
 
Parameter
Name Description
name String

Required. The name of the dependency resource to delete. Format: projects/{project}/locations/{location}/dependencies/{dependency}

deleteDependencyCallable()

public final UnaryCallable<DeleteDependencyRequest,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();
 }
 
Returns
Type Description
UnaryCallable<DeleteDependencyRequest,Empty>

getDependency(DependencyName name)

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);
 }
 
Parameter
Name Description
name DependencyName

Required. The name of the dependency resource to retrieve. Format: projects/{project}/locations/{location}/dependencies/{dependency}

Returns
Type Description
Dependency

getDependency(GetDependencyRequest request)

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);
 }
 
Parameter
Name Description
request GetDependencyRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Dependency

getDependency(String name)

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);
 }
 
Parameter
Name Description
name String

Required. The name of the dependency resource to retrieve. Format: projects/{project}/locations/{location}/dependencies/{dependency}

Returns
Type Description
Dependency

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();
 }
 
Returns
Type Description
UnaryCallable<GetDependencyRequest,Dependency>

getLocation(GetLocationRequest request)

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);
 }
 
Parameter
Name Description
request com.google.cloud.location.GetLocationRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.cloud.location.Location

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();
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

getSettings()

public final ApiHubDependenciesSettings getSettings()
Returns
Type Description
ApiHubDependenciesSettings

getStub()

public ApiHubDependenciesStub getStub()
Returns
Type Description
ApiHubDependenciesStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listDependencies(ListDependenciesRequest request)

public final ApiHubDependenciesClient.ListDependenciesPagedResponse listDependencies(ListDependenciesRequest request)

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);
   }
 }
 
Parameter
Name Description
request ListDependenciesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ApiHubDependenciesClient.ListDependenciesPagedResponse

listDependencies(LocationName parent)

public final ApiHubDependenciesClient.ListDependenciesPagedResponse listDependencies(LocationName 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()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (Dependency element : apiHubDependenciesClient.listDependencies(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent LocationName

Required. The parent which owns this collection of dependency resources. Format: projects/{project}/locations/{location}

Returns
Type Description
ApiHubDependenciesClient.ListDependenciesPagedResponse

listDependencies(String parent)

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);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent which owns this collection of dependency resources. Format: projects/{project}/locations/{location}

Returns
Type Description
ApiHubDependenciesClient.ListDependenciesPagedResponse

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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListDependenciesRequest,ListDependenciesResponse>

listDependenciesPagedCallable()

public final UnaryCallable<ListDependenciesRequest,ApiHubDependenciesClient.ListDependenciesPagedResponse> 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);
   }
 }
 
Returns
Type Description
UnaryCallable<ListDependenciesRequest,ListDependenciesPagedResponse>

listLocations(ListLocationsRequest request)

public final ApiHubDependenciesClient.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 (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);
   }
 }
 
Parameter
Name Description
request com.google.cloud.location.ListLocationsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ApiHubDependenciesClient.ListLocationsPagedResponse

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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

listLocationsPagedCallable()

public final UnaryCallable<ListLocationsRequest,ApiHubDependenciesClient.ListLocationsPagedResponse> 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);
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateDependency(Dependency dependency, FieldMask updateMask)

public final Dependency updateDependency(Dependency dependency, FieldMask updateMask)

Update a dependency based on the update_mask provided in the request.

The following fields in the dependency can be updated:

  • 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
Name Description
dependency 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 FieldMask

Required. The list of fields to update.

Returns
Type Description
Dependency

updateDependency(UpdateDependencyRequest request)

public final Dependency updateDependency(UpdateDependencyRequest request)

Update a dependency based on the update_mask provided in the request.

The following fields in the dependency can be updated:

  • 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);
 }
 
Parameter
Name Description
request UpdateDependencyRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Dependency

updateDependencyCallable()

public final UnaryCallable<UpdateDependencyRequest,Dependency> updateDependencyCallable()

Update a dependency based on the update_mask provided in the request.

The following fields in the dependency can be updated:

  • 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();
 }
 
Returns
Type Description
UnaryCallable<UpdateDependencyRequest,Dependency>