Class v1.CssProductInputsServiceClient (0.7.0)

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

Package

@google-shopping/css

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?:ClientOptions,gaxInstance?:typeofgax|typeofgax.fallback);

Construct an instance of CssProductInputsServiceClient.

Parameters
NameDescription
optsClientOptions
gaxInstancetypeofgax | typeoffallback

: loaded instance ofgoogle-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new CssProductInputsServiceClient({fallback: true}, gax); ```

Properties

apiEndpoint

getapiEndpoint():string;

The DNS address for this API service.

apiEndpoint

staticgetapiEndpoint():string;

The DNS address for this API service - same as servicePath.

auth

auth:gax.GoogleAuth;

cssProductInputsServiceStub

cssProductInputsServiceStub?:Promise<{[name:string]:Function;}>;

descriptors

descriptors:Descriptors;

innerApiCalls

innerApiCalls:{[name:string]:Function;};

pathTemplates

pathTemplates:{[name:string]:gax.PathTemplate;};

port

staticgetport():number;

The port for this API service.

scopes

staticgetscopes():string[];

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

staticgetservicePath():string;

The DNS address for this API service.

universeDomain

getuniverseDomain():string;

warn

warn:(code:string,message:string,warnType?:string)=>void;

Methods

accountLabelPath(account, label)

accountLabelPath(account:string,label:string):string;

Return a fully-qualified accountLabel resource name string.

Parameters
NameDescription
accountstring
labelstring
Returns
TypeDescription
string

{string} Resource name string.

accountPath(account)

accountPath(account:string):string;

Return a fully-qualified account resource name string.

Parameter
NameDescription
accountstring
Returns
TypeDescription
string

{string} Resource name string.

close()

close():Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

cssProductInputPath(account, cssProductInput)

cssProductInputPath(account:string,cssProductInput:string):string;

Return a fully-qualified cssProductInput resource name string.

Parameters
NameDescription
accountstring
cssProductInputstring
Returns
TypeDescription
string

{string} Resource name string.

cssProductPath(account, cssProduct)

cssProductPath(account:string,cssProduct:string):string;

Return a fully-qualified cssProduct resource name string.

Parameters
NameDescription
accountstring
cssProductstring
Returns
TypeDescription
string

{string} Resource name string.

deleteCssProductInput(request, options)

deleteCssProductInput(request?:protos.google.shopping.css.v1.IDeleteCssProductInputRequest,options?:CallOptions):Promise<[protos.google.protobuf.IEmpty,protos.google.shopping.css.v1.IDeleteCssProductInputRequest|undefined,{}|undefined]>;

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.

Parameters
NameDescription
requestIDeleteCssProductInputRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.protobuf.IEmpty,protos.google.shopping.css.v1.IDeleteCssProductInputRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representingEmpty. Please see thedocumentation for more details and examples.

Example
/**   * 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.   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Required. The name of the CSS product input resource to delete.   *  Format: accounts/{account}/cssProductInputs/{css_product_input}   */// const name = 'abc123'/**   *  The Content API Supplemental Feed ID.   *  The field must not be set if the action applies to a primary feed.   *  If the field is set, then product action applies to a supplemental feed   *  instead of primary Content API feed.   */// const supplementalFeedId = 1234// Imports the Css libraryconst{CssProductInputsServiceClient}=require('@google-shopping/css').v1;// Instantiates a clientconstcssClient=newCssProductInputsServiceClient();asyncfunctioncallDeleteCssProductInput(){// Construct requestconstrequest={name,};// Run requestconstresponse=awaitcssClient.deleteCssProductInput(request);console.log(response);}callDeleteCssProductInput();

deleteCssProductInput(request, options, callback)

deleteCssProductInput(request:protos.google.shopping.css.v1.IDeleteCssProductInputRequest,options:CallOptions,callback:Callback<protos.google.protobuf.IEmpty,protos.google.shopping.css.v1.IDeleteCssProductInputRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestIDeleteCssProductInputRequest
optionsCallOptions
callbackCallback<protos.google.protobuf.IEmpty,protos.google.shopping.css.v1.IDeleteCssProductInputRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteCssProductInput(request, callback)

deleteCssProductInput(request:protos.google.shopping.css.v1.IDeleteCssProductInputRequest,callback:Callback<protos.google.protobuf.IEmpty,protos.google.shopping.css.v1.IDeleteCssProductInputRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestIDeleteCssProductInputRequest
callbackCallback<protos.google.protobuf.IEmpty,protos.google.shopping.css.v1.IDeleteCssProductInputRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProjectId()

getProjectId():Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback:Callback<string,undefined,undefined>):void;
Parameter
NameDescription
callbackCallback<string, undefined, undefined>
Returns
TypeDescription
void

initialize()

initialize():Promise<{[name:string]:Function;}>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
TypeDescription
Promise<{ [name: string]:Function; }>

{Promise} A promise that resolves to an authenticated service stub.

insertCssProductInput(request, options)

insertCssProductInput(request?:protos.google.shopping.css.v1.IInsertCssProductInputRequest,options?:CallOptions):Promise<[protos.google.shopping.css.v1.ICssProductInput,protos.google.shopping.css.v1.IInsertCssProductInputRequest|undefined,{}|undefined]>;

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.

Parameters
NameDescription
requestIInsertCssProductInputRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.shopping.css.v1.ICssProductInput,protos.google.shopping.css.v1.IInsertCssProductInputRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representingCssProductInput. Please see thedocumentation for more details and examples.

Example
/**   * 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.   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Required. The account where this CSS Product will be inserted.   *  Format: accounts/{account}   */// const parent = 'abc123'/**   *  Required. The CSS Product Input to insert.   */// const cssProductInput = {}/**   *  Optional. DEPRECATED. Feed id is not required for CSS Products.   *  The primary or supplemental feed id. If CSS Product already exists and   *  feed id provided is different, then the CSS Product will be moved to a   *  new feed.   *  Note: For now, CSSs do not need to provide feed ids as we create   *  feeds on the fly.   *  We do not have supplemental feed support for CSS Products yet.   */// const feedId = 1234// Imports the Css libraryconst{CssProductInputsServiceClient}=require('@google-shopping/css').v1;// Instantiates a clientconstcssClient=newCssProductInputsServiceClient();asyncfunctioncallInsertCssProductInput(){// Construct requestconstrequest={parent,cssProductInput,};// Run requestconstresponse=awaitcssClient.insertCssProductInput(request);console.log(response);}callInsertCssProductInput();

insertCssProductInput(request, options, callback)

insertCssProductInput(request:protos.google.shopping.css.v1.IInsertCssProductInputRequest,options:CallOptions,callback:Callback<protos.google.shopping.css.v1.ICssProductInput,protos.google.shopping.css.v1.IInsertCssProductInputRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestIInsertCssProductInputRequest
optionsCallOptions
callbackCallback<protos.google.shopping.css.v1.ICssProductInput,protos.google.shopping.css.v1.IInsertCssProductInputRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

insertCssProductInput(request, callback)

insertCssProductInput(request:protos.google.shopping.css.v1.IInsertCssProductInputRequest,callback:Callback<protos.google.shopping.css.v1.ICssProductInput,protos.google.shopping.css.v1.IInsertCssProductInputRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestIInsertCssProductInputRequest
callbackCallback<protos.google.shopping.css.v1.ICssProductInput,protos.google.shopping.css.v1.IInsertCssProductInputRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

matchAccountFromAccountLabelName(accountLabelName)

matchAccountFromAccountLabelName(accountLabelName:string):string|number;

Parse the account from AccountLabel resource.

Parameter
NameDescription
accountLabelNamestring

A fully-qualified path representing AccountLabel resource.

Returns
TypeDescription
string | number

{string} A string representing the account.

matchAccountFromAccountName(accountName)

matchAccountFromAccountName(accountName:string):string|number;

Parse the account from Account resource.

Parameter
NameDescription
accountNamestring

A fully-qualified path representing Account resource.

Returns
TypeDescription
string | number

{string} A string representing the account.

matchAccountFromCssProductInputName(cssProductInputName)

matchAccountFromCssProductInputName(cssProductInputName:string):string|number;

Parse the account from CssProductInput resource.

Parameter
NameDescription
cssProductInputNamestring

A fully-qualified path representing CssProductInput resource.

Returns
TypeDescription
string | number

{string} A string representing the account.

matchAccountFromCssProductName(cssProductName)

matchAccountFromCssProductName(cssProductName:string):string|number;

Parse the account from CssProduct resource.

Parameter
NameDescription
cssProductNamestring

A fully-qualified path representing CssProduct resource.

Returns
TypeDescription
string | number

{string} A string representing the account.

matchCssProductFromCssProductName(cssProductName)

matchCssProductFromCssProductName(cssProductName:string):string|number;

Parse the css_product from CssProduct resource.

Parameter
NameDescription
cssProductNamestring

A fully-qualified path representing CssProduct resource.

Returns
TypeDescription
string | number

{string} A string representing the css_product.

matchCssProductInputFromCssProductInputName(cssProductInputName)

matchCssProductInputFromCssProductInputName(cssProductInputName:string):string|number;

Parse the css_product_input from CssProductInput resource.

Parameter
NameDescription
cssProductInputNamestring

A fully-qualified path representing CssProductInput resource.

Returns
TypeDescription
string | number

{string} A string representing the css_product_input.

matchLabelFromAccountLabelName(accountLabelName)

matchLabelFromAccountLabelName(accountLabelName:string):string|number;

Parse the label from AccountLabel resource.

Parameter
NameDescription
accountLabelNamestring

A fully-qualified path representing AccountLabel resource.

Returns
TypeDescription
string | number

{string} A string representing the label.

updateCssProductInput(request, options)

updateCssProductInput(request?:protos.google.shopping.css.v1.IUpdateCssProductInputRequest,options?:CallOptions):Promise<[protos.google.shopping.css.v1.ICssProductInput,protos.google.shopping.css.v1.IUpdateCssProductInputRequest|undefined,{}|undefined]>;

Updates the existing Css Product input in your CSS Center account.

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

Parameters
NameDescription
requestIUpdateCssProductInputRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.shopping.css.v1.ICssProductInput,protos.google.shopping.css.v1.IUpdateCssProductInputRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representingCssProductInput. Please see thedocumentation for more details and examples.

Example
/**   * 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.   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Required. The CSS product input resource to update. Information you submit   *  will be applied to the processed CSS product as well.   */// const cssProductInput = {}/**   *  The list of CSS product attributes to be updated.   *  If the update mask is omitted, then it is treated as implied field mask   *  equivalent to all fields that are populated (have a non-empty value).   *  Attributes specified in the update mask without a value specified in the   *  body will be deleted from the CSS product.   *  Update mask can only be specified for top level fields in   *  attributes and custom attributes.   *  To specify the update mask for custom attributes you need to add the   *  `custom_attribute.` prefix.   *  Providing special "*" value for full CSS product replacement is not   *  supported.   */// const updateMask = {}// Imports the Css libraryconst{CssProductInputsServiceClient}=require('@google-shopping/css').v1;// Instantiates a clientconstcssClient=newCssProductInputsServiceClient();asyncfunctioncallUpdateCssProductInput(){// Construct requestconstrequest={cssProductInput,};// Run requestconstresponse=awaitcssClient.updateCssProductInput(request);console.log(response);}callUpdateCssProductInput();

updateCssProductInput(request, options, callback)

updateCssProductInput(request:protos.google.shopping.css.v1.IUpdateCssProductInputRequest,options:CallOptions,callback:Callback<protos.google.shopping.css.v1.ICssProductInput,protos.google.shopping.css.v1.IUpdateCssProductInputRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestIUpdateCssProductInputRequest
optionsCallOptions
callbackCallback<protos.google.shopping.css.v1.ICssProductInput,protos.google.shopping.css.v1.IUpdateCssProductInputRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateCssProductInput(request, callback)

updateCssProductInput(request:protos.google.shopping.css.v1.IUpdateCssProductInputRequest,callback:Callback<protos.google.shopping.css.v1.ICssProductInput,protos.google.shopping.css.v1.IUpdateCssProductInputRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestIUpdateCssProductInputRequest
callbackCallback<protos.google.shopping.css.v1.ICssProductInput,protos.google.shopping.css.v1.IUpdateCssProductInputRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-30 UTC.