Service to support user API. v1beta
Package
@google-shopping/accountsConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of UserServiceClient.
Parameters | |
---|---|
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of |
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;
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;
userServiceStub
userServiceStub?: Promise<{
[name: string]: Function;
}>;
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
accountIssuePath(account, issue)
accountIssuePath(account: string, issue: string): string;
Return a fully-qualified accountIssue resource name string.
Parameters | |
---|---|
Name | Description |
account |
string
|
issue |
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. |
accountTaxPath(account, tax)
accountTaxPath(account: string, tax: string): string;
Return a fully-qualified accountTax resource name string.
Parameters | |
---|---|
Name | Description |
account |
string
|
tax |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
autofeedSettingsPath(account)
autofeedSettingsPath(account: string): string;
Return a fully-qualified autofeedSettings resource name string.
Parameter | |
---|---|
Name | Description |
account |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
businessIdentityPath(account)
businessIdentityPath(account: string): string;
Return a fully-qualified businessIdentity resource name string.
Parameter | |
---|---|
Name | Description |
account |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
businessInfoPath(account)
businessInfoPath(account: string): string;
Return a fully-qualified businessInfo 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. |
createUser(request, options)
createUser(request?: protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest, options?: CallOptions): Promise<[
protos.google.shopping.merchant.accounts.v1beta.IUser,
(protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest | undefined),
{} | undefined
]>;
Creates a Merchant Center account user. Executing this method requires admin access.
Parameters | |
---|---|
Name | Description |
request |
ICreateUserRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.shopping.merchant.accounts.v1beta.IUser,
(protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest | 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 resource name of the account for which a user will be
* created. Format: `accounts/{account}`
*/
// const parent = 'abc123'
/**
* Required. The email address of the user (for example,
* `john.doe@gmail.com`).
*/
// const userId = 'abc123'
/**
* Required. The user to create.
*/
// const user = {}
// Imports the Accounts library
const {UserServiceClient} = require('@google-shopping/accounts').v1beta;
// Instantiates a client
const accountsClient = new UserServiceClient();
async function callCreateUser() {
// Construct request
const request = {
parent,
userId,
user,
};
// Run request
const response = await accountsClient.createUser(request);
console.log(response);
}
callCreateUser();
createUser(request, options, callback)
createUser(request: protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest, options: CallOptions, callback: Callback<protos.google.shopping.merchant.accounts.v1beta.IUser, protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICreateUserRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.shopping.merchant.accounts.v1beta.IUser, protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
createUser(request, callback)
createUser(request: protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest, callback: Callback<protos.google.shopping.merchant.accounts.v1beta.IUser, protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICreateUserRequest
|
callback |
Callback<protos.google.shopping.merchant.accounts.v1beta.IUser, protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteUser(request, options)
deleteUser(request?: protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
(protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest | undefined),
{} | undefined
]>;
Deletes a Merchant Center account user. Executing this method requires admin access.
Parameters | |
---|---|
Name | Description |
request |
IDeleteUserRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.protobuf.IEmpty,
(protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest | 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 user to delete.
* Format: `accounts/{account}/users/{email}`
* It is also possible to delete the user corresponding to the caller by using
* `me` rather than an email address as in `accounts/{account}/users/me`.
*/
// const name = 'abc123'
// Imports the Accounts library
const {UserServiceClient} = require('@google-shopping/accounts').v1beta;
// Instantiates a client
const accountsClient = new UserServiceClient();
async function callDeleteUser() {
// Construct request
const request = {
name,
};
// Run request
const response = await accountsClient.deleteUser(request);
console.log(response);
}
callDeleteUser();
deleteUser(request, options, callback)
deleteUser(request: protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeleteUserRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteUser(request, callback)
deleteUser(request: protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeleteUserRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
emailPreferencesPath(account, email)
emailPreferencesPath(account: string, email: string): string;
Return a fully-qualified emailPreferences resource name string.
Parameters | |
---|---|
Name | Description |
account |
string
|
email |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
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 |
getUser(request, options)
getUser(request?: protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest, options?: CallOptions): Promise<[
protos.google.shopping.merchant.accounts.v1beta.IUser,
(protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest | undefined),
{} | undefined
]>;
Retrieves a Merchant Center account user.
Parameters | |
---|---|
Name | Description |
request |
IGetUserRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.shopping.merchant.accounts.v1beta.IUser,
(protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest | 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 user to retrieve.
* Format: `accounts/{account}/users/{email}`
* It is also possible to retrieve the user corresponding to the caller by
* using `me` rather than an email address as in
* `accounts/{account}/users/me`.
*/
// const name = 'abc123'
// Imports the Accounts library
const {UserServiceClient} = require('@google-shopping/accounts').v1beta;
// Instantiates a client
const accountsClient = new UserServiceClient();
async function callGetUser() {
// Construct request
const request = {
name,
};
// Run request
const response = await accountsClient.getUser(request);
console.log(response);
}
callGetUser();
getUser(request, options, callback)
getUser(request: protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest, options: CallOptions, callback: Callback<protos.google.shopping.merchant.accounts.v1beta.IUser, protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetUserRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.shopping.merchant.accounts.v1beta.IUser, protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getUser(request, callback)
getUser(request: protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest, callback: Callback<protos.google.shopping.merchant.accounts.v1beta.IUser, protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetUserRequest
|
callback |
Callback<protos.google.shopping.merchant.accounts.v1beta.IUser, protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
homepagePath(account)
homepagePath(account: string): string;
Return a fully-qualified homepage resource name string.
Parameter | |
---|---|
Name | Description |
account |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
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. |
listUsers(request, options)
listUsers(request?: protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, options?: CallOptions): Promise<[
protos.google.shopping.merchant.accounts.v1beta.IUser[],
protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest | null,
protos.google.shopping.merchant.accounts.v1beta.IListUsersResponse
]>;
Lists all users of a Merchant Center account.
Parameters | |
---|---|
Name | Description |
request |
IListUsersRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.shopping.merchant.accounts.v1beta.IUser[],
protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest | null,
protos.google.shopping.merchant.accounts.v1beta.IListUsersResponse
]> |
{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 |
listUsers(request, options, callback)
listUsers(request: protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, options: CallOptions, callback: PaginationCallback<protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, protos.google.shopping.merchant.accounts.v1beta.IListUsersResponse | null | undefined, protos.google.shopping.merchant.accounts.v1beta.IUser>): void;
Parameters | |
---|---|
Name | Description |
request |
IListUsersRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, protos.google.shopping.merchant.accounts.v1beta.IListUsersResponse | null | undefined, protos.google.shopping.merchant.accounts.v1beta.IUser>
|
Returns | |
---|---|
Type | Description |
void |
listUsers(request, callback)
listUsers(request: protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, callback: PaginationCallback<protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, protos.google.shopping.merchant.accounts.v1beta.IListUsersResponse | null | undefined, protos.google.shopping.merchant.accounts.v1beta.IUser>): void;
Parameters | |
---|---|
Name | Description |
request |
IListUsersRequest
|
callback |
PaginationCallback<protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, protos.google.shopping.merchant.accounts.v1beta.IListUsersResponse | null | undefined, protos.google.shopping.merchant.accounts.v1beta.IUser>
|
Returns | |
---|---|
Type | Description |
void |
listUsersAsync(request, options)
listUsersAsync(request?: protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, options?: CallOptions): AsyncIterable<protos.google.shopping.merchant.accounts.v1beta.IUser>;
Equivalent to listUsers
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListUsersRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.shopping.merchant.accounts.v1beta.IUser> |
{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, which owns this collection of users.
* Format: `accounts/{account}`
*/
// const parent = 'abc123'
/**
* Optional. The maximum number of users to return. The service may return
* fewer than this value. If unspecified, at most 50 users will be returned.
* The maximum value is 100; values above 100 will be coerced to 100
*/
// const pageSize = 1234
/**
* Optional. A page token, received from a previous `ListUsers` call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters provided to `ListUsers` must match
* the call that provided the page token.
*/
// const pageToken = 'abc123'
// Imports the Accounts library
const {UserServiceClient} = require('@google-shopping/accounts').v1beta;
// Instantiates a client
const accountsClient = new UserServiceClient();
async function callListUsers() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = accountsClient.listUsersAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListUsers();
listUsersStream(request, options)
listUsersStream(request?: protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListUsersRequest
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 |
matchAccountFromAccountIssueName(accountIssueName)
matchAccountFromAccountIssueName(accountIssueName: string): string | number;
Parse the account from AccountIssue resource.
Parameter | |
---|---|
Name | Description |
accountIssueName |
string
A fully-qualified path representing AccountIssue 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. |
matchAccountFromAccountTaxName(accountTaxName)
matchAccountFromAccountTaxName(accountTaxName: string): string | number;
Parse the account from AccountTax resource.
Parameter | |
---|---|
Name | Description |
accountTaxName |
string
A fully-qualified path representing AccountTax resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the account. |
matchAccountFromAutofeedSettingsName(autofeedSettingsName)
matchAccountFromAutofeedSettingsName(autofeedSettingsName: string): string | number;
Parse the account from AutofeedSettings resource.
Parameter | |
---|---|
Name | Description |
autofeedSettingsName |
string
A fully-qualified path representing AutofeedSettings resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the account. |
matchAccountFromBusinessIdentityName(businessIdentityName)
matchAccountFromBusinessIdentityName(businessIdentityName: string): string | number;
Parse the account from BusinessIdentity resource.
Parameter | |
---|---|
Name | Description |
businessIdentityName |
string
A fully-qualified path representing BusinessIdentity resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the account. |
matchAccountFromBusinessInfoName(businessInfoName)
matchAccountFromBusinessInfoName(businessInfoName: string): string | number;
Parse the account from BusinessInfo resource.
Parameter | |
---|---|
Name | Description |
businessInfoName |
string
A fully-qualified path representing BusinessInfo resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the account. |
matchAccountFromEmailPreferencesName(emailPreferencesName)
matchAccountFromEmailPreferencesName(emailPreferencesName: string): string | number;
Parse the account from EmailPreferences resource.
Parameter | |
---|---|
Name | Description |
emailPreferencesName |
string
A fully-qualified path representing EmailPreferences resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the account. |
matchAccountFromHomepageName(homepageName)
matchAccountFromHomepageName(homepageName: string): string | number;
Parse the account from Homepage resource.
Parameter | |
---|---|
Name | Description |
homepageName |
string
A fully-qualified path representing Homepage resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the account. |
matchAccountFromOnlineReturnPolicyName(onlineReturnPolicyName)
matchAccountFromOnlineReturnPolicyName(onlineReturnPolicyName: string): string | number;
Parse the account from OnlineReturnPolicy resource.
Parameter | |
---|---|
Name | Description |
onlineReturnPolicyName |
string
A fully-qualified path representing OnlineReturnPolicy resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the account. |
matchAccountFromProgramName(programName)
matchAccountFromProgramName(programName: string): string | number;
Parse the account from Program resource.
Parameter | |
---|---|
Name | Description |
programName |
string
A fully-qualified path representing Program resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the account. |
matchAccountFromRegionName(regionName)
matchAccountFromRegionName(regionName: string): string | number;
Parse the account from Region resource.
Parameter | |
---|---|
Name | Description |
regionName |
string
A fully-qualified path representing Region resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the account. |
matchAccountFromShippingSettingsName(shippingSettingsName)
matchAccountFromShippingSettingsName(shippingSettingsName: string): string | number;
Parse the account from ShippingSettings resource.
Parameter | |
---|---|
Name | Description |
shippingSettingsName |
string
A fully-qualified path representing ShippingSettings resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the account. |
matchAccountFromTermsOfServiceAgreementStateName(termsOfServiceAgreementStateName)
matchAccountFromTermsOfServiceAgreementStateName(termsOfServiceAgreementStateName: string): string | number;
Parse the account from TermsOfServiceAgreementState resource.
Parameter | |
---|---|
Name | Description |
termsOfServiceAgreementStateName |
string
A fully-qualified path representing TermsOfServiceAgreementState resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the account. |
matchAccountFromUserName(userName)
matchAccountFromUserName(userName: string): string | number;
Parse the account from User resource.
Parameter | |
---|---|
Name | Description |
userName |
string
A fully-qualified path representing User resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the account. |
matchEmailFromEmailPreferencesName(emailPreferencesName)
matchEmailFromEmailPreferencesName(emailPreferencesName: string): string | number;
Parse the email from EmailPreferences resource.
Parameter | |
---|---|
Name | Description |
emailPreferencesName |
string
A fully-qualified path representing EmailPreferences resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the email. |
matchEmailFromUserName(userName)
matchEmailFromUserName(userName: string): string | number;
Parse the email from User resource.
Parameter | |
---|---|
Name | Description |
userName |
string
A fully-qualified path representing User resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the email. |
matchIdentifierFromTermsOfServiceAgreementStateName(termsOfServiceAgreementStateName)
matchIdentifierFromTermsOfServiceAgreementStateName(termsOfServiceAgreementStateName: string): string | number;
Parse the identifier from TermsOfServiceAgreementState resource.
Parameter | |
---|---|
Name | Description |
termsOfServiceAgreementStateName |
string
A fully-qualified path representing TermsOfServiceAgreementState resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the identifier. |
matchIssueFromAccountIssueName(accountIssueName)
matchIssueFromAccountIssueName(accountIssueName: string): string | number;
Parse the issue from AccountIssue resource.
Parameter | |
---|---|
Name | Description |
accountIssueName |
string
A fully-qualified path representing AccountIssue resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the issue. |
matchProgramFromProgramName(programName)
matchProgramFromProgramName(programName: string): string | number;
Parse the program from Program resource.
Parameter | |
---|---|
Name | Description |
programName |
string
A fully-qualified path representing Program resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the program. |
matchRegionFromRegionName(regionName)
matchRegionFromRegionName(regionName: string): string | number;
Parse the region from Region resource.
Parameter | |
---|---|
Name | Description |
regionName |
string
A fully-qualified path representing Region resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the region. |
matchReturnPolicyFromOnlineReturnPolicyName(onlineReturnPolicyName)
matchReturnPolicyFromOnlineReturnPolicyName(onlineReturnPolicyName: string): string | number;
Parse the return_policy from OnlineReturnPolicy resource.
Parameter | |
---|---|
Name | Description |
onlineReturnPolicyName |
string
A fully-qualified path representing OnlineReturnPolicy resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the return_policy. |
matchTaxFromAccountTaxName(accountTaxName)
matchTaxFromAccountTaxName(accountTaxName: string): string | number;
Parse the tax from AccountTax resource.
Parameter | |
---|---|
Name | Description |
accountTaxName |
string
A fully-qualified path representing AccountTax resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the tax. |
matchVersionFromTermsOfServiceName(termsOfServiceName)
matchVersionFromTermsOfServiceName(termsOfServiceName: string): string | number;
Parse the version from TermsOfService resource.
Parameter | |
---|---|
Name | Description |
termsOfServiceName |
string
A fully-qualified path representing TermsOfService resource. |
Returns | |
---|---|
Type | Description |
string | number |
{string} A string representing the version. |
onlineReturnPolicyPath(account, returnPolicy)
onlineReturnPolicyPath(account: string, returnPolicy: string): string;
Return a fully-qualified onlineReturnPolicy resource name string.
Parameters | |
---|---|
Name | Description |
account |
string
|
returnPolicy |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
programPath(account, program)
programPath(account: string, program: string): string;
Return a fully-qualified program resource name string.
Parameters | |
---|---|
Name | Description |
account |
string
|
program |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
regionPath(account, region)
regionPath(account: string, region: string): string;
Return a fully-qualified region resource name string.
Parameters | |
---|---|
Name | Description |
account |
string
|
region |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
shippingSettingsPath(account)
shippingSettingsPath(account: string): string;
Return a fully-qualified shippingSettings resource name string.
Parameter | |
---|---|
Name | Description |
account |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
termsOfServiceAgreementStatePath(account, identifier)
termsOfServiceAgreementStatePath(account: string, identifier: string): string;
Return a fully-qualified termsOfServiceAgreementState resource name string.
Parameters | |
---|---|
Name | Description |
account |
string
|
identifier |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
termsOfServicePath(version)
termsOfServicePath(version: string): string;
Return a fully-qualified termsOfService resource name string.
Parameter | |
---|---|
Name | Description |
version |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |
updateUser(request, options)
updateUser(request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest, options?: CallOptions): Promise<[
protos.google.shopping.merchant.accounts.v1beta.IUser,
(protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest | undefined),
{} | undefined
]>;
Updates a Merchant Center account user. Executing this method requires admin access.
Parameters | |
---|---|
Name | Description |
request |
IUpdateUserRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.shopping.merchant.accounts.v1beta.IUser,
(protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest | 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 new version of the user.
* Use `me` to refer to your own email address, for example
* `accounts/{account}/users/me`.
*/
// const user = {}
/**
* Required. List of fields being updated.
*/
// const updateMask = {}
// Imports the Accounts library
const {UserServiceClient} = require('@google-shopping/accounts').v1beta;
// Instantiates a client
const accountsClient = new UserServiceClient();
async function callUpdateUser() {
// Construct request
const request = {
user,
updateMask,
};
// Run request
const response = await accountsClient.updateUser(request);
console.log(response);
}
callUpdateUser();
updateUser(request, options, callback)
updateUser(request: protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest, options: CallOptions, callback: Callback<protos.google.shopping.merchant.accounts.v1beta.IUser, protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateUserRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.shopping.merchant.accounts.v1beta.IUser, protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateUser(request, callback)
updateUser(request: protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest, callback: Callback<protos.google.shopping.merchant.accounts.v1beta.IUser, protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateUserRequest
|
callback |
Callback<protos.google.shopping.merchant.accounts.v1beta.IUser, protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
userPath(account, email)
userPath(account: string, email: string): string;
Return a fully-qualified user resource name string.
Parameters | |
---|---|
Name | Description |
account |
string
|
email |
string
|
Returns | |
---|---|
Type | Description |
string |
{string} Resource name string. |