@Generated(value="by gapic-generator-java") public class AnalyticsHubServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
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().
| Method | Description | Method Variants |
|---|---|---|
ListDataExchanges |
Lists all data exchanges in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListOrgDataExchanges |
Lists all data exchanges from projects in a given organization and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetDataExchange |
Gets the details of a data exchange. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateDataExchange |
Creates a new data exchange. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateDataExchange |
Updates an existing data exchange. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteDataExchange |
Deletes an existing data exchange. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListListings |
Lists all listings in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetListing |
Gets the details of a listing. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateListing |
Creates a new listing. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateListing |
Updates an existing listing. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteListing |
Deletes a listing. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SubscribeListing |
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. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SubscribeDataExchange |
Creates a Subscription to a Data Clean Room. This is a long-running operation as it will create one or more linked datasets. Throws a Bad Request error if the Data Exchange does not contain any listings. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RefreshSubscription |
Refreshes a Subscription to a Data Exchange. A Data Exchange can become stale when a publisher adds or removes data. This is a long-running operation as it may create many linked datasets. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetSubscription |
Gets the details of a Subscription. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListSubscriptions |
Lists all subscriptions in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListSharedResourceSubscriptions |
Lists all subscriptions on a given Data Exchange or Listing. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RevokeSubscription |
Revokes a given subscription. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteSubscription |
Deletes a subscription. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIamPolicy |
Gets the IAM policy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the IAM policy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
TestIamPermissions |
Returns the permissions that a caller has. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return 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.
| Modifier | Constructor and Description |
|---|---|
protected |
AnalyticsHubServiceClient(AnalyticsHubServiceSettings settings)
Constructs an instance of AnalyticsHubServiceClient, using the given settings.
|
protected |
AnalyticsHubServiceClient(AnalyticsHubServiceStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static AnalyticsHubServiceClient |
create()
Constructs an instance of AnalyticsHubServiceClient with default settings.
|
static AnalyticsHubServiceClient |
create(AnalyticsHubServiceSettings settings)
Constructs an instance of AnalyticsHubServiceClient, using the given settings.
|
static AnalyticsHubServiceClient |
create(AnalyticsHubServiceStub stub)
Constructs an instance of AnalyticsHubServiceClient, using the given stub for making calls.
|
DataExchange |
createDataExchange(CreateDataExchangeRequest request)
Creates a new data exchange.
|
DataExchange |
createDataExchange(LocationName parent,
DataExchange dataExchange)
Creates a new data exchange.
|
DataExchange |
createDataExchange(String parent,
DataExchange dataExchange)
Creates a new data exchange.
|
com.google.api.gax.rpc.UnaryCallable<CreateDataExchangeRequest,DataExchange> |
createDataExchangeCallable()
Creates a new data exchange.
|
Listing |
createListing(CreateListingRequest request)
Creates a new listing.
|
Listing |
createListing(DataExchangeName parent,
Listing listing)
Creates a new listing.
|
Listing |
createListing(String parent,
Listing listing)
Creates a new listing.
|
com.google.api.gax.rpc.UnaryCallable<CreateListingRequest,Listing> |
createListingCallable()
Creates a new listing.
|
void |
deleteDataExchange(DataExchangeName name)
Deletes an existing data exchange.
|
void |
deleteDataExchange(DeleteDataExchangeRequest request)
Deletes an existing data exchange.
|
void |
deleteDataExchange(String name)
Deletes an existing data exchange.
|
com.google.api.gax.rpc.UnaryCallable<DeleteDataExchangeRequest,com.google.protobuf.Empty> |
deleteDataExchangeCallable()
Deletes an existing data exchange.
|
void |
deleteListing(DeleteListingRequest request)
Deletes a listing.
|
void |
deleteListing(ListingName name)
Deletes a listing.
|
void |
deleteListing(String name)
Deletes a listing.
|
com.google.api.gax.rpc.UnaryCallable<DeleteListingRequest,com.google.protobuf.Empty> |
deleteListingCallable()
Deletes a listing.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteSubscriptionAsync(DeleteSubscriptionRequest request)
Deletes a subscription.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteSubscriptionAsync(String name)
Deletes a subscription.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteSubscriptionAsync(SubscriptionName name)
Deletes a subscription.
|
com.google.api.gax.rpc.UnaryCallable<DeleteSubscriptionRequest,com.google.longrunning.Operation> |
deleteSubscriptionCallable()
Deletes a subscription.
|
com.google.api.gax.rpc.OperationCallable<DeleteSubscriptionRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteSubscriptionOperationCallable()
Deletes a subscription.
|
DataExchange |
getDataExchange(DataExchangeName name)
Gets the details of a data exchange.
|
DataExchange |
getDataExchange(GetDataExchangeRequest request)
Gets the details of a data exchange.
|
DataExchange |
getDataExchange(String name)
Gets the details of a data exchange.
|
com.google.api.gax.rpc.UnaryCallable<GetDataExchangeRequest,DataExchange> |
getDataExchangeCallable()
Gets the details of a data exchange.
|
com.google.api.gax.httpjson.longrunning.OperationsClient |
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
com.google.iam.v1.Policy |
getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Gets the IAM policy.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> |
getIamPolicyCallable()
Gets the IAM policy.
|
Listing |
getListing(GetListingRequest request)
Gets the details of a listing.
|
Listing |
getListing(ListingName name)
Gets the details of a listing.
|
Listing |
getListing(String name)
Gets the details of a listing.
|
com.google.api.gax.rpc.UnaryCallable<GetListingRequest,Listing> |
getListingCallable()
Gets the details of a listing.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
AnalyticsHubServiceSettings |
getSettings() |
AnalyticsHubServiceStub |
getStub() |
Subscription |
getSubscription(GetSubscriptionRequest request)
Gets the details of a Subscription.
|
Subscription |
getSubscription(String name)
Gets the details of a Subscription.
|
Subscription |
getSubscription(SubscriptionName name)
Gets the details of a Subscription.
|
com.google.api.gax.rpc.UnaryCallable<GetSubscriptionRequest,Subscription> |
getSubscriptionCallable()
Gets the details of a Subscription.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
AnalyticsHubServiceClient.ListDataExchangesPagedResponse |
listDataExchanges(ListDataExchangesRequest request)
Lists all data exchanges in a given project and location.
|
AnalyticsHubServiceClient.ListDataExchangesPagedResponse |
listDataExchanges(LocationName parent)
Lists all data exchanges in a given project and location.
|
AnalyticsHubServiceClient.ListDataExchangesPagedResponse |
listDataExchanges(String parent)
Lists all data exchanges in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListDataExchangesRequest,ListDataExchangesResponse> |
listDataExchangesCallable()
Lists all data exchanges in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListDataExchangesRequest,AnalyticsHubServiceClient.ListDataExchangesPagedResponse> |
listDataExchangesPagedCallable()
Lists all data exchanges in a given project and location.
|
AnalyticsHubServiceClient.ListListingsPagedResponse |
listListings(DataExchangeName parent)
Lists all listings in a given project and location.
|
AnalyticsHubServiceClient.ListListingsPagedResponse |
listListings(ListListingsRequest request)
Lists all listings in a given project and location.
|
AnalyticsHubServiceClient.ListListingsPagedResponse |
listListings(String parent)
Lists all listings in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListListingsRequest,ListListingsResponse> |
listListingsCallable()
Lists all listings in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListListingsRequest,AnalyticsHubServiceClient.ListListingsPagedResponse> |
listListingsPagedCallable()
Lists all listings in a given project and location.
|
AnalyticsHubServiceClient.ListOrgDataExchangesPagedResponse |
listOrgDataExchanges(ListOrgDataExchangesRequest request)
Lists all data exchanges from projects in a given organization and location.
|
AnalyticsHubServiceClient.ListOrgDataExchangesPagedResponse |
listOrgDataExchanges(String organization)
Lists all data exchanges from projects in a given organization and location.
|
com.google.api.gax.rpc.UnaryCallable<ListOrgDataExchangesRequest,ListOrgDataExchangesResponse> |
listOrgDataExchangesCallable()
Lists all data exchanges from projects in a given organization and location.
|
com.google.api.gax.rpc.UnaryCallable<ListOrgDataExchangesRequest,AnalyticsHubServiceClient.ListOrgDataExchangesPagedResponse> |
listOrgDataExchangesPagedCallable()
Lists all data exchanges from projects in a given organization and location.
|
AnalyticsHubServiceClient.ListSharedResourceSubscriptionsPagedResponse |
listSharedResourceSubscriptions(ListSharedResourceSubscriptionsRequest request)
Lists all subscriptions on a given Data Exchange or Listing.
|
AnalyticsHubServiceClient.ListSharedResourceSubscriptionsPagedResponse |
listSharedResourceSubscriptions(com.google.api.resourcenames.ResourceName resource)
Lists all subscriptions on a given Data Exchange or Listing.
|
AnalyticsHubServiceClient.ListSharedResourceSubscriptionsPagedResponse |
listSharedResourceSubscriptions(String resource)
Lists all subscriptions on a given Data Exchange or Listing.
|
com.google.api.gax.rpc.UnaryCallable<ListSharedResourceSubscriptionsRequest,ListSharedResourceSubscriptionsResponse> |
listSharedResourceSubscriptionsCallable()
Lists all subscriptions on a given Data Exchange or Listing.
|
com.google.api.gax.rpc.UnaryCallable<ListSharedResourceSubscriptionsRequest,AnalyticsHubServiceClient.ListSharedResourceSubscriptionsPagedResponse> |
listSharedResourceSubscriptionsPagedCallable()
Lists all subscriptions on a given Data Exchange or Listing.
|
AnalyticsHubServiceClient.ListSubscriptionsPagedResponse |
listSubscriptions(ListSubscriptionsRequest request)
Lists all subscriptions in a given project and location.
|
AnalyticsHubServiceClient.ListSubscriptionsPagedResponse |
listSubscriptions(LocationName parent)
Lists all subscriptions in a given project and location.
|
AnalyticsHubServiceClient.ListSubscriptionsPagedResponse |
listSubscriptions(String parent)
Lists all subscriptions in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListSubscriptionsRequest,ListSubscriptionsResponse> |
listSubscriptionsCallable()
Lists all subscriptions in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListSubscriptionsRequest,AnalyticsHubServiceClient.ListSubscriptionsPagedResponse> |
listSubscriptionsPagedCallable()
Lists all subscriptions in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<RefreshSubscriptionResponse,OperationMetadata> |
refreshSubscriptionAsync(RefreshSubscriptionRequest request)
Refreshes a Subscription to a Data Exchange.
|
com.google.api.gax.longrunning.OperationFuture<RefreshSubscriptionResponse,OperationMetadata> |
refreshSubscriptionAsync(String name)
Refreshes a Subscription to a Data Exchange.
|
com.google.api.gax.longrunning.OperationFuture<RefreshSubscriptionResponse,OperationMetadata> |
refreshSubscriptionAsync(SubscriptionName name)
Refreshes a Subscription to a Data Exchange.
|
com.google.api.gax.rpc.UnaryCallable<RefreshSubscriptionRequest,com.google.longrunning.Operation> |
refreshSubscriptionCallable()
Refreshes a Subscription to a Data Exchange.
|
com.google.api.gax.rpc.OperationCallable<RefreshSubscriptionRequest,RefreshSubscriptionResponse,OperationMetadata> |
refreshSubscriptionOperationCallable()
Refreshes a Subscription to a Data Exchange.
|
RevokeSubscriptionResponse |
revokeSubscription(RevokeSubscriptionRequest request)
Revokes a given subscription.
|
RevokeSubscriptionResponse |
revokeSubscription(String name)
Revokes a given subscription.
|
RevokeSubscriptionResponse |
revokeSubscription(SubscriptionName name)
Revokes a given subscription.
|
com.google.api.gax.rpc.UnaryCallable<RevokeSubscriptionRequest,RevokeSubscriptionResponse> |
revokeSubscriptionCallable()
Revokes a given subscription.
|
com.google.iam.v1.Policy |
setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sets the IAM policy.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> |
setIamPolicyCallable()
Sets the IAM policy.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.api.gax.longrunning.OperationFuture<SubscribeDataExchangeResponse,OperationMetadata> |
subscribeDataExchangeAsync(DataExchangeName name)
Creates a Subscription to a Data Clean Room.
|
com.google.api.gax.longrunning.OperationFuture<SubscribeDataExchangeResponse,OperationMetadata> |
subscribeDataExchangeAsync(String name)
Creates a Subscription to a Data Clean Room.
|
com.google.api.gax.longrunning.OperationFuture<SubscribeDataExchangeResponse,OperationMetadata> |
subscribeDataExchangeAsync(SubscribeDataExchangeRequest request)
Creates a Subscription to a Data Clean Room.
|
com.google.api.gax.rpc.UnaryCallable<SubscribeDataExchangeRequest,com.google.longrunning.Operation> |
subscribeDataExchangeCallable()
Creates a Subscription to a Data Clean Room.
|
com.google.api.gax.rpc.OperationCallable<SubscribeDataExchangeRequest,SubscribeDataExchangeResponse,OperationMetadata> |
subscribeDataExchangeOperationCallable()
Creates a Subscription to a Data Clean Room.
|
SubscribeListingResponse |
subscribeListing(ListingName name)
Subscribes to a listing.
|
SubscribeListingResponse |
subscribeListing(String name)
Subscribes to a listing.
|
SubscribeListingResponse |
subscribeListing(SubscribeListingRequest request)
Subscribes to a listing.
|
com.google.api.gax.rpc.UnaryCallable<SubscribeListingRequest,SubscribeListingResponse> |
subscribeListingCallable()
Subscribes to a listing.
|
com.google.iam.v1.TestIamPermissionsResponse |
testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Returns the permissions that a caller has.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> |
testIamPermissionsCallable()
Returns the permissions that a caller has.
|
DataExchange |
updateDataExchange(DataExchange dataExchange,
com.google.protobuf.FieldMask updateMask)
Updates an existing data exchange.
|
DataExchange |
updateDataExchange(UpdateDataExchangeRequest request)
Updates an existing data exchange.
|
com.google.api.gax.rpc.UnaryCallable<UpdateDataExchangeRequest,DataExchange> |
updateDataExchangeCallable()
Updates an existing data exchange.
|
Listing |
updateListing(Listing listing,
com.google.protobuf.FieldMask updateMask)
Updates an existing listing.
|
Listing |
updateListing(UpdateListingRequest request)
Updates an existing listing.
|
com.google.api.gax.rpc.UnaryCallable<UpdateListingRequest,Listing> |
updateListingCallable()
Updates an existing listing.
|
protected AnalyticsHubServiceClient(AnalyticsHubServiceSettings settings) throws IOException
IOExceptionprotected AnalyticsHubServiceClient(AnalyticsHubServiceStub stub)
public static final AnalyticsHubServiceClient create() throws IOException
IOExceptionpublic static final AnalyticsHubServiceClient create(AnalyticsHubServiceSettings settings) throws IOException
IOExceptionpublic static final AnalyticsHubServiceClient create(AnalyticsHubServiceStub stub)
public final AnalyticsHubServiceSettings getSettings()
public AnalyticsHubServiceStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final AnalyticsHubServiceClient.ListDataExchangesPagedResponse listDataExchanges(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
parent - Required. The parent resource path of the data exchanges. e.g.
`projects/myproject/locations/us`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AnalyticsHubServiceClient.ListDataExchangesPagedResponse listDataExchanges(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
parent - Required. The parent resource path of the data exchanges. e.g.
`projects/myproject/locations/us`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AnalyticsHubServiceClient.ListDataExchangesPagedResponse listDataExchanges(ListDataExchangesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListDataExchangesRequest,AnalyticsHubServiceClient.ListDataExchangesPagedResponse> listDataExchangesPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListDataExchangesRequest,ListDataExchangesResponse> listDataExchangesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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;
}
}
}
public final AnalyticsHubServiceClient.ListOrgDataExchangesPagedResponse listOrgDataExchanges(String organization)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
organization - Required. The organization resource path of the projects containing
DataExchanges. e.g. `organizations/myorg/locations/us`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AnalyticsHubServiceClient.ListOrgDataExchangesPagedResponse listOrgDataExchanges(ListOrgDataExchangesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListOrgDataExchangesRequest,AnalyticsHubServiceClient.ListOrgDataExchangesPagedResponse> listOrgDataExchangesPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListOrgDataExchangesRequest,ListOrgDataExchangesResponse> listOrgDataExchangesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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;
}
}
}
public final DataExchange getDataExchange(DataExchangeName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The resource name of the data exchange. e.g.
`projects/myproject/locations/us/dataExchanges/123`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataExchange getDataExchange(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The resource name of the data exchange. e.g.
`projects/myproject/locations/us/dataExchanges/123`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataExchange getDataExchange(GetDataExchangeRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetDataExchangeRequest,DataExchange> getDataExchangeCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final DataExchange createDataExchange(LocationName parent, DataExchange dataExchange)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
parent - Required. The parent resource path of the data exchange. e.g.
`projects/myproject/locations/us`.dataExchange - Required. The data exchange to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataExchange createDataExchange(String parent, DataExchange dataExchange)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
parent - Required. The parent resource path of the data exchange. e.g.
`projects/myproject/locations/us`.dataExchange - Required. The data exchange to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataExchange createDataExchange(CreateDataExchangeRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateDataExchangeRequest,DataExchange> createDataExchangeCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final DataExchange updateDataExchange(DataExchange dataExchange, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
dataExchange - Required. The data exchange to update.updateMask - 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.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataExchange updateDataExchange(UpdateDataExchangeRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateDataExchangeRequest,DataExchange> updateDataExchangeCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final void deleteDataExchange(DataExchangeName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The full name of the data exchange resource that you want to delete. For
example, `projects/myproject/locations/us/dataExchanges/123`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteDataExchange(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The full name of the data exchange resource that you want to delete. For
example, `projects/myproject/locations/us/dataExchanges/123`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteDataExchange(DeleteDataExchangeRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteDataExchangeRequest,com.google.protobuf.Empty> deleteDataExchangeCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final AnalyticsHubServiceClient.ListListingsPagedResponse listListings(DataExchangeName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
parent - Required. The parent resource path of the listing. e.g.
`projects/myproject/locations/us/dataExchanges/123`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AnalyticsHubServiceClient.ListListingsPagedResponse listListings(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
parent - Required. The parent resource path of the listing. e.g.
`projects/myproject/locations/us/dataExchanges/123`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AnalyticsHubServiceClient.ListListingsPagedResponse listListings(ListListingsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListListingsRequest,AnalyticsHubServiceClient.ListListingsPagedResponse> listListingsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListListingsRequest,ListListingsResponse> listListingsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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;
}
}
}
public final Listing getListing(ListingName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The resource name of the listing. e.g.
`projects/myproject/locations/us/dataExchanges/123/listings/456`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Listing getListing(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The resource name of the listing. e.g.
`projects/myproject/locations/us/dataExchanges/123/listings/456`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Listing getListing(GetListingRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetListingRequest,Listing> getListingCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final Listing createListing(DataExchangeName parent, Listing 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);
}
parent - Required. The parent resource path of the listing. e.g.
`projects/myproject/locations/us/dataExchanges/123`.listing - Required. The listing to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Listing createListing(String parent, Listing 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);
}
parent - Required. The parent resource path of the listing. e.g.
`projects/myproject/locations/us/dataExchanges/123`.listing - Required. The listing to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Listing createListing(CreateListingRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateListingRequest,Listing> createListingCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final Listing updateListing(Listing listing, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
listing - Required. The listing to update.updateMask - 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.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Listing updateListing(UpdateListingRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateListingRequest,Listing> updateListingCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final void deleteListing(ListingName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. Resource name of the listing to delete. e.g.
`projects/myproject/locations/us/dataExchanges/123/listings/456`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteListing(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. Resource name of the listing to delete. e.g.
`projects/myproject/locations/us/dataExchanges/123/listings/456`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteListing(DeleteListingRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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())
.setDeleteCommercial(true)
.build();
analyticsHubServiceClient.deleteListing(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteListingRequest,com.google.protobuf.Empty> deleteListingCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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())
.setDeleteCommercial(true)
.build();
ApiFuture<Empty> future =
analyticsHubServiceClient.deleteListingCallable().futureCall(request);
// Do something.
future.get();
}
public final SubscribeListingResponse subscribeListing(ListingName name)
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);
}
name - Required. Resource name of the listing that you want to subscribe to. e.g.
`projects/myproject/locations/us/dataExchanges/123/listings/456`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final SubscribeListingResponse subscribeListing(String name)
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);
}
name - Required. Resource name of the listing that you want to subscribe to. e.g.
`projects/myproject/locations/us/dataExchanges/123/listings/456`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final SubscribeListingResponse subscribeListing(SubscribeListingRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SubscribeListingRequest,SubscribeListingResponse> subscribeListingCallable()
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();
}
public final com.google.api.gax.longrunning.OperationFuture<SubscribeDataExchangeResponse,OperationMetadata> subscribeDataExchangeAsync(DataExchangeName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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]");
SubscribeDataExchangeResponse response =
analyticsHubServiceClient.subscribeDataExchangeAsync(name).get();
}
name - Required. Resource name of the Data Exchange. e.g.
`projects/publisherproject/locations/us/dataExchanges/123`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<SubscribeDataExchangeResponse,OperationMetadata> subscribeDataExchangeAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
SubscribeDataExchangeResponse response =
analyticsHubServiceClient.subscribeDataExchangeAsync(name).get();
}
name - Required. Resource name of the Data Exchange. e.g.
`projects/publisherproject/locations/us/dataExchanges/123`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<SubscribeDataExchangeResponse,OperationMetadata> subscribeDataExchangeAsync(SubscribeDataExchangeRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
SubscribeDataExchangeRequest request =
SubscribeDataExchangeRequest.newBuilder()
.setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
.setDestination(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setDestinationDataset(DestinationDataset.newBuilder().build())
.setSubscription("subscription341203229")
.setSubscriberContact("subscriberContact-847205736")
.build();
SubscribeDataExchangeResponse response =
analyticsHubServiceClient.subscribeDataExchangeAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<SubscribeDataExchangeRequest,SubscribeDataExchangeResponse,OperationMetadata> subscribeDataExchangeOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
SubscribeDataExchangeRequest request =
SubscribeDataExchangeRequest.newBuilder()
.setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
.setDestination(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setDestinationDataset(DestinationDataset.newBuilder().build())
.setSubscription("subscription341203229")
.setSubscriberContact("subscriberContact-847205736")
.build();
OperationFuture<SubscribeDataExchangeResponse, OperationMetadata> future =
analyticsHubServiceClient.subscribeDataExchangeOperationCallable().futureCall(request);
// Do something.
SubscribeDataExchangeResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SubscribeDataExchangeRequest,com.google.longrunning.Operation> subscribeDataExchangeCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
SubscribeDataExchangeRequest request =
SubscribeDataExchangeRequest.newBuilder()
.setName(DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
.setDestination(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setDestinationDataset(DestinationDataset.newBuilder().build())
.setSubscription("subscription341203229")
.setSubscriberContact("subscriberContact-847205736")
.build();
ApiFuture<Operation> future =
analyticsHubServiceClient.subscribeDataExchangeCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<RefreshSubscriptionResponse,OperationMetadata> refreshSubscriptionAsync(SubscriptionName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
SubscriptionName name = SubscriptionName.of("[PROJECT]", "[LOCATION]", "[SUBSCRIPTION]");
RefreshSubscriptionResponse response =
analyticsHubServiceClient.refreshSubscriptionAsync(name).get();
}
name - Required. Resource name of the Subscription to refresh. e.g.
`projects/subscriberproject/locations/us/subscriptions/123`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<RefreshSubscriptionResponse,OperationMetadata> refreshSubscriptionAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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 = SubscriptionName.of("[PROJECT]", "[LOCATION]", "[SUBSCRIPTION]").toString();
RefreshSubscriptionResponse response =
analyticsHubServiceClient.refreshSubscriptionAsync(name).get();
}
name - Required. Resource name of the Subscription to refresh. e.g.
`projects/subscriberproject/locations/us/subscriptions/123`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<RefreshSubscriptionResponse,OperationMetadata> refreshSubscriptionAsync(RefreshSubscriptionRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
RefreshSubscriptionRequest request =
RefreshSubscriptionRequest.newBuilder()
.setName(SubscriptionName.of("[PROJECT]", "[LOCATION]", "[SUBSCRIPTION]").toString())
.build();
RefreshSubscriptionResponse response =
analyticsHubServiceClient.refreshSubscriptionAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<RefreshSubscriptionRequest,RefreshSubscriptionResponse,OperationMetadata> refreshSubscriptionOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
RefreshSubscriptionRequest request =
RefreshSubscriptionRequest.newBuilder()
.setName(SubscriptionName.of("[PROJECT]", "[LOCATION]", "[SUBSCRIPTION]").toString())
.build();
OperationFuture<RefreshSubscriptionResponse, OperationMetadata> future =
analyticsHubServiceClient.refreshSubscriptionOperationCallable().futureCall(request);
// Do something.
RefreshSubscriptionResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<RefreshSubscriptionRequest,com.google.longrunning.Operation> refreshSubscriptionCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
RefreshSubscriptionRequest request =
RefreshSubscriptionRequest.newBuilder()
.setName(SubscriptionName.of("[PROJECT]", "[LOCATION]", "[SUBSCRIPTION]").toString())
.build();
ApiFuture<Operation> future =
analyticsHubServiceClient.refreshSubscriptionCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final Subscription getSubscription(SubscriptionName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
SubscriptionName name = SubscriptionName.of("[PROJECT]", "[LOCATION]", "[SUBSCRIPTION]");
Subscription response = analyticsHubServiceClient.getSubscription(name);
}
name - Required. Resource name of the subscription. e.g.
projects/123/locations/us/subscriptions/456com.google.api.gax.rpc.ApiException - if the remote call failspublic final Subscription getSubscription(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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 = SubscriptionName.of("[PROJECT]", "[LOCATION]", "[SUBSCRIPTION]").toString();
Subscription response = analyticsHubServiceClient.getSubscription(name);
}
name - Required. Resource name of the subscription. e.g.
projects/123/locations/us/subscriptions/456com.google.api.gax.rpc.ApiException - if the remote call failspublic final Subscription getSubscription(GetSubscriptionRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
GetSubscriptionRequest request =
GetSubscriptionRequest.newBuilder()
.setName(SubscriptionName.of("[PROJECT]", "[LOCATION]", "[SUBSCRIPTION]").toString())
.build();
Subscription response = analyticsHubServiceClient.getSubscription(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetSubscriptionRequest,Subscription> getSubscriptionCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
GetSubscriptionRequest request =
GetSubscriptionRequest.newBuilder()
.setName(SubscriptionName.of("[PROJECT]", "[LOCATION]", "[SUBSCRIPTION]").toString())
.build();
ApiFuture<Subscription> future =
analyticsHubServiceClient.getSubscriptionCallable().futureCall(request);
// Do something.
Subscription response = future.get();
}
public final AnalyticsHubServiceClient.ListSubscriptionsPagedResponse listSubscriptions(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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 (Subscription element :
analyticsHubServiceClient.listSubscriptions(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource path of the subscription. e.g.
projects/myproject/locations/uscom.google.api.gax.rpc.ApiException - if the remote call failspublic final AnalyticsHubServiceClient.ListSubscriptionsPagedResponse listSubscriptions(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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 (Subscription element :
analyticsHubServiceClient.listSubscriptions(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource path of the subscription. e.g.
projects/myproject/locations/uscom.google.api.gax.rpc.ApiException - if the remote call failspublic final AnalyticsHubServiceClient.ListSubscriptionsPagedResponse listSubscriptions(ListSubscriptionsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListSubscriptionsRequest request =
ListSubscriptionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Subscription element :
analyticsHubServiceClient.listSubscriptions(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListSubscriptionsRequest,AnalyticsHubServiceClient.ListSubscriptionsPagedResponse> listSubscriptionsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListSubscriptionsRequest request =
ListSubscriptionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Subscription> future =
analyticsHubServiceClient.listSubscriptionsPagedCallable().futureCall(request);
// Do something.
for (Subscription element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListSubscriptionsRequest,ListSubscriptionsResponse> listSubscriptionsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListSubscriptionsRequest request =
ListSubscriptionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListSubscriptionsResponse response =
analyticsHubServiceClient.listSubscriptionsCallable().call(request);
for (Subscription element : response.getSubscriptionsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final AnalyticsHubServiceClient.ListSharedResourceSubscriptionsPagedResponse listSharedResourceSubscriptions(com.google.api.resourcenames.ResourceName resource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
ResourceName resource = DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]");
for (Subscription element :
analyticsHubServiceClient.listSharedResourceSubscriptions(resource).iterateAll()) {
// doThingsWith(element);
}
}
resource - Required. Resource name of the requested target. This resource may be either a
Listing or a DataExchange. e.g. projects/123/locations/us/dataExchanges/456 OR e.g.
projects/123/locations/us/dataExchanges/456/listings/789com.google.api.gax.rpc.ApiException - if the remote call failspublic final AnalyticsHubServiceClient.ListSharedResourceSubscriptionsPagedResponse listSharedResourceSubscriptions(String resource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AnalyticsHubServiceClient analyticsHubServiceClient = AnalyticsHubServiceClient.create()) {
String resource =
DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString();
for (Subscription element :
analyticsHubServiceClient.listSharedResourceSubscriptions(resource).iterateAll()) {
// doThingsWith(element);
}
}
resource - Required. Resource name of the requested target. This resource may be either a
Listing or a DataExchange. e.g. projects/123/locations/us/dataExchanges/456 OR e.g.
projects/123/locations/us/dataExchanges/456/listings/789com.google.api.gax.rpc.ApiException - if the remote call failspublic final AnalyticsHubServiceClient.ListSharedResourceSubscriptionsPagedResponse listSharedResourceSubscriptions(ListSharedResourceSubscriptionsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListSharedResourceSubscriptionsRequest request =
ListSharedResourceSubscriptionsRequest.newBuilder()
.setResource(
DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
.setIncludeDeletedSubscriptions(true)
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Subscription element :
analyticsHubServiceClient.listSharedResourceSubscriptions(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListSharedResourceSubscriptionsRequest,AnalyticsHubServiceClient.ListSharedResourceSubscriptionsPagedResponse> listSharedResourceSubscriptionsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListSharedResourceSubscriptionsRequest request =
ListSharedResourceSubscriptionsRequest.newBuilder()
.setResource(
DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
.setIncludeDeletedSubscriptions(true)
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Subscription> future =
analyticsHubServiceClient
.listSharedResourceSubscriptionsPagedCallable()
.futureCall(request);
// Do something.
for (Subscription element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListSharedResourceSubscriptionsRequest,ListSharedResourceSubscriptionsResponse> listSharedResourceSubscriptionsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListSharedResourceSubscriptionsRequest request =
ListSharedResourceSubscriptionsRequest.newBuilder()
.setResource(
DataExchangeName.of("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]").toString())
.setIncludeDeletedSubscriptions(true)
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListSharedResourceSubscriptionsResponse response =
analyticsHubServiceClient.listSharedResourceSubscriptionsCallable().call(request);
for (Subscription element : response.getSharedResourceSubscriptionsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final RevokeSubscriptionResponse revokeSubscription(SubscriptionName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
SubscriptionName name = SubscriptionName.of("[PROJECT]", "[LOCATION]", "[SUBSCRIPTION]");
RevokeSubscriptionResponse response = analyticsHubServiceClient.revokeSubscription(name);
}
name - Required. Resource name of the subscription to revoke. e.g.
projects/123/locations/us/subscriptions/456com.google.api.gax.rpc.ApiException - if the remote call failspublic final RevokeSubscriptionResponse revokeSubscription(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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 = SubscriptionName.of("[PROJECT]", "[LOCATION]", "[SUBSCRIPTION]").toString();
RevokeSubscriptionResponse response = analyticsHubServiceClient.revokeSubscription(name);
}
name - Required. Resource name of the subscription to revoke. e.g.
projects/123/locations/us/subscriptions/456com.google.api.gax.rpc.ApiException - if the remote call failspublic final RevokeSubscriptionResponse revokeSubscription(RevokeSubscriptionRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
RevokeSubscriptionRequest request =
RevokeSubscriptionRequest.newBuilder()
.setName(SubscriptionName.of("[PROJECT]", "[LOCATION]", "[SUBSCRIPTION]").toString())
.setRevokeCommercial(true)
.build();
RevokeSubscriptionResponse response = analyticsHubServiceClient.revokeSubscription(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<RevokeSubscriptionRequest,RevokeSubscriptionResponse> revokeSubscriptionCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
RevokeSubscriptionRequest request =
RevokeSubscriptionRequest.newBuilder()
.setName(SubscriptionName.of("[PROJECT]", "[LOCATION]", "[SUBSCRIPTION]").toString())
.setRevokeCommercial(true)
.build();
ApiFuture<RevokeSubscriptionResponse> future =
analyticsHubServiceClient.revokeSubscriptionCallable().futureCall(request);
// Do something.
RevokeSubscriptionResponse response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteSubscriptionAsync(SubscriptionName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
SubscriptionName name = SubscriptionName.of("[PROJECT]", "[LOCATION]", "[SUBSCRIPTION]");
analyticsHubServiceClient.deleteSubscriptionAsync(name).get();
}
name - Required. Resource name of the subscription to delete. e.g.
projects/123/locations/us/subscriptions/456com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteSubscriptionAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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 = SubscriptionName.of("[PROJECT]", "[LOCATION]", "[SUBSCRIPTION]").toString();
analyticsHubServiceClient.deleteSubscriptionAsync(name).get();
}
name - Required. Resource name of the subscription to delete. e.g.
projects/123/locations/us/subscriptions/456com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteSubscriptionAsync(DeleteSubscriptionRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
DeleteSubscriptionRequest request =
DeleteSubscriptionRequest.newBuilder()
.setName(SubscriptionName.of("[PROJECT]", "[LOCATION]", "[SUBSCRIPTION]").toString())
.build();
analyticsHubServiceClient.deleteSubscriptionAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteSubscriptionRequest,com.google.protobuf.Empty,OperationMetadata> deleteSubscriptionOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
DeleteSubscriptionRequest request =
DeleteSubscriptionRequest.newBuilder()
.setName(SubscriptionName.of("[PROJECT]", "[LOCATION]", "[SUBSCRIPTION]").toString())
.build();
OperationFuture<Empty, OperationMetadata> future =
analyticsHubServiceClient.deleteSubscriptionOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteSubscriptionRequest,com.google.longrunning.Operation> deleteSubscriptionCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
DeleteSubscriptionRequest request =
DeleteSubscriptionRequest.newBuilder()
.setName(SubscriptionName.of("[PROJECT]", "[LOCATION]", "[SUBSCRIPTION]").toString())
.build();
ApiFuture<Operation> future =
analyticsHubServiceClient.deleteSubscriptionCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> getIamPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> setIamPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2025 Google LLC. All rights reserved.