Class v1.IngestionServiceClient (0.1.0)

Service for sending audience data to supported destinations. v1

Package

@google-ads/datamanager

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of IngestionServiceClient.

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 IngestionServiceClient({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;

ingestionServiceStub

ingestionServiceStub?: Promise<{
        [name: string]: Function;
    }>;

innerApiCalls

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

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

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.

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

ingestAudienceMembers(request, options)

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

Uploads a list of AudienceMember resources to the provided Destination.

Parameters
Name Description
request IIngestAudienceMembersRequest

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.IIngestAudienceMembersResponse, protos.google.ads.datamanager.v1.IIngestAudienceMembersRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing IngestAudienceMembersResponse. 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 list of destinations to send the audience members to.
   */
  // const destinations = [1,2,3,4]
  /**
   *  Required. The list of users to send to the specified destinations. At most
   *  10000 AudienceMember google.ads.datamanager.v1.AudienceMember  resources
   *  can be sent in a single request.
   */
  // const audienceMembers = [1,2,3,4]
  /**
   *  Optional. Request-level consent to apply to all users in the request.
   *  User-level consent overrides request-level consent, and can be specified in
   *  each AudienceMember google.ads.datamanager.v1.AudienceMember.
   */
  // const consent = {}
  /**
   *  Optional. For testing purposes. If `true`, the request is validated but not
   *  executed. Only errors are returned, not results.
   */
  // const validateOnly = true
  /**
   *  Optional. Required for UserData google.ads.datamanager.v1.UserData 
   *  uploads. The encoding type of the user identifiers. For hashed user
   *  identifiers, this is the encoding type of the hashed string. For encrypted
   *  hashed user identifiers, this is the encoding type of the outer encrypted
   *  string, but not necessarily the inner hashed string, meaning the inner
   *  hashed string could be encoded in a different way than the outer encrypted
   *  string. For non `UserData` uploads, this field is ignored.
   */
  // const encoding = {}
  /**
   *  Optional. Encryption information for
   *  UserData google.ads.datamanager.v1.UserData  uploads. If not set, it's
   *  assumed that uploaded identifying information is hashed but not encrypted.
   *  For non `UserData` uploads, this field is ignored.
   */
  // const encryptionInfo = {}
  /**
   *  Optional. The terms of service that the user has accepted/rejected.
   */
  // const termsOfService = {}

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

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

  async function callIngestAudienceMembers() {
    // Construct request
    const request = {
      destinations,
      audienceMembers,
    };

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

  callIngestAudienceMembers();

ingestAudienceMembers(request, options, callback)

ingestAudienceMembers(request: protos.google.ads.datamanager.v1.IIngestAudienceMembersRequest, options: CallOptions, callback: Callback<protos.google.ads.datamanager.v1.IIngestAudienceMembersResponse, protos.google.ads.datamanager.v1.IIngestAudienceMembersRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IIngestAudienceMembersRequest
options CallOptions
callback Callback<protos.google.ads.datamanager.v1.IIngestAudienceMembersResponse, protos.google.ads.datamanager.v1.IIngestAudienceMembersRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

ingestAudienceMembers(request, callback)

ingestAudienceMembers(request: protos.google.ads.datamanager.v1.IIngestAudienceMembersRequest, callback: Callback<protos.google.ads.datamanager.v1.IIngestAudienceMembersResponse, protos.google.ads.datamanager.v1.IIngestAudienceMembersRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IIngestAudienceMembersRequest
callback Callback<protos.google.ads.datamanager.v1.IIngestAudienceMembersResponse, protos.google.ads.datamanager.v1.IIngestAudienceMembersRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

ingestEvents(request, options)

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

Uploads a list of Event resources from the provided Destination.

Parameters
Name Description
request IIngestEventsRequest

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.IIngestEventsResponse, protos.google.ads.datamanager.v1.IIngestEventsRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing IngestEventsResponse. 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 list of destinations to send the events to.
   */
  // const destinations = [1,2,3,4]
  /**
   *  Required. The list of events to send to the specified destinations. At most
   *  2000 Event google.ads.datamanager.v1.Event  resources
   *  can be sent in a single request.
   */
  // const events = [1,2,3,4]
  /**
   *  Optional. Request-level consent to apply to all users in the request.
   *  User-level consent overrides request-level consent, and can be specified in
   *  each Event google.ads.datamanager.v1.Event.
   */
  // const consent = {}
  /**
   *  Optional. For testing purposes. If `true`, the request is validated but not
   *  executed. Only errors are returned, not results.
   */
  // const validateOnly = true
  /**
   *  Optional. Required for UserData google.ads.datamanager.v1.UserData 
   *  uploads. The encoding type of the user identifiers. For hashed user
   *  identifiers, this is the encoding type of the hashed string. For encrypted
   *  hashed user identifiers, this is the encoding type of the outer encrypted
   *  string, but not necessarily the inner hashed string, meaning the inner
   *  hashed string could be encoded in a different way than the outer encrypted
   *  string. For non `UserData` uploads, this field is ignored.
   */
  // const encoding = {}
  /**
   *  Optional. Encryption information for
   *  UserData google.ads.datamanager.v1.UserData  uploads. If not set, it's
   *  assumed that uploaded identifying information is hashed but not encrypted.
   *  For non `UserData` uploads, this field is ignored.
   */
  // const encryptionInfo = {}

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

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

  async function callIngestEvents() {
    // Construct request
    const request = {
      destinations,
      events,
    };

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

  callIngestEvents();

ingestEvents(request, options, callback)

ingestEvents(request: protos.google.ads.datamanager.v1.IIngestEventsRequest, options: CallOptions, callback: Callback<protos.google.ads.datamanager.v1.IIngestEventsResponse, protos.google.ads.datamanager.v1.IIngestEventsRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IIngestEventsRequest
options CallOptions
callback Callback<protos.google.ads.datamanager.v1.IIngestEventsResponse, protos.google.ads.datamanager.v1.IIngestEventsRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

ingestEvents(request, callback)

ingestEvents(request: protos.google.ads.datamanager.v1.IIngestEventsRequest, callback: Callback<protos.google.ads.datamanager.v1.IIngestEventsResponse, protos.google.ads.datamanager.v1.IIngestEventsRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IIngestEventsRequest
callback Callback<protos.google.ads.datamanager.v1.IIngestEventsResponse, protos.google.ads.datamanager.v1.IIngestEventsRequest | null | undefined, {} | null | 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.

removeAudienceMembers(request, options)

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

Removes a list of AudienceMember resources from the provided Destination.

Parameters
Name Description
request IRemoveAudienceMembersRequest

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.IRemoveAudienceMembersResponse, protos.google.ads.datamanager.v1.IRemoveAudienceMembersRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing RemoveAudienceMembersResponse. 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 list of destinations to remove the users from.
   */
  // const destinations = [1,2,3,4]
  /**
   *  Required. The list of users to remove.
   */
  // const audienceMembers = [1,2,3,4]
  /**
   *  Optional. For testing purposes. If `true`, the request is validated but not
   *  executed. Only errors are returned, not results.
   */
  // const validateOnly = true
  /**
   *  Optional. Required for UserData google.ads.datamanager.v1.UserData 
   *  uploads. The encoding type of the user identifiers. Applies to only the
   *  outer encoding for encrypted user identifiers. For non `UserData` uploads,
   *  this field is ignored.
   */
  // const encoding = {}
  /**
   *  Optional. Encryption information for
   *  UserData google.ads.datamanager.v1.UserData  uploads. If not set, it's
   *  assumed that uploaded identifying information is hashed but not encrypted.
   *  For non `UserData` uploads, this field is ignored.
   */
  // const encryptionInfo = {}

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

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

  async function callRemoveAudienceMembers() {
    // Construct request
    const request = {
      destinations,
      audienceMembers,
    };

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

  callRemoveAudienceMembers();

removeAudienceMembers(request, options, callback)

removeAudienceMembers(request: protos.google.ads.datamanager.v1.IRemoveAudienceMembersRequest, options: CallOptions, callback: Callback<protos.google.ads.datamanager.v1.IRemoveAudienceMembersResponse, protos.google.ads.datamanager.v1.IRemoveAudienceMembersRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IRemoveAudienceMembersRequest
options CallOptions
callback Callback<protos.google.ads.datamanager.v1.IRemoveAudienceMembersResponse, protos.google.ads.datamanager.v1.IRemoveAudienceMembersRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

removeAudienceMembers(request, callback)

removeAudienceMembers(request: protos.google.ads.datamanager.v1.IRemoveAudienceMembersRequest, callback: Callback<protos.google.ads.datamanager.v1.IRemoveAudienceMembersResponse, protos.google.ads.datamanager.v1.IRemoveAudienceMembersRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IRemoveAudienceMembersRequest
callback Callback<protos.google.ads.datamanager.v1.IRemoveAudienceMembersResponse, protos.google.ads.datamanager.v1.IRemoveAudienceMembersRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

retrieveRequestStatus(request, options)

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

Gets the status of a request given request id.

Parameters
Name Description
request IRetrieveRequestStatusRequest

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.IRetrieveRequestStatusResponse, protos.google.ads.datamanager.v1.IRetrieveRequestStatusRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing RetrieveRequestStatusResponse. 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. Required. The request ID of the Data Manager API request.
   */
  // const requestId = 'abc123'

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

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

  async function callRetrieveRequestStatus() {
    // Construct request
    const request = {
      requestId,
    };

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

  callRetrieveRequestStatus();

retrieveRequestStatus(request, options, callback)

retrieveRequestStatus(request: protos.google.ads.datamanager.v1.IRetrieveRequestStatusRequest, options: CallOptions, callback: Callback<protos.google.ads.datamanager.v1.IRetrieveRequestStatusResponse, protos.google.ads.datamanager.v1.IRetrieveRequestStatusRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IRetrieveRequestStatusRequest
options CallOptions
callback Callback<protos.google.ads.datamanager.v1.IRetrieveRequestStatusResponse, protos.google.ads.datamanager.v1.IRetrieveRequestStatusRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

retrieveRequestStatus(request, callback)

retrieveRequestStatus(request: protos.google.ads.datamanager.v1.IRetrieveRequestStatusRequest, callback: Callback<protos.google.ads.datamanager.v1.IRetrieveRequestStatusResponse, protos.google.ads.datamanager.v1.IRetrieveRequestStatusRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IRetrieveRequestStatusRequest
callback Callback<protos.google.ads.datamanager.v1.IRetrieveRequestStatusResponse, protos.google.ads.datamanager.v1.IRetrieveRequestStatusRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void