Class HubServiceClient (1.41.0)

GitHub RepositoryProduct Reference

Service Description: Network Connectivity Center is a hub-and-spoke abstraction for network connectivity management in Google Cloud. It reduces operational complexity through a simple, centralized connectivity management model.

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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   HubName name = HubName.of("[PROJECT]", "[HUB]");
   Hub response = hubServiceClient.getHub(name);
 }
 

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

ListHubs

Lists Hubs in a given project and location.

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

  • listHubs(ListHubsRequest request)

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

  • listHubs(LocationName parent)

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

  • listHubsPagedCallable()

  • listHubsCallable()

GetHub

Gets details of a single Hub.

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

  • getHub(GetHubRequest request)

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

  • getHub(HubName name)

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

  • getHubCallable()

CreateHub

Creates a new Hub in a given project and location.

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

  • createHubAsync(CreateHubRequest request)

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

  • createHubAsync(LocationName parent, Hub hub, String hubId)

  • createHubAsync(String parent, Hub hub, String hubId)

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

  • createHubOperationCallable()

  • createHubCallable()

UpdateHub

Updates the parameters of a single Hub.

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

  • updateHubAsync(UpdateHubRequest request)

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

  • updateHubAsync(Hub hub, 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.

  • updateHubOperationCallable()

  • updateHubCallable()

DeleteHub

Deletes a single Hub.

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

  • deleteHubAsync(DeleteHubRequest request)

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

  • deleteHubAsync(HubName name)

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

  • deleteHubOperationCallable()

  • deleteHubCallable()

ListSpokes

Lists Spokes in a given project and location.

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

  • listSpokes(ListSpokesRequest request)

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

  • listSpokes(LocationName parent)

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

  • listSpokesPagedCallable()

  • listSpokesCallable()

GetSpoke

Gets details of a single Spoke.

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

  • getSpoke(GetSpokeRequest request)

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

  • getSpoke(SpokeName name)

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

  • getSpokeCallable()

CreateSpoke

Creates a new Spoke in a given project and location.

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

  • createSpokeAsync(CreateSpokeRequest request)

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

  • createSpokeAsync(LocationName parent, Spoke spoke, String spokeId)

  • createSpokeAsync(String parent, Spoke spoke, String spokeId)

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

  • createSpokeOperationCallable()

  • createSpokeCallable()

UpdateSpoke

Updates the parameters of a single Spoke.

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

  • updateSpokeAsync(UpdateSpokeRequest request)

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

  • updateSpokeAsync(Spoke spoke, 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.

  • updateSpokeOperationCallable()

  • updateSpokeCallable()

DeleteSpoke

Deletes a single Spoke.

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

  • deleteSpokeAsync(DeleteSpokeRequest request)

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

  • deleteSpokeAsync(SpokeName name)

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

  • deleteSpokeOperationCallable()

  • deleteSpokeCallable()

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 HubServiceSettings 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
 HubServiceSettings hubServiceSettings =
     HubServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 HubServiceClient hubServiceClient = HubServiceClient.create(hubServiceSettings);
 

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
 HubServiceSettings hubServiceSettings =
     HubServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 HubServiceClient hubServiceClient = HubServiceClient.create(hubServiceSettings);
 

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

Inheritance

java.lang.Object > HubServiceClient

Static Methods

create()

public static final HubServiceClient create()

Constructs an instance of HubServiceClient with default settings.

Returns
Type Description
HubServiceClient
Exceptions
Type Description
IOException

create(HubServiceSettings settings)

public static final HubServiceClient create(HubServiceSettings settings)

Constructs an instance of HubServiceClient, 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 HubServiceSettings
Returns
Type Description
HubServiceClient
Exceptions
Type Description
IOException

create(HubServiceStub stub)

public static final HubServiceClient create(HubServiceStub stub)

Constructs an instance of HubServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(HubServiceSettings).

Parameter
Name Description
stub HubServiceStub
Returns
Type Description
HubServiceClient

Constructors

HubServiceClient(HubServiceSettings settings)

protected HubServiceClient(HubServiceSettings settings)

Constructs an instance of HubServiceClient, 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 HubServiceSettings

HubServiceClient(HubServiceStub stub)

protected HubServiceClient(HubServiceStub stub)
Parameter
Name Description
stub HubServiceStub

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

createHubAsync(CreateHubRequest request)

public final OperationFuture<Hub,OperationMetadata> createHubAsync(CreateHubRequest request)

Creates a new Hub in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   CreateHubRequest request =
       CreateHubRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setHubId("hubId99628272")
           .setHub(Hub.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   Hub response = hubServiceClient.createHubAsync(request).get();
 }
 
Parameter
Name Description
request CreateHubRequest

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

Returns
Type Description
OperationFuture<Hub,OperationMetadata>

createHubAsync(LocationName parent, Hub hub, String hubId)

public final OperationFuture<Hub,OperationMetadata> createHubAsync(LocationName parent, Hub hub, String hubId)

Creates a new Hub in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Hub hub = Hub.newBuilder().build();
   String hubId = "hubId99628272";
   Hub response = hubServiceClient.createHubAsync(parent, hub, hubId).get();
 }
 
Parameters
Name Description
parent LocationName

Required. The parent resource's name of the Hub.

hub Hub

Required. Initial values for a new Hub.

hubId String

Optional. Unique id for the Hub to create.

Returns
Type Description
OperationFuture<Hub,OperationMetadata>

createHubAsync(String parent, Hub hub, String hubId)

public final OperationFuture<Hub,OperationMetadata> createHubAsync(String parent, Hub hub, String hubId)

Creates a new Hub in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   Hub hub = Hub.newBuilder().build();
   String hubId = "hubId99628272";
   Hub response = hubServiceClient.createHubAsync(parent, hub, hubId).get();
 }
 
Parameters
Name Description
parent String

Required. The parent resource's name of the Hub.

hub Hub

Required. Initial values for a new Hub.

hubId String

Optional. Unique id for the Hub to create.

Returns
Type Description
OperationFuture<Hub,OperationMetadata>

createHubCallable()

public final UnaryCallable<CreateHubRequest,Operation> createHubCallable()

Creates a new Hub in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   CreateHubRequest request =
       CreateHubRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setHubId("hubId99628272")
           .setHub(Hub.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future = hubServiceClient.createHubCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateHubRequest,Operation>

createHubOperationCallable()

public final OperationCallable<CreateHubRequest,Hub,OperationMetadata> createHubOperationCallable()

Creates a new Hub in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   CreateHubRequest request =
       CreateHubRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setHubId("hubId99628272")
           .setHub(Hub.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Hub, OperationMetadata> future =
       hubServiceClient.createHubOperationCallable().futureCall(request);
   // Do something.
   Hub response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateHubRequest,Hub,OperationMetadata>

createSpokeAsync(CreateSpokeRequest request)

public final OperationFuture<Spoke,OperationMetadata> createSpokeAsync(CreateSpokeRequest request)

Creates a new Spoke in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   CreateSpokeRequest request =
       CreateSpokeRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setSpokeId("spokeId-1998996281")
           .setSpoke(Spoke.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   Spoke response = hubServiceClient.createSpokeAsync(request).get();
 }
 
Parameter
Name Description
request CreateSpokeRequest

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

Returns
Type Description
OperationFuture<Spoke,OperationMetadata>

createSpokeAsync(LocationName parent, Spoke spoke, String spokeId)

public final OperationFuture<Spoke,OperationMetadata> createSpokeAsync(LocationName parent, Spoke spoke, String spokeId)

Creates a new Spoke in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Spoke spoke = Spoke.newBuilder().build();
   String spokeId = "spokeId-1998996281";
   Spoke response = hubServiceClient.createSpokeAsync(parent, spoke, spokeId).get();
 }
 
Parameters
Name Description
parent LocationName

Required. The parent's resource name of the Spoke.

spoke Spoke

Required. Initial values for a new Hub.

spokeId String

Optional. Unique id for the Spoke to create.

Returns
Type Description
OperationFuture<Spoke,OperationMetadata>

createSpokeAsync(String parent, Spoke spoke, String spokeId)

public final OperationFuture<Spoke,OperationMetadata> createSpokeAsync(String parent, Spoke spoke, String spokeId)

Creates a new Spoke in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   Spoke spoke = Spoke.newBuilder().build();
   String spokeId = "spokeId-1998996281";
   Spoke response = hubServiceClient.createSpokeAsync(parent, spoke, spokeId).get();
 }
 
Parameters
Name Description
parent String

Required. The parent's resource name of the Spoke.

spoke Spoke

Required. Initial values for a new Hub.

spokeId String

Optional. Unique id for the Spoke to create.

Returns
Type Description
OperationFuture<Spoke,OperationMetadata>

createSpokeCallable()

public final UnaryCallable<CreateSpokeRequest,Operation> createSpokeCallable()

Creates a new Spoke in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   CreateSpokeRequest request =
       CreateSpokeRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setSpokeId("spokeId-1998996281")
           .setSpoke(Spoke.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future = hubServiceClient.createSpokeCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateSpokeRequest,Operation>

createSpokeOperationCallable()

public final OperationCallable<CreateSpokeRequest,Spoke,OperationMetadata> createSpokeOperationCallable()

Creates a new Spoke in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   CreateSpokeRequest request =
       CreateSpokeRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setSpokeId("spokeId-1998996281")
           .setSpoke(Spoke.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Spoke, OperationMetadata> future =
       hubServiceClient.createSpokeOperationCallable().futureCall(request);
   // Do something.
   Spoke response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateSpokeRequest,Spoke,OperationMetadata>

deleteHubAsync(DeleteHubRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteHubAsync(DeleteHubRequest request)

Deletes a single 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   DeleteHubRequest request =
       DeleteHubRequest.newBuilder()
           .setName(HubName.of("[PROJECT]", "[HUB]").toString())
           .setRequestId("requestId693933066")
           .build();
   hubServiceClient.deleteHubAsync(request).get();
 }
 
Parameter
Name Description
request DeleteHubRequest

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

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteHubAsync(HubName name)

public final OperationFuture<Empty,OperationMetadata> deleteHubAsync(HubName name)

Deletes a single 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   HubName name = HubName.of("[PROJECT]", "[HUB]");
   hubServiceClient.deleteHubAsync(name).get();
 }
 
Parameter
Name Description
name HubName

Required. The name of the Hub to delete.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteHubAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteHubAsync(String name)

Deletes a single 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   String name = HubName.of("[PROJECT]", "[HUB]").toString();
   hubServiceClient.deleteHubAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The name of the Hub to delete.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteHubCallable()

public final UnaryCallable<DeleteHubRequest,Operation> deleteHubCallable()

Deletes a single 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   DeleteHubRequest request =
       DeleteHubRequest.newBuilder()
           .setName(HubName.of("[PROJECT]", "[HUB]").toString())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future = hubServiceClient.deleteHubCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteHubRequest,Operation>

deleteHubOperationCallable()

public final OperationCallable<DeleteHubRequest,Empty,OperationMetadata> deleteHubOperationCallable()

Deletes a single 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   DeleteHubRequest request =
       DeleteHubRequest.newBuilder()
           .setName(HubName.of("[PROJECT]", "[HUB]").toString())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Empty, OperationMetadata> future =
       hubServiceClient.deleteHubOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteHubRequest,Empty,OperationMetadata>

deleteSpokeAsync(DeleteSpokeRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteSpokeAsync(DeleteSpokeRequest request)

Deletes a single Spoke.

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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   DeleteSpokeRequest request =
       DeleteSpokeRequest.newBuilder()
           .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
           .setRequestId("requestId693933066")
           .build();
   hubServiceClient.deleteSpokeAsync(request).get();
 }
 
Parameter
Name Description
request DeleteSpokeRequest

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

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteSpokeAsync(SpokeName name)

public final OperationFuture<Empty,OperationMetadata> deleteSpokeAsync(SpokeName name)

Deletes a single Spoke.

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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]");
   hubServiceClient.deleteSpokeAsync(name).get();
 }
 
Parameter
Name Description
name SpokeName

Required. The name of the Spoke to delete.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteSpokeAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteSpokeAsync(String name)

Deletes a single Spoke.

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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   String name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
   hubServiceClient.deleteSpokeAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The name of the Spoke to delete.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteSpokeCallable()

public final UnaryCallable<DeleteSpokeRequest,Operation> deleteSpokeCallable()

Deletes a single Spoke.

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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   DeleteSpokeRequest request =
       DeleteSpokeRequest.newBuilder()
           .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future = hubServiceClient.deleteSpokeCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteSpokeRequest,Operation>

deleteSpokeOperationCallable()

public final OperationCallable<DeleteSpokeRequest,Empty,OperationMetadata> deleteSpokeOperationCallable()

Deletes a single Spoke.

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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   DeleteSpokeRequest request =
       DeleteSpokeRequest.newBuilder()
           .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Empty, OperationMetadata> future =
       hubServiceClient.deleteSpokeOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteSpokeRequest,Empty,OperationMetadata>

getHub(GetHubRequest request)

public final Hub getHub(GetHubRequest request)

Gets details of a single 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   GetHubRequest request =
       GetHubRequest.newBuilder().setName(HubName.of("[PROJECT]", "[HUB]").toString()).build();
   Hub response = hubServiceClient.getHub(request);
 }
 
Parameter
Name Description
request GetHubRequest

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

Returns
Type Description
Hub

getHub(HubName name)

public final Hub getHub(HubName name)

Gets details of a single 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   HubName name = HubName.of("[PROJECT]", "[HUB]");
   Hub response = hubServiceClient.getHub(name);
 }
 
Parameter
Name Description
name HubName

Required. Name of the Hub resource to get.

Returns
Type Description
Hub

getHub(String name)

public final Hub getHub(String name)

Gets details of a single 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   String name = HubName.of("[PROJECT]", "[HUB]").toString();
   Hub response = hubServiceClient.getHub(name);
 }
 
Parameter
Name Description
name String

Required. Name of the Hub resource to get.

Returns
Type Description
Hub

getHubCallable()

public final UnaryCallable<GetHubRequest,Hub> getHubCallable()

Gets details of a single 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   GetHubRequest request =
       GetHubRequest.newBuilder().setName(HubName.of("[PROJECT]", "[HUB]").toString()).build();
   ApiFuture<Hub> future = hubServiceClient.getHubCallable().futureCall(request);
   // Do something.
   Hub response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetHubRequest,Hub>

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.

Returns
Type Description
OperationsClient

getSettings()

public final HubServiceSettings getSettings()
Returns
Type Description
HubServiceSettings

getSpoke(GetSpokeRequest request)

public final Spoke getSpoke(GetSpokeRequest request)

Gets details of a single Spoke.

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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   GetSpokeRequest request =
       GetSpokeRequest.newBuilder()
           .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
           .build();
   Spoke response = hubServiceClient.getSpoke(request);
 }
 
Parameter
Name Description
request GetSpokeRequest

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

Returns
Type Description
Spoke

getSpoke(SpokeName name)

public final Spoke getSpoke(SpokeName name)

Gets details of a single Spoke.

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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]");
   Spoke response = hubServiceClient.getSpoke(name);
 }
 
Parameter
Name Description
name SpokeName

Required. The name of Spoke resource.

Returns
Type Description
Spoke

getSpoke(String name)

public final Spoke getSpoke(String name)

Gets details of a single Spoke.

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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   String name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
   Spoke response = hubServiceClient.getSpoke(name);
 }
 
Parameter
Name Description
name String

Required. The name of Spoke resource.

Returns
Type Description
Spoke

getSpokeCallable()

public final UnaryCallable<GetSpokeRequest,Spoke> getSpokeCallable()

Gets details of a single Spoke.

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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   GetSpokeRequest request =
       GetSpokeRequest.newBuilder()
           .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
           .build();
   ApiFuture<Spoke> future = hubServiceClient.getSpokeCallable().futureCall(request);
   // Do something.
   Spoke response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetSpokeRequest,Spoke>

getStub()

public HubServiceStub getStub()
Returns
Type Description
HubServiceStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listHubs(ListHubsRequest request)

public final HubServiceClient.ListHubsPagedResponse listHubs(ListHubsRequest request)

Lists Hubs in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   ListHubsRequest request =
       ListHubsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   for (Hub element : hubServiceClient.listHubs(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListHubsRequest

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

Returns
Type Description
HubServiceClient.ListHubsPagedResponse

listHubs(LocationName parent)

public final HubServiceClient.ListHubsPagedResponse listHubs(LocationName parent)

Lists Hubs in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (Hub element : hubServiceClient.listHubs(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent LocationName

Required. The parent resource's name.

Returns
Type Description
HubServiceClient.ListHubsPagedResponse

listHubs(String parent)

public final HubServiceClient.ListHubsPagedResponse listHubs(String parent)

Lists Hubs in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (Hub element : hubServiceClient.listHubs(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent resource's name.

Returns
Type Description
HubServiceClient.ListHubsPagedResponse

listHubsCallable()

public final UnaryCallable<ListHubsRequest,ListHubsResponse> listHubsCallable()

Lists Hubs in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   ListHubsRequest request =
       ListHubsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListHubsResponse response = hubServiceClient.listHubsCallable().call(request);
     for (Hub element : response.getHubsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListHubsRequest,ListHubsResponse>

listHubsPagedCallable()

public final UnaryCallable<ListHubsRequest,HubServiceClient.ListHubsPagedResponse> listHubsPagedCallable()

Lists Hubs in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   ListHubsRequest request =
       ListHubsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<Hub> future = hubServiceClient.listHubsPagedCallable().futureCall(request);
   // Do something.
   for (Hub element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListHubsRequest,ListHubsPagedResponse>

listSpokes(ListSpokesRequest request)

public final HubServiceClient.ListSpokesPagedResponse listSpokes(ListSpokesRequest request)

Lists Spokes in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   ListSpokesRequest request =
       ListSpokesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   for (Spoke element : hubServiceClient.listSpokes(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListSpokesRequest

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

Returns
Type Description
HubServiceClient.ListSpokesPagedResponse

listSpokes(LocationName parent)

public final HubServiceClient.ListSpokesPagedResponse listSpokes(LocationName parent)

Lists Spokes in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (Spoke element : hubServiceClient.listSpokes(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent LocationName

Required. The parent's resource name.

Returns
Type Description
HubServiceClient.ListSpokesPagedResponse

listSpokes(String parent)

public final HubServiceClient.ListSpokesPagedResponse listSpokes(String parent)

Lists Spokes in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (Spoke element : hubServiceClient.listSpokes(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent's resource name.

Returns
Type Description
HubServiceClient.ListSpokesPagedResponse

listSpokesCallable()

public final UnaryCallable<ListSpokesRequest,ListSpokesResponse> listSpokesCallable()

Lists Spokes in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   ListSpokesRequest request =
       ListSpokesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListSpokesResponse response = hubServiceClient.listSpokesCallable().call(request);
     for (Spoke element : response.getSpokesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListSpokesRequest,ListSpokesResponse>

listSpokesPagedCallable()

public final UnaryCallable<ListSpokesRequest,HubServiceClient.ListSpokesPagedResponse> listSpokesPagedCallable()

Lists Spokes in a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   ListSpokesRequest request =
       ListSpokesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<Spoke> future = hubServiceClient.listSpokesPagedCallable().futureCall(request);
   // Do something.
   for (Spoke element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListSpokesRequest,ListSpokesPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateHubAsync(Hub hub, FieldMask updateMask)

public final OperationFuture<Hub,OperationMetadata> updateHubAsync(Hub hub, FieldMask updateMask)

Updates the parameters of a single 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   Hub hub = Hub.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Hub response = hubServiceClient.updateHubAsync(hub, updateMask).get();
 }
 
Parameters
Name Description
hub Hub

Required. The state that the Hub should be in after the update.

updateMask FieldMask

Optional. Field mask is used to specify the fields to be overwritten in the Hub resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

Returns
Type Description
OperationFuture<Hub,OperationMetadata>

updateHubAsync(UpdateHubRequest request)

public final OperationFuture<Hub,OperationMetadata> updateHubAsync(UpdateHubRequest request)

Updates the parameters of a single 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   UpdateHubRequest request =
       UpdateHubRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setHub(Hub.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   Hub response = hubServiceClient.updateHubAsync(request).get();
 }
 
Parameter
Name Description
request UpdateHubRequest

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

Returns
Type Description
OperationFuture<Hub,OperationMetadata>

updateHubCallable()

public final UnaryCallable<UpdateHubRequest,Operation> updateHubCallable()

Updates the parameters of a single 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   UpdateHubRequest request =
       UpdateHubRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setHub(Hub.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future = hubServiceClient.updateHubCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateHubRequest,Operation>

updateHubOperationCallable()

public final OperationCallable<UpdateHubRequest,Hub,OperationMetadata> updateHubOperationCallable()

Updates the parameters of a single 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   UpdateHubRequest request =
       UpdateHubRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setHub(Hub.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Hub, OperationMetadata> future =
       hubServiceClient.updateHubOperationCallable().futureCall(request);
   // Do something.
   Hub response = future.get();
 }
 
Returns
Type Description
OperationCallable<UpdateHubRequest,Hub,OperationMetadata>

updateSpokeAsync(Spoke spoke, FieldMask updateMask)

public final OperationFuture<Spoke,OperationMetadata> updateSpokeAsync(Spoke spoke, FieldMask updateMask)

Updates the parameters of a single Spoke.

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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   Spoke spoke = Spoke.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Spoke response = hubServiceClient.updateSpokeAsync(spoke, updateMask).get();
 }
 
Parameters
Name Description
spoke Spoke

Required. The state that the Spoke should be in after the update.

updateMask FieldMask

Optional. Field mask is used to specify the fields to be overwritten in the Spoke resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

Returns
Type Description
OperationFuture<Spoke,OperationMetadata>

updateSpokeAsync(UpdateSpokeRequest request)

public final OperationFuture<Spoke,OperationMetadata> updateSpokeAsync(UpdateSpokeRequest request)

Updates the parameters of a single Spoke.

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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   UpdateSpokeRequest request =
       UpdateSpokeRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setSpoke(Spoke.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   Spoke response = hubServiceClient.updateSpokeAsync(request).get();
 }
 
Parameter
Name Description
request UpdateSpokeRequest

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

Returns
Type Description
OperationFuture<Spoke,OperationMetadata>

updateSpokeCallable()

public final UnaryCallable<UpdateSpokeRequest,Operation> updateSpokeCallable()

Updates the parameters of a single Spoke.

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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   UpdateSpokeRequest request =
       UpdateSpokeRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setSpoke(Spoke.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future = hubServiceClient.updateSpokeCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateSpokeRequest,Operation>

updateSpokeOperationCallable()

public final OperationCallable<UpdateSpokeRequest,Spoke,OperationMetadata> updateSpokeOperationCallable()

Updates the parameters of a single Spoke.

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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
   UpdateSpokeRequest request =
       UpdateSpokeRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setSpoke(Spoke.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Spoke, OperationMetadata> future =
       hubServiceClient.updateSpokeOperationCallable().futureCall(request);
   // Do something.
   Spoke response = future.get();
 }
 
Returns
Type Description
OperationCallable<UpdateSpokeRequest,Spoke,OperationMetadata>