@google-analytics/data 3.2.2 → 4.0.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
@@ -179,9 +191,8 @@ export declare class AlphaAnalyticsDataClient {
179
191
  * @param {object} [options]
180
192
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
181
193
  * @returns {Promise} - The promise which resolves to an array.
182
- * The first element of the array is an object representing {@link google.analytics.data.v1alpha.RunFunnelReportResponse | RunFunnelReportResponse}.
183
- * Please see the
184
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
194
+ * The first element of the array is an object representing {@link protos.google.analytics.data.v1alpha.RunFunnelReportResponse|RunFunnelReportResponse}.
195
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
185
196
  * for more details and examples.
186
197
  * @example <caption>include:samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js</caption>
187
198
  * region_tag:analyticsdata_v1alpha_generated_AlphaAnalyticsData_RunFunnelReport_async
@@ -193,6 +204,279 @@ export declare class AlphaAnalyticsDataClient {
193
204
  ]>;
194
205
  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
206
  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;
207
+ /**
208
+ * Retrieves an audience list of users. After creating an audience, the users
209
+ * are not immediately available for listing. First, a request to
210
+ * `CreateAudienceList` is necessary to create an audience list of users, and
211
+ * then second, this method is used to retrieve the users in the audience.
212
+ *
213
+ * Audiences in Google Analytics 4 allow you to segment your users in the ways
214
+ * that are important to your business. To learn more, see
215
+ * https://support.google.com/analytics/answer/9267572.
216
+ *
217
+ * @param {Object} request
218
+ * The request object that will be sent.
219
+ * @param {string} request.name
220
+ * The name of the audience list to retrieve users from.
221
+ * Format: `properties/{propertyId}/audienceLists/{audienceListId}`
222
+ * @param {number} request.offset
223
+ * The row count of the start row. The first row is counted as row 0.
224
+ *
225
+ * When paging, the first request does not specify offset; or equivalently,
226
+ * sets offset to 0; the first request returns the first `limit` of rows. The
227
+ * second request sets offset to the `limit` of the first request; the second
228
+ * request returns the second `limit` of rows.
229
+ *
230
+ * To learn more about this pagination parameter, see
231
+ * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
232
+ * @param {number} request.limit
233
+ * The number of rows to return. If unspecified, 10,000 rows are returned. The
234
+ * API returns a maximum of 250,000 rows per request, no matter how many you
235
+ * ask for. `limit` must be positive.
236
+ *
237
+ * The API can also return fewer rows than the requested `limit`, if there
238
+ * aren't as many dimension values as the `limit`.
239
+ *
240
+ * To learn more about this pagination parameter, see
241
+ * [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
242
+ * @param {object} [options]
243
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
244
+ * @returns {Promise} - The promise which resolves to an array.
245
+ * The first element of the array is an object representing {@link protos.google.analytics.data.v1alpha.QueryAudienceListResponse|QueryAudienceListResponse}.
246
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
247
+ * for more details and examples.
248
+ * @example <caption>include:samples/generated/v1alpha/alpha_analytics_data.query_audience_list.js</caption>
249
+ * region_tag:analyticsdata_v1alpha_generated_AlphaAnalyticsData_QueryAudienceList_async
250
+ */
251
+ queryAudienceList(request?: protos.google.analytics.data.v1alpha.IQueryAudienceListRequest, options?: CallOptions): Promise<[
252
+ protos.google.analytics.data.v1alpha.IQueryAudienceListResponse,
253
+ (protos.google.analytics.data.v1alpha.IQueryAudienceListRequest | undefined),
254
+ {} | undefined
255
+ ]>;
256
+ 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;
257
+ 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;
258
+ /**
259
+ * Gets configuration metadata about a specific audience list. This method
260
+ * can be used to understand an audience list after it has been created.
261
+ *
262
+ * @param {Object} request
263
+ * The request object that will be sent.
264
+ * @param {string} request.name
265
+ * Required. The audience list resource name.
266
+ * Format: `properties/{propertyId}/audienceLists/{audienceListId}`
267
+ * @param {object} [options]
268
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
269
+ * @returns {Promise} - The promise which resolves to an array.
270
+ * The first element of the array is an object representing {@link protos.google.analytics.data.v1alpha.AudienceList|AudienceList}.
271
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
272
+ * for more details and examples.
273
+ * @example <caption>include:samples/generated/v1alpha/alpha_analytics_data.get_audience_list.js</caption>
274
+ * region_tag:analyticsdata_v1alpha_generated_AlphaAnalyticsData_GetAudienceList_async
275
+ */
276
+ getAudienceList(request?: protos.google.analytics.data.v1alpha.IGetAudienceListRequest, options?: CallOptions): Promise<[
277
+ protos.google.analytics.data.v1alpha.IAudienceList,
278
+ protos.google.analytics.data.v1alpha.IGetAudienceListRequest | undefined,
279
+ {} | undefined
280
+ ]>;
281
+ 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;
282
+ 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;
283
+ /**
284
+ * Creates an audience list for later retrieval. This method quickly returns
285
+ * the audience list's resource name and initiates a long running asynchronous
286
+ * request to form an audience list. To list the users in an audience list,
287
+ * first create the audience list through this method and then send the
288
+ * audience resource name to the `QueryAudienceList` method.
289
+ *
290
+ * An audience list is a snapshot of the users currently in the audience at
291
+ * the time of audience list creation. Creating audience lists for one
292
+ * audience on different days will return different results as users enter and
293
+ * exit the audience.
294
+ *
295
+ * Audiences in Google Analytics 4 allow you to segment your users in the ways
296
+ * that are important to your business. To learn more, see
297
+ * https://support.google.com/analytics/answer/9267572. Audience lists contain
298
+ * the users in each audience.
299
+ *
300
+ * @param {Object} request
301
+ * The request object that will be sent.
302
+ * @param {string} request.parent
303
+ * Required. The parent resource where this audience list will be created.
304
+ * Format: `properties/{propertyId}`
305
+ * @param {google.analytics.data.v1alpha.AudienceList} request.audienceList
306
+ * Required. The audience list to create.
307
+ * @param {object} [options]
308
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
309
+ * @returns {Promise} - The promise which resolves to an array.
310
+ * The first element of the array is an object representing
311
+ * a long running operation. Its `promise()` method returns a promise
312
+ * you can `await` for.
313
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
314
+ * for more details and examples.
315
+ * @example <caption>include:samples/generated/v1alpha/alpha_analytics_data.create_audience_list.js</caption>
316
+ * region_tag:analyticsdata_v1alpha_generated_AlphaAnalyticsData_CreateAudienceList_async
317
+ */
318
+ createAudienceList(request?: protos.google.analytics.data.v1alpha.ICreateAudienceListRequest, options?: CallOptions): Promise<[
319
+ LROperation<protos.google.analytics.data.v1alpha.IAudienceList, protos.google.analytics.data.v1alpha.IAudienceListMetadata>,
320
+ protos.google.longrunning.IOperation | undefined,
321
+ {} | undefined
322
+ ]>;
323
+ 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;
324
+ 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;
325
+ /**
326
+ * Check the status of the long running operation returned by `createAudienceList()`.
327
+ * @param {String} name
328
+ * The operation name that will be passed.
329
+ * @returns {Promise} - The promise which resolves to an object.
330
+ * The decoded operation object has result and metadata field to get information from.
331
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
332
+ * for more details and examples.
333
+ * @example <caption>include:samples/generated/v1alpha/alpha_analytics_data.create_audience_list.js</caption>
334
+ * region_tag:analyticsdata_v1alpha_generated_AlphaAnalyticsData_CreateAudienceList_async
335
+ */
336
+ checkCreateAudienceListProgress(name: string): Promise<LROperation<protos.google.analytics.data.v1alpha.AudienceList, protos.google.analytics.data.v1alpha.AudienceListMetadata>>;
337
+ /**
338
+ * Lists all audience lists for a property. This method can be used for you to
339
+ * find and reuse existing audience lists rather than creating unnecessary new
340
+ * audience lists. The same audience can have multiple audience lists that
341
+ * represent the list of users that were in an audience on different days.
342
+ *
343
+ * @param {Object} request
344
+ * The request object that will be sent.
345
+ * @param {string} request.parent
346
+ * Required. All audience lists for this property will be listed in the
347
+ * response. Format: `properties/{propertyId}`
348
+ * @param {number} request.pageSize
349
+ * The maximum number of audience lists to return. The service may return
350
+ * fewer than this value. If unspecified, at most 200 audience lists will be
351
+ * returned. The maximum value is 1000 (higher values will be coerced to the
352
+ * maximum).
353
+ * @param {string} request.pageToken
354
+ * A page token, received from a previous `ListAudienceLists` call. Provide
355
+ * this to retrieve the subsequent page.
356
+ *
357
+ * When paginating, all other parameters provided to `ListAudienceLists` must
358
+ * match the call that provided the page token.
359
+ * @param {object} [options]
360
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
361
+ * @returns {Promise} - The promise which resolves to an array.
362
+ * The first element of the array is Array of {@link protos.google.analytics.data.v1alpha.AudienceList|AudienceList}.
363
+ * The client library will perform auto-pagination by default: it will call the API as many
364
+ * times as needed and will merge results from all the pages into this array.
365
+ * Note that it can affect your quota.
366
+ * We recommend using `listAudienceListsAsync()`
367
+ * method described below for async iteration which you can stop as needed.
368
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
369
+ * for more details and examples.
370
+ */
371
+ listAudienceLists(request?: protos.google.analytics.data.v1alpha.IListAudienceListsRequest, options?: CallOptions): Promise<[
372
+ protos.google.analytics.data.v1alpha.IAudienceList[],
373
+ protos.google.analytics.data.v1alpha.IListAudienceListsRequest | null,
374
+ protos.google.analytics.data.v1alpha.IListAudienceListsResponse
375
+ ]>;
376
+ 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;
377
+ 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;
378
+ /**
379
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
380
+ * @param {Object} request
381
+ * The request object that will be sent.
382
+ * @param {string} request.parent
383
+ * Required. All audience lists for this property will be listed in the
384
+ * response. Format: `properties/{propertyId}`
385
+ * @param {number} request.pageSize
386
+ * The maximum number of audience lists to return. The service may return
387
+ * fewer than this value. If unspecified, at most 200 audience lists will be
388
+ * returned. The maximum value is 1000 (higher values will be coerced to the
389
+ * maximum).
390
+ * @param {string} request.pageToken
391
+ * A page token, received from a previous `ListAudienceLists` call. Provide
392
+ * this to retrieve the subsequent page.
393
+ *
394
+ * When paginating, all other parameters provided to `ListAudienceLists` must
395
+ * match the call that provided the page token.
396
+ * @param {object} [options]
397
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
398
+ * @returns {Stream}
399
+ * An object stream which emits an object representing {@link protos.google.analytics.data.v1alpha.AudienceList|AudienceList} on 'data' event.
400
+ * The client library will perform auto-pagination by default: it will call the API as many
401
+ * times as needed. Note that it can affect your quota.
402
+ * We recommend using `listAudienceListsAsync()`
403
+ * method described below for async iteration which you can stop as needed.
404
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
405
+ * for more details and examples.
406
+ */
407
+ listAudienceListsStream(request?: protos.google.analytics.data.v1alpha.IListAudienceListsRequest, options?: CallOptions): Transform;
408
+ /**
409
+ * Equivalent to `listAudienceLists`, but returns an iterable object.
410
+ *
411
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
412
+ * @param {Object} request
413
+ * The request object that will be sent.
414
+ * @param {string} request.parent
415
+ * Required. All audience lists for this property will be listed in the
416
+ * response. Format: `properties/{propertyId}`
417
+ * @param {number} request.pageSize
418
+ * The maximum number of audience lists to return. The service may return
419
+ * fewer than this value. If unspecified, at most 200 audience lists will be
420
+ * returned. The maximum value is 1000 (higher values will be coerced to the
421
+ * maximum).
422
+ * @param {string} request.pageToken
423
+ * A page token, received from a previous `ListAudienceLists` call. Provide
424
+ * this to retrieve the subsequent page.
425
+ *
426
+ * When paginating, all other parameters provided to `ListAudienceLists` must
427
+ * match the call that provided the page token.
428
+ * @param {object} [options]
429
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
430
+ * @returns {Object}
431
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
432
+ * When you iterate the returned iterable, each element will be an object representing
433
+ * {@link protos.google.analytics.data.v1alpha.AudienceList|AudienceList}. The API will be called under the hood as needed, once per the page,
434
+ * so you can stop the iteration when you don't need more results.
435
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
436
+ * for more details and examples.
437
+ * @example <caption>include:samples/generated/v1alpha/alpha_analytics_data.list_audience_lists.js</caption>
438
+ * region_tag:analyticsdata_v1alpha_generated_AlphaAnalyticsData_ListAudienceLists_async
439
+ */
440
+ listAudienceListsAsync(request?: protos.google.analytics.data.v1alpha.IListAudienceListsRequest, options?: CallOptions): AsyncIterable<protos.google.analytics.data.v1alpha.IAudienceList>;
441
+ /**
442
+ * Return a fully-qualified audienceList resource name string.
443
+ *
444
+ * @param {string} propertyId
445
+ * @param {string} audienceListId
446
+ * @returns {string} Resource name string.
447
+ */
448
+ audienceListPath(propertyId: string, audienceListId: string): string;
449
+ /**
450
+ * Parse the propertyId from AudienceList resource.
451
+ *
452
+ * @param {string} audienceListName
453
+ * A fully-qualified path representing AudienceList resource.
454
+ * @returns {string} A string representing the propertyId.
455
+ */
456
+ matchPropertyIdFromAudienceListName(audienceListName: string): string | number;
457
+ /**
458
+ * Parse the audienceListId from AudienceList resource.
459
+ *
460
+ * @param {string} audienceListName
461
+ * A fully-qualified path representing AudienceList resource.
462
+ * @returns {string} A string representing the audienceListId.
463
+ */
464
+ matchAudienceListIdFromAudienceListName(audienceListName: string): string | number;
465
+ /**
466
+ * Return a fully-qualified property resource name string.
467
+ *
468
+ * @param {string} propertyId
469
+ * @returns {string} Resource name string.
470
+ */
471
+ propertyPath(propertyId: string): string;
472
+ /**
473
+ * Parse the propertyId from Property resource.
474
+ *
475
+ * @param {string} propertyName
476
+ * A fully-qualified path representing Property resource.
477
+ * @returns {string} A string representing the propertyId.
478
+ */
479
+ matchPropertyIdFromPropertyName(propertyName: string): string | number;
196
480
  /**
197
481
  * Terminate the gRPC channel and close the client.
198
482
  *