-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
v1alpha.ts
10001 lines (9720 loc) · 367 KB
/
v1alpha.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2020 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/class-name-casing */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-empty-interface */
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable no-irregular-whitespace */
import {
OAuth2Client,
JWT,
Compute,
UserRefreshClient,
BaseExternalAccountClient,
GaxiosPromise,
GoogleConfigurable,
createAPIRequest,
MethodOptions,
StreamMethodOptions,
GlobalOptions,
GoogleAuth,
BodyResponseCallback,
APIRequestContext,
} from 'googleapis-common';
import {Readable} from 'stream';
export namespace analyticsadmin_v1alpha {
export interface Options extends GlobalOptions {
version: 'v1alpha';
}
interface StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?:
| string
| OAuth2Client
| JWT
| Compute
| UserRefreshClient
| BaseExternalAccountClient
| GoogleAuth;
/**
* V1 error format.
*/
'$.xgafv'?: string;
/**
* OAuth access token.
*/
access_token?: string;
/**
* Data format for response.
*/
alt?: string;
/**
* JSONP
*/
callback?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
fields?: string;
/**
* API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
*/
key?: string;
/**
* OAuth 2.0 token for the current user.
*/
oauth_token?: string;
/**
* Returns response with indentations and line breaks.
*/
prettyPrint?: boolean;
/**
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
*/
quotaUser?: string;
/**
* Legacy upload protocol for media (e.g. "media", "multipart").
*/
uploadType?: string;
/**
* Upload protocol for media (e.g. "raw", "multipart").
*/
upload_protocol?: string;
}
/**
* Google Analytics Admin API
*
*
*
* @example
* ```js
* const {google} = require('googleapis');
* const analyticsadmin = google.analyticsadmin('v1alpha');
* ```
*/
export class Analyticsadmin {
context: APIRequestContext;
accounts: Resource$Accounts;
accountSummaries: Resource$Accountsummaries;
properties: Resource$Properties;
constructor(options: GlobalOptions, google?: GoogleConfigurable) {
this.context = {
_options: options || {},
google,
};
this.accounts = new Resource$Accounts(this.context);
this.accountSummaries = new Resource$Accountsummaries(this.context);
this.properties = new Resource$Properties(this.context);
}
}
/**
* A resource message representing a Google Analytics account.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaAccount {
/**
* Output only. Time when this account was originally created.
*/
createTime?: string | null;
/**
* Output only. Indicates whether this Account is soft-deleted or not. Deleted accounts are excluded from List results unless specifically requested.
*/
deleted?: boolean | null;
/**
* Required. Human-readable display name for this account.
*/
displayName?: string | null;
/**
* Output only. Resource name of this account. Format: accounts/{account\} Example: "accounts/100"
*/
name?: string | null;
/**
* Country of business. Must be a Unicode CLDR region code.
*/
regionCode?: string | null;
/**
* Output only. Time when account payload fields were last updated.
*/
updateTime?: string | null;
}
/**
* A virtual resource representing an overview of an account and all its child GA4 properties.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaAccountSummary {
/**
* Resource name of account referred to by this account summary Format: accounts/{account_id\} Example: "accounts/1000"
*/
account?: string | null;
/**
* Display name for the account referred to in this account summary.
*/
displayName?: string | null;
/**
* Resource name for this account summary. Format: accountSummaries/{account_id\} Example: "accountSummaries/1000"
*/
name?: string | null;
/**
* List of summaries for child accounts of this account.
*/
propertySummaries?: Schema$GoogleAnalyticsAdminV1alphaPropertySummary[];
}
/**
* A resource message representing a Google Analytics Android app stream.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaAndroidAppDataStream {
/**
* Output only. Time when this stream was originally created.
*/
createTime?: string | null;
/**
* Human-readable display name for the Data Stream. The max allowed display name length is 255 UTF-16 code units.
*/
displayName?: string | null;
/**
* Output only. ID of the corresponding Android app in Firebase, if any. This ID can change if the Android app is deleted and recreated.
*/
firebaseAppId?: string | null;
/**
* Output only. Resource name of this Data Stream. Format: properties/{property_id\}/androidAppDataStreams/{stream_id\} Example: "properties/1000/androidAppDataStreams/2000"
*/
name?: string | null;
/**
* Immutable. The package name for the app being measured. Example: "com.example.myandroidapp"
*/
packageName?: string | null;
/**
* Output only. Time when stream payload fields were last updated.
*/
updateTime?: string | null;
}
/**
* Read-only resource used to summarize a principal's effective roles.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaAuditUserLink {
/**
* Roles directly assigned to this user for this entity. Format: predefinedRoles/read Excludes roles that are inherited from an account (if this is for a property), group, or organization admin role.
*/
directRoles?: string[] | null;
/**
* Union of all permissions a user has at this account or property (includes direct permissions, group-inherited permissions, etc.). Format: predefinedRoles/read
*/
effectiveRoles?: string[] | null;
/**
* Email address of the linked user
*/
emailAddress?: string | null;
/**
* Example format: properties/1234/userLinks/5678
*/
name?: string | null;
}
/**
* Request message for AuditUserLinks RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaAuditUserLinksRequest {
/**
* The maximum number of user links to return. The service may return fewer than this value. If unspecified, at most 1000 user links will be returned. The maximum value is 5000; values above 5000 will be coerced to 5000.
*/
pageSize?: number | null;
/**
* A page token, received from a previous `AuditUserLinks` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `AuditUserLinks` must match the call that provided the page token.
*/
pageToken?: string | null;
}
/**
* Response message for AuditUserLinks RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaAuditUserLinksResponse {
/**
* A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
*/
nextPageToken?: string | null;
/**
* List of AuditUserLinks. These will be ordered stably, but in an arbitrary order.
*/
userLinks?: Schema$GoogleAnalyticsAdminV1alphaAuditUserLink[];
}
/**
* Request message for BatchCreateUserLinks RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaBatchCreateUserLinksRequest {
/**
* Optional. If set, then email the new users notifying them that they've been granted permissions to the resource. Regardless of whether this is set or not, notify_new_user field inside each individual request is ignored.
*/
notifyNewUsers?: boolean | null;
/**
* Required. The requests specifying the user links to create. A maximum of 1000 user links can be created in a batch.
*/
requests?: Schema$GoogleAnalyticsAdminV1alphaCreateUserLinkRequest[];
}
/**
* Response message for BatchCreateUserLinks RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaBatchCreateUserLinksResponse {
/**
* The user links created.
*/
userLinks?: Schema$GoogleAnalyticsAdminV1alphaUserLink[];
}
/**
* Request message for BatchDeleteUserLinks RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaBatchDeleteUserLinksRequest {
/**
* Required. The requests specifying the user links to update. A maximum of 1000 user links can be updated in a batch.
*/
requests?: Schema$GoogleAnalyticsAdminV1alphaDeleteUserLinkRequest[];
}
/**
* Response message for BatchGetUserLinks RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaBatchGetUserLinksResponse {
/**
* The requested user links.
*/
userLinks?: Schema$GoogleAnalyticsAdminV1alphaUserLink[];
}
/**
* Request message for BatchUpdateUserLinks RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaBatchUpdateUserLinksRequest {
/**
* Required. The requests specifying the user links to update. A maximum of 1000 user links can be updated in a batch.
*/
requests?: Schema$GoogleAnalyticsAdminV1alphaUpdateUserLinkRequest[];
}
/**
* Response message for BatchUpdateUserLinks RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaBatchUpdateUserLinksResponse {
/**
* The user links updated.
*/
userLinks?: Schema$GoogleAnalyticsAdminV1alphaUserLink[];
}
/**
* A description of a change to a single Google Analytics resource.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaChangeHistoryChange {
/**
* The type of action that changed this resource.
*/
action?: string | null;
/**
* Resource name of the resource whose changes are described by this entry.
*/
resource?: string | null;
/**
* Resource contents from after the change was made. If this resource was deleted in this change, this field will be missing.
*/
resourceAfterChange?: Schema$GoogleAnalyticsAdminV1alphaChangeHistoryChangeChangeHistoryResource;
/**
* Resource contents from before the change was made. If this resource was created in this change, this field will be missing.
*/
resourceBeforeChange?: Schema$GoogleAnalyticsAdminV1alphaChangeHistoryChangeChangeHistoryResource;
}
/**
* A snapshot of a resource as before or after the result of a change in change history.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaChangeHistoryChangeChangeHistoryResource {
/**
* A snapshot of an Account resource in change history.
*/
account?: Schema$GoogleAnalyticsAdminV1alphaAccount;
/**
* A snapshot of an AndroidAppDataStream resource in change history.
*/
androidAppDataStream?: Schema$GoogleAnalyticsAdminV1alphaAndroidAppDataStream;
/**
* A snapshot of a FirebaseLink resource in change history.
*/
firebaseLink?: Schema$GoogleAnalyticsAdminV1alphaFirebaseLink;
/**
* A snapshot of a GoogleAdsLink resource in change history.
*/
googleAdsLink?: Schema$GoogleAnalyticsAdminV1alphaGoogleAdsLink;
/**
* A snapshot of an IosAppDataStream resource in change history.
*/
iosAppDataStream?: Schema$GoogleAnalyticsAdminV1alphaIosAppDataStream;
/**
* A snapshot of a Property resource in change history.
*/
property?: Schema$GoogleAnalyticsAdminV1alphaProperty;
/**
* A snapshot of a WebDataStream resource in change history.
*/
webDataStream?: Schema$GoogleAnalyticsAdminV1alphaWebDataStream;
}
/**
* A set of changes within a Google Analytics account or its child properties that resulted from the same cause. Common causes would be updates made in the Google Analytics UI, changes from customer support, or automatic Google Analytics system changes.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaChangeHistoryEvent {
/**
* The type of actor that made this change.
*/
actorType?: string | null;
/**
* A list of changes made in this change history event that fit the filters specified in SearchChangeHistoryEventsRequest.
*/
changes?: Schema$GoogleAnalyticsAdminV1alphaChangeHistoryChange[];
/**
* If true, then the list of changes returned was filtered, and does not represent all changes that occurred in this event.
*/
changesFiltered?: boolean | null;
/**
* Time when change was made.
*/
changeTime?: string | null;
/**
* ID of this change history event. This ID is unique across Google Analytics.
*/
id?: string | null;
/**
* Email address of the Google account that made the change. This will be a valid email address if the actor field is set to USER, and empty otherwise. Google accounts that have been deleted will cause an error.
*/
userActorEmail?: string | null;
}
/**
* Request message for CreateUserLink RPC. Users can have multiple email addresses associated with their Google account, and one of these email addresses is the "primary" email address. Any of the email addresses associated with a Google account may be used for a new UserLink, but the returned UserLink will always contain the "primary" email address. As a result, the input and output email address for this request may differ.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaCreateUserLinkRequest {
/**
* Optional. If set, then email the new user notifying them that they've been granted permissions to the resource.
*/
notifyNewUser?: boolean | null;
/**
* Required. Example format: accounts/1234
*/
parent?: string | null;
/**
* Required. The user link to create.
*/
userLink?: Schema$GoogleAnalyticsAdminV1alphaUserLink;
}
/**
* A resource message representing data sharing settings of a Google Analytics account.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaDataSharingSettings {
/**
* Output only. Resource name. Format: accounts/{account\}/dataSharingSettings Example: "accounts/1000/dataSharingSettings"
*/
name?: string | null;
/**
* Allows any of Google sales to access the data in order to suggest configuration changes to improve results.
*/
sharingWithGoogleAnySalesEnabled?: boolean | null;
/**
* Allows Google sales teams that are assigned to the customer to access the data in order to suggest configuration changes to improve results. Sales team restrictions still apply when enabled.
*/
sharingWithGoogleAssignedSalesEnabled?: boolean | null;
/**
* Allows Google to use the data to improve other Google products or services.
*/
sharingWithGoogleProductsEnabled?: boolean | null;
/**
* Allows Google support to access the data in order to help troubleshoot issues.
*/
sharingWithGoogleSupportEnabled?: boolean | null;
/**
* Allows Google to share the data anonymously in aggregate form with others.
*/
sharingWithOthersEnabled?: boolean | null;
}
/**
* Request message for DeleteUserLink RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaDeleteUserLinkRequest {
/**
* Required. Example format: accounts/1234/userLinks/5678
*/
name?: string | null;
}
/**
* Singleton resource under a WebDataStream, configuring measurement of additional site interactions and content.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaEnhancedMeasurementSettings {
/**
* If enabled, capture a file download event each time a link is clicked with a common document, compressed file, application, video, or audio extension.
*/
fileDownloadsEnabled?: boolean | null;
/**
* Output only. Resource name of this Data Stream. Format: properties/{property_id\}/webDataStreams/{stream_id\}/enhancedMeasurementSettings Example: "properties/1000/webDataStreams/2000/enhancedMeasurementSettings"
*/
name?: string | null;
/**
* If enabled, capture an outbound click event each time a visitor clicks a link that leads them away from your domain.
*/
outboundClicksEnabled?: boolean | null;
/**
* If enabled, capture a page view event each time the website changes the browser history state.
*/
pageChangesEnabled?: boolean | null;
/**
* Output only. If enabled, capture a page view event each time a page loads.
*/
pageLoadsEnabled?: boolean | null;
/**
* Output only. If enabled, capture a page view event each time a page loads or the website changes the browser history state.
*/
pageViewsEnabled?: boolean | null;
/**
* If enabled, capture scroll events each time a visitor gets to the bottom of a page.
*/
scrollsEnabled?: boolean | null;
/**
* Required. URL query parameters to interpret as site search parameters. Max length is 1024 characters. Must not be empty.
*/
searchQueryParameter?: string | null;
/**
* If enabled, capture a view search results event each time a visitor performs a search on your site (based on a query parameter).
*/
siteSearchEnabled?: boolean | null;
/**
* Indicates whether Enhanced Measurement Settings will be used to automatically measure interactions and content on this web stream. Changing this value does not affect the settings themselves, but determines whether they are respected.
*/
streamEnabled?: boolean | null;
/**
* Additional URL query parameters. Max length is 1024 characters.
*/
uriQueryParameter?: string | null;
/**
* If enabled, capture video play, progress, and complete events as visitors view embedded videos on your site.
*/
videoEngagementEnabled?: boolean | null;
}
/**
* A link between an GA4 property and a Firebase project.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaFirebaseLink {
/**
* Output only. Time when this FirebaseLink was originally created.
*/
createTime?: string | null;
/**
* Maximum user access to the GA4 property allowed to admins of the linked Firebase project.
*/
maximumUserAccess?: string | null;
/**
* Output only. Example format: properties/1234/firebaseLinks/5678
*/
name?: string | null;
/**
* Immutable. Firebase project resource name. When creating a FirebaseLink, you may provide this resource name using either a project number or project ID. Once this resource has been created, returned FirebaseLinks will always have a project_name that contains a project number. Format: 'projects/{project number\}' Example: 'projects/1234'
*/
project?: string | null;
}
/**
* Read-only resource with the tag for sending data from a website to a WebDataStream.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaGlobalSiteTag {
/**
* Output only. Resource name for this GlobalSiteTag resource. Format: properties/{propertyId\}/globalSiteTag
*/
name?: string | null;
/**
* Immutable. JavaScript code snippet to be pasted as the first item into the head tag of every webpage to measure.
*/
snippet?: string | null;
}
/**
* A link between an GA4 property and a Google Ads account.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaGoogleAdsLink {
/**
* Enable personalized advertising features with this integration. Automatically publish my Google Analytics audience lists and Google Analytics remarketing events/parameters to the linked Google Ads account. If this field is not set on create/update, it will be defaulted to true.
*/
adsPersonalizationEnabled?: boolean | null;
/**
* Output only. If true, this link is for a Google Ads manager account.
*/
canManageClients?: boolean | null;
/**
* Output only. Time when this link was originally created.
*/
createTime?: string | null;
/**
* Immutable. Google Ads customer ID.
*/
customerId?: string | null;
/**
* Output only. Email address of the user that created the link. An empty string will be returned if the email address can't be retrieved.
*/
emailAddress?: string | null;
/**
* Output only. Format: properties/{propertyId\}/googleAdsLinks/{googleAdsLinkId\} Note: googleAdsLinkId is not the Google Ads customer ID.
*/
name?: string | null;
/**
* Output only. Time when this link was last updated.
*/
updateTime?: string | null;
}
/**
* A resource message representing a Google Analytics IOS app stream.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaIosAppDataStream {
/**
* Required. Immutable. The Apple App Store Bundle ID for the app Example: "com.example.myiosapp"
*/
bundleId?: string | null;
/**
* Output only. Time when this stream was originally created.
*/
createTime?: string | null;
/**
* Human-readable display name for the Data Stream. The max allowed display name length is 255 UTF-16 code units.
*/
displayName?: string | null;
/**
* Output only. ID of the corresponding iOS app in Firebase, if any. This ID can change if the iOS app is deleted and recreated.
*/
firebaseAppId?: string | null;
/**
* Output only. Resource name of this Data Stream. Format: properties/{property_id\}/iosAppDataStreams/{stream_id\} Example: "properties/1000/iosAppDataStreams/2000"
*/
name?: string | null;
/**
* Output only. Time when stream payload fields were last updated.
*/
updateTime?: string | null;
}
/**
* Request message for ListAccounts RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaListAccountsResponse {
/**
* Results that were accessible to the caller.
*/
accounts?: Schema$GoogleAnalyticsAdminV1alphaAccount[];
/**
* A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
*/
nextPageToken?: string | null;
}
/**
* Response message for ListAccountSummaries RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaListAccountSummariesResponse {
/**
* Account summaries of all accounts the caller has access to.
*/
accountSummaries?: Schema$GoogleAnalyticsAdminV1alphaAccountSummary[];
/**
* A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
*/
nextPageToken?: string | null;
}
/**
* Request message for ListAndroidDataStreams RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaListAndroidAppDataStreamsResponse {
/**
* Results that matched the filter criteria and were accessible to the caller.
*/
androidAppDataStreams?: Schema$GoogleAnalyticsAdminV1alphaAndroidAppDataStream[];
/**
* A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
*/
nextPageToken?: string | null;
}
/**
* Response message for ListFirebaseLinks RPC
*/
export interface Schema$GoogleAnalyticsAdminV1alphaListFirebaseLinksResponse {
/**
* List of FirebaseLinks. This will have at most one value.
*/
firebaseLinks?: Schema$GoogleAnalyticsAdminV1alphaFirebaseLink[];
/**
* A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. Currently, Google Analytics supports only one FirebaseLink per property, so this will never be populated.
*/
nextPageToken?: string | null;
}
/**
* Response message for ListGoogleAdsLinks RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaListGoogleAdsLinksResponse {
/**
* List of GoogleAdsLinks.
*/
googleAdsLinks?: Schema$GoogleAnalyticsAdminV1alphaGoogleAdsLink[];
/**
* A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
*/
nextPageToken?: string | null;
}
/**
* Request message for ListIosAppDataStreams RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaListIosAppDataStreamsResponse {
/**
* Results that matched the filter criteria and were accessible to the caller.
*/
iosAppDataStreams?: Schema$GoogleAnalyticsAdminV1alphaIosAppDataStream[];
/**
* A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
*/
nextPageToken?: string | null;
}
/**
* Response message for ListProperties RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaListPropertiesResponse {
/**
* A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
*/
nextPageToken?: string | null;
/**
* Results that matched the filter criteria and were accessible to the caller.
*/
properties?: Schema$GoogleAnalyticsAdminV1alphaProperty[];
}
/**
* Response message for ListUserLinks RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaListUserLinksResponse {
/**
* A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
*/
nextPageToken?: string | null;
/**
* List of UserLinks. These will be ordered stably, but in an arbitrary order.
*/
userLinks?: Schema$GoogleAnalyticsAdminV1alphaUserLink[];
}
/**
* Request message for ListWebDataStreams RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaListWebDataStreamsResponse {
/**
* A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
*/
nextPageToken?: string | null;
/**
* Results that matched the filter criteria and were accessible to the caller.
*/
webDataStreams?: Schema$GoogleAnalyticsAdminV1alphaWebDataStream[];
}
/**
* A resource message representing a Google Analytics GA4 property.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaProperty {
/**
* Output only. Time when the entity was originally created.
*/
createTime?: string | null;
/**
* The currency type used in reports involving monetary values. Format: https://en.wikipedia.org/wiki/ISO_4217 Examples: "USD", "EUR", "JPY"
*/
currencyCode?: string | null;
/**
* Output only. If set, the time at which this property was trashed. If not set, then this property is not currently in the trash can.
*/
deleteTime?: string | null;
/**
* Required. Human-readable display name for this property. The max allowed display name length is 100 UTF-16 code units.
*/
displayName?: string | null;
/**
* Output only. If set, the time at which this trashed property will be permanently deleted. If not set, then this property is not currently in the trash can and is not slated to be deleted.
*/
expireTime?: string | null;
/**
* Industry associated with this property Example: AUTOMOTIVE, FOOD_AND_DRINK
*/
industryCategory?: string | null;
/**
* Output only. Resource name of this property. Format: properties/{property_id\} Example: "properties/1000"
*/
name?: string | null;
/**
* Immutable. Resource name of this property's logical parent. Note: The Property-Moving UI can be used to change the parent. Format: accounts/{account\} Example: "accounts/100"
*/
parent?: string | null;
/**
* Required. Reporting Time Zone, used as the day boundary for reports, regardless of where the data originates. If the time zone honors DST, Analytics will automatically adjust for the changes. NOTE: Changing the time zone only affects data going forward, and is not applied retroactively. Format: https://www.iana.org/time-zones Example: "America/Los_Angeles"
*/
timeZone?: string | null;
/**
* Output only. Time when entity payload fields were last updated.
*/
updateTime?: string | null;
}
/**
* A virtual resource representing metadata for an GA4 property.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaPropertySummary {
/**
* Display name for the property referred to in this account summary.
*/
displayName?: string | null;
/**
* Resource name of property referred to by this property summary Format: properties/{property_id\} Example: "properties/1000"
*/
property?: string | null;
}
/**
* Request message for ProvisionAccountTicket RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaProvisionAccountTicketRequest {
/**
* The account to create.
*/
account?: Schema$GoogleAnalyticsAdminV1alphaAccount;
/**
* Redirect URI where the user will be sent after accepting Terms of Service. Must be configured in Developers Console as a Redirect URI
*/
redirectUri?: string | null;
}
/**
* Response message for ProvisionAccountTicket RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaProvisionAccountTicketResponse {
/**
* The param to be passed in the ToS link.
*/
accountTicketId?: string | null;
}
/**
* Request message for SearchChangeHistoryEvents RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaSearchChangeHistoryEventsRequest {
/**
* Optional. If set, only return changes that match one or more of these types of actions.
*/
action?: string[] | null;
/**
* Optional. If set, only return changes if they are made by a user in this list.
*/
actorEmail?: string[] | null;
/**
* Optional. If set, only return changes made after this time (inclusive).
*/
earliestChangeTime?: string | null;
/**
* Optional. If set, only return changes made before this time (inclusive).
*/
latestChangeTime?: string | null;
/**
* Optional. The maximum number of ChangeHistoryEvent items to return. The service may return fewer than this value, even if there are additional pages. If unspecified, at most 50 items will be returned. The maximum value is 200 (higher values will be coerced to the maximum).
*/
pageSize?: number | null;
/**
* Optional. A page token, received from a previous `SearchChangeHistoryEvents` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `SearchChangeHistoryEvents` must match the call that provided the page token.
*/
pageToken?: string | null;
/**
* Optional. Resource name for a child property. If set, only return changes made to this property or its child resources.
*/
property?: string | null;
/**
* Optional. If set, only return changes if they are for a resource that matches at least one of these types.
*/
resourceType?: string[] | null;
}
/**
* Response message for SearchAccounts RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaSearchChangeHistoryEventsResponse {
/**
* Results that were accessible to the caller.
*/
changeHistoryEvents?: Schema$GoogleAnalyticsAdminV1alphaChangeHistoryEvent[];
/**
* A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
*/
nextPageToken?: string | null;
}
/**
* Request message for UpdateUserLink RPC.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaUpdateUserLinkRequest {
/**
* Required. The user link to update.
*/
userLink?: Schema$GoogleAnalyticsAdminV1alphaUserLink;
}
/**
* A resource message representing a user's permissions on an Account or Property resource.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaUserLink {
/**
* Roles directly assigned to this user for this account or property. Valid values: predefinedRoles/read predefinedRoles/collaborate predefinedRoles/edit predefinedRoles/manage-users Excludes roles that are inherited from a higher-level entity, group, or organization admin role. A UserLink that is updated to have an empty list of direct_roles will be deleted.
*/
directRoles?: string[] | null;
/**
* Email address of the user to link
*/
emailAddress?: string | null;
/**
* Example format: properties/1234/userLinks/5678
*/
name?: string | null;
}
/**
* A resource message representing a Google Analytics web stream.
*/
export interface Schema$GoogleAnalyticsAdminV1alphaWebDataStream {
/**
* Output only. Time when this stream was originally created.
*/
createTime?: string | null;
/**
* Immutable. Domain name of the web app being measured, or empty. Example: "http://www.google.com", "https://www.google.com"
*/
defaultUri?: string | null;
/**
* Required. Human-readable display name for the Data Stream. The max allowed display name length is 100 UTF-16 code units.
*/
displayName?: string | null;
/**
* Output only. ID of the corresponding web app in Firebase, if any. This ID can change if the web app is deleted and recreated.
*/
firebaseAppId?: string | null;
/**
* Output only. Analytics "Measurement ID", without the "G-" prefix. Example: "G-1A2BCD345E" would just be "1A2BCD345E"
*/
measurementId?: string | null;
/**
* Output only. Resource name of this Data Stream. Format: properties/{property_id\}/webDataStreams/{stream_id\} Example: "properties/1000/webDataStreams/2000"
*/
name?: string | null;
/**
* Output only. Time when stream payload fields were last updated.
*/
updateTime?: string | null;
}
/**
* A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); \} The JSON representation for `Empty` is empty JSON object `{\}`.
*/
export interface Schema$GoogleProtobufEmpty {}
export class Resource$Accounts {
context: APIRequestContext;
userLinks: Resource$Accounts$Userlinks;
constructor(context: APIRequestContext) {
this.context = context;
this.userLinks = new Resource$Accounts$Userlinks(this.context);
}
/**
* Marks target Account as soft-deleted (ie: "trashed") and returns it. This API does not have a method to restore soft-deleted accounts. However, they can be restored using the Trash Can UI. If the accounts are not restored before the expiration time, the account and all child resources (eg: Properties, GoogleAdsLinks, Streams, UserLinks) will be permanently purged. https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/analyticsadmin.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const analyticsadmin = google.analyticsadmin('v1alpha');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/analytics.edit'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await analyticsadmin.accounts.delete({
* // Required. The name of the Account to soft-delete. Format: accounts/{account\} Example: "accounts/100"
* name: 'accounts/my-account',
* });
* console.log(res.data);
*
* // Example response
* // {}
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
delete(
params: Params$Resource$Accounts$Delete,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
delete(
params?: Params$Resource$Accounts$Delete,
options?: MethodOptions
): GaxiosPromise<Schema$GoogleProtobufEmpty>;
delete(
params: Params$Resource$Accounts$Delete,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
delete(
params: Params$Resource$Accounts$Delete,
options: MethodOptions | BodyResponseCallback<Schema$GoogleProtobufEmpty>,
callback: BodyResponseCallback<Schema$GoogleProtobufEmpty>
): void;
delete(
params: Params$Resource$Accounts$Delete,
callback: BodyResponseCallback<Schema$GoogleProtobufEmpty>
): void;
delete(callback: BodyResponseCallback<Schema$GoogleProtobufEmpty>): void;
delete(
paramsOrCallback?:
| Params$Resource$Accounts$Delete
| BodyResponseCallback<Schema$GoogleProtobufEmpty>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions