Class ConversionSourcesServiceClient (0.10.0)

GitHub RepositoryProduct Reference

Service Description: Service for managing conversion sources for a merchant account.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   AccountName parent = AccountName.of("[ACCOUNT]");
   ConversionSource conversionSource = ConversionSource.newBuilder().build();
   ConversionSource response =
       conversionSourcesServiceClient.createConversionSource(parent, conversionSource);
 }
 

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

CreateConversionSource

Creates a new conversion source.

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

  • createConversionSource(CreateConversionSourceRequest request)

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

  • createConversionSource(AccountName parent, ConversionSource conversionSource)

  • createConversionSource(String parent, ConversionSource conversionSource)

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

  • createConversionSourceCallable()

UpdateConversionSource

Updates information of an existing conversion source. Available only for Merchant Center Destination conversion sources.

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

  • updateConversionSource(UpdateConversionSourceRequest request)

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

  • updateConversionSource(ConversionSource conversionSource, FieldMask updateMask)

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

  • updateConversionSourceCallable()

DeleteConversionSource

Archives an existing conversion source. If the conversion source is a Merchant Center Destination, it will be recoverable for 30 days. If the conversion source is a Google Analytics Link, it will be deleted immediately and can be restored by creating a new one.

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

  • deleteConversionSource(DeleteConversionSourceRequest request)

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

  • deleteConversionSource(ConversionSourceName name)

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

  • deleteConversionSourceCallable()

UndeleteConversionSource

Re-enables an archived conversion source. Only Available for Merchant Center Destination conversion sources.

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

  • undeleteConversionSource(UndeleteConversionSourceRequest request)

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

  • undeleteConversionSourceCallable()

GetConversionSource

Fetches a conversion source.

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

  • getConversionSource(GetConversionSourceRequest request)

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

  • getConversionSource(ConversionSourceName name)

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

  • getConversionSourceCallable()

ListConversionSources

Retrieves the list of conversion sources the caller has access to.

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

  • listConversionSources(ListConversionSourcesRequest request)

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

  • listConversionSources(AccountName parent)

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

  • listConversionSourcesPagedCallable()

  • listConversionSourcesCallable()

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 ConversionSourcesServiceSettings 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
 ConversionSourcesServiceSettings conversionSourcesServiceSettings =
     ConversionSourcesServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create(conversionSourcesServiceSettings);
 

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
 ConversionSourcesServiceSettings conversionSourcesServiceSettings =
     ConversionSourcesServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create(conversionSourcesServiceSettings);
 

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
 ConversionSourcesServiceSettings conversionSourcesServiceSettings =
     ConversionSourcesServiceSettings.newHttpJsonBuilder().build();
 ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create(conversionSourcesServiceSettings);
 

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

Inheritance

java.lang.Object > ConversionSourcesServiceClient

Static Methods

create()

public static final ConversionSourcesServiceClient create()

Constructs an instance of ConversionSourcesServiceClient with default settings.

Returns
Type Description
ConversionSourcesServiceClient
Exceptions
Type Description
IOException

create(ConversionSourcesServiceSettings settings)

public static final ConversionSourcesServiceClient create(ConversionSourcesServiceSettings settings)

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

create(ConversionSourcesServiceStub stub)

public static final ConversionSourcesServiceClient create(ConversionSourcesServiceStub stub)

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

Parameter
Name Description
stub ConversionSourcesServiceStub
Returns
Type Description
ConversionSourcesServiceClient

Constructors

ConversionSourcesServiceClient(ConversionSourcesServiceSettings settings)

protected ConversionSourcesServiceClient(ConversionSourcesServiceSettings settings)

Constructs an instance of ConversionSourcesServiceClient, 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 ConversionSourcesServiceSettings

ConversionSourcesServiceClient(ConversionSourcesServiceStub stub)

protected ConversionSourcesServiceClient(ConversionSourcesServiceStub stub)
Parameter
Name Description
stub ConversionSourcesServiceStub

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

createConversionSource(AccountName parent, ConversionSource conversionSource)

public final ConversionSource createConversionSource(AccountName parent, ConversionSource conversionSource)

Creates a new conversion source.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   AccountName parent = AccountName.of("[ACCOUNT]");
   ConversionSource conversionSource = ConversionSource.newBuilder().build();
   ConversionSource response =
       conversionSourcesServiceClient.createConversionSource(parent, conversionSource);
 }
 
Parameters
Name Description
parent AccountName

Required. The merchant account that will own the new conversion source. Format: accounts/{account}

conversionSource ConversionSource

Required. The conversion source description. A new ID will be automatically assigned to it upon creation.

Returns
Type Description
ConversionSource

createConversionSource(CreateConversionSourceRequest request)

public final ConversionSource createConversionSource(CreateConversionSourceRequest request)

Creates a new conversion source.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   CreateConversionSourceRequest request =
       CreateConversionSourceRequest.newBuilder()
           .setParent(AccountName.of("[ACCOUNT]").toString())
           .setConversionSource(ConversionSource.newBuilder().build())
           .build();
   ConversionSource response = conversionSourcesServiceClient.createConversionSource(request);
 }
 
Parameter
Name Description
request CreateConversionSourceRequest

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

Returns
Type Description
ConversionSource

createConversionSource(String parent, ConversionSource conversionSource)

public final ConversionSource createConversionSource(String parent, ConversionSource conversionSource)

Creates a new conversion source.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   String parent = AccountName.of("[ACCOUNT]").toString();
   ConversionSource conversionSource = ConversionSource.newBuilder().build();
   ConversionSource response =
       conversionSourcesServiceClient.createConversionSource(parent, conversionSource);
 }
 
Parameters
Name Description
parent String

Required. The merchant account that will own the new conversion source. Format: accounts/{account}

conversionSource ConversionSource

Required. The conversion source description. A new ID will be automatically assigned to it upon creation.

Returns
Type Description
ConversionSource

createConversionSourceCallable()

public final UnaryCallable<CreateConversionSourceRequest,ConversionSource> createConversionSourceCallable()

Creates a new conversion source.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   CreateConversionSourceRequest request =
       CreateConversionSourceRequest.newBuilder()
           .setParent(AccountName.of("[ACCOUNT]").toString())
           .setConversionSource(ConversionSource.newBuilder().build())
           .build();
   ApiFuture<ConversionSource> future =
       conversionSourcesServiceClient.createConversionSourceCallable().futureCall(request);
   // Do something.
   ConversionSource response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateConversionSourceRequest,ConversionSource>

deleteConversionSource(ConversionSourceName name)

public final void deleteConversionSource(ConversionSourceName name)

Archives an existing conversion source. If the conversion source is a Merchant Center Destination, it will be recoverable for 30 days. If the conversion source is a Google Analytics Link, it will be deleted immediately and can be restored by creating a new one.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   ConversionSourceName name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]");
   conversionSourcesServiceClient.deleteConversionSource(name);
 }
 
Parameter
Name Description
name ConversionSourceName

Required. The name of the conversion source to be deleted. Format: accounts/{account}/conversionSources/{conversion_source}

deleteConversionSource(DeleteConversionSourceRequest request)

public final void deleteConversionSource(DeleteConversionSourceRequest request)

Archives an existing conversion source. If the conversion source is a Merchant Center Destination, it will be recoverable for 30 days. If the conversion source is a Google Analytics Link, it will be deleted immediately and can be restored by creating a new one.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   DeleteConversionSourceRequest request =
       DeleteConversionSourceRequest.newBuilder()
           .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString())
           .build();
   conversionSourcesServiceClient.deleteConversionSource(request);
 }
 
Parameter
Name Description
request DeleteConversionSourceRequest

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

deleteConversionSource(String name)

public final void deleteConversionSource(String name)

Archives an existing conversion source. If the conversion source is a Merchant Center Destination, it will be recoverable for 30 days. If the conversion source is a Google Analytics Link, it will be deleted immediately and can be restored by creating a new one.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   String name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString();
   conversionSourcesServiceClient.deleteConversionSource(name);
 }
 
Parameter
Name Description
name String

Required. The name of the conversion source to be deleted. Format: accounts/{account}/conversionSources/{conversion_source}

deleteConversionSourceCallable()

public final UnaryCallable<DeleteConversionSourceRequest,Empty> deleteConversionSourceCallable()

Archives an existing conversion source. If the conversion source is a Merchant Center Destination, it will be recoverable for 30 days. If the conversion source is a Google Analytics Link, it will be deleted immediately and can be restored by creating a new one.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   DeleteConversionSourceRequest request =
       DeleteConversionSourceRequest.newBuilder()
           .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString())
           .build();
   ApiFuture<Empty> future =
       conversionSourcesServiceClient.deleteConversionSourceCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteConversionSourceRequest,Empty>

getConversionSource(ConversionSourceName name)

public final ConversionSource getConversionSource(ConversionSourceName name)

Fetches a conversion source.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   ConversionSourceName name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]");
   ConversionSource response = conversionSourcesServiceClient.getConversionSource(name);
 }
 
Parameter
Name Description
name ConversionSourceName

Required. The name of the conversion source to be fetched. Format: accounts/{account}/conversionsources/{conversion_source}

Returns
Type Description
ConversionSource

getConversionSource(GetConversionSourceRequest request)

public final ConversionSource getConversionSource(GetConversionSourceRequest request)

Fetches a conversion source.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   GetConversionSourceRequest request =
       GetConversionSourceRequest.newBuilder()
           .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString())
           .build();
   ConversionSource response = conversionSourcesServiceClient.getConversionSource(request);
 }
 
Parameter
Name Description
request GetConversionSourceRequest

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

Returns
Type Description
ConversionSource

getConversionSource(String name)

public final ConversionSource getConversionSource(String name)

Fetches a conversion source.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   String name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString();
   ConversionSource response = conversionSourcesServiceClient.getConversionSource(name);
 }
 
Parameter
Name Description
name String

Required. The name of the conversion source to be fetched. Format: accounts/{account}/conversionsources/{conversion_source}

Returns
Type Description
ConversionSource

getConversionSourceCallable()

public final UnaryCallable<GetConversionSourceRequest,ConversionSource> getConversionSourceCallable()

Fetches a conversion source.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   GetConversionSourceRequest request =
       GetConversionSourceRequest.newBuilder()
           .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString())
           .build();
   ApiFuture<ConversionSource> future =
       conversionSourcesServiceClient.getConversionSourceCallable().futureCall(request);
   // Do something.
   ConversionSource response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetConversionSourceRequest,ConversionSource>

getSettings()

public final ConversionSourcesServiceSettings getSettings()
Returns
Type Description
ConversionSourcesServiceSettings

getStub()

public ConversionSourcesServiceStub getStub()
Returns
Type Description
ConversionSourcesServiceStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listConversionSources(AccountName parent)

public final ConversionSourcesServiceClient.ListConversionSourcesPagedResponse listConversionSources(AccountName parent)

Retrieves the list of conversion sources the caller has access to.

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

Required. The merchant account who owns the collection of conversion sources. Format: accounts/{account}

Returns
Type Description
ConversionSourcesServiceClient.ListConversionSourcesPagedResponse

listConversionSources(ListConversionSourcesRequest request)

public final ConversionSourcesServiceClient.ListConversionSourcesPagedResponse listConversionSources(ListConversionSourcesRequest request)

Retrieves the list of conversion sources the caller has access to.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   ListConversionSourcesRequest request =
       ListConversionSourcesRequest.newBuilder()
           .setParent(AccountName.of("[ACCOUNT]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setShowDeleted(true)
           .build();
   for (ConversionSource element :
       conversionSourcesServiceClient.listConversionSources(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListConversionSourcesRequest

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

Returns
Type Description
ConversionSourcesServiceClient.ListConversionSourcesPagedResponse

listConversionSources(String parent)

public final ConversionSourcesServiceClient.ListConversionSourcesPagedResponse listConversionSources(String parent)

Retrieves the list of conversion sources the caller has access to.

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

Required. The merchant account who owns the collection of conversion sources. Format: accounts/{account}

Returns
Type Description
ConversionSourcesServiceClient.ListConversionSourcesPagedResponse

listConversionSourcesCallable()

public final UnaryCallable<ListConversionSourcesRequest,ListConversionSourcesResponse> listConversionSourcesCallable()

Retrieves the list of conversion sources the caller has access to.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   ListConversionSourcesRequest request =
       ListConversionSourcesRequest.newBuilder()
           .setParent(AccountName.of("[ACCOUNT]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setShowDeleted(true)
           .build();
   while (true) {
     ListConversionSourcesResponse response =
         conversionSourcesServiceClient.listConversionSourcesCallable().call(request);
     for (ConversionSource element : response.getConversionSourcesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListConversionSourcesRequest,ListConversionSourcesResponse>

listConversionSourcesPagedCallable()

public final UnaryCallable<ListConversionSourcesRequest,ConversionSourcesServiceClient.ListConversionSourcesPagedResponse> listConversionSourcesPagedCallable()

Retrieves the list of conversion sources the caller has access to.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   ListConversionSourcesRequest request =
       ListConversionSourcesRequest.newBuilder()
           .setParent(AccountName.of("[ACCOUNT]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setShowDeleted(true)
           .build();
   ApiFuture<ConversionSource> future =
       conversionSourcesServiceClient.listConversionSourcesPagedCallable().futureCall(request);
   // Do something.
   for (ConversionSource element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListConversionSourcesRequest,ListConversionSourcesPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

undeleteConversionSource(UndeleteConversionSourceRequest request)

public final ConversionSource undeleteConversionSource(UndeleteConversionSourceRequest request)

Re-enables an archived conversion source. Only Available for Merchant Center Destination conversion sources.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   UndeleteConversionSourceRequest request =
       UndeleteConversionSourceRequest.newBuilder()
           .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString())
           .build();
   ConversionSource response = conversionSourcesServiceClient.undeleteConversionSource(request);
 }
 
Parameter
Name Description
request UndeleteConversionSourceRequest

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

Returns
Type Description
ConversionSource

undeleteConversionSourceCallable()

public final UnaryCallable<UndeleteConversionSourceRequest,ConversionSource> undeleteConversionSourceCallable()

Re-enables an archived conversion source. Only Available for Merchant Center Destination conversion sources.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   UndeleteConversionSourceRequest request =
       UndeleteConversionSourceRequest.newBuilder()
           .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString())
           .build();
   ApiFuture<ConversionSource> future =
       conversionSourcesServiceClient.undeleteConversionSourceCallable().futureCall(request);
   // Do something.
   ConversionSource response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UndeleteConversionSourceRequest,ConversionSource>

updateConversionSource(ConversionSource conversionSource, FieldMask updateMask)

public final ConversionSource updateConversionSource(ConversionSource conversionSource, FieldMask updateMask)

Updates information of an existing conversion source. Available only for Merchant Center Destination conversion sources.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   ConversionSource conversionSource = ConversionSource.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   ConversionSource response =
       conversionSourcesServiceClient.updateConversionSource(conversionSource, updateMask);
 }
 
Parameters
Name Description
conversionSource ConversionSource

Required. The new version of the conversion source data. Format: accounts/{account}/conversionSources/{conversion_source}

updateMask FieldMask

Required. List of fields being updated.

Returns
Type Description
ConversionSource

updateConversionSource(UpdateConversionSourceRequest request)

public final ConversionSource updateConversionSource(UpdateConversionSourceRequest request)

Updates information of an existing conversion source. Available only for Merchant Center Destination conversion sources.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   UpdateConversionSourceRequest request =
       UpdateConversionSourceRequest.newBuilder()
           .setConversionSource(ConversionSource.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ConversionSource response = conversionSourcesServiceClient.updateConversionSource(request);
 }
 
Parameter
Name Description
request UpdateConversionSourceRequest

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

Returns
Type Description
ConversionSource

updateConversionSourceCallable()

public final UnaryCallable<UpdateConversionSourceRequest,ConversionSource> updateConversionSourceCallable()

Updates information of an existing conversion source. Available only for Merchant Center Destination conversion sources.

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
     ConversionSourcesServiceClient.create()) {
   UpdateConversionSourceRequest request =
       UpdateConversionSourceRequest.newBuilder()
           .setConversionSource(ConversionSource.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<ConversionSource> future =
       conversionSourcesServiceClient.updateConversionSourceCallable().futureCall(request);
   // Do something.
   ConversionSource response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateConversionSourceRequest,ConversionSource>