Class AccountServicesServiceClient (1.0.0)

GitHub RepositoryProduct Reference

Service Description: Service to support AccountService API.

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 (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   AccountServiceName name = AccountServiceName.of("[ACCOUNT]", "[SERVICE]");
   AccountService response = accountServicesServiceClient.getAccountService(name);
 }
 

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

Methods
Method Description Method Variants

GetAccountService

Retrieve an account service.

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

  • getAccountService(GetAccountServiceRequest request)

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

  • getAccountService(AccountServiceName name)

  • getAccountService(String name)

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

  • getAccountServiceCallable()

ListAccountServices

List account services for the specified accounts. Supports filtering.

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

  • listAccountServices(ListAccountServicesRequest request)

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

  • listAccountServices(AccountName parent)

  • listAccountServices(String parent)

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

  • listAccountServicesPagedCallable()

  • listAccountServicesCallable()

ProposeAccountService

Propose an account service.

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

  • proposeAccountService(ProposeAccountServiceRequest request)

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

  • proposeAccountService(AccountName parent, String provider, AccountService accountService)

  • proposeAccountService(String parent, String provider, AccountService accountService)

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

  • proposeAccountServiceCallable()

ApproveAccountService

Approve an account service proposal.

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

  • approveAccountService(ApproveAccountServiceRequest request)

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

  • approveAccountService(AccountServiceName name)

  • approveAccountService(String name)

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

  • approveAccountServiceCallable()

RejectAccountService

Reject an account service (both proposed and approve services can be rejected).

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

  • rejectAccountService(RejectAccountServiceRequest request)

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

  • rejectAccountService(AccountServiceName name)

  • rejectAccountService(String name)

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

  • rejectAccountServiceCallable()

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 AccountServicesServiceSettings 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
 AccountServicesServiceSettings accountServicesServiceSettings =
     AccountServicesServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create(accountServicesServiceSettings);
 

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
 AccountServicesServiceSettings accountServicesServiceSettings =
     AccountServicesServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create(accountServicesServiceSettings);
 

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
 AccountServicesServiceSettings accountServicesServiceSettings =
     AccountServicesServiceSettings.newHttpJsonBuilder().build();
 AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create(accountServicesServiceSettings);
 

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

Inheritance

java.lang.Object > AccountServicesServiceClient

Static Methods

create()

public static final AccountServicesServiceClient create()

Constructs an instance of AccountServicesServiceClient with default settings.

Returns
Type Description
AccountServicesServiceClient
Exceptions
Type Description
IOException

create(AccountServicesServiceSettings settings)

public static final AccountServicesServiceClient create(AccountServicesServiceSettings settings)

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

Parameter
Name Description
settings AccountServicesServiceSettings
Returns
Type Description
AccountServicesServiceClient
Exceptions
Type Description
IOException

create(AccountServicesServiceStub stub)

public static final AccountServicesServiceClient create(AccountServicesServiceStub stub)

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

Parameter
Name Description
stub AccountServicesServiceStub
Returns
Type Description
AccountServicesServiceClient

Constructors

AccountServicesServiceClient(AccountServicesServiceSettings settings)

protected AccountServicesServiceClient(AccountServicesServiceSettings settings)

Constructs an instance of AccountServicesServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
Name Description
settings AccountServicesServiceSettings

AccountServicesServiceClient(AccountServicesServiceStub stub)

protected AccountServicesServiceClient(AccountServicesServiceStub stub)
Parameter
Name Description
stub AccountServicesServiceStub

Methods

approveAccountService(AccountServiceName name)

public final AccountService approveAccountService(AccountServiceName name)

Approve an account service proposal.

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 (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   AccountServiceName name = AccountServiceName.of("[ACCOUNT]", "[SERVICE]");
   AccountService response = accountServicesServiceClient.approveAccountService(name);
 }
 
Parameter
Name Description
name AccountServiceName

Required. The resource name of the account service to approve. Format: accounts/{account}/services/{service}

Returns
Type Description
AccountService

approveAccountService(ApproveAccountServiceRequest request)

public final AccountService approveAccountService(ApproveAccountServiceRequest request)

Approve an account service proposal.

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 (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   ApproveAccountServiceRequest request =
       ApproveAccountServiceRequest.newBuilder()
           .setName(AccountServiceName.of("[ACCOUNT]", "[SERVICE]").toString())
           .build();
   AccountService response = accountServicesServiceClient.approveAccountService(request);
 }
 
Parameter
Name Description
request ApproveAccountServiceRequest

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

Returns
Type Description
AccountService

approveAccountService(String name)

public final AccountService approveAccountService(String name)

Approve an account service proposal.

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 (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   String name = AccountServiceName.of("[ACCOUNT]", "[SERVICE]").toString();
   AccountService response = accountServicesServiceClient.approveAccountService(name);
 }
 
Parameter
Name Description
name String

Required. The resource name of the account service to approve. Format: accounts/{account}/services/{service}

Returns
Type Description
AccountService

approveAccountServiceCallable()

public final UnaryCallable<ApproveAccountServiceRequest,AccountService> approveAccountServiceCallable()

Approve an account service proposal.

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 (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   ApproveAccountServiceRequest request =
       ApproveAccountServiceRequest.newBuilder()
           .setName(AccountServiceName.of("[ACCOUNT]", "[SERVICE]").toString())
           .build();
   ApiFuture<AccountService> future =
       accountServicesServiceClient.approveAccountServiceCallable().futureCall(request);
   // Do something.
   AccountService response = future.get();
 }
 
Returns
Type Description
UnaryCallable<ApproveAccountServiceRequest,AccountService>

awaitTermination(long duration, TimeUnit unit)

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

close()

public final void close()

getAccountService(AccountServiceName name)

public final AccountService getAccountService(AccountServiceName name)

Retrieve an account service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   AccountServiceName name = AccountServiceName.of("[ACCOUNT]", "[SERVICE]");
   AccountService response = accountServicesServiceClient.getAccountService(name);
 }
 
Parameter
Name Description
name AccountServiceName

Required. The resource name of the account service to get. Format: accounts/{account}/services/{service}

Returns
Type Description
AccountService

getAccountService(GetAccountServiceRequest request)

public final AccountService getAccountService(GetAccountServiceRequest request)

Retrieve an account service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   GetAccountServiceRequest request =
       GetAccountServiceRequest.newBuilder()
           .setName(AccountServiceName.of("[ACCOUNT]", "[SERVICE]").toString())
           .build();
   AccountService response = accountServicesServiceClient.getAccountService(request);
 }
 
Parameter
Name Description
request GetAccountServiceRequest

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

Returns
Type Description
AccountService

getAccountService(String name)

public final AccountService getAccountService(String name)

Retrieve an account service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   String name = AccountServiceName.of("[ACCOUNT]", "[SERVICE]").toString();
   AccountService response = accountServicesServiceClient.getAccountService(name);
 }
 
Parameter
Name Description
name String

Required. The resource name of the account service to get. Format: accounts/{account}/services/{service}

Returns
Type Description
AccountService

getAccountServiceCallable()

public final UnaryCallable<GetAccountServiceRequest,AccountService> getAccountServiceCallable()

Retrieve an account service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   GetAccountServiceRequest request =
       GetAccountServiceRequest.newBuilder()
           .setName(AccountServiceName.of("[ACCOUNT]", "[SERVICE]").toString())
           .build();
   ApiFuture<AccountService> future =
       accountServicesServiceClient.getAccountServiceCallable().futureCall(request);
   // Do something.
   AccountService response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetAccountServiceRequest,AccountService>

getSettings()

public final AccountServicesServiceSettings getSettings()
Returns
Type Description
AccountServicesServiceSettings

getStub()

public AccountServicesServiceStub getStub()
Returns
Type Description
AccountServicesServiceStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listAccountServices(AccountName parent)

public final AccountServicesServiceClient.ListAccountServicesPagedResponse listAccountServices(AccountName parent)

List account services for the specified accounts. Supports filtering.

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 (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   AccountName parent = AccountName.of("[ACCOUNT]");
   for (AccountService element :
       accountServicesServiceClient.listAccountServices(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent AccountName

Required. The parent account of the account service to filter by. Format: accounts/{account}

Returns
Type Description
AccountServicesServiceClient.ListAccountServicesPagedResponse

listAccountServices(ListAccountServicesRequest request)

public final AccountServicesServiceClient.ListAccountServicesPagedResponse listAccountServices(ListAccountServicesRequest request)

List account services for the specified accounts. Supports filtering.

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 (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   ListAccountServicesRequest request =
       ListAccountServicesRequest.newBuilder()
           .setParent(AccountName.of("[ACCOUNT]").toString())
           .setPageToken("pageToken873572522")
           .setPageSize(883849137)
           .build();
   for (AccountService element :
       accountServicesServiceClient.listAccountServices(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListAccountServicesRequest

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

Returns
Type Description
AccountServicesServiceClient.ListAccountServicesPagedResponse

listAccountServices(String parent)

public final AccountServicesServiceClient.ListAccountServicesPagedResponse listAccountServices(String parent)

List account services for the specified accounts. Supports filtering.

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 (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   String parent = AccountName.of("[ACCOUNT]").toString();
   for (AccountService element :
       accountServicesServiceClient.listAccountServices(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent account of the account service to filter by. Format: accounts/{account}

Returns
Type Description
AccountServicesServiceClient.ListAccountServicesPagedResponse

listAccountServicesCallable()

public final UnaryCallable<ListAccountServicesRequest,ListAccountServicesResponse> listAccountServicesCallable()

List account services for the specified accounts. Supports filtering.

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 (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   ListAccountServicesRequest request =
       ListAccountServicesRequest.newBuilder()
           .setParent(AccountName.of("[ACCOUNT]").toString())
           .setPageToken("pageToken873572522")
           .setPageSize(883849137)
           .build();
   while (true) {
     ListAccountServicesResponse response =
         accountServicesServiceClient.listAccountServicesCallable().call(request);
     for (AccountService element : response.getAccountServicesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListAccountServicesRequest,ListAccountServicesResponse>

listAccountServicesPagedCallable()

public final UnaryCallable<ListAccountServicesRequest,AccountServicesServiceClient.ListAccountServicesPagedResponse> listAccountServicesPagedCallable()

List account services for the specified accounts. Supports filtering.

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 (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   ListAccountServicesRequest request =
       ListAccountServicesRequest.newBuilder()
           .setParent(AccountName.of("[ACCOUNT]").toString())
           .setPageToken("pageToken873572522")
           .setPageSize(883849137)
           .build();
   ApiFuture<AccountService> future =
       accountServicesServiceClient.listAccountServicesPagedCallable().futureCall(request);
   // Do something.
   for (AccountService element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListAccountServicesRequest,ListAccountServicesPagedResponse>

proposeAccountService(AccountName parent, String provider, AccountService accountService)

public final AccountService proposeAccountService(AccountName parent, String provider, AccountService accountService)

Propose an account service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   AccountName parent = AccountName.of("[ACCOUNT]");
   String provider = "provider-987494927";
   AccountService accountService = AccountService.newBuilder().build();
   AccountService response =
       accountServicesServiceClient.proposeAccountService(parent, provider, accountService);
 }
 
Parameters
Name Description
parent AccountName

Required. The resource name of the parent account for the service. Format: accounts/{account}

provider String

Required. The provider of the service. Either the reference to an account such as providers/123 or a well-known service provider (one of providers/GOOGLE_ADS or providers/GOOGLE_BUSINESS_PROFILE).

accountService AccountService

Required. The account service to propose.

Returns
Type Description
AccountService

proposeAccountService(ProposeAccountServiceRequest request)

public final AccountService proposeAccountService(ProposeAccountServiceRequest request)

Propose an account service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   ProposeAccountServiceRequest request =
       ProposeAccountServiceRequest.newBuilder()
           .setParent(AccountName.of("[ACCOUNT]").toString())
           .setProvider("provider-987494927")
           .setAccountService(AccountService.newBuilder().build())
           .build();
   AccountService response = accountServicesServiceClient.proposeAccountService(request);
 }
 
Parameter
Name Description
request ProposeAccountServiceRequest

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

Returns
Type Description
AccountService

proposeAccountService(String parent, String provider, AccountService accountService)

public final AccountService proposeAccountService(String parent, String provider, AccountService accountService)

Propose an account service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   String parent = AccountName.of("[ACCOUNT]").toString();
   String provider = "provider-987494927";
   AccountService accountService = AccountService.newBuilder().build();
   AccountService response =
       accountServicesServiceClient.proposeAccountService(parent, provider, accountService);
 }
 
Parameters
Name Description
parent String

Required. The resource name of the parent account for the service. Format: accounts/{account}

provider String

Required. The provider of the service. Either the reference to an account such as providers/123 or a well-known service provider (one of providers/GOOGLE_ADS or providers/GOOGLE_BUSINESS_PROFILE).

accountService AccountService

Required. The account service to propose.

Returns
Type Description
AccountService

proposeAccountServiceCallable()

public final UnaryCallable<ProposeAccountServiceRequest,AccountService> proposeAccountServiceCallable()

Propose an account service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   ProposeAccountServiceRequest request =
       ProposeAccountServiceRequest.newBuilder()
           .setParent(AccountName.of("[ACCOUNT]").toString())
           .setProvider("provider-987494927")
           .setAccountService(AccountService.newBuilder().build())
           .build();
   ApiFuture<AccountService> future =
       accountServicesServiceClient.proposeAccountServiceCallable().futureCall(request);
   // Do something.
   AccountService response = future.get();
 }
 
Returns
Type Description
UnaryCallable<ProposeAccountServiceRequest,AccountService>

rejectAccountService(AccountServiceName name)

public final void rejectAccountService(AccountServiceName name)

Reject an account service (both proposed and approve services can be rejected).

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 (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   AccountServiceName name = AccountServiceName.of("[ACCOUNT]", "[SERVICE]");
   accountServicesServiceClient.rejectAccountService(name);
 }
 
Parameter
Name Description
name AccountServiceName

Required. The resource name of the account service to reject. Format: accounts/{account}/services/{service}

rejectAccountService(RejectAccountServiceRequest request)

public final void rejectAccountService(RejectAccountServiceRequest request)

Reject an account service (both proposed and approve services can be rejected).

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 (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   RejectAccountServiceRequest request =
       RejectAccountServiceRequest.newBuilder()
           .setName(AccountServiceName.of("[ACCOUNT]", "[SERVICE]").toString())
           .build();
   accountServicesServiceClient.rejectAccountService(request);
 }
 
Parameter
Name Description
request RejectAccountServiceRequest

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

rejectAccountService(String name)

public final void rejectAccountService(String name)

Reject an account service (both proposed and approve services can be rejected).

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 (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   String name = AccountServiceName.of("[ACCOUNT]", "[SERVICE]").toString();
   accountServicesServiceClient.rejectAccountService(name);
 }
 
Parameter
Name Description
name String

Required. The resource name of the account service to reject. Format: accounts/{account}/services/{service}

rejectAccountServiceCallable()

public final UnaryCallable<RejectAccountServiceRequest,Empty> rejectAccountServiceCallable()

Reject an account service (both proposed and approve services can be rejected).

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 (AccountServicesServiceClient accountServicesServiceClient =
     AccountServicesServiceClient.create()) {
   RejectAccountServiceRequest request =
       RejectAccountServiceRequest.newBuilder()
           .setName(AccountServiceName.of("[ACCOUNT]", "[SERVICE]").toString())
           .build();
   ApiFuture<Empty> future =
       accountServicesServiceClient.rejectAccountServiceCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<RejectAccountServiceRequest,Empty>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()