Class CssProductInputsServiceClient (0.4.0)

GitHub RepositoryProduct Reference

Service Description: Service to use CssProductInput resource. This service helps to insert/update/delete CSS Products.

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 (CssProductInputsServiceClient cssProductInputsServiceClient =
     CssProductInputsServiceClient.create()) {
   InsertCssProductInputRequest request =
       InsertCssProductInputRequest.newBuilder()
           .setParent(AccountName.of("[ACCOUNT]").toString())
           .setCssProductInput(CssProductInput.newBuilder().build())
           .setFeedId(-976011428)
           .build();
   CssProductInput response = cssProductInputsServiceClient.insertCssProductInput(request);
 }
 

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

Methods
MethodDescriptionMethod Variants

InsertCssProductInput

Uploads a CssProductInput to your CSS Center account. If an input with the same contentLanguage, identity, feedLabel and feedId already exists, this method replaces that entry.

After inserting, updating, or deleting a CSS Product input, it may take several minutes before the processed CSS Product can be retrieved.

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

  • insertCssProductInput(InsertCssProductInputRequest request)

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

  • insertCssProductInputCallable()

DeleteCssProductInput

Deletes a CSS Product input from your CSS Center account.

After a delete it may take several minutes until the input is no longer available.

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

  • deleteCssProductInput(DeleteCssProductInputRequest request)

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

  • deleteCssProductInput(CssProductInputName name)

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

  • deleteCssProductInputCallable()

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 CssProductInputsServiceSettings 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
 CssProductInputsServiceSettings cssProductInputsServiceSettings =
     CssProductInputsServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 CssProductInputsServiceClient cssProductInputsServiceClient =
     CssProductInputsServiceClient.create(cssProductInputsServiceSettings);
 

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
 CssProductInputsServiceSettings cssProductInputsServiceSettings =
     CssProductInputsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 CssProductInputsServiceClient cssProductInputsServiceClient =
     CssProductInputsServiceClient.create(cssProductInputsServiceSettings);
 

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
 CssProductInputsServiceSettings cssProductInputsServiceSettings =
     CssProductInputsServiceSettings.newHttpJsonBuilder().build();
 CssProductInputsServiceClient cssProductInputsServiceClient =
     CssProductInputsServiceClient.create(cssProductInputsServiceSettings);
 

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

Inheritance

java.lang.Object > CssProductInputsServiceClient

Static Methods

create()

public static final CssProductInputsServiceClient create()

Constructs an instance of CssProductInputsServiceClient with default settings.

Returns
TypeDescription
CssProductInputsServiceClient
Exceptions
TypeDescription
IOException

create(CssProductInputsServiceSettings settings)

public static final CssProductInputsServiceClient create(CssProductInputsServiceSettings settings)

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

Parameter
NameDescription
settingsCssProductInputsServiceSettings
Returns
TypeDescription
CssProductInputsServiceClient
Exceptions
TypeDescription
IOException

create(CssProductInputsServiceStub stub)

public static final CssProductInputsServiceClient create(CssProductInputsServiceStub stub)

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

Parameter
NameDescription
stubCssProductInputsServiceStub
Returns
TypeDescription
CssProductInputsServiceClient

Constructors

CssProductInputsServiceClient(CssProductInputsServiceSettings settings)

protected CssProductInputsServiceClient(CssProductInputsServiceSettings settings)

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

Parameter
NameDescription
settingsCssProductInputsServiceSettings

CssProductInputsServiceClient(CssProductInputsServiceStub stub)

protected CssProductInputsServiceClient(CssProductInputsServiceStub stub)
Parameter
NameDescription
stubCssProductInputsServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

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

close()

public final void close()

deleteCssProductInput(CssProductInputName name)

public final void deleteCssProductInput(CssProductInputName name)

Deletes a CSS Product input from your CSS Center account.

After a delete it may take several minutes until the input is no longer available.

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 (CssProductInputsServiceClient cssProductInputsServiceClient =
     CssProductInputsServiceClient.create()) {
   CssProductInputName name = CssProductInputName.of("[ACCOUNT]", "[CSS_PRODUCT_INPUT]");
   cssProductInputsServiceClient.deleteCssProductInput(name);
 }
 
Parameter
NameDescription
nameCssProductInputName

Required. The name of the CSS product input resource to delete. Format: accounts/{account}/cssProductInputs/{css_product_input}

deleteCssProductInput(DeleteCssProductInputRequest request)

public final void deleteCssProductInput(DeleteCssProductInputRequest request)

Deletes a CSS Product input from your CSS Center account.

After a delete it may take several minutes until the input is no longer available.

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 (CssProductInputsServiceClient cssProductInputsServiceClient =
     CssProductInputsServiceClient.create()) {
   DeleteCssProductInputRequest request =
       DeleteCssProductInputRequest.newBuilder()
           .setName(CssProductInputName.of("[ACCOUNT]", "[CSS_PRODUCT_INPUT]").toString())
           .setSupplementalFeedId(1845271745)
           .build();
   cssProductInputsServiceClient.deleteCssProductInput(request);
 }
 
Parameter
NameDescription
requestDeleteCssProductInputRequest

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

deleteCssProductInput(String name)

public final void deleteCssProductInput(String name)

Deletes a CSS Product input from your CSS Center account.

After a delete it may take several minutes until the input is no longer available.

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 (CssProductInputsServiceClient cssProductInputsServiceClient =
     CssProductInputsServiceClient.create()) {
   String name = CssProductInputName.of("[ACCOUNT]", "[CSS_PRODUCT_INPUT]").toString();
   cssProductInputsServiceClient.deleteCssProductInput(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the CSS product input resource to delete. Format: accounts/{account}/cssProductInputs/{css_product_input}

deleteCssProductInputCallable()

public final UnaryCallable<DeleteCssProductInputRequest,Empty> deleteCssProductInputCallable()

Deletes a CSS Product input from your CSS Center account.

After a delete it may take several minutes until the input is no longer available.

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 (CssProductInputsServiceClient cssProductInputsServiceClient =
     CssProductInputsServiceClient.create()) {
   DeleteCssProductInputRequest request =
       DeleteCssProductInputRequest.newBuilder()
           .setName(CssProductInputName.of("[ACCOUNT]", "[CSS_PRODUCT_INPUT]").toString())
           .setSupplementalFeedId(1845271745)
           .build();
   ApiFuture<Empty> future =
       cssProductInputsServiceClient.deleteCssProductInputCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteCssProductInputRequest,Empty>

getSettings()

public final CssProductInputsServiceSettings getSettings()
Returns
TypeDescription
CssProductInputsServiceSettings

getStub()

public CssProductInputsServiceStub getStub()
Returns
TypeDescription
CssProductInputsServiceStub

insertCssProductInput(InsertCssProductInputRequest request)

public final CssProductInput insertCssProductInput(InsertCssProductInputRequest request)

Uploads a CssProductInput to your CSS Center account. If an input with the same contentLanguage, identity, feedLabel and feedId already exists, this method replaces that entry.

After inserting, updating, or deleting a CSS Product input, it may take several minutes before the processed CSS Product can be retrieved.

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 (CssProductInputsServiceClient cssProductInputsServiceClient =
     CssProductInputsServiceClient.create()) {
   InsertCssProductInputRequest request =
       InsertCssProductInputRequest.newBuilder()
           .setParent(AccountName.of("[ACCOUNT]").toString())
           .setCssProductInput(CssProductInput.newBuilder().build())
           .setFeedId(-976011428)
           .build();
   CssProductInput response = cssProductInputsServiceClient.insertCssProductInput(request);
 }
 
Parameter
NameDescription
requestInsertCssProductInputRequest

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

Returns
TypeDescription
CssProductInput

insertCssProductInputCallable()

public final UnaryCallable<InsertCssProductInputRequest,CssProductInput> insertCssProductInputCallable()

Uploads a CssProductInput to your CSS Center account. If an input with the same contentLanguage, identity, feedLabel and feedId already exists, this method replaces that entry.

After inserting, updating, or deleting a CSS Product input, it may take several minutes before the processed CSS Product can be retrieved.

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 (CssProductInputsServiceClient cssProductInputsServiceClient =
     CssProductInputsServiceClient.create()) {
   InsertCssProductInputRequest request =
       InsertCssProductInputRequest.newBuilder()
           .setParent(AccountName.of("[ACCOUNT]").toString())
           .setCssProductInput(CssProductInput.newBuilder().build())
           .setFeedId(-976011428)
           .build();
   ApiFuture<CssProductInput> future =
       cssProductInputsServiceClient.insertCssProductInputCallable().futureCall(request);
   // Do something.
   CssProductInput response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<InsertCssProductInputRequest,CssProductInput>

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()