Class v1.PartnerLinkServiceClient (1.0.0)

Service for managing partner links. v1

Package

@google-ads/datamanager

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of PartnerLinkServiceClient.

Parameters
Name Description
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 PartnerLinkServiceClient({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;

descriptors

descriptors: Descriptors;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

partnerLinkServiceStub

partnerLinkServiceStub?: 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(accountType, account)

accountPath(accountType: string, account: string): string;

Return a fully-qualified account resource name string.

Parameters
Name Description
accountType string
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.

createPartnerLink(request?: protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest, options?: CallOptions): Promise<[
        protos.google.ads.datamanager.v1.IPartnerLink,
        protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest | undefined,
        {} | undefined
    ]>;

Creates a partner link for the given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

* login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}

Parameters
Name Description
request ICreatePartnerLinkRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.ads.datamanager.v1.IPartnerLink, protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing PartnerLink. Please see the documentation for more details and examples.

Example

  /**
   * 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 partner links.
   *  Format: accountTypes/{account_type}/accounts/{account}
   */
  // const parent = 'abc123'
  /**
   *  Required. The partner link to create.
   */
  // const partnerLink = {}

  // Imports the Datamanager library
  const {PartnerLinkServiceClient} = require('@google-ads/datamanager').v1;

  // Instantiates a client
  const datamanagerClient = new PartnerLinkServiceClient();

  async function callCreatePartnerLink() {
    // Construct request
    const request = {
      parent,
      partnerLink,
    };

    // Run request
    const response = await datamanagerClient.createPartnerLink(request);
    console.log(response);
  }

  callCreatePartnerLink();

createPartnerLink(request: protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest, options: CallOptions, callback: Callback<protos.google.ads.datamanager.v1.IPartnerLink, protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreatePartnerLinkRequest
options CallOptions
callback Callback<protos.google.ads.datamanager.v1.IPartnerLink, protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void
createPartnerLink(request: protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest, callback: Callback<protos.google.ads.datamanager.v1.IPartnerLink, protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreatePartnerLinkRequest
callback Callback<protos.google.ads.datamanager.v1.IPartnerLink, protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void
deletePartnerLink(request?: protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest | undefined,
        {} | undefined
    ]>;

Deletes a partner link for the given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

* login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}

Parameters
Name Description
request IDeletePartnerLinkRequest

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.ads.datamanager.v1.IDeletePartnerLinkRequest | 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.

Example

  /**
   * 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 partner link to delete.
   *  Format:
   *  accountTypes/{account_type}/accounts/{account}/partnerLinks/{partner_link}
   */
  // const name = 'abc123'

  // Imports the Datamanager library
  const {PartnerLinkServiceClient} = require('@google-ads/datamanager').v1;

  // Instantiates a client
  const datamanagerClient = new PartnerLinkServiceClient();

  async function callDeletePartnerLink() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await datamanagerClient.deletePartnerLink(request);
    console.log(response);
  }

  callDeletePartnerLink();

deletePartnerLink(request: protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeletePartnerLinkRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void
deletePartnerLink(request: protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeletePartnerLinkRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest | 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.

matchAccountFromPartnerLinkName(partnerLinkName)

matchAccountFromPartnerLinkName(partnerLinkName: string): string | number;

Parse the account from PartnerLink resource.

Parameter
Name Description
partnerLinkName string

A fully-qualified path representing PartnerLink resource.

Returns
Type Description
string | number

{string} A string representing the account.

matchAccountFromUserListDirectLicenseName(userListDirectLicenseName)

matchAccountFromUserListDirectLicenseName(userListDirectLicenseName: string): string | number;

Parse the account from UserListDirectLicense resource.

Parameter
Name Description
userListDirectLicenseName string

A fully-qualified path representing UserListDirectLicense resource.

Returns
Type Description
string | number

{string} A string representing the account.

matchAccountFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName)

matchAccountFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string): string | number;

Parse the account from UserListGlobalLicenseCustomerInfo resource.

Parameter
Name Description
userListGlobalLicenseCustomerInfoName string

A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource.

Returns
Type Description
string | number

{string} A string representing the account.

matchAccountFromUserListGlobalLicenseName(userListGlobalLicenseName)

matchAccountFromUserListGlobalLicenseName(userListGlobalLicenseName: string): string | number;

Parse the account from UserListGlobalLicense resource.

Parameter
Name Description
userListGlobalLicenseName string

A fully-qualified path representing UserListGlobalLicense resource.

Returns
Type Description
string | number

{string} A string representing the account.

matchAccountFromUserListName(userListName)

matchAccountFromUserListName(userListName: string): string | number;

Parse the account from UserList resource.

Parameter
Name Description
userListName string

A fully-qualified path representing UserList resource.

Returns
Type Description
string | number

{string} A string representing the account.

matchAccountTypeFromAccountName(accountName)

matchAccountTypeFromAccountName(accountName: string): string | number;

Parse the account_type 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_type.

matchAccountTypeFromPartnerLinkName(partnerLinkName)

matchAccountTypeFromPartnerLinkName(partnerLinkName: string): string | number;

Parse the account_type from PartnerLink resource.

Parameter
Name Description
partnerLinkName string

A fully-qualified path representing PartnerLink resource.

Returns
Type Description
string | number

{string} A string representing the account_type.

matchAccountTypeFromUserListDirectLicenseName(userListDirectLicenseName)

matchAccountTypeFromUserListDirectLicenseName(userListDirectLicenseName: string): string | number;

Parse the account_type from UserListDirectLicense resource.

Parameter
Name Description
userListDirectLicenseName string

A fully-qualified path representing UserListDirectLicense resource.

Returns
Type Description
string | number

{string} A string representing the account_type.

matchAccountTypeFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName)

matchAccountTypeFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string): string | number;

Parse the account_type from UserListGlobalLicenseCustomerInfo resource.

Parameter
Name Description
userListGlobalLicenseCustomerInfoName string

A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource.

Returns
Type Description
string | number

{string} A string representing the account_type.

matchAccountTypeFromUserListGlobalLicenseName(userListGlobalLicenseName)

matchAccountTypeFromUserListGlobalLicenseName(userListGlobalLicenseName: string): string | number;

Parse the account_type from UserListGlobalLicense resource.

Parameter
Name Description
userListGlobalLicenseName string

A fully-qualified path representing UserListGlobalLicense resource.

Returns
Type Description
string | number

{string} A string representing the account_type.

matchAccountTypeFromUserListName(userListName)

matchAccountTypeFromUserListName(userListName: string): string | number;

Parse the account_type from UserList resource.

Parameter
Name Description
userListName string

A fully-qualified path representing UserList resource.

Returns
Type Description
string | number

{string} A string representing the account_type.

matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName)

matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string): string | number;

Parse the license_customer_info from UserListGlobalLicenseCustomerInfo resource.

Parameter
Name Description
userListGlobalLicenseCustomerInfoName string

A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource.

Returns
Type Description
string | number

{string} A string representing the license_customer_info.

matchPartnerLinkFromPartnerLinkName(partnerLinkName)

matchPartnerLinkFromPartnerLinkName(partnerLinkName: string): string | number;

Parse the partner_link from PartnerLink resource.

Parameter
Name Description
partnerLinkName string

A fully-qualified path representing PartnerLink resource.

Returns
Type Description
string | number

{string} A string representing the partner_link.

matchUserListDirectLicenseFromUserListDirectLicenseName(userListDirectLicenseName)

matchUserListDirectLicenseFromUserListDirectLicenseName(userListDirectLicenseName: string): string | number;

Parse the user_list_direct_license from UserListDirectLicense resource.

Parameter
Name Description
userListDirectLicenseName string

A fully-qualified path representing UserListDirectLicense resource.

Returns
Type Description
string | number

{string} A string representing the user_list_direct_license.

matchUserListFromUserListName(userListName)

matchUserListFromUserListName(userListName: string): string | number;

Parse the user_list from UserList resource.

Parameter
Name Description
userListName string

A fully-qualified path representing UserList resource.

Returns
Type Description
string | number

{string} A string representing the user_list.

matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName)

matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string): string | number;

Parse the user_list_global_license from UserListGlobalLicenseCustomerInfo resource.

Parameter
Name Description
userListGlobalLicenseCustomerInfoName string

A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource.

Returns
Type Description
string | number

{string} A string representing the user_list_global_license.

matchUserListGlobalLicenseFromUserListGlobalLicenseName(userListGlobalLicenseName)

matchUserListGlobalLicenseFromUserListGlobalLicenseName(userListGlobalLicenseName: string): string | number;

Parse the user_list_global_license from UserListGlobalLicense resource.

Parameter
Name Description
userListGlobalLicenseName string

A fully-qualified path representing UserListGlobalLicense resource.

Returns
Type Description
string | number

{string} A string representing the user_list_global_license.

partnerLinkPath(accountType, account, partnerLink)

partnerLinkPath(accountType: string, account: string, partnerLink: string): string;

Return a fully-qualified partnerLink resource name string.

Parameters
Name Description
accountType string
account string
partnerLink string
Returns
Type Description
string

{string} Resource name string.

searchPartnerLinks(request?: protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, options?: CallOptions): Promise<[
        protos.google.ads.datamanager.v1.IPartnerLink[],
        protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest | null,
        protos.google.ads.datamanager.v1.ISearchPartnerLinksResponse
    ]>;

Searches for all partner links to and from a given account.

Authorization Headers:

This method supports the following optional headers to define how the API authorizes access for the request:

* login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: accountTypes/{loginAccountType}/accounts/{loginAccountId}

Parameters
Name Description
request ISearchPartnerLinksRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.ads.datamanager.v1.IPartnerLink[], protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest | null, protos.google.ads.datamanager.v1.ISearchPartnerLinksResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of PartnerLink. 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 searchPartnerLinksAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

searchPartnerLinks(request: protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, options: CallOptions, callback: PaginationCallback<protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, protos.google.ads.datamanager.v1.ISearchPartnerLinksResponse | null | undefined, protos.google.ads.datamanager.v1.IPartnerLink>): void;
Parameters
Name Description
request ISearchPartnerLinksRequest
options CallOptions
callback PaginationCallback<protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, protos.google.ads.datamanager.v1.ISearchPartnerLinksResponse | null | undefined, protos.google.ads.datamanager.v1.IPartnerLink>
Returns
Type Description
void
searchPartnerLinks(request: protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, callback: PaginationCallback<protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, protos.google.ads.datamanager.v1.ISearchPartnerLinksResponse | null | undefined, protos.google.ads.datamanager.v1.IPartnerLink>): void;
Parameters
Name Description
request ISearchPartnerLinksRequest
callback PaginationCallback<protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, protos.google.ads.datamanager.v1.ISearchPartnerLinksResponse | null | undefined, protos.google.ads.datamanager.v1.IPartnerLink>
Returns
Type Description
void

searchPartnerLinksAsync(request, options)

searchPartnerLinksAsync(request?: protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, options?: CallOptions): AsyncIterable<protos.google.ads.datamanager.v1.IPartnerLink>;

Equivalent to searchPartnerLinks, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
Name Description
request ISearchPartnerLinksRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.ads.datamanager.v1.IPartnerLink>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing PartnerLink. 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.

Example

  /**
   * 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. Account to search for partner links. If no `filter` is specified,
   *  all partner links where this account is either the `owning_account` or
   *  `partner_account` are returned.
   *  Format: `accountTypes/{account_type}/accounts/{account}`
   */
  // const parent = 'abc123'
  /**
   *  The maximum number of partner links to return. The service may return
   *  fewer than this value.
   *  If unspecified, at most 50 partner links will be returned.
   *  The maximum value is 100; values above 100 will be coerced to 100.
   */
  // const pageSize = 1234
  /**
   *  A page token, received from a previous `SearchPartnerLinks` call.
   *  Provide this to retrieve the subsequent page.
   *  When paginating, all other parameters provided to `SearchPartnerLinks`
   *  must match the call that provided the page token.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. A filter string (https://google.aip.dev/160). All fields need to
   *  be on the left hand side of each condition (for example: `partner_link_id =
   *  123456789`). Fields must be specified using either all camel
   *  case (https://en.wikipedia.org/wiki/Camel_case) or all snake
   *  case (https://en.wikipedia.org/wiki/Snake_case). Don't use a combination of
   *  camel case and snake case.
   *  Supported operations:
   *  - `AND`
   *  - `=`
   *  - `!=`
   *  Supported fields:
   *  - `partner_link_id`
   *  - `owning_account.account_type`
   *  - `owning_account.account_id`
   *  - `partner_account.account_type`
   *  - `partner_account.account_id`
   *  - `feature_set`
   *  For partner links with the
   *  FEATURE_SET_AD_EVENT_MANAGEMENT google.ads.datamanager.v1.FeatureSet.FEATURE_SET_AD_EVENT_MANAGEMENT 
   *  feature set, the following fields are also supported:
   *  - `partner_customer_account.account_id`
   *  Example:
   *  `owning_account.account_type = "GOOGLE_ADS" AND partner_account.account_id
   *  = 987654321`
   */
  // const filter = 'abc123'

  // Imports the Datamanager library
  const {PartnerLinkServiceClient} = require('@google-ads/datamanager').v1;

  // Instantiates a client
  const datamanagerClient = new PartnerLinkServiceClient();

  async function callSearchPartnerLinks() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = datamanagerClient.searchPartnerLinksAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callSearchPartnerLinks();

searchPartnerLinksStream(request, options)

searchPartnerLinksStream(request?: protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, options?: CallOptions): Transform;

Equivalent to searchPartnerLinks, but returns a NodeJS Stream object.

Parameters
Name Description
request ISearchPartnerLinksRequest

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 PartnerLink 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 searchPartnerLinksAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

userListDirectLicensePath(accountType, account, userListDirectLicense)

userListDirectLicensePath(accountType: string, account: string, userListDirectLicense: string): string;

Return a fully-qualified userListDirectLicense resource name string.

Parameters
Name Description
accountType string
account string
userListDirectLicense string
Returns
Type Description
string

{string} Resource name string.

userListGlobalLicenseCustomerInfoPath(accountType, account, userListGlobalLicense, licenseCustomerInfo)

userListGlobalLicenseCustomerInfoPath(accountType: string, account: string, userListGlobalLicense: string, licenseCustomerInfo: string): string;

Return a fully-qualified userListGlobalLicenseCustomerInfo resource name string.

Parameters
Name Description
accountType string
account string
userListGlobalLicense string
licenseCustomerInfo string
Returns
Type Description
string

{string} Resource name string.

userListGlobalLicensePath(accountType, account, userListGlobalLicense)

userListGlobalLicensePath(accountType: string, account: string, userListGlobalLicense: string): string;

Return a fully-qualified userListGlobalLicense resource name string.

Parameters
Name Description
accountType string
account string
userListGlobalLicense string
Returns
Type Description
string

{string} Resource name string.

userListPath(accountType, account, userList)

userListPath(accountType: string, account: string, userList: string): string;

Return a fully-qualified userList resource name string.

Parameters
Name Description
accountType string
account string
userList string
Returns
Type Description
string

{string} Resource name string.