File

src/apis/localservices/v1.ts

Index

Properties
Methods

Constructor

constructor(context: APIRequestContext)
Parameters :
Name Type Optional
context APIRequestContext No

Properties

context
Type : APIRequestContext

Methods

search
search(params: Params$Resource$Accountreports$Search, options: StreamMethodOptions)

Get account reports containing aggregate account data of all linked GLS accounts. Caller needs to provide their manager customer id and the associated auth credential that allows them read permissions on their linked accounts.

// Before running the sample:
// - Enable the API at:
//   https://console.developers.google.com/apis/api/localservices.googleapis.com
// - Login into gcloud by running:
//   `$ gcloud auth application-default login`
// - Install the npm module by running:
//   `$ npm install googleapis`

const {google} = require('googleapis');
const localservices = google.localservices('v1');

async function main() {
  const auth = new google.auth.GoogleAuth({
    // Scopes can be specified either as an array or as a single, space-delimited string.
    scopes: ['https://www.googleapis.com/auth/adwords'],
  });

  // Acquire an auth client, and bind it to all future calls
  const authClient = await auth.getClient();
  google.options({auth: authClient});

  // Do the magic
  const res = await localservices.accountReports.search({
    // Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
    'endDate.day': 'placeholder-value',
    // Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
    'endDate.month': 'placeholder-value',
    // Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
    'endDate.year': 'placeholder-value',
    // The maximum number of accounts to return. If the page size is unset, page size will default to 1000. Maximum page_size is 10000. Optional.
    pageSize: 'placeholder-value',
    // The `next_page_token` value returned from a previous request to SearchAccountReports that indicates where listing should continue. Optional.
    pageToken: 'placeholder-value',
    // A query string for searching for account reports. Caller must provide a customer id of their MCC account with an associated Gaia Mint that allows read permission on their linked accounts. Search expressions are case insensitive. Example query: | Query | Description | |-------------------------|-----------------------------------------------| | manager_customer_id:123 | Get Account Report for Manager with id 123. | Required.
    query: 'placeholder-value',
    // Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
    'startDate.day': 'placeholder-value',
    // Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
    'startDate.month': 'placeholder-value',
    // Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
    'startDate.year': 'placeholder-value',
  });
  console.log(res.data);

  // Example response
  // {
  //   "accountReports": [],
  //   "nextPageToken": "my_nextPageToken"
  // }
}

main().catch(e => {
  console.error(e);
  throw e;
});
Parameters :
Name Type Optional Description
params Params$Resource$Accountreports$Search No
  • Parameters for request
options StreamMethodOptions No
  • Optionally override request options, such as url, method, and encoding.
Example :
<pre><code class="language-js">// Before running the sample:
// - Enable the API at:
//   https://console.developers.google.com/apis/api/localservices.googleapis.com
// - Login into gcloud by running:
//   `$ gcloud auth application-default login`
// - Install the npm module by running:
//   `$ npm install googleapis`

const {google} = require(&#39;googleapis&#39;);
const localservices = google.localservices(&#39;v1&#39;);

async function main() {
  const auth = new google.auth.GoogleAuth({
    // Scopes can be specified either as an array or as a single, space-delimited string.
    scopes: [&#39;https://www.googleapis.com/auth/adwords&#39;],
  });

  // Acquire an auth client, and bind it to all future calls
  const authClient = await auth.getClient();
  google.options({auth: authClient});

  // Do the magic
  const res = await localservices.accountReports.search({
    // Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn&#39;t significant.
    &#39;endDate.day&#39;: &#39;placeholder-value&#39;,
    // Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
    &#39;endDate.month&#39;: &#39;placeholder-value&#39;,
    // Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
    &#39;endDate.year&#39;: &#39;placeholder-value&#39;,
    // The maximum number of accounts to return. If the page size is unset, page size will default to 1000. Maximum page_size is 10000. Optional.
    pageSize: &#39;placeholder-value&#39;,
    // The `next_page_token` value returned from a previous request to SearchAccountReports that indicates where listing should continue. Optional.
    pageToken: &#39;placeholder-value&#39;,
    // A query string for searching for account reports. Caller must provide a customer id of their MCC account with an associated Gaia Mint that allows read permission on their linked accounts. Search expressions are case insensitive. Example query: | Query | Description | |-------------------------|-----------------------------------------------| | manager_customer_id:123 | Get Account Report for Manager with id 123. | Required.
    query: &#39;placeholder-value&#39;,
    // Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn&#39;t significant.
    &#39;startDate.day&#39;: &#39;placeholder-value&#39;,
    // Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
    &#39;startDate.month&#39;: &#39;placeholder-value&#39;,
    // Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
    &#39;startDate.year&#39;: &#39;placeholder-value&#39;,
  });
  console.log(res.data);

  // Example response
  // {
  //   &quot;accountReports&quot;: [],
  //   &quot;nextPageToken&quot;: &quot;my_nextPageToken&quot;
  // }
}

main().catch(e =&gt; {
  console.error(e);
  throw e;
});
</code></pre>
Returns : GaxiosPromise<Readable>

A promise if used with async/await, or void if used with a callback.

search
search(params?: Params$Resource$Accountreports$Search, options?: MethodOptions)
Parameters :
Name Type Optional
params Params$Resource$Accountreports$Search Yes
options MethodOptions Yes
search
search(params: Params$Resource$Accountreports$Search, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback)
Parameters :
Name Type Optional
params Params$Resource$Accountreports$Search No
options StreamMethodOptions | BodyResponseCallback<Readable> No
callback BodyResponseCallback<Readable> No
Returns : void
search
search(params: Params$Resource$Accountreports$Search, options: MethodOptions | BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse>, callback: BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse>)
Returns : void
search
search(params: Params$Resource$Accountreports$Search, callback: BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse>)
Returns : void
search
search(callback: BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse>)
Returns : void
search
search(paramsOrCallback?: Params$Resource$Accountreports$Search | BodyResponseCallback | BodyResponseCallback, optionsOrCallback?: MethodOptions | StreamMethodOptions | BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse> | BodyResponseCallback<Readable>, callback?: BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse> | BodyResponseCallback<Readable>)
Parameters :
Name Type Optional
paramsOrCallback Params$Resource$Accountreports$Search | BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse> | BodyResponseCallback<Readable> Yes
optionsOrCallback MethodOptions | StreamMethodOptions | BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse> | BodyResponseCallback<Readable> Yes
callback BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse> | BodyResponseCallback<Readable> Yes
Returns : void | GaxiosPromise | GaxiosPromise
import {
  OAuth2Client,
  JWT,
  Compute,
  UserRefreshClient,
  BaseExternalAccountClient,
  GaxiosPromise,
  GoogleConfigurable,
  createAPIRequest,
  MethodOptions,
  StreamMethodOptions,
  GlobalOptions,
  GoogleAuth,
  BodyResponseCallback,
  APIRequestContext,
} from 'googleapis-common';
import {Readable} from 'stream';

export namespace localservices_v1 {
  export interface Options extends GlobalOptions {
    version: 'v1';
  }

  interface StandardParameters {
    /**
     * Auth client or API Key for the request
     */
    auth?:
      | string
      | OAuth2Client
      | JWT
      | Compute
      | UserRefreshClient
      | BaseExternalAccountClient
      | GoogleAuth;

    /**
     * V1 error format.
     */
    '$.xgafv'?: string;
    /**
     * OAuth access token.
     */
    access_token?: string;
    /**
     * Data format for response.
     */
    alt?: string;
    /**
     * JSONP
     */
    callback?: string;
    /**
     * Selector specifying which fields to include in a partial response.
     */
    fields?: string;
    /**
     * API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
     */
    key?: string;
    /**
     * OAuth 2.0 token for the current user.
     */
    oauth_token?: string;
    /**
     * Returns response with indentations and line breaks.
     */
    prettyPrint?: boolean;
    /**
     * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
     */
    quotaUser?: string;
    /**
     * Legacy upload protocol for media (e.g. "media", "multipart").
     */
    uploadType?: string;
    /**
     * Upload protocol for media (e.g. "raw", "multipart").
     */
    upload_protocol?: string;
  }

  /**
   * Local Services API
   *
   *
   *
   * @example
   * ```js
   * const {google} = require('googleapis');
   * const localservices = google.localservices('v1');
   * ```
   */
  export class Localservices {
    context: APIRequestContext;
    accountReports: Resource$Accountreports;
    detailedLeadReports: Resource$Detailedleadreports;

    constructor(options: GlobalOptions, google?: GoogleConfigurable) {
      this.context = {
        _options: options || {},
        google,
      };

      this.accountReports = new Resource$Accountreports(this.context);
      this.detailedLeadReports = new Resource$Detailedleadreports(this.context);
    }
  }

  /**
   * An Account Report of a GLS account identified by their account id containing aggregate data gathered from a particular date range. Next ID: 18
   */
  export interface Schema$GoogleAdsHomeservicesLocalservicesV1AccountReport {
    /**
     * Unique identifier of the GLS account.
     */
    accountId?: string | null;
    /**
     * Aggregator specific information related to the account.
     */
    aggregatorInfo?: Schema$GoogleAdsHomeservicesLocalservicesV1AggregatorInfo;
    /**
     * Average review rating score from 1-5 stars.
     */
    averageFiveStarRating?: number | null;
    /**
     * Average weekly budget in the currency code of the account.
     */
    averageWeeklyBudget?: number | null;
    /**
     * Business name of the account.
     */
    businessName?: string | null;
    /**
     * Currency code of the account.
     */
    currencyCode?: string | null;
    /**
     * Number of charged leads the account received in current specified period.
     */
    currentPeriodChargedLeads?: string | null;
    /**
     * Number of connected phone calls (duration over 30s) in current specified period.
     */
    currentPeriodConnectedPhoneCalls?: string | null;
    /**
     * Number of phone calls in current specified period, including both connected and unconnected calls.
     */
    currentPeriodPhoneCalls?: string | null;
    /**
     * Total cost of the account in current specified period in the account's specified currency.
     */
    currentPeriodTotalCost?: number | null;
    /**
     * Number of impressions that customers have had in the past 2 days.
     */
    impressionsLastTwoDays?: string | null;
    /**
     * Phone lead responsiveness of the account for the past 90 days from current date. This is computed by taking the total number of connected calls from charged phone leads and dividing by the total number of calls received.
     */
    phoneLeadResponsiveness?: number | null;
    /**
     * Number of charged leads the account received in previous specified period.
     */
    previousPeriodChargedLeads?: string | null;
    /**
     * Number of connected phone calls (duration over 30s) in previous specified period.
     */
    previousPeriodConnectedPhoneCalls?: string | null;
    /**
     * Number of phone calls in previous specified period, including both connected and unconnected calls.
     */
    previousPeriodPhoneCalls?: string | null;
    /**
     * Total cost of the account in previous specified period in the account's specified currency.
     */
    previousPeriodTotalCost?: number | null;
    /**
     * Total number of reviews the account has up to current date.
     */
    totalReview?: number | null;
  }
  /**
   * Conatiner for aggregator specific information if lead is for an aggregator GLS account.
   */
  export interface Schema$GoogleAdsHomeservicesLocalservicesV1AggregatorInfo {
    /**
     * Provider id (listed in aggregator system) which maps to a account id in GLS system.
     */
    aggregatorProviderId?: string | null;
  }
  /**
   * A Detailed Lead Report of a lead identified by their lead id and contains consumer, account, monetization, and lead data.
   */
  export interface Schema$GoogleAdsHomeservicesLocalservicesV1DetailedLeadReport {
    /**
     * Identifies account that received the lead.
     */
    accountId?: string | null;
    /**
     * Aggregator specific information related to the lead.
     */
    aggregatorInfo?: Schema$GoogleAdsHomeservicesLocalservicesV1AggregatorInfo;
    /**
     * Business name associated to the account.
     */
    businessName?: string | null;
    /**
     * Whether the lead has been charged.
     */
    chargeStatus?: string | null;
    /**
     * Currency code.
     */
    currencyCode?: string | null;
    /**
     * Dispute status related to the lead.
     */
    disputeStatus?: string | null;
    /**
     * Location of the associated account's home city.
     */
    geo?: string | null;
    /**
     * Lead category (e.g. hvac, plumber)
     */
    leadCategory?: string | null;
    /**
     * Timestamp of when the lead was created.
     */
    leadCreationTimestamp?: string | null;
    /**
     * Unique identifier of a Detailed Lead Report.
     */
    leadId?: string | null;
    /**
     * Price of the lead (available only after it has been charged).
     */
    leadPrice?: number | null;
    /**
     * Lead type.
     */
    leadType?: string | null;
    /**
     * More information associated to only message leads.
     */
    messageLead?: Schema$GoogleAdsHomeservicesLocalservicesV1MessageLead;
    /**
     * More information associated to only phone leads.
     */
    phoneLead?: Schema$GoogleAdsHomeservicesLocalservicesV1PhoneLead;
    /**
     * Timezone of the particular provider associated to a lead.
     */
    timezone?: Schema$GoogleTypeTimeZone;
  }
  /**
   * Container for message lead specific information.
   */
  export interface Schema$GoogleAdsHomeservicesLocalservicesV1MessageLead {
    /**
     * Consumer phone number associated with the message lead.
     */
    consumerPhoneNumber?: string | null;
    /**
     * Name of the customer who created the lead.
     */
    customerName?: string | null;
    /**
     * The job type of the specified lead.
     */
    jobType?: string | null;
    /**
     * The postal code of the customer who created the lead.
     */
    postalCode?: string | null;
  }
  /**
   * Container for phone lead specific information.
   */
  export interface Schema$GoogleAdsHomeservicesLocalservicesV1PhoneLead {
    /**
     * Timestamp of the phone call which resulted in a charged phone lead.
     */
    chargedCallTimestamp?: string | null;
    /**
     * Duration of the charged phone call in seconds.
     */
    chargedConnectedCallDurationSeconds?: string | null;
    /**
     * Consumer phone number associated with the phone lead.
     */
    consumerPhoneNumber?: string | null;
  }
  /**
   * A page of the response received from the SearchAccountReports method. A paginated response where more pages are available has `next_page_token` set. This token can be used in a subsequent request to retrieve the next request page.
   */
  export interface Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse {
    /**
     * List of account reports which maps 1:1 to a particular linked GLS account.
     */
    accountReports?: Schema$GoogleAdsHomeservicesLocalservicesV1AccountReport[];
    /**
     * Pagination token to retrieve the next page of results. When `next_page_token` is not filled in, there is no next page and the list returned is the last page in the result set.
     */
    nextPageToken?: string | null;
  }
  /**
   * A page of the response received from the SearchDetailedLeadReports method. A paginated response where more pages are available has `next_page_token` set. This token can be used in a subsequent request to retrieve the next request page.
   */
  export interface Schema$GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse {
    /**
     * List of detailed lead reports uniquely identified by external lead id.
     */
    detailedLeadReports?: Schema$GoogleAdsHomeservicesLocalservicesV1DetailedLeadReport[];
    /**
     * Pagination token to retrieve the next page of results. When `next_page_token` is not filled in, there is no next page and the list returned is the last page in the result set.
     */
    nextPageToken?: string | null;
  }
  /**
   * Represents a time zone from the [IANA Time Zone Database](https://www.iana.org/time-zones).
   */
  export interface Schema$GoogleTypeTimeZone {
    /**
     * IANA Time Zone Database time zone, e.g. "America/New_York".
     */
    id?: string | null;
    /**
     * Optional. IANA Time Zone Database version number, e.g. "2019a".
     */
    version?: string | null;
  }

  export class Resource$Accountreports {
    context: APIRequestContext;
    constructor(context: APIRequestContext) {
      this.context = context;
    }

    /**
     * Get account reports containing aggregate account data of all linked GLS accounts. Caller needs to provide their manager customer id and the associated auth credential that allows them read permissions on their linked accounts.
     * @example
     * ```js
     * // Before running the sample:
     * // - Enable the API at:
     * //   https://console.developers.google.com/apis/api/localservices.googleapis.com
     * // - Login into gcloud by running:
     * //   `$ gcloud auth application-default login`
     * // - Install the npm module by running:
     * //   `$ npm install googleapis`
     *
     * const {google} = require('googleapis');
     * const localservices = google.localservices('v1');
     *
     * async function main() {
     *   const auth = new google.auth.GoogleAuth({
     *     // Scopes can be specified either as an array or as a single, space-delimited string.
     *     scopes: ['https://www.googleapis.com/auth/adwords'],
     *   });
     *
     *   // Acquire an auth client, and bind it to all future calls
     *   const authClient = await auth.getClient();
     *   google.options({auth: authClient});
     *
     *   // Do the magic
     *   const res = await localservices.accountReports.search({
     *     // Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
     *     'endDate.day': 'placeholder-value',
     *     // Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
     *     'endDate.month': 'placeholder-value',
     *     // Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
     *     'endDate.year': 'placeholder-value',
     *     // The maximum number of accounts to return. If the page size is unset, page size will default to 1000. Maximum page_size is 10000. Optional.
     *     pageSize: 'placeholder-value',
     *     // The `next_page_token` value returned from a previous request to SearchAccountReports that indicates where listing should continue. Optional.
     *     pageToken: 'placeholder-value',
     *     // A query string for searching for account reports. Caller must provide a customer id of their MCC account with an associated Gaia Mint that allows read permission on their linked accounts. Search expressions are case insensitive. Example query: | Query | Description | |-------------------------|-----------------------------------------------| | manager_customer_id:123 | Get Account Report for Manager with id 123. | Required.
     *     query: 'placeholder-value',
     *     // Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
     *     'startDate.day': 'placeholder-value',
     *     // Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
     *     'startDate.month': 'placeholder-value',
     *     // Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
     *     'startDate.year': 'placeholder-value',
     *   });
     *   console.log(res.data);
     *
     *   // Example response
     *   // {
     *   //   "accountReports": [],
     *   //   "nextPageToken": "my_nextPageToken"
     *   // }
     * }
     *
     * main().catch(e => {
     *   console.error(e);
     *   throw e;
     * });
     *
     * ```
     *
     * @param params - Parameters for request
     * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
     * @param callback - Optional callback that handles the response.
     * @returns A promise if used with async/await, or void if used with a callback.
     */
    search(
      params: Params$Resource$Accountreports$Search,
      options: StreamMethodOptions
    ): GaxiosPromise<Readable>;
    search(
      params?: Params$Resource$Accountreports$Search,
      options?: MethodOptions
    ): GaxiosPromise<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse>;
    search(
      params: Params$Resource$Accountreports$Search,
      options: StreamMethodOptions | BodyResponseCallback<Readable>,
      callback: BodyResponseCallback<Readable>
    ): void;
    search(
      params: Params$Resource$Accountreports$Search,
      options:
        | MethodOptions
        | BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse>,
      callback: BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse>
    ): void;
    search(
      params: Params$Resource$Accountreports$Search,
      callback: BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse>
    ): void;
    search(
      callback: BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse>
    ): void;
    search(
      paramsOrCallback?:
        | Params$Resource$Accountreports$Search
        | BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse>
        | BodyResponseCallback<Readable>,
      optionsOrCallback?:
        | MethodOptions
        | StreamMethodOptions
        | BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse>
        | BodyResponseCallback<Readable>,
      callback?:
        | BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse>
        | BodyResponseCallback<Readable>
    ):
      | void
      | GaxiosPromise<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse>
      | GaxiosPromise<Readable> {
      let params = (paramsOrCallback ||
        {}) as Params$Resource$Accountreports$Search;
      let options = (optionsOrCallback || {}) as MethodOptions;

      if (typeof paramsOrCallback === 'function') {
        callback = paramsOrCallback;
        params = {} as Params$Resource$Accountreports$Search;
        options = {};
      }

      if (typeof optionsOrCallback === 'function') {
        callback = optionsOrCallback;
        options = {};
      }

      const rootUrl =
        options.rootUrl || 'https://localservices.googleapis.com/';
      const parameters = {
        options: Object.assign(
          {
            url: (rootUrl + '/v1/accountReports:search').replace(
              /([^:]\/)\/+/g,
              '$1'
            ),
            method: 'GET',
          },
          options
        ),
        params,
        requiredParams: [],
        pathParams: [],
        context: this.context,
      };
      if (callback) {
        createAPIRequest<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse>(
          parameters,
          callback as BodyResponseCallback<unknown>
        );
      } else {
        return createAPIRequest<Schema$GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse>(
          parameters
        );
      }
    }
  }

  export interface Params$Resource$Accountreports$Search
    extends StandardParameters {
    /**
     * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
     */
    'endDate.day'?: number;
    /**
     * Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
     */
    'endDate.month'?: number;
    /**
     * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
     */
    'endDate.year'?: number;
    /**
     * The maximum number of accounts to return. If the page size is unset, page size will default to 1000. Maximum page_size is 10000. Optional.
     */
    pageSize?: number;
    /**
     * The `next_page_token` value returned from a previous request to SearchAccountReports that indicates where listing should continue. Optional.
     */
    pageToken?: string;
    /**
     * A query string for searching for account reports. Caller must provide a customer id of their MCC account with an associated Gaia Mint that allows read permission on their linked accounts. Search expressions are case insensitive. Example query: | Query | Description | |-------------------------|-----------------------------------------------| | manager_customer_id:123 | Get Account Report for Manager with id 123. | Required.
     */
    query?: string;
    /**
     * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
     */
    'startDate.day'?: number;
    /**
     * Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
     */
    'startDate.month'?: number;
    /**
     * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
     */
    'startDate.year'?: number;
  }

  export class Resource$Detailedleadreports {
    context: APIRequestContext;
    constructor(context: APIRequestContext) {
      this.context = context;
    }

    /**
     * Get detailed lead reports containing leads that have been received by all linked GLS accounts. Caller needs to provide their manager customer id and the associated auth credential that allows them read permissions on their linked accounts.
     * @example
     * ```js
     * // Before running the sample:
     * // - Enable the API at:
     * //   https://console.developers.google.com/apis/api/localservices.googleapis.com
     * // - Login into gcloud by running:
     * //   `$ gcloud auth application-default login`
     * // - Install the npm module by running:
     * //   `$ npm install googleapis`
     *
     * const {google} = require('googleapis');
     * const localservices = google.localservices('v1');
     *
     * async function main() {
     *   const auth = new google.auth.GoogleAuth({
     *     // Scopes can be specified either as an array or as a single, space-delimited string.
     *     scopes: ['https://www.googleapis.com/auth/adwords'],
     *   });
     *
     *   // Acquire an auth client, and bind it to all future calls
     *   const authClient = await auth.getClient();
     *   google.options({auth: authClient});
     *
     *   // Do the magic
     *   const res = await localservices.detailedLeadReports.search({
     *     // Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
     *     'endDate.day': 'placeholder-value',
     *     // Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
     *     'endDate.month': 'placeholder-value',
     *     // Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
     *     'endDate.year': 'placeholder-value',
     *     // The maximum number of accounts to return. If the page size is unset, page size will default to 1000. Maximum page_size is 10000. Optional.
     *     pageSize: 'placeholder-value',
     *     // The `next_page_token` value returned from a previous request to SearchDetailedLeadReports that indicates where listing should continue. Optional.
     *     pageToken: 'placeholder-value',
     *     // A query string for searching for account reports. Caller must provide a customer id of their MCC account with an associated Gaia Mint that allows read permission on their linked accounts. Search expressions are case insensitive. Example query: | Query | Description | |-------------------------|-----------------------------------------------| | manager_customer_id:123 | Get Detailed Lead Report for Manager with id | | | 123. | Required.
     *     query: 'placeholder-value',
     *     // Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
     *     'startDate.day': 'placeholder-value',
     *     // Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
     *     'startDate.month': 'placeholder-value',
     *     // Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
     *     'startDate.year': 'placeholder-value',
     *   });
     *   console.log(res.data);
     *
     *   // Example response
     *   // {
     *   //   "detailedLeadReports": [],
     *   //   "nextPageToken": "my_nextPageToken"
     *   // }
     * }
     *
     * main().catch(e => {
     *   console.error(e);
     *   throw e;
     * });
     *
     * ```
     *
     * @param params - Parameters for request
     * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
     * @param callback - Optional callback that handles the response.
     * @returns A promise if used with async/await, or void if used with a callback.
     */
    search(
      params: Params$Resource$Detailedleadreports$Search,
      options: StreamMethodOptions
    ): GaxiosPromise<Readable>;
    search(
      params?: Params$Resource$Detailedleadreports$Search,
      options?: MethodOptions
    ): GaxiosPromise<Schema$GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse>;
    search(
      params: Params$Resource$Detailedleadreports$Search,
      options: StreamMethodOptions | BodyResponseCallback<Readable>,
      callback: BodyResponseCallback<Readable>
    ): void;
    search(
      params: Params$Resource$Detailedleadreports$Search,
      options:
        | MethodOptions
        | BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse>,
      callback: BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse>
    ): void;
    search(
      params: Params$Resource$Detailedleadreports$Search,
      callback: BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse>
    ): void;
    search(
      callback: BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse>
    ): void;
    search(
      paramsOrCallback?:
        | Params$Resource$Detailedleadreports$Search
        | BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse>
        | BodyResponseCallback<Readable>,
      optionsOrCallback?:
        | MethodOptions
        | StreamMethodOptions
        | BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse>
        | BodyResponseCallback<Readable>,
      callback?:
        | BodyResponseCallback<Schema$GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse>
        | BodyResponseCallback<Readable>
    ):
      | void
      | GaxiosPromise<Schema$GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse>
      | GaxiosPromise<Readable> {
      let params = (paramsOrCallback ||
        {}) as Params$Resource$Detailedleadreports$Search;
      let options = (optionsOrCallback || {}) as MethodOptions;

      if (typeof paramsOrCallback === 'function') {
        callback = paramsOrCallback;
        params = {} as Params$Resource$Detailedleadreports$Search;
        options = {};
      }

      if (typeof optionsOrCallback === 'function') {
        callback = optionsOrCallback;
        options = {};
      }

      const rootUrl =
        options.rootUrl || 'https://localservices.googleapis.com/';
      const parameters = {
        options: Object.assign(
          {
            url: (rootUrl + '/v1/detailedLeadReports:search').replace(
              /([^:]\/)\/+/g,
              '$1'
            ),
            method: 'GET',
          },
          options
        ),
        params,
        requiredParams: [],
        pathParams: [],
        context: this.context,
      };
      if (callback) {
        createAPIRequest<Schema$GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse>(
          parameters,
          callback as BodyResponseCallback<unknown>
        );
      } else {
        return createAPIRequest<Schema$GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse>(
          parameters
        );
      }
    }
  }

  export interface Params$Resource$Detailedleadreports$Search
    extends StandardParameters {
    /**
     * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
     */
    'endDate.day'?: number;
    /**
     * Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
     */
    'endDate.month'?: number;
    /**
     * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
     */
    'endDate.year'?: number;
    /**
     * The maximum number of accounts to return. If the page size is unset, page size will default to 1000. Maximum page_size is 10000. Optional.
     */
    pageSize?: number;
    /**
     * The `next_page_token` value returned from a previous request to SearchDetailedLeadReports that indicates where listing should continue. Optional.
     */
    pageToken?: string;
    /**
     * A query string for searching for account reports. Caller must provide a customer id of their MCC account with an associated Gaia Mint that allows read permission on their linked accounts. Search expressions are case insensitive. Example query: | Query | Description | |-------------------------|-----------------------------------------------| | manager_customer_id:123 | Get Detailed Lead Report for Manager with id | | | 123. | Required.
     */
    query?: string;
    /**
     * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
     */
    'startDate.day'?: number;
    /**
     * Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
     */
    'startDate.month'?: number;
    /**
     * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
     */
    'startDate.year'?: number;
  }
}

result-matching ""

    No results matching ""