Class PartnerLinkServiceClient (0.8.0)

GitHub RepositoryProduct ReferenceRPC Documentation

Service Description: Service for managing partner links.

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 (PartnerLinkServiceClient partnerLinkServiceClient = PartnerLinkServiceClient.create()) {
   AccountName parent = AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]");
   PartnerLink partnerLink = PartnerLink.newBuilder().build();
   PartnerLink response = partnerLinkServiceClient.createPartnerLink(parent, partnerLink);
 }
 

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

CreatePartnerLink

Creates a partner link for the given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

  • login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}
  • linked-account: (Optional) The resource name of the account with an established product link to the login-account. Format: accountTypes/{linkedAccountType}/accounts/{linkedAccountId}

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

  • createPartnerLink(CreatePartnerLinkRequest request)

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

  • createPartnerLink(AccountName parent, PartnerLink partnerLink)

  • createPartnerLink(String parent, PartnerLink partnerLink)

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

  • createPartnerLinkCallable()

DeletePartnerLink

Deletes a partner link for the given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

  • login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}
  • linked-account: (Optional) The resource name of the account with an established product link to the login-account. Format: accountTypes/{linkedAccountType}/accounts/{linkedAccountId}

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

  • deletePartnerLink(DeletePartnerLinkRequest request)

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

  • deletePartnerLink(PartnerLinkName name)

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

  • deletePartnerLinkCallable()

SearchPartnerLinks

Searches for all partner links to and from a given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

  • login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}
  • linked-account: (Optional) The resource name of the account with an established product link to the login-account. Format: accountTypes/{linkedAccountType}/accounts/{linkedAccountId}

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

  • searchPartnerLinks(SearchPartnerLinksRequest request)

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

  • searchPartnerLinks(AccountName parent)

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

  • searchPartnerLinksPagedCallable()

  • searchPartnerLinksCallable()

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 PartnerLinkServiceSettings 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
 PartnerLinkServiceSettings partnerLinkServiceSettings =
     PartnerLinkServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 PartnerLinkServiceClient partnerLinkServiceClient =
     PartnerLinkServiceClient.create(partnerLinkServiceSettings);
 

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
 PartnerLinkServiceSettings partnerLinkServiceSettings =
     PartnerLinkServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 PartnerLinkServiceClient partnerLinkServiceClient =
     PartnerLinkServiceClient.create(partnerLinkServiceSettings);
 

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
 PartnerLinkServiceSettings partnerLinkServiceSettings =
     PartnerLinkServiceSettings.newHttpJsonBuilder().build();
 PartnerLinkServiceClient partnerLinkServiceClient =
     PartnerLinkServiceClient.create(partnerLinkServiceSettings);
 

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

Inheritance

java.lang.Object > PartnerLinkServiceClient

Static Methods

create()

public static final PartnerLinkServiceClient create()

Constructs an instance of PartnerLinkServiceClient with default settings.

Returns
Type Description
PartnerLinkServiceClient
Exceptions
Type Description
IOException

create(PartnerLinkServiceSettings settings)

public static final PartnerLinkServiceClient create(PartnerLinkServiceSettings settings)

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

create(PartnerLinkServiceStub stub)

public static final PartnerLinkServiceClient create(PartnerLinkServiceStub stub)

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

Parameter
Name Description
stub PartnerLinkServiceStub
Returns
Type Description
PartnerLinkServiceClient

Constructors

PartnerLinkServiceClient(PartnerLinkServiceSettings settings)

protected PartnerLinkServiceClient(PartnerLinkServiceSettings settings)

Constructs an instance of PartnerLinkServiceClient, 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 PartnerLinkServiceSettings

PartnerLinkServiceClient(PartnerLinkServiceStub stub)

protected PartnerLinkServiceClient(PartnerLinkServiceStub stub)
Parameter
Name Description
stub PartnerLinkServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

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

close()

public final void close()
public final PartnerLink createPartnerLink(AccountName parent, PartnerLink partnerLink)

Creates a partner link for the given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

  • login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}
  • linked-account: (Optional) The resource name of the account with an established product link to the login-account. Format: accountTypes/{linkedAccountType}/accounts/{linkedAccountId}

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 (PartnerLinkServiceClient partnerLinkServiceClient = PartnerLinkServiceClient.create()) {
   AccountName parent = AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]");
   PartnerLink partnerLink = PartnerLink.newBuilder().build();
   PartnerLink response = partnerLinkServiceClient.createPartnerLink(parent, partnerLink);
 }
 
Parameters
Name Description
parent AccountName

Required. The parent, which owns this collection of partner links. Format: accountTypes/{account_type}/accounts/{account}

partnerLink PartnerLink

Required. The partner link to create.

Returns
Type Description
PartnerLink
public final PartnerLink createPartnerLink(CreatePartnerLinkRequest request)

Creates a partner link for the given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

  • login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}
  • linked-account: (Optional) The resource name of the account with an established product link to the login-account. Format: accountTypes/{linkedAccountType}/accounts/{linkedAccountId}

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 (PartnerLinkServiceClient partnerLinkServiceClient = PartnerLinkServiceClient.create()) {
   CreatePartnerLinkRequest request =
       CreatePartnerLinkRequest.newBuilder()
           .setParent(AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]").toString())
           .setPartnerLink(PartnerLink.newBuilder().build())
           .build();
   PartnerLink response = partnerLinkServiceClient.createPartnerLink(request);
 }
 
Parameter
Name Description
request CreatePartnerLinkRequest

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

Returns
Type Description
PartnerLink
public final PartnerLink createPartnerLink(String parent, PartnerLink partnerLink)

Creates a partner link for the given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

  • login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}
  • linked-account: (Optional) The resource name of the account with an established product link to the login-account. Format: accountTypes/{linkedAccountType}/accounts/{linkedAccountId}

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 (PartnerLinkServiceClient partnerLinkServiceClient = PartnerLinkServiceClient.create()) {
   String parent = AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]").toString();
   PartnerLink partnerLink = PartnerLink.newBuilder().build();
   PartnerLink response = partnerLinkServiceClient.createPartnerLink(parent, partnerLink);
 }
 
Parameters
Name Description
parent String

Required. The parent, which owns this collection of partner links. Format: accountTypes/{account_type}/accounts/{account}

partnerLink PartnerLink

Required. The partner link to create.

Returns
Type Description
PartnerLink

createPartnerLinkCallable()

public final UnaryCallable<CreatePartnerLinkRequest,PartnerLink> createPartnerLinkCallable()

Creates a partner link for the given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

  • login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}
  • linked-account: (Optional) The resource name of the account with an established product link to the login-account. Format: accountTypes/{linkedAccountType}/accounts/{linkedAccountId}

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 (PartnerLinkServiceClient partnerLinkServiceClient = PartnerLinkServiceClient.create()) {
   CreatePartnerLinkRequest request =
       CreatePartnerLinkRequest.newBuilder()
           .setParent(AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]").toString())
           .setPartnerLink(PartnerLink.newBuilder().build())
           .build();
   ApiFuture<PartnerLink> future =
       partnerLinkServiceClient.createPartnerLinkCallable().futureCall(request);
   // Do something.
   PartnerLink response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreatePartnerLinkRequest,PartnerLink>
public final void deletePartnerLink(DeletePartnerLinkRequest request)

Deletes a partner link for the given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

  • login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}
  • linked-account: (Optional) The resource name of the account with an established product link to the login-account. Format: accountTypes/{linkedAccountType}/accounts/{linkedAccountId}

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 (PartnerLinkServiceClient partnerLinkServiceClient = PartnerLinkServiceClient.create()) {
   DeletePartnerLinkRequest request =
       DeletePartnerLinkRequest.newBuilder()
           .setName(
               PartnerLinkName.of("[ACCOUNT_TYPE]", "[ACCOUNT]", "[PARTNER_LINK]").toString())
           .build();
   partnerLinkServiceClient.deletePartnerLink(request);
 }
 
Parameter
Name Description
request DeletePartnerLinkRequest

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

public final void deletePartnerLink(PartnerLinkName name)

Deletes a partner link for the given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

  • login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}
  • linked-account: (Optional) The resource name of the account with an established product link to the login-account. Format: accountTypes/{linkedAccountType}/accounts/{linkedAccountId}

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 (PartnerLinkServiceClient partnerLinkServiceClient = PartnerLinkServiceClient.create()) {
   PartnerLinkName name = PartnerLinkName.of("[ACCOUNT_TYPE]", "[ACCOUNT]", "[PARTNER_LINK]");
   partnerLinkServiceClient.deletePartnerLink(name);
 }
 
Parameter
Name Description
name PartnerLinkName

Required. The resource name of the partner link to delete. Format: accountTypes/{account_type}/accounts/{account}/partnerLinks/{partner_link}

public final void deletePartnerLink(String name)

Deletes a partner link for the given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

  • login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}
  • linked-account: (Optional) The resource name of the account with an established product link to the login-account. Format: accountTypes/{linkedAccountType}/accounts/{linkedAccountId}

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 (PartnerLinkServiceClient partnerLinkServiceClient = PartnerLinkServiceClient.create()) {
   String name = PartnerLinkName.of("[ACCOUNT_TYPE]", "[ACCOUNT]", "[PARTNER_LINK]").toString();
   partnerLinkServiceClient.deletePartnerLink(name);
 }
 
Parameter
Name Description
name String

Required. The resource name of the partner link to delete. Format: accountTypes/{account_type}/accounts/{account}/partnerLinks/{partner_link}

deletePartnerLinkCallable()

public final UnaryCallable<DeletePartnerLinkRequest,Empty> deletePartnerLinkCallable()

Deletes a partner link for the given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

  • login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}
  • linked-account: (Optional) The resource name of the account with an established product link to the login-account. Format: accountTypes/{linkedAccountType}/accounts/{linkedAccountId}

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 (PartnerLinkServiceClient partnerLinkServiceClient = PartnerLinkServiceClient.create()) {
   DeletePartnerLinkRequest request =
       DeletePartnerLinkRequest.newBuilder()
           .setName(
               PartnerLinkName.of("[ACCOUNT_TYPE]", "[ACCOUNT]", "[PARTNER_LINK]").toString())
           .build();
   ApiFuture<Empty> future =
       partnerLinkServiceClient.deletePartnerLinkCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeletePartnerLinkRequest,Empty>

getSettings()

public final PartnerLinkServiceSettings getSettings()
Returns
Type Description
PartnerLinkServiceSettings

getStub()

public PartnerLinkServiceStub getStub()
Returns
Type Description
PartnerLinkServiceStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean
public final PartnerLinkServiceClient.SearchPartnerLinksPagedResponse searchPartnerLinks(AccountName parent)

Searches for all partner links to and from a given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

  • login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}
  • linked-account: (Optional) The resource name of the account with an established product link to the login-account. Format: accountTypes/{linkedAccountType}/accounts/{linkedAccountId}

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 (PartnerLinkServiceClient partnerLinkServiceClient = PartnerLinkServiceClient.create()) {
   AccountName parent = AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]");
   for (PartnerLink element : partnerLinkServiceClient.searchPartnerLinks(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent AccountName

Required. Account to search for partner links. If no filter is specified, all partner links where this account is either the owning_account or partner_account are returned.

Format: accountTypes/{account_type}/accounts/{account}

Returns
Type Description
PartnerLinkServiceClient.SearchPartnerLinksPagedResponse
public final PartnerLinkServiceClient.SearchPartnerLinksPagedResponse searchPartnerLinks(SearchPartnerLinksRequest request)

Searches for all partner links to and from a given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

  • login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}
  • linked-account: (Optional) The resource name of the account with an established product link to the login-account. Format: accountTypes/{linkedAccountType}/accounts/{linkedAccountId}

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 (PartnerLinkServiceClient partnerLinkServiceClient = PartnerLinkServiceClient.create()) {
   SearchPartnerLinksRequest request =
       SearchPartnerLinksRequest.newBuilder()
           .setParent(AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   for (PartnerLink element :
       partnerLinkServiceClient.searchPartnerLinks(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request SearchPartnerLinksRequest

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

Returns
Type Description
PartnerLinkServiceClient.SearchPartnerLinksPagedResponse
public final PartnerLinkServiceClient.SearchPartnerLinksPagedResponse searchPartnerLinks(String parent)

Searches for all partner links to and from a given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

  • login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}
  • linked-account: (Optional) The resource name of the account with an established product link to the login-account. Format: accountTypes/{linkedAccountType}/accounts/{linkedAccountId}

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 (PartnerLinkServiceClient partnerLinkServiceClient = PartnerLinkServiceClient.create()) {
   String parent = AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]").toString();
   for (PartnerLink element : partnerLinkServiceClient.searchPartnerLinks(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. Account to search for partner links. If no filter is specified, all partner links where this account is either the owning_account or partner_account are returned.

Format: accountTypes/{account_type}/accounts/{account}

Returns
Type Description
PartnerLinkServiceClient.SearchPartnerLinksPagedResponse

searchPartnerLinksCallable()

public final UnaryCallable<SearchPartnerLinksRequest,SearchPartnerLinksResponse> searchPartnerLinksCallable()

Searches for all partner links to and from a given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

  • login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}
  • linked-account: (Optional) The resource name of the account with an established product link to the login-account. Format: accountTypes/{linkedAccountType}/accounts/{linkedAccountId}

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 (PartnerLinkServiceClient partnerLinkServiceClient = PartnerLinkServiceClient.create()) {
   SearchPartnerLinksRequest request =
       SearchPartnerLinksRequest.newBuilder()
           .setParent(AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   while (true) {
     SearchPartnerLinksResponse response =
         partnerLinkServiceClient.searchPartnerLinksCallable().call(request);
     for (PartnerLink element : response.getPartnerLinksList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<SearchPartnerLinksRequest,SearchPartnerLinksResponse>

searchPartnerLinksPagedCallable()

public final UnaryCallable<SearchPartnerLinksRequest,PartnerLinkServiceClient.SearchPartnerLinksPagedResponse> searchPartnerLinksPagedCallable()

Searches for all partner links to and from a given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

  • login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}
  • linked-account: (Optional) The resource name of the account with an established product link to the login-account. Format: accountTypes/{linkedAccountType}/accounts/{linkedAccountId}

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 (PartnerLinkServiceClient partnerLinkServiceClient = PartnerLinkServiceClient.create()) {
   SearchPartnerLinksRequest request =
       SearchPartnerLinksRequest.newBuilder()
           .setParent(AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   ApiFuture<PartnerLink> future =
       partnerLinkServiceClient.searchPartnerLinksPagedCallable().futureCall(request);
   // Do something.
   for (PartnerLink element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<SearchPartnerLinksRequest,SearchPartnerLinksPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()