@google-analytics/data 3.2.1 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,7 @@
1
+ /// <reference types="node" />
1
2
  import type * as gax from 'google-gax';
2
- import type { Callback, CallOptions, Descriptors, ClientOptions } from 'google-gax';
3
+ import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback } from 'google-gax';
4
+ import { Transform } from 'stream';
3
5
  import * as protos from '../../protos/protos';
4
6
  /**
5
7
  * Google Analytics reporting data service.
@@ -20,6 +22,10 @@ export declare class AlphaAnalyticsDataClient {
20
22
  innerApiCalls: {
21
23
  [name: string]: Function;
22
24
  };
25
+ pathTemplates: {
26
+ [name: string]: gax.PathTemplate;
27
+ };
28
+ operationsClient: gax.OperationsClient;
23
29
  alphaAnalyticsDataStub?: Promise<{
24
30
  [name: string]: Function;
25
31
  }>;
@@ -114,6 +120,12 @@ export declare class AlphaAnalyticsDataClient {
114
120
  * improve inefficient or abandoned customer journeys. To learn more, see [GA4
115
121
  * Funnel Explorations](https://support.google.com/analytics/answer/9327974).
116
122
  *
123
+ * This method is introduced at alpha stability with the intention of
124
+ * gathering feedback on syntax and capabilities before entering beta. To give
125
+ * your feedback on this API, complete the [Google Analytics Data API Funnel
126
+ * Reporting
127
+ * Feedback](https://docs.google.com/forms/d/e/1FAIpQLSdwOlQDJAUoBiIgUZZ3S_Lwi8gr7Bb0k1jhvc-DEg7Rol3UjA/viewform).
128
+ *
117
129
  * @param {Object} request
118
130
  * The request object that will be sent.
119
131
  * @param {string} request.property
@@ -143,7 +155,7 @@ export declare class AlphaAnalyticsDataClient {
143
155
  * If specified, next action adds a dimension to the funnel visualization sub
144
156
  * report response. This next action dimension expands each funnel step to the
145
157
  * unique values of the next action. For example a next action of the
146
- * `eventName` dimension will create rows for several events (i.e.
158
+ * `eventName` dimension will create rows for several events (for example
147
159
  * `session_start` & `click`) and the total.
148
160
  *
149
161
  * Next action only supports `eventName` and most Page / Screen dimensions
@@ -163,7 +175,7 @@ export declare class AlphaAnalyticsDataClient {
163
175
  * The segments parameter is optional. Requests are limited to 4 segments.
164
176
  * @param {number} request.limit
165
177
  * The number of rows to return. If unspecified, 10,000 rows are returned. The
166
- * API returns a maximum of 100,000 rows per request, no matter how many you
178
+ * API returns a maximum of 250,000 rows per request, no matter how many you
167
179
  * ask for. `limit` must be positive.
168
180
  *
169
181
  * The API can also return fewer rows than the requested `limit`, if there
@@ -193,6 +205,286 @@ export declare class AlphaAnalyticsDataClient {
193
205
  ]>;
194
206
  runFunnelReport(request: protos.google.analytics.data.v1alpha.IRunFunnelReportRequest, options: CallOptions, callback: Callback<protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, protos.google.analytics.data.v1alpha.IRunFunnelReportRequest | null | undefined, {} | null | undefined>): void;
195
207
  runFunnelReport(request: protos.google.analytics.data.v1alpha.IRunFunnelReportRequest, callback: Callback<protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, protos.google.analytics.data.v1alpha.IRunFunnelReportRequest | null | undefined, {} | null | undefined>): void;
208
+ /**
209
+ * Retrieves an audience list of users. After creating an audience, the users
210
+ * are not immediately available for listing. First, a request to
211
+ * `CreateAudienceList` is necessary to create an audience list of users, and
212
+ * then second, this method is used to retrieve the users in the audience.
213
+ *
214
+ * Audiences in Google Analytics 4 allow you to segment your users in the ways
215
+ * that are important to your business. To learn more, see
216
+ * https://support.google.com/analytics/answer/9267572.
217
+ *
218
+ * @param {Object} request
219
+ * The request object that will be sent.
220
+ * @param {string} request.name
221
+ * The name of the audience list to retrieve users from.
222
+ * Format: `properties/{propertyId}/audienceLists/{audienceListId}`
223
+ * @param {number} request.offset
224
+ * The row count of the start row. The first row is counted as row 0.
225
+ *
226
+ * When paging, the first request does not specify offset; or equivalently,
227
+ * sets offset to 0; the first request returns the first `limit` of rows. The
228
+ * second request sets offset to the `limit` of the first request; the second
229
+ * request returns the second `limit` of rows.
230
+ *
231
+ * To learn more about this pagination parameter, see
232
+ * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
233
+ * @param {number} request.limit
234
+ * The number of rows to return. If unspecified, 10,000 rows are returned. The
235
+ * API returns a maximum of 250,000 rows per request, no matter how many you
236
+ * ask for. `limit` must be positive.
237
+ *
238
+ * The API can also return fewer rows than the requested `limit`, if there
239
+ * aren't as many dimension values as the `limit`.
240
+ *
241
+ * To learn more about this pagination parameter, see
242
+ * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
243
+ * @param {object} [options]
244
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
245
+ * @returns {Promise} - The promise which resolves to an array.
246
+ * The first element of the array is an object representing {@link google.analytics.data.v1alpha.QueryAudienceListResponse | QueryAudienceListResponse}.
247
+ * Please see the
248
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
249
+ * for more details and examples.
250
+ * @example <caption>include:samples/generated/v1alpha/alpha_analytics_data.query_audience_list.js</caption>
251
+ * region_tag:analyticsdata_v1alpha_generated_AlphaAnalyticsData_QueryAudienceList_async
252
+ */
253
+ queryAudienceList(request?: protos.google.analytics.data.v1alpha.IQueryAudienceListRequest, options?: CallOptions): Promise<[
254
+ protos.google.analytics.data.v1alpha.IQueryAudienceListResponse,
255
+ (protos.google.analytics.data.v1alpha.IQueryAudienceListRequest | undefined),
256
+ {} | undefined
257
+ ]>;
258
+ queryAudienceList(request: protos.google.analytics.data.v1alpha.IQueryAudienceListRequest, options: CallOptions, callback: Callback<protos.google.analytics.data.v1alpha.IQueryAudienceListResponse, protos.google.analytics.data.v1alpha.IQueryAudienceListRequest | null | undefined, {} | null | undefined>): void;
259
+ queryAudienceList(request: protos.google.analytics.data.v1alpha.IQueryAudienceListRequest, callback: Callback<protos.google.analytics.data.v1alpha.IQueryAudienceListResponse, protos.google.analytics.data.v1alpha.IQueryAudienceListRequest | null | undefined, {} | null | undefined>): void;
260
+ /**
261
+ * Gets configuration metadata about a specific audience list. This method
262
+ * can be used to understand an audience list after it has been created.
263
+ *
264
+ * @param {Object} request
265
+ * The request object that will be sent.
266
+ * @param {string} request.name
267
+ * Required. The audience list resource name.
268
+ * Format: `properties/{propertyId}/audienceLists/{audienceListId}`
269
+ * @param {object} [options]
270
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
271
+ * @returns {Promise} - The promise which resolves to an array.
272
+ * The first element of the array is an object representing {@link google.analytics.data.v1alpha.AudienceList | AudienceList}.
273
+ * Please see the
274
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
275
+ * for more details and examples.
276
+ * @example <caption>include:samples/generated/v1alpha/alpha_analytics_data.get_audience_list.js</caption>
277
+ * region_tag:analyticsdata_v1alpha_generated_AlphaAnalyticsData_GetAudienceList_async
278
+ */
279
+ getAudienceList(request?: protos.google.analytics.data.v1alpha.IGetAudienceListRequest, options?: CallOptions): Promise<[
280
+ protos.google.analytics.data.v1alpha.IAudienceList,
281
+ protos.google.analytics.data.v1alpha.IGetAudienceListRequest | undefined,
282
+ {} | undefined
283
+ ]>;
284
+ getAudienceList(request: protos.google.analytics.data.v1alpha.IGetAudienceListRequest, options: CallOptions, callback: Callback<protos.google.analytics.data.v1alpha.IAudienceList, protos.google.analytics.data.v1alpha.IGetAudienceListRequest | null | undefined, {} | null | undefined>): void;
285
+ getAudienceList(request: protos.google.analytics.data.v1alpha.IGetAudienceListRequest, callback: Callback<protos.google.analytics.data.v1alpha.IAudienceList, protos.google.analytics.data.v1alpha.IGetAudienceListRequest | null | undefined, {} | null | undefined>): void;
286
+ /**
287
+ * Creates an audience list for later retrieval. This method quickly returns
288
+ * the audience list's resource name and initiates a long running asynchronous
289
+ * request to form an audience list. To list the users in an audience list,
290
+ * first create the audience list through this method and then send the
291
+ * audience resource name to the `QueryAudienceList` method.
292
+ *
293
+ * An audience list is a snapshot of the users currently in the audience at
294
+ * the time of audience list creation. Creating audience lists for one
295
+ * audience on different days will return different results as users enter and
296
+ * exit the audience.
297
+ *
298
+ * Audiences in Google Analytics 4 allow you to segment your users in the ways
299
+ * that are important to your business. To learn more, see
300
+ * https://support.google.com/analytics/answer/9267572. Audience lists contain
301
+ * the users in each audience.
302
+ *
303
+ * @param {Object} request
304
+ * The request object that will be sent.
305
+ * @param {string} request.parent
306
+ * Required. The parent resource where this audience list will be created.
307
+ * Format: `properties/{propertyId}`
308
+ * @param {google.analytics.data.v1alpha.AudienceList} request.audienceList
309
+ * Required. The audience list to create.
310
+ * @param {object} [options]
311
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
312
+ * @returns {Promise} - The promise which resolves to an array.
313
+ * The first element of the array is an object representing
314
+ * a long running operation. Its `promise()` method returns a promise
315
+ * you can `await` for.
316
+ * Please see the
317
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
318
+ * for more details and examples.
319
+ * @example <caption>include:samples/generated/v1alpha/alpha_analytics_data.create_audience_list.js</caption>
320
+ * region_tag:analyticsdata_v1alpha_generated_AlphaAnalyticsData_CreateAudienceList_async
321
+ */
322
+ createAudienceList(request?: protos.google.analytics.data.v1alpha.ICreateAudienceListRequest, options?: CallOptions): Promise<[
323
+ LROperation<protos.google.analytics.data.v1alpha.IAudienceList, protos.google.analytics.data.v1alpha.IAudienceListMetadata>,
324
+ protos.google.longrunning.IOperation | undefined,
325
+ {} | undefined
326
+ ]>;
327
+ createAudienceList(request: protos.google.analytics.data.v1alpha.ICreateAudienceListRequest, options: CallOptions, callback: Callback<LROperation<protos.google.analytics.data.v1alpha.IAudienceList, protos.google.analytics.data.v1alpha.IAudienceListMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
328
+ createAudienceList(request: protos.google.analytics.data.v1alpha.ICreateAudienceListRequest, callback: Callback<LROperation<protos.google.analytics.data.v1alpha.IAudienceList, protos.google.analytics.data.v1alpha.IAudienceListMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
329
+ /**
330
+ * Check the status of the long running operation returned by `createAudienceList()`.
331
+ * @param {String} name
332
+ * The operation name that will be passed.
333
+ * @returns {Promise} - The promise which resolves to an object.
334
+ * The decoded operation object has result and metadata field to get information from.
335
+ * Please see the
336
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
337
+ * for more details and examples.
338
+ * @example <caption>include:samples/generated/v1alpha/alpha_analytics_data.create_audience_list.js</caption>
339
+ * region_tag:analyticsdata_v1alpha_generated_AlphaAnalyticsData_CreateAudienceList_async
340
+ */
341
+ checkCreateAudienceListProgress(name: string): Promise<LROperation<protos.google.analytics.data.v1alpha.AudienceList, protos.google.analytics.data.v1alpha.AudienceListMetadata>>;
342
+ /**
343
+ * Lists all audience lists for a property. This method can be used for you to
344
+ * find and reuse existing audience lists rather than creating unnecessary new
345
+ * audience lists. The same audience can have multiple audience lists that
346
+ * represent the list of users that were in an audience on different days.
347
+ *
348
+ * @param {Object} request
349
+ * The request object that will be sent.
350
+ * @param {string} request.parent
351
+ * Required. All audience lists for this property will be listed in the
352
+ * response. Format: `properties/{propertyId}`
353
+ * @param {number} request.pageSize
354
+ * The maximum number of audience lists to return. The service may return
355
+ * fewer than this value. If unspecified, at most 200 audience lists will be
356
+ * returned. The maximum value is 1000 (higher values will be coerced to the
357
+ * maximum).
358
+ * @param {string} request.pageToken
359
+ * A page token, received from a previous `ListAudienceLists` call. Provide
360
+ * this to retrieve the subsequent page.
361
+ *
362
+ * When paginating, all other parameters provided to `ListAudienceLists` must
363
+ * match the call that provided the page token.
364
+ * @param {object} [options]
365
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
366
+ * @returns {Promise} - The promise which resolves to an array.
367
+ * The first element of the array is Array of {@link google.analytics.data.v1alpha.AudienceList | AudienceList}.
368
+ * The client library will perform auto-pagination by default: it will call the API as many
369
+ * times as needed and will merge results from all the pages into this array.
370
+ * Note that it can affect your quota.
371
+ * We recommend using `listAudienceListsAsync()`
372
+ * method described below for async iteration which you can stop as needed.
373
+ * Please see the
374
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
375
+ * for more details and examples.
376
+ */
377
+ listAudienceLists(request?: protos.google.analytics.data.v1alpha.IListAudienceListsRequest, options?: CallOptions): Promise<[
378
+ protos.google.analytics.data.v1alpha.IAudienceList[],
379
+ protos.google.analytics.data.v1alpha.IListAudienceListsRequest | null,
380
+ protos.google.analytics.data.v1alpha.IListAudienceListsResponse
381
+ ]>;
382
+ listAudienceLists(request: protos.google.analytics.data.v1alpha.IListAudienceListsRequest, options: CallOptions, callback: PaginationCallback<protos.google.analytics.data.v1alpha.IListAudienceListsRequest, protos.google.analytics.data.v1alpha.IListAudienceListsResponse | null | undefined, protos.google.analytics.data.v1alpha.IAudienceList>): void;
383
+ listAudienceLists(request: protos.google.analytics.data.v1alpha.IListAudienceListsRequest, callback: PaginationCallback<protos.google.analytics.data.v1alpha.IListAudienceListsRequest, protos.google.analytics.data.v1alpha.IListAudienceListsResponse | null | undefined, protos.google.analytics.data.v1alpha.IAudienceList>): void;
384
+ /**
385
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
386
+ * @param {Object} request
387
+ * The request object that will be sent.
388
+ * @param {string} request.parent
389
+ * Required. All audience lists for this property will be listed in the
390
+ * response. Format: `properties/{propertyId}`
391
+ * @param {number} request.pageSize
392
+ * The maximum number of audience lists to return. The service may return
393
+ * fewer than this value. If unspecified, at most 200 audience lists will be
394
+ * returned. The maximum value is 1000 (higher values will be coerced to the
395
+ * maximum).
396
+ * @param {string} request.pageToken
397
+ * A page token, received from a previous `ListAudienceLists` call. Provide
398
+ * this to retrieve the subsequent page.
399
+ *
400
+ * When paginating, all other parameters provided to `ListAudienceLists` must
401
+ * match the call that provided the page token.
402
+ * @param {object} [options]
403
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
404
+ * @returns {Stream}
405
+ * An object stream which emits an object representing {@link google.analytics.data.v1alpha.AudienceList | AudienceList} on 'data' event.
406
+ * The client library will perform auto-pagination by default: it will call the API as many
407
+ * times as needed. Note that it can affect your quota.
408
+ * We recommend using `listAudienceListsAsync()`
409
+ * method described below for async iteration which you can stop as needed.
410
+ * Please see the
411
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
412
+ * for more details and examples.
413
+ */
414
+ listAudienceListsStream(request?: protos.google.analytics.data.v1alpha.IListAudienceListsRequest, options?: CallOptions): Transform;
415
+ /**
416
+ * Equivalent to `listAudienceLists`, but returns an iterable object.
417
+ *
418
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
419
+ * @param {Object} request
420
+ * The request object that will be sent.
421
+ * @param {string} request.parent
422
+ * Required. All audience lists for this property will be listed in the
423
+ * response. Format: `properties/{propertyId}`
424
+ * @param {number} request.pageSize
425
+ * The maximum number of audience lists to return. The service may return
426
+ * fewer than this value. If unspecified, at most 200 audience lists will be
427
+ * returned. The maximum value is 1000 (higher values will be coerced to the
428
+ * maximum).
429
+ * @param {string} request.pageToken
430
+ * A page token, received from a previous `ListAudienceLists` call. Provide
431
+ * this to retrieve the subsequent page.
432
+ *
433
+ * When paginating, all other parameters provided to `ListAudienceLists` must
434
+ * match the call that provided the page token.
435
+ * @param {object} [options]
436
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
437
+ * @returns {Object}
438
+ * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
439
+ * When you iterate the returned iterable, each element will be an object representing
440
+ * {@link google.analytics.data.v1alpha.AudienceList | AudienceList}. The API will be called under the hood as needed, once per the page,
441
+ * so you can stop the iteration when you don't need more results.
442
+ * Please see the
443
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
444
+ * for more details and examples.
445
+ * @example <caption>include:samples/generated/v1alpha/alpha_analytics_data.list_audience_lists.js</caption>
446
+ * region_tag:analyticsdata_v1alpha_generated_AlphaAnalyticsData_ListAudienceLists_async
447
+ */
448
+ listAudienceListsAsync(request?: protos.google.analytics.data.v1alpha.IListAudienceListsRequest, options?: CallOptions): AsyncIterable<protos.google.analytics.data.v1alpha.IAudienceList>;
449
+ /**
450
+ * Return a fully-qualified audienceList resource name string.
451
+ *
452
+ * @param {string} propertyId
453
+ * @param {string} audienceListId
454
+ * @returns {string} Resource name string.
455
+ */
456
+ audienceListPath(propertyId: string, audienceListId: string): string;
457
+ /**
458
+ * Parse the propertyId from AudienceList resource.
459
+ *
460
+ * @param {string} audienceListName
461
+ * A fully-qualified path representing AudienceList resource.
462
+ * @returns {string} A string representing the propertyId.
463
+ */
464
+ matchPropertyIdFromAudienceListName(audienceListName: string): string | number;
465
+ /**
466
+ * Parse the audienceListId from AudienceList resource.
467
+ *
468
+ * @param {string} audienceListName
469
+ * A fully-qualified path representing AudienceList resource.
470
+ * @returns {string} A string representing the audienceListId.
471
+ */
472
+ matchAudienceListIdFromAudienceListName(audienceListName: string): string | number;
473
+ /**
474
+ * Return a fully-qualified property resource name string.
475
+ *
476
+ * @param {string} propertyId
477
+ * @returns {string} Resource name string.
478
+ */
479
+ propertyPath(propertyId: string): string;
480
+ /**
481
+ * Parse the propertyId from Property resource.
482
+ *
483
+ * @param {string} propertyName
484
+ * A fully-qualified path representing Property resource.
485
+ * @returns {string} A string representing the propertyId.
486
+ */
487
+ matchPropertyIdFromPropertyName(propertyName: string): string | number;
196
488
  /**
197
489
  * Terminate the gRPC channel and close the client.
198
490
  *
@@ -134,6 +134,39 @@ class AlphaAnalyticsDataClient {
134
134
  }
135
135
  // Load the applicable protos.
136
136
  this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos);
137
+ // This API contains "path templates"; forward-slash-separated
138
+ // identifiers to uniquely identify resources within the API.
139
+ // Create useful helper objects for these.
140
+ this.pathTemplates = {
141
+ audienceListPathTemplate: new this._gaxModule.PathTemplate('properties/{propertyId}/audienceLists/{audienceListId}'),
142
+ propertyPathTemplate: new this._gaxModule.PathTemplate('properties/{propertyId}'),
143
+ };
144
+ // Some of the methods on this service return "paged" results,
145
+ // (e.g. 50 results at a time, with tokens to get subsequent
146
+ // pages). Denote the keys used for pagination and results.
147
+ this.descriptors.page = {
148
+ listAudienceLists: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'audienceLists'),
149
+ };
150
+ const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
151
+ // This API contains "long-running operations", which return a
152
+ // an Operation object that allows for tracking of the operation,
153
+ // rather than holding a request open.
154
+ const lroOptions = {
155
+ auth: this.auth,
156
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
157
+ };
158
+ if (opts.fallback === 'rest') {
159
+ lroOptions.protoJson = protoFilesRoot;
160
+ lroOptions.httpRules = [];
161
+ }
162
+ this.operationsClient = this._gaxModule
163
+ .lro(lroOptions)
164
+ .operationsClient(opts);
165
+ const createAudienceListResponse = protoFilesRoot.lookup('.google.analytics.data.v1alpha.AudienceList');
166
+ const createAudienceListMetadata = protoFilesRoot.lookup('.google.analytics.data.v1alpha.AudienceListMetadata');
167
+ this.descriptors.longrunning = {
168
+ createAudienceList: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createAudienceListResponse.decode.bind(createAudienceListResponse), createAudienceListMetadata.decode.bind(createAudienceListMetadata)),
169
+ };
137
170
  // Put together the default options sent with requests.
138
171
  this._defaults = this._gaxGrpc.constructSettings('google.analytics.data.v1alpha.AlphaAnalyticsData', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
139
172
  // Set up a dictionary of "inner API calls"; the core implementation
@@ -168,7 +201,13 @@ class AlphaAnalyticsDataClient {
168
201
  .AlphaAnalyticsData, this._opts, this._providedCustomServicePath);
169
202
  // Iterate over each of the methods that the service provides
170
203
  // and create an API call method for each.
171
- const alphaAnalyticsDataStubMethods = ['runFunnelReport'];
204
+ const alphaAnalyticsDataStubMethods = [
205
+ 'runFunnelReport',
206
+ 'createAudienceList',
207
+ 'queryAudienceList',
208
+ 'getAudienceList',
209
+ 'listAudienceLists',
210
+ ];
172
211
  for (const methodName of alphaAnalyticsDataStubMethods) {
173
212
  const callPromise = this.alphaAnalyticsDataStub.then(stub => (...args) => {
174
213
  if (this._terminated) {
@@ -179,7 +218,9 @@ class AlphaAnalyticsDataClient {
179
218
  }, (err) => () => {
180
219
  throw err;
181
220
  });
182
- const descriptor = undefined;
221
+ const descriptor = this.descriptors.page[methodName] ||
222
+ this.descriptors.longrunning[methodName] ||
223
+ undefined;
183
224
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
184
225
  this.innerApiCalls[methodName] = apiCall;
185
226
  }
@@ -250,6 +291,261 @@ class AlphaAnalyticsDataClient {
250
291
  this.initialize();
251
292
  return this.innerApiCalls.runFunnelReport(request, options, callback);
252
293
  }
294
+ queryAudienceList(request, optionsOrCallback, callback) {
295
+ var _a;
296
+ request = request || {};
297
+ let options;
298
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
299
+ callback = optionsOrCallback;
300
+ options = {};
301
+ }
302
+ else {
303
+ options = optionsOrCallback;
304
+ }
305
+ options = options || {};
306
+ options.otherArgs = options.otherArgs || {};
307
+ options.otherArgs.headers = options.otherArgs.headers || {};
308
+ options.otherArgs.headers['x-goog-request-params'] =
309
+ this._gaxModule.routingHeader.fromParams({
310
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
311
+ });
312
+ this.initialize();
313
+ return this.innerApiCalls.queryAudienceList(request, options, callback);
314
+ }
315
+ getAudienceList(request, optionsOrCallback, callback) {
316
+ var _a;
317
+ request = request || {};
318
+ let options;
319
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
320
+ callback = optionsOrCallback;
321
+ options = {};
322
+ }
323
+ else {
324
+ options = optionsOrCallback;
325
+ }
326
+ options = options || {};
327
+ options.otherArgs = options.otherArgs || {};
328
+ options.otherArgs.headers = options.otherArgs.headers || {};
329
+ options.otherArgs.headers['x-goog-request-params'] =
330
+ this._gaxModule.routingHeader.fromParams({
331
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
332
+ });
333
+ this.initialize();
334
+ return this.innerApiCalls.getAudienceList(request, options, callback);
335
+ }
336
+ createAudienceList(request, optionsOrCallback, callback) {
337
+ var _a;
338
+ request = request || {};
339
+ let options;
340
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
341
+ callback = optionsOrCallback;
342
+ options = {};
343
+ }
344
+ else {
345
+ options = optionsOrCallback;
346
+ }
347
+ options = options || {};
348
+ options.otherArgs = options.otherArgs || {};
349
+ options.otherArgs.headers = options.otherArgs.headers || {};
350
+ options.otherArgs.headers['x-goog-request-params'] =
351
+ this._gaxModule.routingHeader.fromParams({
352
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
353
+ });
354
+ this.initialize();
355
+ return this.innerApiCalls.createAudienceList(request, options, callback);
356
+ }
357
+ /**
358
+ * Check the status of the long running operation returned by `createAudienceList()`.
359
+ * @param {String} name
360
+ * The operation name that will be passed.
361
+ * @returns {Promise} - The promise which resolves to an object.
362
+ * The decoded operation object has result and metadata field to get information from.
363
+ * Please see the
364
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
365
+ * for more details and examples.
366
+ * @example <caption>include:samples/generated/v1alpha/alpha_analytics_data.create_audience_list.js</caption>
367
+ * region_tag:analyticsdata_v1alpha_generated_AlphaAnalyticsData_CreateAudienceList_async
368
+ */
369
+ async checkCreateAudienceListProgress(name) {
370
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
371
+ const [operation] = await this.operationsClient.getOperation(request);
372
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createAudienceList, this._gaxModule.createDefaultBackoffSettings());
373
+ return decodeOperation;
374
+ }
375
+ listAudienceLists(request, optionsOrCallback, callback) {
376
+ var _a;
377
+ request = request || {};
378
+ let options;
379
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
380
+ callback = optionsOrCallback;
381
+ options = {};
382
+ }
383
+ else {
384
+ options = optionsOrCallback;
385
+ }
386
+ options = options || {};
387
+ options.otherArgs = options.otherArgs || {};
388
+ options.otherArgs.headers = options.otherArgs.headers || {};
389
+ options.otherArgs.headers['x-goog-request-params'] =
390
+ this._gaxModule.routingHeader.fromParams({
391
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
392
+ });
393
+ this.initialize();
394
+ return this.innerApiCalls.listAudienceLists(request, options, callback);
395
+ }
396
+ /**
397
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
398
+ * @param {Object} request
399
+ * The request object that will be sent.
400
+ * @param {string} request.parent
401
+ * Required. All audience lists for this property will be listed in the
402
+ * response. Format: `properties/{propertyId}`
403
+ * @param {number} request.pageSize
404
+ * The maximum number of audience lists to return. The service may return
405
+ * fewer than this value. If unspecified, at most 200 audience lists will be
406
+ * returned. The maximum value is 1000 (higher values will be coerced to the
407
+ * maximum).
408
+ * @param {string} request.pageToken
409
+ * A page token, received from a previous `ListAudienceLists` call. Provide
410
+ * this to retrieve the subsequent page.
411
+ *
412
+ * When paginating, all other parameters provided to `ListAudienceLists` must
413
+ * match the call that provided the page token.
414
+ * @param {object} [options]
415
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
416
+ * @returns {Stream}
417
+ * An object stream which emits an object representing {@link google.analytics.data.v1alpha.AudienceList | AudienceList} on 'data' event.
418
+ * The client library will perform auto-pagination by default: it will call the API as many
419
+ * times as needed. Note that it can affect your quota.
420
+ * We recommend using `listAudienceListsAsync()`
421
+ * method described below for async iteration which you can stop as needed.
422
+ * Please see the
423
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
424
+ * for more details and examples.
425
+ */
426
+ listAudienceListsStream(request, options) {
427
+ var _a;
428
+ request = request || {};
429
+ options = options || {};
430
+ options.otherArgs = options.otherArgs || {};
431
+ options.otherArgs.headers = options.otherArgs.headers || {};
432
+ options.otherArgs.headers['x-goog-request-params'] =
433
+ this._gaxModule.routingHeader.fromParams({
434
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
435
+ });
436
+ const defaultCallSettings = this._defaults['listAudienceLists'];
437
+ const callSettings = defaultCallSettings.merge(options);
438
+ this.initialize();
439
+ return this.descriptors.page.listAudienceLists.createStream(this.innerApiCalls.listAudienceLists, request, callSettings);
440
+ }
441
+ /**
442
+ * Equivalent to `listAudienceLists`, but returns an iterable object.
443
+ *
444
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
445
+ * @param {Object} request
446
+ * The request object that will be sent.
447
+ * @param {string} request.parent
448
+ * Required. All audience lists for this property will be listed in the
449
+ * response. Format: `properties/{propertyId}`
450
+ * @param {number} request.pageSize
451
+ * The maximum number of audience lists to return. The service may return
452
+ * fewer than this value. If unspecified, at most 200 audience lists will be
453
+ * returned. The maximum value is 1000 (higher values will be coerced to the
454
+ * maximum).
455
+ * @param {string} request.pageToken
456
+ * A page token, received from a previous `ListAudienceLists` call. Provide
457
+ * this to retrieve the subsequent page.
458
+ *
459
+ * When paginating, all other parameters provided to `ListAudienceLists` must
460
+ * match the call that provided the page token.
461
+ * @param {object} [options]
462
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
463
+ * @returns {Object}
464
+ * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
465
+ * When you iterate the returned iterable, each element will be an object representing
466
+ * {@link google.analytics.data.v1alpha.AudienceList | AudienceList}. The API will be called under the hood as needed, once per the page,
467
+ * so you can stop the iteration when you don't need more results.
468
+ * Please see the
469
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
470
+ * for more details and examples.
471
+ * @example <caption>include:samples/generated/v1alpha/alpha_analytics_data.list_audience_lists.js</caption>
472
+ * region_tag:analyticsdata_v1alpha_generated_AlphaAnalyticsData_ListAudienceLists_async
473
+ */
474
+ listAudienceListsAsync(request, options) {
475
+ var _a;
476
+ request = request || {};
477
+ options = options || {};
478
+ options.otherArgs = options.otherArgs || {};
479
+ options.otherArgs.headers = options.otherArgs.headers || {};
480
+ options.otherArgs.headers['x-goog-request-params'] =
481
+ this._gaxModule.routingHeader.fromParams({
482
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
483
+ });
484
+ const defaultCallSettings = this._defaults['listAudienceLists'];
485
+ const callSettings = defaultCallSettings.merge(options);
486
+ this.initialize();
487
+ return this.descriptors.page.listAudienceLists.asyncIterate(this.innerApiCalls['listAudienceLists'], request, callSettings);
488
+ }
489
+ // --------------------
490
+ // -- Path templates --
491
+ // --------------------
492
+ /**
493
+ * Return a fully-qualified audienceList resource name string.
494
+ *
495
+ * @param {string} propertyId
496
+ * @param {string} audienceListId
497
+ * @returns {string} Resource name string.
498
+ */
499
+ audienceListPath(propertyId, audienceListId) {
500
+ return this.pathTemplates.audienceListPathTemplate.render({
501
+ propertyId: propertyId,
502
+ audienceListId: audienceListId,
503
+ });
504
+ }
505
+ /**
506
+ * Parse the propertyId from AudienceList resource.
507
+ *
508
+ * @param {string} audienceListName
509
+ * A fully-qualified path representing AudienceList resource.
510
+ * @returns {string} A string representing the propertyId.
511
+ */
512
+ matchPropertyIdFromAudienceListName(audienceListName) {
513
+ return this.pathTemplates.audienceListPathTemplate.match(audienceListName)
514
+ .propertyId;
515
+ }
516
+ /**
517
+ * Parse the audienceListId from AudienceList resource.
518
+ *
519
+ * @param {string} audienceListName
520
+ * A fully-qualified path representing AudienceList resource.
521
+ * @returns {string} A string representing the audienceListId.
522
+ */
523
+ matchAudienceListIdFromAudienceListName(audienceListName) {
524
+ return this.pathTemplates.audienceListPathTemplate.match(audienceListName)
525
+ .audienceListId;
526
+ }
527
+ /**
528
+ * Return a fully-qualified property resource name string.
529
+ *
530
+ * @param {string} propertyId
531
+ * @returns {string} Resource name string.
532
+ */
533
+ propertyPath(propertyId) {
534
+ return this.pathTemplates.propertyPathTemplate.render({
535
+ propertyId: propertyId,
536
+ });
537
+ }
538
+ /**
539
+ * Parse the propertyId from Property resource.
540
+ *
541
+ * @param {string} propertyName
542
+ * A fully-qualified path representing Property resource.
543
+ * @returns {string} A string representing the propertyId.
544
+ */
545
+ matchPropertyIdFromPropertyName(propertyName) {
546
+ return this.pathTemplates.propertyPathTemplate.match(propertyName)
547
+ .propertyId;
548
+ }
253
549
  /**
254
550
  * Terminate the gRPC channel and close the client.
255
551
  *
@@ -261,6 +557,7 @@ class AlphaAnalyticsDataClient {
261
557
  return this.alphaAnalyticsDataStub.then(stub => {
262
558
  this._terminated = true;
263
559
  stub.close();
560
+ this.operationsClient.close();
264
561
  });
265
562
  }
266
563
  return Promise.resolve();