@google-analytics/data 4.12.1 → 5.1.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.
- package/CHANGELOG.md +23 -0
- package/README.md +2 -2
- package/build/protos/google/analytics/data/v1alpha/analytics_data_api.proto +1 -1
- package/build/protos/google/analytics/data/v1alpha/data.proto +1 -1
- package/build/protos/google/analytics/data/v1beta/analytics_data_api.proto +1 -1
- package/build/protos/google/analytics/data/v1beta/data.proto +1 -1
- package/build/protos/protos.json +0 -3
- package/build/src/v1alpha/alpha_analytics_data_client.d.ts +3 -2
- package/build/src/v1alpha/alpha_analytics_data_client.js +312 -100
- package/build/src/v1alpha/alpha_analytics_data_proto_list.json +4 -0
- package/build/src/v1alpha/gapic_metadata.json +175 -0
- package/build/src/v1beta/beta_analytics_data_client.d.ts +3 -2
- package/build/src/v1beta/beta_analytics_data_client.js +240 -76
- package/build/src/v1beta/beta_analytics_data_proto_list.json +4 -0
- package/build/src/v1beta/gapic_metadata.json +137 -0
- package/package.json +16 -16
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.BetaAnalyticsDataClient = void 0;
|
|
21
21
|
const jsonProtos = require("../../protos/protos.json");
|
|
22
|
+
const google_gax_1 = require("google-gax");
|
|
22
23
|
/**
|
|
23
24
|
* Client JSON configuration object, loaded from
|
|
24
25
|
* `src/v1beta/beta_analytics_data_client_config.json`.
|
|
@@ -32,6 +33,28 @@ const version = require('../../../package.json').version;
|
|
|
32
33
|
* @memberof v1beta
|
|
33
34
|
*/
|
|
34
35
|
class BetaAnalyticsDataClient {
|
|
36
|
+
_terminated = false;
|
|
37
|
+
_opts;
|
|
38
|
+
_providedCustomServicePath;
|
|
39
|
+
_gaxModule;
|
|
40
|
+
_gaxGrpc;
|
|
41
|
+
_protos;
|
|
42
|
+
_defaults;
|
|
43
|
+
_universeDomain;
|
|
44
|
+
_servicePath;
|
|
45
|
+
_log = google_gax_1.loggingUtils.log('data');
|
|
46
|
+
auth;
|
|
47
|
+
descriptors = {
|
|
48
|
+
page: {},
|
|
49
|
+
stream: {},
|
|
50
|
+
longrunning: {},
|
|
51
|
+
batching: {},
|
|
52
|
+
};
|
|
53
|
+
warn;
|
|
54
|
+
innerApiCalls;
|
|
55
|
+
pathTemplates;
|
|
56
|
+
operationsClient;
|
|
57
|
+
betaAnalyticsDataStub;
|
|
35
58
|
/**
|
|
36
59
|
* Construct an instance of BetaAnalyticsDataClient.
|
|
37
60
|
*
|
|
@@ -54,7 +77,7 @@ class BetaAnalyticsDataClient {
|
|
|
54
77
|
* Developer's Console, e.g. 'grape-spaceship-123'. We will also check
|
|
55
78
|
* the environment variable GCLOUD_PROJECT for your project ID. If your
|
|
56
79
|
* app is running in an environment which supports
|
|
57
|
-
* {@link https://
|
|
80
|
+
* {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
|
|
58
81
|
* your project ID will be detected automatically.
|
|
59
82
|
* @param {string} [options.apiEndpoint] - The domain name of the
|
|
60
83
|
* API remote host.
|
|
@@ -72,32 +95,28 @@ class BetaAnalyticsDataClient {
|
|
|
72
95
|
* ```
|
|
73
96
|
*/
|
|
74
97
|
constructor(opts, gaxInstance) {
|
|
75
|
-
var _a, _b, _c, _d, _e;
|
|
76
|
-
this._terminated = false;
|
|
77
|
-
this.descriptors = {
|
|
78
|
-
page: {},
|
|
79
|
-
stream: {},
|
|
80
|
-
longrunning: {},
|
|
81
|
-
batching: {},
|
|
82
|
-
};
|
|
83
98
|
// Ensure that options include all the required fields.
|
|
84
99
|
const staticMembers = this.constructor;
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
|
|
100
|
+
if (opts?.universe_domain &&
|
|
101
|
+
opts?.universeDomain &&
|
|
102
|
+
opts?.universe_domain !== opts?.universeDomain) {
|
|
88
103
|
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
|
89
104
|
}
|
|
90
105
|
const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
|
|
91
106
|
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
|
|
92
107
|
: undefined;
|
|
93
108
|
this._universeDomain =
|
|
94
|
-
|
|
109
|
+
opts?.universeDomain ??
|
|
110
|
+
opts?.universe_domain ??
|
|
111
|
+
universeDomainEnvVar ??
|
|
112
|
+
'googleapis.com';
|
|
95
113
|
this._servicePath = 'analyticsdata.' + this._universeDomain;
|
|
96
|
-
const servicePath =
|
|
97
|
-
this._providedCustomServicePath = !!(
|
|
98
|
-
const port =
|
|
99
|
-
const clientConfig =
|
|
100
|
-
const fallback =
|
|
114
|
+
const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
|
|
115
|
+
this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
|
|
116
|
+
const port = opts?.port || staticMembers.port;
|
|
117
|
+
const clientConfig = opts?.clientConfig ?? {};
|
|
118
|
+
const fallback = opts?.fallback ??
|
|
119
|
+
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
|
101
120
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
|
102
121
|
// Request numeric enum values if REST transport is used.
|
|
103
122
|
opts.numericEnums = true;
|
|
@@ -306,7 +325,6 @@ class BetaAnalyticsDataClient {
|
|
|
306
325
|
return this.auth.getProjectId();
|
|
307
326
|
}
|
|
308
327
|
runReport(request, optionsOrCallback, callback) {
|
|
309
|
-
var _a;
|
|
310
328
|
request = request || {};
|
|
311
329
|
let options;
|
|
312
330
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -321,13 +339,26 @@ class BetaAnalyticsDataClient {
|
|
|
321
339
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
322
340
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
323
341
|
this._gaxModule.routingHeader.fromParams({
|
|
324
|
-
property:
|
|
342
|
+
property: request.property ?? '',
|
|
325
343
|
});
|
|
326
|
-
this.initialize()
|
|
327
|
-
|
|
344
|
+
this.initialize().catch(err => {
|
|
345
|
+
throw err;
|
|
346
|
+
});
|
|
347
|
+
this._log.info('runReport request %j', request);
|
|
348
|
+
const wrappedCallback = callback
|
|
349
|
+
? (error, response, options, rawResponse) => {
|
|
350
|
+
this._log.info('runReport response %j', response);
|
|
351
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
352
|
+
}
|
|
353
|
+
: undefined;
|
|
354
|
+
return this.innerApiCalls
|
|
355
|
+
.runReport(request, options, wrappedCallback)
|
|
356
|
+
?.then(([response, options, rawResponse]) => {
|
|
357
|
+
this._log.info('runReport response %j', response);
|
|
358
|
+
return [response, options, rawResponse];
|
|
359
|
+
});
|
|
328
360
|
}
|
|
329
361
|
runPivotReport(request, optionsOrCallback, callback) {
|
|
330
|
-
var _a;
|
|
331
362
|
request = request || {};
|
|
332
363
|
let options;
|
|
333
364
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -342,13 +373,26 @@ class BetaAnalyticsDataClient {
|
|
|
342
373
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
343
374
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
344
375
|
this._gaxModule.routingHeader.fromParams({
|
|
345
|
-
property:
|
|
376
|
+
property: request.property ?? '',
|
|
346
377
|
});
|
|
347
|
-
this.initialize()
|
|
348
|
-
|
|
378
|
+
this.initialize().catch(err => {
|
|
379
|
+
throw err;
|
|
380
|
+
});
|
|
381
|
+
this._log.info('runPivotReport request %j', request);
|
|
382
|
+
const wrappedCallback = callback
|
|
383
|
+
? (error, response, options, rawResponse) => {
|
|
384
|
+
this._log.info('runPivotReport response %j', response);
|
|
385
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
386
|
+
}
|
|
387
|
+
: undefined;
|
|
388
|
+
return this.innerApiCalls
|
|
389
|
+
.runPivotReport(request, options, wrappedCallback)
|
|
390
|
+
?.then(([response, options, rawResponse]) => {
|
|
391
|
+
this._log.info('runPivotReport response %j', response);
|
|
392
|
+
return [response, options, rawResponse];
|
|
393
|
+
});
|
|
349
394
|
}
|
|
350
395
|
batchRunReports(request, optionsOrCallback, callback) {
|
|
351
|
-
var _a;
|
|
352
396
|
request = request || {};
|
|
353
397
|
let options;
|
|
354
398
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -363,13 +407,26 @@ class BetaAnalyticsDataClient {
|
|
|
363
407
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
364
408
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
365
409
|
this._gaxModule.routingHeader.fromParams({
|
|
366
|
-
property:
|
|
410
|
+
property: request.property ?? '',
|
|
367
411
|
});
|
|
368
|
-
this.initialize()
|
|
369
|
-
|
|
412
|
+
this.initialize().catch(err => {
|
|
413
|
+
throw err;
|
|
414
|
+
});
|
|
415
|
+
this._log.info('batchRunReports request %j', request);
|
|
416
|
+
const wrappedCallback = callback
|
|
417
|
+
? (error, response, options, rawResponse) => {
|
|
418
|
+
this._log.info('batchRunReports response %j', response);
|
|
419
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
420
|
+
}
|
|
421
|
+
: undefined;
|
|
422
|
+
return this.innerApiCalls
|
|
423
|
+
.batchRunReports(request, options, wrappedCallback)
|
|
424
|
+
?.then(([response, options, rawResponse]) => {
|
|
425
|
+
this._log.info('batchRunReports response %j', response);
|
|
426
|
+
return [response, options, rawResponse];
|
|
427
|
+
});
|
|
370
428
|
}
|
|
371
429
|
batchRunPivotReports(request, optionsOrCallback, callback) {
|
|
372
|
-
var _a;
|
|
373
430
|
request = request || {};
|
|
374
431
|
let options;
|
|
375
432
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -384,13 +441,26 @@ class BetaAnalyticsDataClient {
|
|
|
384
441
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
385
442
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
386
443
|
this._gaxModule.routingHeader.fromParams({
|
|
387
|
-
property:
|
|
444
|
+
property: request.property ?? '',
|
|
388
445
|
});
|
|
389
|
-
this.initialize()
|
|
390
|
-
|
|
446
|
+
this.initialize().catch(err => {
|
|
447
|
+
throw err;
|
|
448
|
+
});
|
|
449
|
+
this._log.info('batchRunPivotReports request %j', request);
|
|
450
|
+
const wrappedCallback = callback
|
|
451
|
+
? (error, response, options, rawResponse) => {
|
|
452
|
+
this._log.info('batchRunPivotReports response %j', response);
|
|
453
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
454
|
+
}
|
|
455
|
+
: undefined;
|
|
456
|
+
return this.innerApiCalls
|
|
457
|
+
.batchRunPivotReports(request, options, wrappedCallback)
|
|
458
|
+
?.then(([response, options, rawResponse]) => {
|
|
459
|
+
this._log.info('batchRunPivotReports response %j', response);
|
|
460
|
+
return [response, options, rawResponse];
|
|
461
|
+
});
|
|
391
462
|
}
|
|
392
463
|
getMetadata(request, optionsOrCallback, callback) {
|
|
393
|
-
var _a;
|
|
394
464
|
request = request || {};
|
|
395
465
|
let options;
|
|
396
466
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -405,13 +475,26 @@ class BetaAnalyticsDataClient {
|
|
|
405
475
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
406
476
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
407
477
|
this._gaxModule.routingHeader.fromParams({
|
|
408
|
-
name:
|
|
478
|
+
name: request.name ?? '',
|
|
409
479
|
});
|
|
410
|
-
this.initialize()
|
|
411
|
-
|
|
480
|
+
this.initialize().catch(err => {
|
|
481
|
+
throw err;
|
|
482
|
+
});
|
|
483
|
+
this._log.info('getMetadata request %j', request);
|
|
484
|
+
const wrappedCallback = callback
|
|
485
|
+
? (error, response, options, rawResponse) => {
|
|
486
|
+
this._log.info('getMetadata response %j', response);
|
|
487
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
488
|
+
}
|
|
489
|
+
: undefined;
|
|
490
|
+
return this.innerApiCalls
|
|
491
|
+
.getMetadata(request, options, wrappedCallback)
|
|
492
|
+
?.then(([response, options, rawResponse]) => {
|
|
493
|
+
this._log.info('getMetadata response %j', response);
|
|
494
|
+
return [response, options, rawResponse];
|
|
495
|
+
});
|
|
412
496
|
}
|
|
413
497
|
runRealtimeReport(request, optionsOrCallback, callback) {
|
|
414
|
-
var _a;
|
|
415
498
|
request = request || {};
|
|
416
499
|
let options;
|
|
417
500
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -426,13 +509,26 @@ class BetaAnalyticsDataClient {
|
|
|
426
509
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
427
510
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
428
511
|
this._gaxModule.routingHeader.fromParams({
|
|
429
|
-
property:
|
|
512
|
+
property: request.property ?? '',
|
|
430
513
|
});
|
|
431
|
-
this.initialize()
|
|
432
|
-
|
|
514
|
+
this.initialize().catch(err => {
|
|
515
|
+
throw err;
|
|
516
|
+
});
|
|
517
|
+
this._log.info('runRealtimeReport request %j', request);
|
|
518
|
+
const wrappedCallback = callback
|
|
519
|
+
? (error, response, options, rawResponse) => {
|
|
520
|
+
this._log.info('runRealtimeReport response %j', response);
|
|
521
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
522
|
+
}
|
|
523
|
+
: undefined;
|
|
524
|
+
return this.innerApiCalls
|
|
525
|
+
.runRealtimeReport(request, options, wrappedCallback)
|
|
526
|
+
?.then(([response, options, rawResponse]) => {
|
|
527
|
+
this._log.info('runRealtimeReport response %j', response);
|
|
528
|
+
return [response, options, rawResponse];
|
|
529
|
+
});
|
|
433
530
|
}
|
|
434
531
|
checkCompatibility(request, optionsOrCallback, callback) {
|
|
435
|
-
var _a;
|
|
436
532
|
request = request || {};
|
|
437
533
|
let options;
|
|
438
534
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -447,13 +543,26 @@ class BetaAnalyticsDataClient {
|
|
|
447
543
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
448
544
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
449
545
|
this._gaxModule.routingHeader.fromParams({
|
|
450
|
-
property:
|
|
546
|
+
property: request.property ?? '',
|
|
451
547
|
});
|
|
452
|
-
this.initialize()
|
|
453
|
-
|
|
548
|
+
this.initialize().catch(err => {
|
|
549
|
+
throw err;
|
|
550
|
+
});
|
|
551
|
+
this._log.info('checkCompatibility request %j', request);
|
|
552
|
+
const wrappedCallback = callback
|
|
553
|
+
? (error, response, options, rawResponse) => {
|
|
554
|
+
this._log.info('checkCompatibility response %j', response);
|
|
555
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
556
|
+
}
|
|
557
|
+
: undefined;
|
|
558
|
+
return this.innerApiCalls
|
|
559
|
+
.checkCompatibility(request, options, wrappedCallback)
|
|
560
|
+
?.then(([response, options, rawResponse]) => {
|
|
561
|
+
this._log.info('checkCompatibility response %j', response);
|
|
562
|
+
return [response, options, rawResponse];
|
|
563
|
+
});
|
|
454
564
|
}
|
|
455
565
|
queryAudienceExport(request, optionsOrCallback, callback) {
|
|
456
|
-
var _a;
|
|
457
566
|
request = request || {};
|
|
458
567
|
let options;
|
|
459
568
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -468,13 +577,26 @@ class BetaAnalyticsDataClient {
|
|
|
468
577
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
469
578
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
470
579
|
this._gaxModule.routingHeader.fromParams({
|
|
471
|
-
name:
|
|
580
|
+
name: request.name ?? '',
|
|
472
581
|
});
|
|
473
|
-
this.initialize()
|
|
474
|
-
|
|
582
|
+
this.initialize().catch(err => {
|
|
583
|
+
throw err;
|
|
584
|
+
});
|
|
585
|
+
this._log.info('queryAudienceExport request %j', request);
|
|
586
|
+
const wrappedCallback = callback
|
|
587
|
+
? (error, response, options, rawResponse) => {
|
|
588
|
+
this._log.info('queryAudienceExport response %j', response);
|
|
589
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
590
|
+
}
|
|
591
|
+
: undefined;
|
|
592
|
+
return this.innerApiCalls
|
|
593
|
+
.queryAudienceExport(request, options, wrappedCallback)
|
|
594
|
+
?.then(([response, options, rawResponse]) => {
|
|
595
|
+
this._log.info('queryAudienceExport response %j', response);
|
|
596
|
+
return [response, options, rawResponse];
|
|
597
|
+
});
|
|
475
598
|
}
|
|
476
599
|
getAudienceExport(request, optionsOrCallback, callback) {
|
|
477
|
-
var _a;
|
|
478
600
|
request = request || {};
|
|
479
601
|
let options;
|
|
480
602
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -489,13 +611,26 @@ class BetaAnalyticsDataClient {
|
|
|
489
611
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
490
612
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
491
613
|
this._gaxModule.routingHeader.fromParams({
|
|
492
|
-
name:
|
|
614
|
+
name: request.name ?? '',
|
|
493
615
|
});
|
|
494
|
-
this.initialize()
|
|
495
|
-
|
|
616
|
+
this.initialize().catch(err => {
|
|
617
|
+
throw err;
|
|
618
|
+
});
|
|
619
|
+
this._log.info('getAudienceExport request %j', request);
|
|
620
|
+
const wrappedCallback = callback
|
|
621
|
+
? (error, response, options, rawResponse) => {
|
|
622
|
+
this._log.info('getAudienceExport response %j', response);
|
|
623
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
624
|
+
}
|
|
625
|
+
: undefined;
|
|
626
|
+
return this.innerApiCalls
|
|
627
|
+
.getAudienceExport(request, options, wrappedCallback)
|
|
628
|
+
?.then(([response, options, rawResponse]) => {
|
|
629
|
+
this._log.info('getAudienceExport response %j', response);
|
|
630
|
+
return [response, options, rawResponse];
|
|
631
|
+
});
|
|
496
632
|
}
|
|
497
633
|
createAudienceExport(request, optionsOrCallback, callback) {
|
|
498
|
-
var _a;
|
|
499
634
|
request = request || {};
|
|
500
635
|
let options;
|
|
501
636
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -510,10 +645,24 @@ class BetaAnalyticsDataClient {
|
|
|
510
645
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
511
646
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
512
647
|
this._gaxModule.routingHeader.fromParams({
|
|
513
|
-
parent:
|
|
648
|
+
parent: request.parent ?? '',
|
|
514
649
|
});
|
|
515
|
-
this.initialize()
|
|
516
|
-
|
|
650
|
+
this.initialize().catch(err => {
|
|
651
|
+
throw err;
|
|
652
|
+
});
|
|
653
|
+
const wrappedCallback = callback
|
|
654
|
+
? (error, response, rawResponse, _) => {
|
|
655
|
+
this._log.info('createAudienceExport response %j', rawResponse);
|
|
656
|
+
callback(error, response, rawResponse, _); // We verified callback above.
|
|
657
|
+
}
|
|
658
|
+
: undefined;
|
|
659
|
+
this._log.info('createAudienceExport request %j', request);
|
|
660
|
+
return this.innerApiCalls
|
|
661
|
+
.createAudienceExport(request, options, wrappedCallback)
|
|
662
|
+
?.then(([response, rawResponse, _]) => {
|
|
663
|
+
this._log.info('createAudienceExport response %j', rawResponse);
|
|
664
|
+
return [response, rawResponse, _];
|
|
665
|
+
});
|
|
517
666
|
}
|
|
518
667
|
/**
|
|
519
668
|
* Check the status of the long running operation returned by `createAudienceExport()`.
|
|
@@ -527,13 +676,13 @@ class BetaAnalyticsDataClient {
|
|
|
527
676
|
* region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_CreateAudienceExport_async
|
|
528
677
|
*/
|
|
529
678
|
async checkCreateAudienceExportProgress(name) {
|
|
679
|
+
this._log.info('createAudienceExport long-running');
|
|
530
680
|
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
531
681
|
const [operation] = await this.operationsClient.getOperation(request);
|
|
532
682
|
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createAudienceExport, this._gaxModule.createDefaultBackoffSettings());
|
|
533
683
|
return decodeOperation;
|
|
534
684
|
}
|
|
535
685
|
listAudienceExports(request, optionsOrCallback, callback) {
|
|
536
|
-
var _a;
|
|
537
686
|
request = request || {};
|
|
538
687
|
let options;
|
|
539
688
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -548,10 +697,24 @@ class BetaAnalyticsDataClient {
|
|
|
548
697
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
549
698
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
550
699
|
this._gaxModule.routingHeader.fromParams({
|
|
551
|
-
parent:
|
|
700
|
+
parent: request.parent ?? '',
|
|
552
701
|
});
|
|
553
|
-
this.initialize()
|
|
554
|
-
|
|
702
|
+
this.initialize().catch(err => {
|
|
703
|
+
throw err;
|
|
704
|
+
});
|
|
705
|
+
const wrappedCallback = callback
|
|
706
|
+
? (error, values, nextPageRequest, rawResponse) => {
|
|
707
|
+
this._log.info('listAudienceExports values %j', values);
|
|
708
|
+
callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
|
|
709
|
+
}
|
|
710
|
+
: undefined;
|
|
711
|
+
this._log.info('listAudienceExports request %j', request);
|
|
712
|
+
return this.innerApiCalls
|
|
713
|
+
.listAudienceExports(request, options, wrappedCallback)
|
|
714
|
+
?.then(([response, input, output]) => {
|
|
715
|
+
this._log.info('listAudienceExports values %j', response);
|
|
716
|
+
return [response, input, output];
|
|
717
|
+
});
|
|
555
718
|
}
|
|
556
719
|
/**
|
|
557
720
|
* Equivalent to `listAudienceExports`, but returns a NodeJS Stream object.
|
|
@@ -583,18 +746,20 @@ class BetaAnalyticsDataClient {
|
|
|
583
746
|
* for more details and examples.
|
|
584
747
|
*/
|
|
585
748
|
listAudienceExportsStream(request, options) {
|
|
586
|
-
var _a;
|
|
587
749
|
request = request || {};
|
|
588
750
|
options = options || {};
|
|
589
751
|
options.otherArgs = options.otherArgs || {};
|
|
590
752
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
591
753
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
592
754
|
this._gaxModule.routingHeader.fromParams({
|
|
593
|
-
parent:
|
|
755
|
+
parent: request.parent ?? '',
|
|
594
756
|
});
|
|
595
757
|
const defaultCallSettings = this._defaults['listAudienceExports'];
|
|
596
758
|
const callSettings = defaultCallSettings.merge(options);
|
|
597
|
-
this.initialize()
|
|
759
|
+
this.initialize().catch(err => {
|
|
760
|
+
throw err;
|
|
761
|
+
});
|
|
762
|
+
this._log.info('listAudienceExports stream %j', request);
|
|
598
763
|
return this.descriptors.page.listAudienceExports.createStream(this.innerApiCalls.listAudienceExports, request, callSettings);
|
|
599
764
|
}
|
|
600
765
|
/**
|
|
@@ -630,18 +795,20 @@ class BetaAnalyticsDataClient {
|
|
|
630
795
|
* region_tag:analyticsdata_v1beta_generated_BetaAnalyticsData_ListAudienceExports_async
|
|
631
796
|
*/
|
|
632
797
|
listAudienceExportsAsync(request, options) {
|
|
633
|
-
var _a;
|
|
634
798
|
request = request || {};
|
|
635
799
|
options = options || {};
|
|
636
800
|
options.otherArgs = options.otherArgs || {};
|
|
637
801
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
638
802
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
639
803
|
this._gaxModule.routingHeader.fromParams({
|
|
640
|
-
parent:
|
|
804
|
+
parent: request.parent ?? '',
|
|
641
805
|
});
|
|
642
806
|
const defaultCallSettings = this._defaults['listAudienceExports'];
|
|
643
807
|
const callSettings = defaultCallSettings.merge(options);
|
|
644
|
-
this.initialize()
|
|
808
|
+
this.initialize().catch(err => {
|
|
809
|
+
throw err;
|
|
810
|
+
});
|
|
811
|
+
this._log.info('listAudienceExports iterate %j', request);
|
|
645
812
|
return this.descriptors.page.listAudienceExports.asyncIterate(this.innerApiCalls['listAudienceExports'], request, callSettings);
|
|
646
813
|
}
|
|
647
814
|
/**
|
|
@@ -675,7 +842,6 @@ class BetaAnalyticsDataClient {
|
|
|
675
842
|
* ```
|
|
676
843
|
*/
|
|
677
844
|
getOperation(request, optionsOrCallback, callback) {
|
|
678
|
-
var _a;
|
|
679
845
|
let options;
|
|
680
846
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
681
847
|
callback = optionsOrCallback;
|
|
@@ -689,7 +855,7 @@ class BetaAnalyticsDataClient {
|
|
|
689
855
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
690
856
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
691
857
|
this._gaxModule.routingHeader.fromParams({
|
|
692
|
-
name:
|
|
858
|
+
name: request.name ?? '',
|
|
693
859
|
});
|
|
694
860
|
return this.operationsClient.getOperation(request, options, callback);
|
|
695
861
|
}
|
|
@@ -724,13 +890,12 @@ class BetaAnalyticsDataClient {
|
|
|
724
890
|
* ```
|
|
725
891
|
*/
|
|
726
892
|
listOperationsAsync(request, options) {
|
|
727
|
-
var _a;
|
|
728
893
|
options = options || {};
|
|
729
894
|
options.otherArgs = options.otherArgs || {};
|
|
730
895
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
731
896
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
732
897
|
this._gaxModule.routingHeader.fromParams({
|
|
733
|
-
name:
|
|
898
|
+
name: request.name ?? '',
|
|
734
899
|
});
|
|
735
900
|
return this.operationsClient.listOperationsAsync(request, options);
|
|
736
901
|
}
|
|
@@ -766,7 +931,6 @@ class BetaAnalyticsDataClient {
|
|
|
766
931
|
* ```
|
|
767
932
|
*/
|
|
768
933
|
cancelOperation(request, optionsOrCallback, callback) {
|
|
769
|
-
var _a;
|
|
770
934
|
let options;
|
|
771
935
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
772
936
|
callback = optionsOrCallback;
|
|
@@ -780,7 +944,7 @@ class BetaAnalyticsDataClient {
|
|
|
780
944
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
781
945
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
782
946
|
this._gaxModule.routingHeader.fromParams({
|
|
783
|
-
name:
|
|
947
|
+
name: request.name ?? '',
|
|
784
948
|
});
|
|
785
949
|
return this.operationsClient.cancelOperation(request, options, callback);
|
|
786
950
|
}
|
|
@@ -810,7 +974,6 @@ class BetaAnalyticsDataClient {
|
|
|
810
974
|
* ```
|
|
811
975
|
*/
|
|
812
976
|
deleteOperation(request, optionsOrCallback, callback) {
|
|
813
|
-
var _a;
|
|
814
977
|
let options;
|
|
815
978
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
816
979
|
callback = optionsOrCallback;
|
|
@@ -824,7 +987,7 @@ class BetaAnalyticsDataClient {
|
|
|
824
987
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
825
988
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
826
989
|
this._gaxModule.routingHeader.fromParams({
|
|
827
|
-
name:
|
|
990
|
+
name: request.name ?? '',
|
|
828
991
|
});
|
|
829
992
|
return this.operationsClient.deleteOperation(request, options, callback);
|
|
830
993
|
}
|
|
@@ -915,6 +1078,7 @@ class BetaAnalyticsDataClient {
|
|
|
915
1078
|
close() {
|
|
916
1079
|
if (this.betaAnalyticsDataStub && !this._terminated) {
|
|
917
1080
|
return this.betaAnalyticsDataStub.then(stub => {
|
|
1081
|
+
this._log.info('ending gRPC channel');
|
|
918
1082
|
this._terminated = true;
|
|
919
1083
|
stub.close();
|
|
920
1084
|
this.operationsClient.close();
|