Service for doing get and list on Css Products(a.k.a Aggregate Offers internally). v1
Package
@google-shopping/cssConstructors
(constructor)(opts, gaxInstance)
constructor
(
opts
?:
ClientOptions
,
gaxInstance
?:
typeof
gax
|
typeof
gax
.
fallback
);
Construct an instance of CssProductsServiceClient.
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 CssProductsServiceClient({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
;
cssProductsServiceStub
cssProductsServiceStub
?:
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.
getCssProduct(request, options)
getCssProduct
(
request
?:
protos
.
google
.
shopping
.
css
.
v1
.
IGetCssProductRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
shopping
.
css
.
v1
.
ICssProduct
,
protos
.
google
.
shopping
.
css
.
v1
.
IGetCssProductRequest
|
undefined
,
{}
|
undefined
]>;
Retrieves the processed CSS Product from your CSS Center account. After inserting, updating, or deleting a product input, it may take several minutes before the updated final product can be retrieved.
request
options
Promise
<[ protos.google.shopping.css.v1.ICssProduct
, protos.google.shopping.css.v1.IGetCssProductRequest
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing CssProduct . 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 to retrieve.
*/
// const name = 'abc123'
// Imports the Css library
const
{
CssProductsServiceClient
}
=
require
(
' @google-shopping/css
'
).
v1
;
// Instantiates a client
const
cssClient
=
new
CssProductsServiceClient
();
async
function
callGetCssProduct
()
{
// Construct request
const
request
=
{
name
,
};
// Run request
const
response
=
await
cssClient
.
getCssProduct
(
request
);
console
.
log
(
response
);
}
callGetCssProduct
();
getCssProduct(request, options, callback)
getCssProduct
(
request
:
protos
.
google
.
shopping
.
css
.
v1
.
IGetCssProductRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
shopping
.
css
.
v1
.
ICssProduct
,
protos
.
google
.
shopping
.
css
.
v1
.
IGetCssProductRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< protos.google.shopping.css.v1.ICssProduct
, protos.google.shopping.css.v1.IGetCssProductRequest
| null | undefined, {} | null | undefined>
void
getCssProduct(request, callback)
getCssProduct
(
request
:
protos
.
google
.
shopping
.
css
.
v1
.
IGetCssProductRequest
,
callback
:
Callback<protos
.
google
.
shopping
.
css
.
v1
.
ICssProduct
,
protos
.
google
.
shopping
.
css
.
v1
.
IGetCssProductRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< protos.google.shopping.css.v1.ICssProduct
, protos.google.shopping.css.v1.IGetCssProductRequest
| 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.
listCssProducts(request, options)
listCssProducts
(
request
?:
protos
.
google
.
shopping
.
css
.
v1
.
IListCssProductsRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
shopping
.
css
.
v1
.
ICssProduct
[],
protos
.
google
.
shopping
.
css
.
v1
.
IListCssProductsRequest
|
null
,
protos
.
google
.
shopping
.
css
.
v1
.
IListCssProductsResponse
]>;
Lists the processed CSS Products in your CSS Center account. The response might contain fewer items than specified by pageSize. Rely on pageToken to determine if there are more items to be requested.
After inserting, updating, or deleting a CSS product input, it may take several minutes before the updated processed CSS product can be retrieved.
request
options
Promise
<[ protos.google.shopping.css.v1.ICssProduct
[], protos.google.shopping.css.v1.IListCssProductsRequest
| null, protos.google.shopping.css.v1.IListCssProductsResponse
]>
{Promise} - The promise which resolves to an array. The first element of the array is Array of CssProduct
. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listCssProductsAsync()
method described below for async iteration which you can stop as needed. Please see the documentation
for more details and examples.
listCssProducts(request, options, callback)
listCssProducts
(
request
:
protos
.
google
.
shopping
.
css
.
v1
.
IListCssProductsRequest
,
options
:
CallOptions
,
callback
:
PaginationCallback<protos
.
google
.
shopping
.
css
.
v1
.
IListCssProductsRequest
,
protos
.
google
.
shopping
.
css
.
v1
.
IListCssProductsResponse
|
null
|
undefined
,
protos
.
google
.
shopping
.
css
.
v1
.
ICssProduct
> )
:
void
;
request
options
CallOptions
callback
PaginationCallback
< protos.google.shopping.css.v1.IListCssProductsRequest
, protos.google.shopping.css.v1.IListCssProductsResponse
| null | undefined, protos.google.shopping.css.v1.ICssProduct
>
void
listCssProducts(request, callback)
listCssProducts
(
request
:
protos
.
google
.
shopping
.
css
.
v1
.
IListCssProductsRequest
,
callback
:
PaginationCallback<protos
.
google
.
shopping
.
css
.
v1
.
IListCssProductsRequest
,
protos
.
google
.
shopping
.
css
.
v1
.
IListCssProductsResponse
|
null
|
undefined
,
protos
.
google
.
shopping
.
css
.
v1
.
ICssProduct
> )
:
void
;
request
callback
PaginationCallback
< protos.google.shopping.css.v1.IListCssProductsRequest
, protos.google.shopping.css.v1.IListCssProductsResponse
| null | undefined, protos.google.shopping.css.v1.ICssProduct
>
void
listCssProductsAsync(request, options)
listCssProductsAsync
(
request
?:
protos
.
google
.
shopping
.
css
.
v1
.
IListCssProductsRequest
,
options
?:
CallOptions
)
:
AsyncIterable<protos
.
google
.
shopping
.
css
.
v1
.
ICssProduct
> ;
Equivalent to listCssProducts
, but returns an iterable object.
for
- await
- of
syntax is used with the iterable to get response elements on-demand.
request
options
AsyncIterable
< protos.google.shopping.css.v1.ICssProduct
>
{Object} An iterable Object that allows async iteration . When you iterate the returned iterable, each element will be an object representing CssProduct . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. 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/domain to list processed CSS Products for.
* Format: accounts/{account}
*/
// const parent = 'abc123'
/**
* The maximum number of CSS Products to return. The service may return
* fewer than this value.
* The maximum value is 1000; values above 1000 will be coerced to 1000. If
* unspecified, the maximum number of CSS products will be returned.
*/
// const pageSize = 1234
/**
* A page token, received from a previous `ListCssProducts` call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters provided to `ListCssProducts`
* must match the call that provided the page token.
*/
// const pageToken = 'abc123'
// Imports the Css library
const
{
CssProductsServiceClient
}
=
require
(
' @google-shopping/css
'
).
v1
;
// Instantiates a client
const
cssClient
=
new
CssProductsServiceClient
();
async
function
callListCssProducts
()
{
// Construct request
const
request
=
{
parent
,
};
// Run request
const
iterable
=
cssClient
.
listCssProductsAsync
(
request
);
for
await
(
const
response
of
iterable
)
{
console
.
log
(
response
);
}
}
callListCssProducts
();
listCssProductsStream(request, options)
listCssProductsStream
(
request
?:
protos
.
google
.
shopping
.
css
.
v1
.
IListCssProductsRequest
,
options
?:
CallOptions
)
:
Transform
;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
request
options
Transform
{Stream} An object stream which emits an object representing CssProduct
on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listCssProductsAsync()
method described below for async iteration which you can stop as needed. Please see the documentation
for more details and examples.
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.