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 
 ?: 
  
 typeof 
  
 gax 
  
 | 
  
 typeof 
  
 gax 
 . 
 fallback 
 ); 
 

Construct an instance of CssProductInputsServiceClient.

Parameters
Name
Description
opts
ClientOptions
gaxInstance
typeof gax | typeof fallback

: loaded instance of google-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

  get 
  
 apiEndpoint 
 () 
 : 
  
 string 
 ; 
 

The DNS address for this API service.

apiEndpoint

  static 
  
 get 
  
 apiEndpoint 
 () 
 : 
  
 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

  static 
  
 get 
  
 port 
 () 
 : 
  
 number 
 ; 
 

The port for this API service.

scopes

  static 
  
 get 
  
 scopes 
 () 
 : 
  
 string 
 []; 
 

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

servicePath

  static 
  
 get 
  
 servicePath 
 () 
 : 
  
 string 
 ; 
 

The DNS address for this API service.

universeDomain

  get 
  
 universeDomain 
 () 
 : 
  
 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
Name
Description
account
string
label
string
Returns
Type
Description
string

{string} Resource name string.

accountPath(account)

  accountPath 
 ( 
 account 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified account resource name string.

Parameter
Name
Description
account
string
Returns
Type
Description
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
Type
Description
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
Name
Description
account
string
cssProductInput
string
Returns
Type
Description
string

{string} Resource name string.

cssProductPath(account, cssProduct)

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

Return a fully-qualified cssProduct resource name string.

Parameters
Name
Description
account
string
cssProduct
string
Returns
Type
Description
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
Name
Description
request
IDeleteCssProductInputRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty . Please see the documentation 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 library 
  
 const 
  
 { 
 CssProductInputsServiceClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-shopping/css 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cssClient 
  
 = 
  
 new 
  
  CssProductInputsServiceClient 
 
 (); 
  
 async 
  
 function 
  
 callDeleteCssProductInput 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 cssClient 
 . 
 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
Name
Description
options
CallOptions
callback
Callback < protos.google.protobuf.IEmpty , protos.google.shopping.css.v1.IDeleteCssProductInputRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
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
Name
Description
callback
Callback < protos.google.protobuf.IEmpty , protos.google.shopping.css.v1.IDeleteCssProductInputRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

getProjectId()

  getProjectId 
 () 
 : 
  
 Promise<string> 
 ; 
 
Returns
Type
Description
Promise <string>

getProjectId(callback)

  getProjectId 
 ( 
 callback 
 : 
  
 Callback<string 
 , 
  
 undefined 
 , 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameter
Name
Description
callback
Callback <string, undefined, undefined>
Returns
Type
Description
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
Type
Description
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
Name
Description
request
IInsertCssProductInputRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing CssProductInput . Please see the documentation 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 library 
  
 const 
  
 { 
 CssProductInputsServiceClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-shopping/css 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cssClient 
  
 = 
  
 new 
  
  CssProductInputsServiceClient 
 
 (); 
  
 async 
  
 function 
  
 callInsertCssProductInput 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 cssProductInput 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 cssClient 
 . 
 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
Name
Description
options
CallOptions
Returns
Type
Description
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
Name
Description
Returns
Type
Description
void

matchAccountFromAccountLabelName(accountLabelName)

  matchAccountFromAccountLabelName 
 ( 
 accountLabelName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the account from AccountLabel resource.

Parameter
Name
Description
accountLabelName
string

A fully-qualified path representing AccountLabel resource.

Returns
Type
Description
string | number

{string} A string representing the account.

matchAccountFromAccountName(accountName)

  matchAccountFromAccountName 
 ( 
 accountName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the account from Account resource.

Parameter
Name
Description
accountName
string

A fully-qualified path representing Account resource.

Returns
Type
Description
string | number

{string} A string representing the account.

matchAccountFromCssProductInputName(cssProductInputName)

  matchAccountFromCssProductInputName 
 ( 
 cssProductInputName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the account from CssProductInput resource.

Parameter
Name
Description
cssProductInputName
string

A fully-qualified path representing CssProductInput resource.

Returns
Type
Description
string | number

{string} A string representing the account.

matchAccountFromCssProductName(cssProductName)

  matchAccountFromCssProductName 
 ( 
 cssProductName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the account from CssProduct resource.

Parameter
Name
Description
cssProductName
string

A fully-qualified path representing CssProduct resource.

Returns
Type
Description
string | number

{string} A string representing the account.

matchCssProductFromCssProductName(cssProductName)

  matchCssProductFromCssProductName 
 ( 
 cssProductName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the css_product from CssProduct resource.

Parameter
Name
Description
cssProductName
string

A fully-qualified path representing CssProduct resource.

Returns
Type
Description
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
Name
Description
cssProductInputName
string

A fully-qualified path representing CssProductInput resource.

Returns
Type
Description
string | number

{string} A string representing the css_product_input.

matchLabelFromAccountLabelName(accountLabelName)

  matchLabelFromAccountLabelName 
 ( 
 accountLabelName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the label from AccountLabel resource.

Parameter
Name
Description
accountLabelName
string

A fully-qualified path representing AccountLabel resource.

Returns
Type
Description
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
Name
Description
request
IUpdateCssProductInputRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing CssProductInput . Please see the documentation 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 library 
  
 const 
  
 { 
 CssProductInputsServiceClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-shopping/css 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 cssClient 
  
 = 
  
 new 
  
  CssProductInputsServiceClient 
 
 (); 
  
 async 
  
 function 
  
 callUpdateCssProductInput 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 cssProductInput 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 cssClient 
 . 
 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
Name
Description
options
CallOptions
Returns
Type
Description
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
Name
Description
Returns
Type
Description
void
Create a Mobile Website
View Site in Mobile | Classic
Share by: