Class AnalyticsHubServiceClient (2.13.0)

public class AnalyticsHubServiceClient implements BackgroundResource

Service Description: The AnalyticsHubService API facilitates data sharing within and across organizations. It allows data providers to publish listings that reference shared datasets. With Analytics Hub, users can discover and search for listings that they have access to. Subscribers can view and subscribe to listings. When you subscribe to a listing, Analytics Hub creates a linked dataset in your project.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   DataExchangeName name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]");
   DataExchange response = analyticsHubServiceClient.getDataExchange(name);
 }
 

Note: close() needs to be called on the AnalyticsHubServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

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 AnalyticsHubServiceSettings 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
 AnalyticsHubServiceSettings analyticsHubServiceSettings =
     AnalyticsHubServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 AnalyticsHubServiceClient analyticsHubServiceClient =
     AnalyticsHubServiceClient.create(analyticsHubServiceSettings);
 

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
 AnalyticsHubServiceSettings analyticsHubServiceSettings =
     AnalyticsHubServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 AnalyticsHubServiceClient analyticsHubServiceClient =
     AnalyticsHubServiceClient.create(analyticsHubServiceSettings);
 

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


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

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

Inheritance

java.lang.Object > AnalyticsHubServiceClient

Implements

BackgroundResource

Static Methods

create()

public static final AnalyticsHubServiceClient create()

Constructs an instance of AnalyticsHubServiceClient with default settings.

Returns
TypeDescription
AnalyticsHubServiceClient
Exceptions
TypeDescription
IOException

create(AnalyticsHubServiceSettings settings)

public static final AnalyticsHubServiceClient create(AnalyticsHubServiceSettings settings)

Constructs an instance of AnalyticsHubServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
NameDescription
settingsAnalyticsHubServiceSettings
Returns
TypeDescription
AnalyticsHubServiceClient
Exceptions
TypeDescription
IOException

create(AnalyticsHubServiceStub stub)

public static final AnalyticsHubServiceClient create(AnalyticsHubServiceStub stub)

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

Parameter
NameDescription
stubAnalyticsHubServiceStub
Returns
TypeDescription
AnalyticsHubServiceClient

Constructors

AnalyticsHubServiceClient(AnalyticsHubServiceSettings settings)

protected AnalyticsHubServiceClient(AnalyticsHubServiceSettings settings)

Constructs an instance of AnalyticsHubServiceClient, 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
NameDescription
settingsAnalyticsHubServiceSettings

AnalyticsHubServiceClient(AnalyticsHubServiceStub stub)

protected AnalyticsHubServiceClient(AnalyticsHubServiceStub stub)
Parameter
NameDescription
stubAnalyticsHubServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

close()

public final void close()

createDataExchange(CreateDataExchangeRequest request)

public final DataExchange createDataExchange(CreateDataExchangeRequest request)

Creates a new data exchange.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   CreateDataExchangeRequest request =
       CreateDataExchangeRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDataExchangeId("dataExchangeId783243752")
           .setDataExchange(DataExchange.newBuilder().build())
           .build();
   DataExchange response = analyticsHubServiceClient.createDataExchange(request);
 }
 
Parameter
NameDescription
requestCreateDataExchangeRequest

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

Returns
TypeDescription
DataExchange

createDataExchange(LocationName parent, DataExchange dataExchange)

public final DataExchange createDataExchange(LocationName parent, DataExchange dataExchange)

Creates a new data exchange.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   DataExchange dataExchange = DataExchange.newBuilder().build();
   DataExchange response = analyticsHubServiceClient.createDataExchange(parent, dataExchange);
 }
 
Parameters
NameDescription
parentLocationName

Required. The parent resource path of the data exchange. e.g. projects/myproject/locations/US.

dataExchangeDataExchange

Required. The data exchange to create.

Returns
TypeDescription
DataExchange

createDataExchange(String parent, DataExchange dataExchange)

public final DataExchange createDataExchange(String parent, DataExchange dataExchange)

Creates a new data exchange.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   DataExchange dataExchange = DataExchange.newBuilder().build();
   DataExchange response = analyticsHubServiceClient.createDataExchange(parent, dataExchange);
 }
 
Parameters
NameDescription
parentString

Required. The parent resource path of the data exchange. e.g. projects/myproject/locations/US.

dataExchangeDataExchange

Required. The data exchange to create.

Returns
TypeDescription
DataExchange

createDataExchangeCallable()

public final UnaryCallable<CreateDataExchangeRequest,DataExchange> createDataExchangeCallable()

Creates a new data exchange.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   CreateDataExchangeRequest request =
       CreateDataExchangeRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDataExchangeId("dataExchangeId783243752")
           .setDataExchange(DataExchange.newBuilder().build())
           .build();
   ApiFuture<DataExchange> future =
       analyticsHubServiceClient.createDataExchangeCallable().futureCall(request);
   // Do something.
   DataExchange response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateDataExchangeRequest,DataExchange>

createListing(CreateListingRequest request)

public final Listing createListing(CreateListingRequest request)

Creates a new listing.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   CreateListingRequest request =
       CreateListingRequest.newBuilder()
           .setParent(
               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
           .setListingId("listingId-1215024449")
           .setListing(Listing.newBuilder().build())
           .build();
   Listing response = analyticsHubServiceClient.createListing(request);
 }
 
Parameter
NameDescription
requestCreateListingRequest

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

Returns
TypeDescription
Listing

createListing(DataExchangeName parent, Listing listing)

public final Listing createListing(DataExchangeName parent, Listing listing)

Creates a new listing.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   DataExchangeName parent = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]");
   Listing listing = Listing.newBuilder().build();
   Listing response = analyticsHubServiceClient.createListing(parent, listing);
 }
 
Parameters
NameDescription
parentDataExchangeName

Required. The parent resource path of the listing. e.g. projects/myproject/locations/US/dataExchanges/123.

listingListing

Required. The listing to create.

Returns
TypeDescription
Listing

createListing(String parent, Listing listing)

public final Listing createListing(String parent, Listing listing)

Creates a new listing.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   String parent = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString();
   Listing listing = Listing.newBuilder().build();
   Listing response = analyticsHubServiceClient.createListing(parent, listing);
 }
 
Parameters
NameDescription
parentString

Required. The parent resource path of the listing. e.g. projects/myproject/locations/US/dataExchanges/123.

listingListing

Required. The listing to create.

Returns
TypeDescription
Listing

createListingCallable()

public final UnaryCallable<CreateListingRequest,Listing> createListingCallable()

Creates a new listing.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   CreateListingRequest request =
       CreateListingRequest.newBuilder()
           .setParent(
               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
           .setListingId("listingId-1215024449")
           .setListing(Listing.newBuilder().build())
           .build();
   ApiFuture<Listing> future =
       analyticsHubServiceClient.createListingCallable().futureCall(request);
   // Do something.
   Listing response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateListingRequest,Listing>

deleteDataExchange(DataExchangeName name)

public final void deleteDataExchange(DataExchangeName name)

Deletes an existing data exchange.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   DataExchangeName name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]");
   analyticsHubServiceClient.deleteDataExchange(name);
 }
 
Parameter
NameDescription
nameDataExchangeName

Required. The full name of the data exchange resource that you want to delete. For example, projects/myproject/locations/US/dataExchanges/123.

deleteDataExchange(DeleteDataExchangeRequest request)

public final void deleteDataExchange(DeleteDataExchangeRequest request)

Deletes an existing data exchange.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   DeleteDataExchangeRequest request =
       DeleteDataExchangeRequest.newBuilder()
           .setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
           .build();
   analyticsHubServiceClient.deleteDataExchange(request);
 }
 
Parameter
NameDescription
requestDeleteDataExchangeRequest

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

deleteDataExchange(String name)

public final void deleteDataExchange(String name)

Deletes an existing data exchange.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   String name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString();
   analyticsHubServiceClient.deleteDataExchange(name);
 }
 
Parameter
NameDescription
nameString

Required. The full name of the data exchange resource that you want to delete. For example, projects/myproject/locations/US/dataExchanges/123.

deleteDataExchangeCallable()

public final UnaryCallable<DeleteDataExchangeRequest,Empty> deleteDataExchangeCallable()

Deletes an existing data exchange.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   DeleteDataExchangeRequest request =
       DeleteDataExchangeRequest.newBuilder()
           .setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
           .build();
   ApiFuture<Empty> future =
       analyticsHubServiceClient.deleteDataExchangeCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteDataExchangeRequest,Empty>

deleteListing(DeleteListingRequest request)

public final void deleteListing(DeleteListingRequest request)

Deletes a listing.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   DeleteListingRequest request =
       DeleteListingRequest.newBuilder()
           .setName(
               ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]")
                   .toString())
           .build();
   analyticsHubServiceClient.deleteListing(request);
 }
 
Parameter
NameDescription
requestDeleteListingRequest

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

deleteListing(ListingName name)

public final void deleteListing(ListingName name)

Deletes a listing.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   ListingName name = ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]");
   analyticsHubServiceClient.deleteListing(name);
 }
 
Parameter
NameDescription
nameListingName

Required. Resource name of the listing to delete. e.g. projects/myproject/locations/US/dataExchanges/123/listings/456.

deleteListing(String name)

public final void deleteListing(String name)

Deletes a listing.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   String name =
       ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]").toString();
   analyticsHubServiceClient.deleteListing(name);
 }
 
Parameter
NameDescription
nameString

Required. Resource name of the listing to delete. e.g. projects/myproject/locations/US/dataExchanges/123/listings/456.

deleteListingCallable()

public final UnaryCallable<DeleteListingRequest,Empty> deleteListingCallable()

Deletes a listing.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   DeleteListingRequest request =
       DeleteListingRequest.newBuilder()
           .setName(
               ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]")
                   .toString())
           .build();
   ApiFuture<Empty> future =
       analyticsHubServiceClient.deleteListingCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteListingRequest,Empty>

getDataExchange(DataExchangeName name)

public final DataExchange getDataExchange(DataExchangeName name)

Gets the details of a data exchange.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   DataExchangeName name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]");
   DataExchange response = analyticsHubServiceClient.getDataExchange(name);
 }
 
Parameter
NameDescription
nameDataExchangeName

Required. The resource name of the data exchange. e.g. projects/myproject/locations/US/dataExchanges/123.

Returns
TypeDescription
DataExchange

getDataExchange(GetDataExchangeRequest request)

public final DataExchange getDataExchange(GetDataExchangeRequest request)

Gets the details of a data exchange.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   GetDataExchangeRequest request =
       GetDataExchangeRequest.newBuilder()
           .setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
           .build();
   DataExchange response = analyticsHubServiceClient.getDataExchange(request);
 }
 
Parameter
NameDescription
requestGetDataExchangeRequest

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

Returns
TypeDescription
DataExchange

getDataExchange(String name)

public final DataExchange getDataExchange(String name)

Gets the details of a data exchange.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   String name = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString();
   DataExchange response = analyticsHubServiceClient.getDataExchange(name);
 }
 
Parameter
NameDescription
nameString

Required. The resource name of the data exchange. e.g. projects/myproject/locations/US/dataExchanges/123.

Returns
TypeDescription
DataExchange

getDataExchangeCallable()

public final UnaryCallable<GetDataExchangeRequest,DataExchange> getDataExchangeCallable()

Gets the details of a data exchange.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   GetDataExchangeRequest request =
       GetDataExchangeRequest.newBuilder()
           .setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
           .build();
   ApiFuture<DataExchange> future =
       analyticsHubServiceClient.getDataExchangeCallable().futureCall(request);
   // Do something.
   DataExchange response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetDataExchangeRequest,DataExchange>

getIamPolicy(GetIamPolicyRequest request)

public final Policy getIamPolicy(GetIamPolicyRequest request)

Gets the IAM policy.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(
               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   Policy response = analyticsHubServiceClient.getIamPolicy(request);
 }
 
Parameter
NameDescription
requestcom.google.iam.v1.GetIamPolicyRequest

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

Returns
TypeDescription
com.google.iam.v1.Policy

getIamPolicyCallable()

public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

Gets the IAM policy.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(
               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   ApiFuture<Policy> future =
       analyticsHubServiceClient.getIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>

getListing(GetListingRequest request)

public final Listing getListing(GetListingRequest request)

Gets the details of a listing.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   GetListingRequest request =
       GetListingRequest.newBuilder()
           .setName(
               ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]")
                   .toString())
           .build();
   Listing response = analyticsHubServiceClient.getListing(request);
 }
 
Parameter
NameDescription
requestGetListingRequest

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

Returns
TypeDescription
Listing

getListing(ListingName name)

public final Listing getListing(ListingName name)

Gets the details of a listing.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   ListingName name = ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]");
   Listing response = analyticsHubServiceClient.getListing(name);
 }
 
Parameter
NameDescription
nameListingName

Required. The resource name of the listing. e.g. projects/myproject/locations/US/dataExchanges/123/listings/456.

Returns
TypeDescription
Listing

getListing(String name)

public final Listing getListing(String name)

Gets the details of a listing.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   String name =
       ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]").toString();
   Listing response = analyticsHubServiceClient.getListing(name);
 }
 
Parameter
NameDescription
nameString

Required. The resource name of the listing. e.g. projects/myproject/locations/US/dataExchanges/123/listings/456.

Returns
TypeDescription
Listing

getListingCallable()

public final UnaryCallable<GetListingRequest,Listing> getListingCallable()

Gets the details of a listing.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   GetListingRequest request =
       GetListingRequest.newBuilder()
           .setName(
               ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]")
                   .toString())
           .build();
   ApiFuture<Listing> future =
       analyticsHubServiceClient.getListingCallable().futureCall(request);
   // Do something.
   Listing response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetListingRequest,Listing>

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   Location response = analyticsHubServiceClient.getLocation(request);
 }
 
Parameter
NameDescription
requestcom.google.cloud.location.GetLocationRequest

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

Returns
TypeDescription
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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Location> future =
       analyticsHubServiceClient.getLocationCallable().futureCall(request);
   // Do something.
   Location response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

getSettings()

public final AnalyticsHubServiceSettings getSettings()
Returns
TypeDescription
AnalyticsHubServiceSettings

getStub()

public AnalyticsHubServiceStub getStub()
Returns
TypeDescription
AnalyticsHubServiceStub

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listDataExchanges(ListDataExchangesRequest request)

public final AnalyticsHubServiceClient.ListDataExchangesPagedResponse listDataExchanges(ListDataExchangesRequest request)

Lists all data exchanges 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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   ListDataExchangesRequest request =
       ListDataExchangesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (DataExchange element :
       analyticsHubServiceClient.listDataExchanges(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListDataExchangesRequest

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

Returns
TypeDescription
AnalyticsHubServiceClient.ListDataExchangesPagedResponse

listDataExchanges(LocationName parent)

public final AnalyticsHubServiceClient.ListDataExchangesPagedResponse listDataExchanges(LocationName parent)

Lists all data exchanges 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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (DataExchange element :
       analyticsHubServiceClient.listDataExchanges(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentLocationName

Required. The parent resource path of the data exchanges. e.g. projects/myproject/locations/US.

Returns
TypeDescription
AnalyticsHubServiceClient.ListDataExchangesPagedResponse

listDataExchanges(String parent)

public final AnalyticsHubServiceClient.ListDataExchangesPagedResponse listDataExchanges(String parent)

Lists all data exchanges 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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (DataExchange element :
       analyticsHubServiceClient.listDataExchanges(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. The parent resource path of the data exchanges. e.g. projects/myproject/locations/US.

Returns
TypeDescription
AnalyticsHubServiceClient.ListDataExchangesPagedResponse

listDataExchangesCallable()

public final UnaryCallable<ListDataExchangesRequest,ListDataExchangesResponse> listDataExchangesCallable()

Lists all data exchanges 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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   ListDataExchangesRequest request =
       ListDataExchangesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListDataExchangesResponse response =
         analyticsHubServiceClient.listDataExchangesCallable().call(request);
     for (DataExchange element : response.getDataExchangesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListDataExchangesRequest,ListDataExchangesResponse>

listDataExchangesPagedCallable()

public final UnaryCallable<ListDataExchangesRequest,AnalyticsHubServiceClient.ListDataExchangesPagedResponse> listDataExchangesPagedCallable()

Lists all data exchanges 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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   ListDataExchangesRequest request =
       ListDataExchangesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<DataExchange> future =
       analyticsHubServiceClient.listDataExchangesPagedCallable().futureCall(request);
   // Do something.
   for (DataExchange element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListDataExchangesRequest,ListDataExchangesPagedResponse>

listListings(DataExchangeName parent)

public final AnalyticsHubServiceClient.ListListingsPagedResponse listListings(DataExchangeName parent)

Lists all listings 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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   DataExchangeName parent = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]");
   for (Listing element : analyticsHubServiceClient.listListings(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentDataExchangeName

Required. The parent resource path of the listing. e.g. projects/myproject/locations/US/dataExchanges/123.

Returns
TypeDescription
AnalyticsHubServiceClient.ListListingsPagedResponse

listListings(ListListingsRequest request)

public final AnalyticsHubServiceClient.ListListingsPagedResponse listListings(ListListingsRequest request)

Lists all listings 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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   ListListingsRequest request =
       ListListingsRequest.newBuilder()
           .setParent(
               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Listing element : analyticsHubServiceClient.listListings(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListListingsRequest

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

Returns
TypeDescription
AnalyticsHubServiceClient.ListListingsPagedResponse

listListings(String parent)

public final AnalyticsHubServiceClient.ListListingsPagedResponse listListings(String parent)

Lists all listings 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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   String parent = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString();
   for (Listing element : analyticsHubServiceClient.listListings(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. The parent resource path of the listing. e.g. projects/myproject/locations/US/dataExchanges/123.

Returns
TypeDescription
AnalyticsHubServiceClient.ListListingsPagedResponse

listListingsCallable()

public final UnaryCallable<ListListingsRequest,ListListingsResponse> listListingsCallable()

Lists all listings 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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   ListListingsRequest request =
       ListListingsRequest.newBuilder()
           .setParent(
               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListListingsResponse response =
         analyticsHubServiceClient.listListingsCallable().call(request);
     for (Listing element : response.getListingsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListListingsRequest,ListListingsResponse>

listListingsPagedCallable()

public final UnaryCallable<ListListingsRequest,AnalyticsHubServiceClient.ListListingsPagedResponse> listListingsPagedCallable()

Lists all listings 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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   ListListingsRequest request =
       ListListingsRequest.newBuilder()
           .setParent(
               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Listing> future =
       analyticsHubServiceClient.listListingsPagedCallable().futureCall(request);
   // Do something.
   for (Listing element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListListingsRequest,ListListingsPagedResponse>

listLocations(ListLocationsRequest request)

public final AnalyticsHubServiceClient.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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Location element : analyticsHubServiceClient.listLocations(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestcom.google.cloud.location.ListLocationsRequest

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

Returns
TypeDescription
AnalyticsHubServiceClient.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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListLocationsResponse response =
         analyticsHubServiceClient.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
TypeDescription
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

listLocationsPagedCallable()

public final UnaryCallable<ListLocationsRequest,AnalyticsHubServiceClient.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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Location> future =
       analyticsHubServiceClient.listLocationsPagedCallable().futureCall(request);
   // Do something.
   for (Location element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

listOrgDataExchanges(ListOrgDataExchangesRequest request)

public final AnalyticsHubServiceClient.ListOrgDataExchangesPagedResponse listOrgDataExchanges(ListOrgDataExchangesRequest request)

Lists all data exchanges from projects in a given organization 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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   ListOrgDataExchangesRequest request =
       ListOrgDataExchangesRequest.newBuilder()
           .setOrganization("organization1178922291")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (DataExchange element :
       analyticsHubServiceClient.listOrgDataExchanges(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListOrgDataExchangesRequest

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

Returns
TypeDescription
AnalyticsHubServiceClient.ListOrgDataExchangesPagedResponse

listOrgDataExchanges(String organization)

public final AnalyticsHubServiceClient.ListOrgDataExchangesPagedResponse listOrgDataExchanges(String organization)

Lists all data exchanges from projects in a given organization 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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   String organization = "organization1178922291";
   for (DataExchange element :
       analyticsHubServiceClient.listOrgDataExchanges(organization).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
organizationString

Required. The organization resource path of the projects containing DataExchanges. e.g. organizations/myorg/locations/US.

Returns
TypeDescription
AnalyticsHubServiceClient.ListOrgDataExchangesPagedResponse

listOrgDataExchangesCallable()

public final UnaryCallable<ListOrgDataExchangesRequest,ListOrgDataExchangesResponse> listOrgDataExchangesCallable()

Lists all data exchanges from projects in a given organization 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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   ListOrgDataExchangesRequest request =
       ListOrgDataExchangesRequest.newBuilder()
           .setOrganization("organization1178922291")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListOrgDataExchangesResponse response =
         analyticsHubServiceClient.listOrgDataExchangesCallable().call(request);
     for (DataExchange element : response.getDataExchangesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListOrgDataExchangesRequest,ListOrgDataExchangesResponse>

listOrgDataExchangesPagedCallable()

public final UnaryCallable<ListOrgDataExchangesRequest,AnalyticsHubServiceClient.ListOrgDataExchangesPagedResponse> listOrgDataExchangesPagedCallable()

Lists all data exchanges from projects in a given organization 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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   ListOrgDataExchangesRequest request =
       ListOrgDataExchangesRequest.newBuilder()
           .setOrganization("organization1178922291")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<DataExchange> future =
       analyticsHubServiceClient.listOrgDataExchangesPagedCallable().futureCall(request);
   // Do something.
   for (DataExchange element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListOrgDataExchangesRequest,ListOrgDataExchangesPagedResponse>

setIamPolicy(SetIamPolicyRequest request)

public final Policy setIamPolicy(SetIamPolicyRequest request)

Sets the IAM policy.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(
               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
           .setPolicy(Policy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Policy response = analyticsHubServiceClient.setIamPolicy(request);
 }
 
Parameter
NameDescription
requestcom.google.iam.v1.SetIamPolicyRequest

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

Returns
TypeDescription
com.google.iam.v1.Policy

setIamPolicyCallable()

public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

Sets the IAM policy.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(
               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
           .setPolicy(Policy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Policy> future =
       analyticsHubServiceClient.setIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

subscribeListing(ListingName name)

public final SubscribeListingResponse subscribeListing(ListingName name)

Subscribes to a listing.

Currently, with Analytics Hub, you can create listings that reference only BigQuery datasets. Upon subscription to a listing for a BigQuery dataset, Analytics Hub creates a linked dataset in the subscriber's project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   ListingName name = ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]");
   SubscribeListingResponse response = analyticsHubServiceClient.subscribeListing(name);
 }
 
Parameter
NameDescription
nameListingName

Required. Resource name of the listing that you want to subscribe to. e.g. projects/myproject/locations/US/dataExchanges/123/listings/456.

Returns
TypeDescription
SubscribeListingResponse

subscribeListing(SubscribeListingRequest request)

public final SubscribeListingResponse subscribeListing(SubscribeListingRequest request)

Subscribes to a listing.

Currently, with Analytics Hub, you can create listings that reference only BigQuery datasets. Upon subscription to a listing for a BigQuery dataset, Analytics Hub creates a linked dataset in the subscriber's project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   SubscribeListingRequest request =
       SubscribeListingRequest.newBuilder()
           .setName(
               ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]")
                   .toString())
           .build();
   SubscribeListingResponse response = analyticsHubServiceClient.subscribeListing(request);
 }
 
Parameter
NameDescription
requestSubscribeListingRequest

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

Returns
TypeDescription
SubscribeListingResponse

subscribeListing(String name)

public final SubscribeListingResponse subscribeListing(String name)

Subscribes to a listing.

Currently, with Analytics Hub, you can create listings that reference only BigQuery datasets. Upon subscription to a listing for a BigQuery dataset, Analytics Hub creates a linked dataset in the subscriber's project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   String name =
       ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]").toString();
   SubscribeListingResponse response = analyticsHubServiceClient.subscribeListing(name);
 }
 
Parameter
NameDescription
nameString

Required. Resource name of the listing that you want to subscribe to. e.g. projects/myproject/locations/US/dataExchanges/123/listings/456.

Returns
TypeDescription
SubscribeListingResponse

subscribeListingCallable()

public final UnaryCallable<SubscribeListingRequest,SubscribeListingResponse> subscribeListingCallable()

Subscribes to a listing.

Currently, with Analytics Hub, you can create listings that reference only BigQuery datasets. Upon subscription to a listing for a BigQuery dataset, Analytics Hub creates a linked dataset in the subscriber's project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   SubscribeListingRequest request =
       SubscribeListingRequest.newBuilder()
           .setName(
               ListingName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]", "[LISTING]")
                   .toString())
           .build();
   ApiFuture<SubscribeListingResponse> future =
       analyticsHubServiceClient.subscribeListingCallable().futureCall(request);
   // Do something.
   SubscribeListingResponse response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<SubscribeListingRequest,SubscribeListingResponse>

testIamPermissions(TestIamPermissionsRequest request)

public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)

Returns the permissions that a caller has.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(
               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   TestIamPermissionsResponse response = analyticsHubServiceClient.testIamPermissions(request);
 }
 
Parameter
NameDescription
requestcom.google.iam.v1.TestIamPermissionsRequest

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

Returns
TypeDescription
com.google.iam.v1.TestIamPermissionsResponse

testIamPermissionsCallable()

public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()

Returns the permissions that a caller has.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(
               DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   ApiFuture<TestIamPermissionsResponse> future =
       analyticsHubServiceClient.testIamPermissionsCallable().futureCall(request);
   // Do something.
   TestIamPermissionsResponse response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>

updateDataExchange(DataExchange dataExchange, FieldMask updateMask)

public final DataExchange updateDataExchange(DataExchange dataExchange, FieldMask updateMask)

Updates an existing data exchange.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   DataExchange dataExchange = DataExchange.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   DataExchange response =
       analyticsHubServiceClient.updateDataExchange(dataExchange, updateMask);
 }
 
Parameters
NameDescription
dataExchangeDataExchange

Required. The data exchange to update.

updateMaskFieldMask

Required. Field mask specifies the fields to update in the data exchange resource. The fields specified in the updateMask are relative to the resource and are not a full request.

Returns
TypeDescription
DataExchange

updateDataExchange(UpdateDataExchangeRequest request)

public final DataExchange updateDataExchange(UpdateDataExchangeRequest request)

Updates an existing data exchange.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   UpdateDataExchangeRequest request =
       UpdateDataExchangeRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setDataExchange(DataExchange.newBuilder().build())
           .build();
   DataExchange response = analyticsHubServiceClient.updateDataExchange(request);
 }
 
Parameter
NameDescription
requestUpdateDataExchangeRequest

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

Returns
TypeDescription
DataExchange

updateDataExchangeCallable()

public final UnaryCallable<UpdateDataExchangeRequest,DataExchange> updateDataExchangeCallable()

Updates an existing data exchange.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   UpdateDataExchangeRequest request =
       UpdateDataExchangeRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setDataExchange(DataExchange.newBuilder().build())
           .build();
   ApiFuture<DataExchange> future =
       analyticsHubServiceClient.updateDataExchangeCallable().futureCall(request);
   // Do something.
   DataExchange response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateDataExchangeRequest,DataExchange>

updateListing(Listing listing, FieldMask updateMask)

public final Listing updateListing(Listing listing, FieldMask updateMask)

Updates an existing listing.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   Listing listing = Listing.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Listing response = analyticsHubServiceClient.updateListing(listing, updateMask);
 }
 
Parameters
NameDescription
listingListing

Required. The listing to update.

updateMaskFieldMask

Required. Field mask specifies the fields to update in the listing resource. The fields specified in the updateMask are relative to the resource and are not a full request.

Returns
TypeDescription
Listing

updateListing(UpdateListingRequest request)

public final Listing updateListing(UpdateListingRequest request)

Updates an existing listing.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   UpdateListingRequest request =
       UpdateListingRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setListing(Listing.newBuilder().build())
           .build();
   Listing response = analyticsHubServiceClient.updateListing(request);
 }
 
Parameter
NameDescription
requestUpdateListingRequest

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

Returns
TypeDescription
Listing

updateListingCallable()

public final UnaryCallable<UpdateListingRequest,Listing> updateListingCallable()

Updates an existing listing.

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 (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
   UpdateListingRequest request =
       UpdateListingRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setListing(Listing.newBuilder().build())
           .build();
   ApiFuture<Listing> future =
       analyticsHubServiceClient.updateListingCallable().futureCall(request);
   // Do something.
   Listing response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateListingRequest,Listing>