Service to serve order tracking signals public API. v1
Package
@google-shopping/ordertrackingConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);Construct an instance of OrderTrackingSignalsServiceClient.
| 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;
};orderTrackingSignalsServiceStub
orderTrackingSignalsServiceStub?: Promise<{
[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
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. |
createOrderTrackingSignal(request, options)
createOrderTrackingSignal(request?: protos.google.shopping.merchant.ordertracking.v1.ICreateOrderTrackingSignalRequest, options?: CallOptions): Promise<[
protos.google.shopping.merchant.ordertracking.v1.IOrderTrackingSignal,
protos.google.shopping.merchant.ordertracking.v1.ICreateOrderTrackingSignalRequest | undefined,
{} | undefined
]>;Creates new order tracking signal.
| Parameters | |
|---|---|
| Name | Description |
request |
ICreateOrderTrackingSignalRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.shopping.merchant.ordertracking.v1.IOrderTrackingSignal,
protos.google.shopping.merchant.ordertracking.v1.ICreateOrderTrackingSignalRequest | 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 account of the business for which the order signal is
* created. Format: accounts/{account}
*/
// const parent = 'abc123'
/**
* Output only. The ID that uniquely identifies this order tracking signal.
*/
// const orderTrackingSignalId = 'abc123'
/**
* Required. The order signal to be created.
*/
// const orderTrackingSignal = {}
// Imports the Ordertracking library
const {OrderTrackingSignalsServiceClient} = require('@google-shopping/ordertracking').v1;
// Instantiates a client
const ordertrackingClient = new OrderTrackingSignalsServiceClient();
async function callCreateOrderTrackingSignal() {
// Construct request
const request = {
parent,
orderTrackingSignalId,
orderTrackingSignal,
};
// Run request
const response = await ordertrackingClient.createOrderTrackingSignal(request);
console.log(response);
}
callCreateOrderTrackingSignal();
createOrderTrackingSignal(request, options, callback)
createOrderTrackingSignal(request: protos.google.shopping.merchant.ordertracking.v1.ICreateOrderTrackingSignalRequest, options: CallOptions, callback: Callback<protos.google.shopping.merchant.ordertracking.v1.IOrderTrackingSignal, protos.google.shopping.merchant.ordertracking.v1.ICreateOrderTrackingSignalRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ICreateOrderTrackingSignalRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.shopping.merchant.ordertracking.v1.IOrderTrackingSignal, protos.google.shopping.merchant.ordertracking.v1.ICreateOrderTrackingSignalRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
createOrderTrackingSignal(request, callback)
createOrderTrackingSignal(request: protos.google.shopping.merchant.ordertracking.v1.ICreateOrderTrackingSignalRequest, callback: Callback<protos.google.shopping.merchant.ordertracking.v1.IOrderTrackingSignal, protos.google.shopping.merchant.ordertracking.v1.ICreateOrderTrackingSignalRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ICreateOrderTrackingSignalRequest
|
callback |
Callback<protos.google.shopping.merchant.ordertracking.v1.IOrderTrackingSignal, protos.google.shopping.merchant.ordertracking.v1.ICreateOrderTrackingSignalRequest | 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. |
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. |