Service to use CssProductInput resource. This service helps to insert/update/delete CSS Products. v1
Package
@google-shopping/cssConstructors
(constructor)(opts, gaxInstance)
constructor
(
opts
?:
ClientOptions
,
gaxInstance
?:
typeof
gax
|
typeof
gax
.
fallback
);
Construct an instance of CssProductInputsServiceClient.
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.
account
string
label
string
string
{string} Resource name string.
accountPath(account)
accountPath
(
account
:
string
)
:
string
;
Return a fully-qualified account resource name string.
account
string
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.
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.
account
string
cssProductInput
string
string
{string} Resource name string.
cssProductPath(account, cssProduct)
cssProductPath
(
account
:
string
,
cssProduct
:
string
)
:
string
;
Return a fully-qualified cssProduct resource name string.
account
string
cssProduct
string
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.
request
options
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 representing Empty . Please see the documentation for more details and examples.
/**
* 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
;
request
options
CallOptions
callback
Callback
< protos.google.protobuf.IEmpty
, protos.google.shopping.css.v1.IDeleteCssProductInputRequest
| null | undefined, {} | null | undefined>
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
;
request
callback
Callback
< protos.google.protobuf.IEmpty
, protos.google.shopping.css.v1.IDeleteCssProductInputRequest
| null | undefined, {} | null | undefined>
void
getProjectId()
getProjectId
()
:
Promise<string>
;
Promise
<string>
getProjectId(callback)
getProjectId
(
callback
:
Callback<string
,
undefined
,
undefined
> )
:
void
;
callback
Callback
<string, undefined, undefined>
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.
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.
request
options
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 representing CssProductInput . Please see the documentation for more details and examples.
/**
* 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
;
request
options
CallOptions
callback
Callback
< protos.google.shopping.css.v1.ICssProductInput
, protos.google.shopping.css.v1.IInsertCssProductInputRequest
| null | undefined, {} | null | undefined>
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
;
request
callback
Callback
< protos.google.shopping.css.v1.ICssProductInput
, protos.google.shopping.css.v1.IInsertCssProductInputRequest
| null | undefined, {} | null | undefined>
void
matchAccountFromAccountLabelName(accountLabelName)
matchAccountFromAccountLabelName
(
accountLabelName
:
string
)
:
string
|
number
;
Parse the account from AccountLabel resource.
accountLabelName
string
A fully-qualified path representing AccountLabel resource.
string | number
{string} A string representing the account.
matchAccountFromAccountName(accountName)
matchAccountFromAccountName
(
accountName
:
string
)
:
string
|
number
;
Parse the account from Account resource.
accountName
string
A fully-qualified path representing Account resource.
string | number
{string} A string representing the account.
matchAccountFromCssProductInputName(cssProductInputName)
matchAccountFromCssProductInputName
(
cssProductInputName
:
string
)
:
string
|
number
;
Parse the account from CssProductInput resource.
cssProductInputName
string
A fully-qualified path representing CssProductInput resource.
string | number
{string} A string representing the account.
matchAccountFromCssProductName(cssProductName)
matchAccountFromCssProductName
(
cssProductName
:
string
)
:
string
|
number
;
Parse the account from CssProduct resource.
cssProductName
string
A fully-qualified path representing CssProduct resource.
string | number
{string} A string representing the account.
matchCssProductFromCssProductName(cssProductName)
matchCssProductFromCssProductName
(
cssProductName
:
string
)
:
string
|
number
;
Parse the css_product from CssProduct resource.
cssProductName
string
A fully-qualified path representing CssProduct resource.
string | number
{string} A string representing the css_product.
matchCssProductInputFromCssProductInputName(cssProductInputName)
matchCssProductInputFromCssProductInputName
(
cssProductInputName
:
string
)
:
string
|
number
;
Parse the css_product_input from CssProductInput resource.
cssProductInputName
string
A fully-qualified path representing CssProductInput resource.
string | number
{string} A string representing the css_product_input.
matchLabelFromAccountLabelName(accountLabelName)
matchLabelFromAccountLabelName
(
accountLabelName
:
string
)
:
string
|
number
;
Parse the label from AccountLabel resource.
accountLabelName
string
A fully-qualified path representing AccountLabel resource.
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.
request
options
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 representing CssProductInput . Please see the documentation for more details and examples.
/**
* 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
;
request
options
CallOptions
callback
Callback
< protos.google.shopping.css.v1.ICssProductInput
, protos.google.shopping.css.v1.IUpdateCssProductInputRequest
| null | undefined, {} | null | undefined>
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
;
request
callback
Callback
< protos.google.shopping.css.v1.ICssProductInput
, protos.google.shopping.css.v1.IUpdateCssProductInputRequest
| null | undefined, {} | null | undefined>
void