Service for managing CSS/MC account information. v1
Package
@google-shopping/cssConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of AccountsServiceClient.
Parameters | |
---|---|
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of |
Properties
accountsServiceStub
accountsServiceStub?: Promise<{
[name: string]: Function;
}>;
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;
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. |
getAccount(request, options)
getAccount(request?: protos.google.shopping.css.v1.IGetAccountRequest, options?: CallOptions): Promise<[
protos.google.shopping.css.v1.IAccount,
protos.google.shopping.css.v1.IGetAccountRequest | undefined,
{} | undefined
]>;
Retrieves a single CSS/MC account by ID.
Parameters | |
---|---|
Name | Description |
request |
IGetAccountRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.shopping.css.v1.IAccount,
protos.google.shopping.css.v1.IGetAccountRequest | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . 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 managed CSS/MC account.
* Format: accounts/{account}
*/
// const name = 'abc123'
/**
* Optional. Only required when retrieving MC account information.
* The CSS domain that is the parent resource of the MC account.
* Format: accounts/{account}
*/
// const parent = 'abc123'
// Imports the Css library
const {AccountsServiceClient} = require('@google-shopping/css').v1;
// Instantiates a client
const cssClient = new AccountsServiceClient();
async function callGetAccount() {
// Construct request
const request = {
name,
};
// Run request
const response = await cssClient.getAccount(request);
console.log(response);
}
callGetAccount();
getAccount(request, options, callback)
getAccount(request: protos.google.shopping.css.v1.IGetAccountRequest, options: CallOptions, callback: Callback<protos.google.shopping.css.v1.IAccount, protos.google.shopping.css.v1.IGetAccountRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetAccountRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.shopping.css.v1.IAccount, protos.google.shopping.css.v1.IGetAccountRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getAccount(request, callback)
getAccount(request: protos.google.shopping.css.v1.IGetAccountRequest, callback: Callback<protos.google.shopping.css.v1.IAccount, protos.google.shopping.css.v1.IGetAccountRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetAccountRequest
|
callback |
Callback<protos.google.shopping.css.v1.IAccount, protos.google.shopping.css.v1.IGetAccountRequest | 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. |
listChildAccounts(request, options)
listChildAccounts(request?: protos.google.shopping.css.v1.IListChildAccountsRequest, options?: CallOptions): Promise<[
protos.google.shopping.css.v1.IAccount[],
protos.google.shopping.css.v1.IListChildAccountsRequest | null,
protos.google.shopping.css.v1.IListChildAccountsResponse
]>;
Lists all the accounts under the specified CSS account ID, and optionally filters by label ID and account name.
Parameters | |
---|---|
Name | Description |
request |
IListChildAccountsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.shopping.css.v1.IAccount[],
protos.google.shopping.css.v1.IListChildAccountsRequest | null,
protos.google.shopping.css.v1.IListChildAccountsResponse
]> |
{Promise} - The promise which resolves to an array. The first element of the array is Array of . 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 |
listChildAccounts(request, options, callback)
listChildAccounts(request: protos.google.shopping.css.v1.IListChildAccountsRequest, options: CallOptions, callback: PaginationCallback<protos.google.shopping.css.v1.IListChildAccountsRequest, protos.google.shopping.css.v1.IListChildAccountsResponse | null | undefined, protos.google.shopping.css.v1.IAccount>): void;
Parameters | |
---|---|
Name | Description |
request |
IListChildAccountsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.shopping.css.v1.IListChildAccountsRequest, protos.google.shopping.css.v1.IListChildAccountsResponse | null | undefined, protos.google.shopping.css.v1.IAccount>
|
Returns | |
---|---|
Type | Description |
void |
listChildAccounts(request, callback)
listChildAccounts(request: protos.google.shopping.css.v1.IListChildAccountsRequest, callback: PaginationCallback<protos.google.shopping.css.v1.IListChildAccountsRequest, protos.google.shopping.css.v1.IListChildAccountsResponse | null | undefined, protos.google.shopping.css.v1.IAccount>): void;
Parameters | |
---|---|
Name | Description |
request |
IListChildAccountsRequest
|
callback |
PaginationCallback<protos.google.shopping.css.v1.IListChildAccountsRequest, protos.google.shopping.css.v1.IListChildAccountsResponse | null | undefined, protos.google.shopping.css.v1.IAccount>
|
Returns | |
---|---|
Type | Description |
void |
listChildAccountsAsync(request, options)
listChildAccountsAsync(request?: protos.google.shopping.css.v1.IListChildAccountsRequest, options?: CallOptions): AsyncIterable<protos.google.shopping.css.v1.IAccount>;
Equivalent to listChildAccounts
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListChildAccountsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.shopping.css.v1.IAccount> |
{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . 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 parent account. Must be a CSS group or domain.
* Format: accounts/{account}
*/
// const parent = 'abc123'
/**
* If set, only the MC accounts with the given label ID will be returned.
*/
// const labelId = 1234
/**
* If set, only the MC accounts with the given name (case sensitive) will be
* returned.
*/
// const fullName = 'abc123'
/**
* Optional. The maximum number of accounts to return. The service may return
* fewer than this value. If unspecified, at most 50 accounts will be
* returned. The maximum value is 1000; values above 1000 will be coerced to
* 1000.
*/
// const pageSize = 1234
/**
* Optional. A page token, received from a previous `ListChildAccounts` call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters provided to `ListChildAccounts` must
* match the call that provided the page token.
*/
// const pageToken = 'abc123'
// Imports the Css library
const {AccountsServiceClient} = require('@google-shopping/css').v1;
// Instantiates a client
const cssClient = new AccountsServiceClient();
async function callListChildAccounts() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = cssClient.listChildAccountsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListChildAccounts();
listChildAccountsStream(request, options)
listChildAccountsStream(request?: protos.google.shopping.css.v1.IListChildAccountsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListChildAccountsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform |
{Stream} An object stream which emits an object representing 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 |
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. |
updateLabels(request, options)
updateLabels(request?: protos.google.shopping.css.v1.IUpdateAccountLabelsRequest, options?: CallOptions): Promise<[
protos.google.shopping.css.v1.IAccount,
protos.google.shopping.css.v1.IUpdateAccountLabelsRequest | undefined,
{} | undefined
]>;
Updates labels assigned to CSS/MC accounts by a CSS domain.
Parameters | |
---|---|
Name | Description |
request |
IUpdateAccountLabelsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.shopping.css.v1.IAccount,
protos.google.shopping.css.v1.IUpdateAccountLabelsRequest | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . 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 label resource name.
* Format: accounts/{account}
*/
// const name = 'abc123'
/**
* The list of label IDs to overwrite the existing account label IDs.
* If the list is empty, all currently assigned label IDs will be deleted.
*/
// const labelIds = [1,2,3,4]
/**
* Optional. Only required when updating MC account labels.
* The CSS domain that is the parent resource of the MC account.
* Format: accounts/{account}
*/
// const parent = 'abc123'
// Imports the Css library
const {AccountsServiceClient} = require('@google-shopping/css').v1;
// Instantiates a client
const cssClient = new AccountsServiceClient();
async function callUpdateLabels() {
// Construct request
const request = {
name,
};
// Run request
const response = await cssClient.updateLabels(request);
console.log(response);
}
callUpdateLabels();
updateLabels(request, options, callback)
updateLabels(request: protos.google.shopping.css.v1.IUpdateAccountLabelsRequest, options: CallOptions, callback: Callback<protos.google.shopping.css.v1.IAccount, protos.google.shopping.css.v1.IUpdateAccountLabelsRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateAccountLabelsRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.shopping.css.v1.IAccount, protos.google.shopping.css.v1.IUpdateAccountLabelsRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateLabels(request, callback)
updateLabels(request: protos.google.shopping.css.v1.IUpdateAccountLabelsRequest, callback: Callback<protos.google.shopping.css.v1.IAccount, protos.google.shopping.css.v1.IUpdateAccountLabelsRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateAccountLabelsRequest
|
callback |
Callback<protos.google.shopping.css.v1.IAccount, protos.google.shopping.css.v1.IUpdateAccountLabelsRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |