import { CancellableStream } from "google-gax"; import { ClientOptions } from "./client"; import { Hooks } from "./hooks"; import { services } from "./protos"; import ServiceFactory from "./protos/autogen/serviceFactory"; import { CustomerOptions, MutateOperation, MutateOptions, ReportOptions, RequestOptions } from "./types"; export declare class Customer extends ServiceFactory { constructor(clientOptions: ClientOptions, customerOptions: CustomerOptions, hooks?: Hooks); /** @description Single query using a raw GAQL string. @hooks onQueryStart, onQueryError, onQueryEnd */ query(gaqlQuery: string, requestOptions?: Readonly): Promise; /** @description Stream query using a raw GAQL string. If a generic type is provided, it must be the type of a single row. If a summary row is requested then this will be the last emitted row of the stream. @hooks onStreamStart, onStreamError @example const stream = queryStream(gaqlQuery) for await (const row of stream) { ... } */ queryStream(gaqlQuery: string, requestOptions?: Readonly): AsyncGenerator; /** @description Single query using ReportOptions. If a summary row is requested then this will be the first row of the results. @hooks onQueryStart, onQueryError, onQueryEnd */ report(options: Readonly): Promise; /** @description Get the total row count of a report. @hooks none */ reportCount(options: Readonly): Promise; /** @description Stream query using ReportOptions. If a generic type is provided, it must be the type of a single row. If a summary row is requested then this will be the last emitted row of the stream. @hooks onStreamStart, onStreamError @example const stream = reportStream(reportOptions) for await (const row of stream) { ... } */ reportStream(reportOptions: Readonly): AsyncGenerator; /** @description Retreive the raw stream using ReportOptions. @hooks onStreamStart @example const stream = reportStreamRaw(reportOptions) stream.on('data', (chunk) => { ... }) // a chunk contains up to 10,000 un-parsed rows stream.on('error', (error) => { ... }) stream.on('end', () => { ... }) */ reportStreamRaw(reportOptions: Readonly): Promise; private search; private paginatedSearch; private useStreamToImitateRegularSearch; private querier; private streamer; private handleStreamError; /** * @description Creates, updates, or removes resources. This method supports atomic transactions * with multiple types of resources. For example, you can atomically create a campaign and a * campaign budget, or perform up to thousands of mutates atomically. * @hooks onMutationStart, onMutationError, onMutationEnd */ mutateResources(mutations: MutateOperation[], mutateOptions?: MutateOptions): Promise; private get googleAdsFields(); private prepareGoogleAdsServicePostRequestArgs; private decamelizeKeysIfNeeded; private gaqlQueryStringIncludesLimit; private generateTooManyRowsError; }