/
v3.ts
11420 lines (10718 loc) · 396 KB
/
v3.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 2015 Google Inc. All Rights Reserved.
*
* 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.
*/
import {AxiosPromise} from 'axios';
import {Compute, JWT, OAuth2Client, UserRefreshClient} from 'google-auth-library';
import {BodyResponseCallback, createAPIRequest, GlobalOptions, GoogleConfigurable, MethodOptions} from 'googleapis-common';
// tslint:disable: no-any
// tslint:disable: class-name
// tslint:disable: variable-name
// tslint:disable: jsdoc-format
// tslint:disable: no-namespace
export namespace analytics_v3 {
export interface Options extends GlobalOptions {
version: 'v3';
}
/**
* Google Analytics API
*
* Views and manages your Google Analytics data.
*
* @example
* const {google} = require('googleapis');
* const analytics = google.analytics('v3');
*
* @namespace analytics
* @type {Function}
* @version v3
* @variation v3
* @param {object=} options Options for Analytics
*/
export class Analytics {
_options: GlobalOptions;
google?: GoogleConfigurable;
root = this;
data: Resource$Data;
management: Resource$Management;
metadata: Resource$Metadata;
provisioning: Resource$Provisioning;
userDeletion: Resource$Userdeletion;
constructor(options: GlobalOptions, google?: GoogleConfigurable) {
this._options = options || {};
this.google = google;
this.getRoot.bind(this);
this.data = new Resource$Data(this);
this.management = new Resource$Management(this);
this.metadata = new Resource$Metadata(this);
this.provisioning = new Resource$Provisioning(this);
this.userDeletion = new Resource$Userdeletion(this);
}
getRoot() {
return this.root;
}
}
/**
* JSON template for Analytics account entry.
*/
export interface Schema$Account {
/**
* Child link for an account entry. Points to the list of web properties for
* this account.
*/
childLink?: any;
/**
* Time the account was created.
*/
created?: string;
/**
* Account ID.
*/
id?: string;
/**
* Resource type for Analytics account.
*/
kind?: string;
/**
* Account name.
*/
name?: string;
/**
* Permissions the user has for this account.
*/
permissions?: any;
/**
* Link for this account.
*/
selfLink?: string;
/**
* Indicates whether this account is starred or not.
*/
starred?: boolean;
/**
* Time the account was last modified.
*/
updated?: string;
}
/**
* JSON template for a linked account.
*/
export interface Schema$AccountRef {
/**
* Link for this account.
*/
href?: string;
/**
* Account ID.
*/
id?: string;
/**
* Analytics account reference.
*/
kind?: string;
/**
* Account name.
*/
name?: string;
}
/**
* An account collection provides a list of Analytics accounts to which a user
* has access. The account collection is the entry point to all management
* information. Each resource in the collection corresponds to a single
* Analytics account.
*/
export interface Schema$Accounts {
/**
* A list of accounts.
*/
items?: Schema$Account[];
/**
* The maximum number of entries the response can contain, regardless of the
* actual number of entries returned. Its value ranges from 1 to 1000 with a
* value of 1000 by default, or otherwise specified by the max-results query
* parameter.
*/
itemsPerPage?: number;
/**
* Collection type.
*/
kind?: string;
/**
* Next link for this account collection.
*/
nextLink?: string;
/**
* Previous link for this account collection.
*/
previousLink?: string;
/**
* The starting index of the entries, which is 1 by default or otherwise
* specified by the start-index query parameter.
*/
startIndex?: number;
/**
* The total number of results for the query, regardless of the number of
* results in the response.
*/
totalResults?: number;
/**
* Email ID of the authenticated user
*/
username?: string;
}
/**
* An AccountSummary collection lists a summary of accounts, properties and
* views (profiles) to which the user has access. Each resource in the
* collection corresponds to a single AccountSummary.
*/
export interface Schema$AccountSummaries {
/**
* A list of AccountSummaries.
*/
items?: Schema$AccountSummary[];
/**
* The maximum number of resources the response can contain, regardless of
* the actual number of resources returned. Its value ranges from 1 to 1000
* with a value of 1000 by default, or otherwise specified by the
* max-results query parameter.
*/
itemsPerPage?: number;
/**
* Collection type.
*/
kind?: string;
/**
* Link to next page for this AccountSummary collection.
*/
nextLink?: string;
/**
* Link to previous page for this AccountSummary collection.
*/
previousLink?: string;
/**
* The starting index of the resources, which is 1 by default or otherwise
* specified by the start-index query parameter.
*/
startIndex?: number;
/**
* The total number of results for the query, regardless of the number of
* results in the response.
*/
totalResults?: number;
/**
* Email ID of the authenticated user
*/
username?: string;
}
/**
* JSON template for an Analytics AccountSummary. An AccountSummary is a
* lightweight tree comprised of properties/profiles.
*/
export interface Schema$AccountSummary {
/**
* Account ID.
*/
id?: string;
/**
* Resource type for Analytics AccountSummary.
*/
kind?: string;
/**
* Account name.
*/
name?: string;
/**
* Indicates whether this account is starred or not.
*/
starred?: boolean;
/**
* List of web properties under this account.
*/
webProperties?: Schema$WebPropertySummary[];
}
/**
* JSON template for an Analytics account ticket. The account ticket consists
* of the ticket ID and the basic information for the account, property and
* profile.
*/
export interface Schema$AccountTicket {
/**
* Account for this ticket.
*/
account?: Schema$Account;
/**
* Account ticket ID used to access the account ticket.
*/
id?: string;
/**
* Resource type for account ticket.
*/
kind?: string;
/**
* View (Profile) for the account.
*/
profile?: Schema$Profile;
/**
* Redirect URI where the user will be sent after accepting Terms of
* Service. Must be configured in APIs console as a callback URL.
*/
redirectUri?: string;
/**
* Web property for the account.
*/
webproperty?: Schema$Webproperty;
}
/**
* JSON template for an Analytics account tree requests. The account tree
* request is used in the provisioning api to create an account, property, and
* view (profile). It contains the basic information required to make these
* fields.
*/
export interface Schema$AccountTreeRequest {
accountName?: string;
accountSettings?: any;
/**
* Resource type for account ticket.
*/
kind?: string;
profileName?: string;
timezone?: string;
webpropertyName?: string;
websiteUrl?: string;
}
/**
* JSON template for an Analytics account tree response. The account tree
* response is used in the provisioning api to return the result of creating
* an account, property, and view (profile).
*/
export interface Schema$AccountTreeResponse {
/**
* The account created.
*/
account?: Schema$Account;
accountSettings?: any;
/**
* Resource type for account ticket.
*/
kind?: string;
/**
* View (Profile) for the account.
*/
profile?: Schema$Profile;
/**
* Web property for the account.
*/
webproperty?: Schema$Webproperty;
}
/**
* JSON template for an AdWords account.
*/
export interface Schema$AdWordsAccount {
/**
* True if auto-tagging is enabled on the AdWords account. Read-only after
* the insert operation.
*/
autoTaggingEnabled?: boolean;
/**
* Customer ID. This field is required when creating an AdWords link.
*/
customerId?: string;
/**
* Resource type for AdWords account.
*/
kind?: string;
}
/**
* Request template for the delete upload data request.
*/
export interface Schema$AnalyticsDataimportDeleteUploadDataRequest {
/**
* A list of upload UIDs.
*/
customDataImportUids?: string[];
}
/**
* JSON template for a metadata column.
*/
export interface Schema$Column {
/**
* Map of attribute name and value for this column.
*/
attributes?: any;
/**
* Column id.
*/
id?: string;
/**
* Resource type for Analytics column.
*/
kind?: string;
}
/**
* Lists columns (dimensions and metrics) for a particular report type.
*/
export interface Schema$Columns {
/**
* List of attributes names returned by columns.
*/
attributeNames?: string[];
/**
* Etag of collection. This etag can be compared with the last response etag
* to check if response has changed.
*/
etag?: string;
/**
* List of columns for a report type.
*/
items?: Schema$Column[];
/**
* Collection type.
*/
kind?: string;
/**
* Total number of columns returned in the response.
*/
totalResults?: number;
}
/**
* JSON template for an Analytics custom data source.
*/
export interface Schema$CustomDataSource {
/**
* Account ID to which this custom data source belongs.
*/
accountId?: string;
childLink?: any;
/**
* Time this custom data source was created.
*/
created?: string;
/**
* Description of custom data source.
*/
description?: string;
/**
* Custom data source ID.
*/
id?: string;
importBehavior?: string;
/**
* Resource type for Analytics custom data source.
*/
kind?: string;
/**
* Name of this custom data source.
*/
name?: string;
/**
* Parent link for this custom data source. Points to the web property to
* which this custom data source belongs.
*/
parentLink?: any;
/**
* IDs of views (profiles) linked to the custom data source.
*/
profilesLinked?: string[];
/**
* Collection of schema headers of the custom data source.
*/
schema?: string[];
/**
* Link for this Analytics custom data source.
*/
selfLink?: string;
/**
* Type of the custom data source.
*/
type?: string;
/**
* Time this custom data source was last modified.
*/
updated?: string;
/**
* Upload type of the custom data source.
*/
uploadType?: string;
/**
* Web property ID of the form UA-XXXXX-YY to which this custom data source
* belongs.
*/
webPropertyId?: string;
}
/**
* Lists Analytics custom data sources to which the user has access. Each
* resource in the collection corresponds to a single Analytics custom data
* source.
*/
export interface Schema$CustomDataSources {
/**
* Collection of custom data sources.
*/
items?: Schema$CustomDataSource[];
/**
* The maximum number of resources the response can contain, regardless of
* the actual number of resources returned. Its value ranges from 1 to 1000
* with a value of 1000 by default, or otherwise specified by the
* max-results query parameter.
*/
itemsPerPage?: number;
/**
* Collection type.
*/
kind?: string;
/**
* Link to next page for this custom data source collection.
*/
nextLink?: string;
/**
* Link to previous page for this custom data source collection.
*/
previousLink?: string;
/**
* The starting index of the resources, which is 1 by default or otherwise
* specified by the start-index query parameter.
*/
startIndex?: number;
/**
* The total number of results for the query, regardless of the number of
* results in the response.
*/
totalResults?: number;
/**
* Email ID of the authenticated user
*/
username?: string;
}
/**
* JSON template for Analytics Custom Dimension.
*/
export interface Schema$CustomDimension {
/**
* Account ID.
*/
accountId?: string;
/**
* Boolean indicating whether the custom dimension is active.
*/
active?: boolean;
/**
* Time the custom dimension was created.
*/
created?: string;
/**
* Custom dimension ID.
*/
id?: string;
/**
* Index of the custom dimension.
*/
index?: number;
/**
* Kind value for a custom dimension. Set to
* "analytics#customDimension". It is a read-only field.
*/
kind?: string;
/**
* Name of the custom dimension.
*/
name?: string;
/**
* Parent link for the custom dimension. Points to the property to which the
* custom dimension belongs.
*/
parentLink?: any;
/**
* Scope of the custom dimension: HIT, SESSION, USER or PRODUCT.
*/
scope?: string;
/**
* Link for the custom dimension
*/
selfLink?: string;
/**
* Time the custom dimension was last modified.
*/
updated?: string;
/**
* Property ID.
*/
webPropertyId?: string;
}
/**
* A custom dimension collection lists Analytics custom dimensions to which
* the user has access. Each resource in the collection corresponds to a
* single Analytics custom dimension.
*/
export interface Schema$CustomDimensions {
/**
* Collection of custom dimensions.
*/
items?: Schema$CustomDimension[];
/**
* The maximum number of resources the response can contain, regardless of
* the actual number of resources returned. Its value ranges from 1 to 1000
* with a value of 1000 by default, or otherwise specified by the
* max-results query parameter.
*/
itemsPerPage?: number;
/**
* Collection type.
*/
kind?: string;
/**
* Link to next page for this custom dimension collection.
*/
nextLink?: string;
/**
* Link to previous page for this custom dimension collection.
*/
previousLink?: string;
/**
* The starting index of the resources, which is 1 by default or otherwise
* specified by the start-index query parameter.
*/
startIndex?: number;
/**
* The total number of results for the query, regardless of the number of
* results in the response.
*/
totalResults?: number;
/**
* Email ID of the authenticated user
*/
username?: string;
}
/**
* JSON template for Analytics Custom Metric.
*/
export interface Schema$CustomMetric {
/**
* Account ID.
*/
accountId?: string;
/**
* Boolean indicating whether the custom metric is active.
*/
active?: boolean;
/**
* Time the custom metric was created.
*/
created?: string;
/**
* Custom metric ID.
*/
id?: string;
/**
* Index of the custom metric.
*/
index?: number;
/**
* Kind value for a custom metric. Set to
* "analytics#customMetric". It is a read-only field.
*/
kind?: string;
/**
* Max value of custom metric.
*/
max_value?: string;
/**
* Min value of custom metric.
*/
min_value?: string;
/**
* Name of the custom metric.
*/
name?: string;
/**
* Parent link for the custom metric. Points to the property to which the
* custom metric belongs.
*/
parentLink?: any;
/**
* Scope of the custom metric: HIT or PRODUCT.
*/
scope?: string;
/**
* Link for the custom metric
*/
selfLink?: string;
/**
* Data type of custom metric.
*/
type?: string;
/**
* Time the custom metric was last modified.
*/
updated?: string;
/**
* Property ID.
*/
webPropertyId?: string;
}
/**
* A custom metric collection lists Analytics custom metrics to which the user
* has access. Each resource in the collection corresponds to a single
* Analytics custom metric.
*/
export interface Schema$CustomMetrics {
/**
* Collection of custom metrics.
*/
items?: Schema$CustomMetric[];
/**
* The maximum number of resources the response can contain, regardless of
* the actual number of resources returned. Its value ranges from 1 to 1000
* with a value of 1000 by default, or otherwise specified by the
* max-results query parameter.
*/
itemsPerPage?: number;
/**
* Collection type.
*/
kind?: string;
/**
* Link to next page for this custom metric collection.
*/
nextLink?: string;
/**
* Link to previous page for this custom metric collection.
*/
previousLink?: string;
/**
* The starting index of the resources, which is 1 by default or otherwise
* specified by the start-index query parameter.
*/
startIndex?: number;
/**
* The total number of results for the query, regardless of the number of
* results in the response.
*/
totalResults?: number;
/**
* Email ID of the authenticated user
*/
username?: string;
}
/**
* JSON template for Analytics Entity AdWords Link.
*/
export interface Schema$EntityAdWordsLink {
/**
* A list of AdWords client accounts. These cannot be MCC accounts. This
* field is required when creating an AdWords link. It cannot be empty.
*/
adWordsAccounts?: Schema$AdWordsAccount[];
/**
* Web property being linked.
*/
entity?: any;
/**
* Entity AdWords link ID
*/
id?: string;
/**
* Resource type for entity AdWords link.
*/
kind?: string;
/**
* Name of the link. This field is required when creating an AdWords link.
*/
name?: string;
/**
* IDs of linked Views (Profiles) represented as strings.
*/
profileIds?: string[];
/**
* URL link for this Google Analytics - Google AdWords link.
*/
selfLink?: string;
}
/**
* An entity AdWords link collection provides a list of GA-AdWords links Each
* resource in this collection corresponds to a single link.
*/
export interface Schema$EntityAdWordsLinks {
/**
* A list of entity AdWords links.
*/
items?: Schema$EntityAdWordsLink[];
/**
* The maximum number of entries the response can contain, regardless of the
* actual number of entries returned. Its value ranges from 1 to 1000 with a
* value of 1000 by default, or otherwise specified by the max-results query
* parameter.
*/
itemsPerPage?: number;
/**
* Collection type.
*/
kind?: string;
/**
* Next link for this AdWords link collection.
*/
nextLink?: string;
/**
* Previous link for this AdWords link collection.
*/
previousLink?: string;
/**
* The starting index of the entries, which is 1 by default or otherwise
* specified by the start-index query parameter.
*/
startIndex?: number;
/**
* The total number of results for the query, regardless of the number of
* results in the response.
*/
totalResults?: number;
}
/**
* JSON template for an Analytics Entity-User Link. Returns permissions that a
* user has for an entity.
*/
export interface Schema$EntityUserLink {
/**
* Entity for this link. It can be an account, a web property, or a view
* (profile).
*/
entity?: any;
/**
* Entity user link ID
*/
id?: string;
/**
* Resource type for entity user link.
*/
kind?: string;
/**
* Permissions the user has for this entity.
*/
permissions?: any;
/**
* Self link for this resource.
*/
selfLink?: string;
/**
* User reference.
*/
userRef?: Schema$UserRef;
}
/**
* An entity user link collection provides a list of Analytics ACL links Each
* resource in this collection corresponds to a single link.
*/
export interface Schema$EntityUserLinks {
/**
* A list of entity user links.
*/
items?: Schema$EntityUserLink[];
/**
* The maximum number of entries the response can contain, regardless of the
* actual number of entries returned. Its value ranges from 1 to 1000 with a
* value of 1000 by default, or otherwise specified by the max-results query
* parameter.
*/
itemsPerPage?: number;
/**
* Collection type.
*/
kind?: string;
/**
* Next link for this account collection.
*/
nextLink?: string;
/**
* Previous link for this account collection.
*/
previousLink?: string;
/**
* The starting index of the entries, which is 1 by default or otherwise
* specified by the start-index query parameter.
*/
startIndex?: number;
/**
* The total number of results for the query, regardless of the number of
* results in the response.
*/
totalResults?: number;
}
/**
* JSON template for Analytics experiment resource.
*/
export interface Schema$Experiment {
/**
* Account ID to which this experiment belongs. This field is read-only.
*/
accountId?: string;
/**
* Time the experiment was created. This field is read-only.
*/
created?: string;
/**
* Notes about this experiment.
*/
description?: string;
/**
* If true, the end user will be able to edit the experiment via the Google
* Analytics user interface.
*/
editableInGaUi?: boolean;
/**
* The ending time of the experiment (the time the status changed from
* RUNNING to ENDED). This field is present only if the experiment has
* ended. This field is read-only.
*/
endTime?: string;
/**
* Boolean specifying whether to distribute traffic evenly across all
* variations. If the value is False, content experiments follows the
* default behavior of adjusting traffic dynamically based on variation
* performance. Optional -- defaults to False. This field may not be changed
* for an experiment whose status is ENDED.
*/
equalWeighting?: boolean;
/**
* Experiment ID. Required for patch and update. Disallowed for create.
*/
id?: string;
/**
* Internal ID for the web property to which this experiment belongs. This
* field is read-only.
*/
internalWebPropertyId?: string;
/**
* Resource type for an Analytics experiment. This field is read-only.
*/
kind?: string;
/**
* An integer number in [3, 90]. Specifies the minimum length of the
* experiment. Can be changed for a running experiment. This field may not
* be changed for an experiments whose status is ENDED.
*/
minimumExperimentLengthInDays?: number;
/**
* Experiment name. This field may not be changed for an experiment whose
* status is ENDED. This field is required when creating an experiment.
*/
name?: string;
/**
* The metric that the experiment is optimizing. Valid values:
* "ga:goal(n)Completions", "ga:adsenseAdsClicks",
* "ga:adsenseAdsViewed", "ga:adsenseRevenue",
* "ga:bounces", "ga:pageviews",
* "ga:sessionDuration", "ga:transactions",
* "ga:transactionRevenue". This field is required if status is
* "RUNNING" and servingFramework is one of "REDIRECT"
* or "API".
*/
objectiveMetric?: string;
/**
* Whether the objectiveMetric should be minimized or maximized. Possible
* values: "MAXIMUM", "MINIMUM". Optional--defaults to
* "MAXIMUM". Cannot be specified without objectiveMetric. Cannot
* be modified when status is "RUNNING" or "ENDED".
*/
optimizationType?: string;
/**
* Parent link for an experiment. Points to the view (profile) to which this
* experiment belongs.
*/
parentLink?: any;
/**
* View (Profile) ID to which this experiment belongs. This field is
* read-only.
*/
profileId?: string;
/**
* Why the experiment ended. Possible values: "STOPPED_BY_USER",
* "WINNER_FOUND", "EXPERIMENT_EXPIRED",
* "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED".
* "ENDED_WITH_NO_WINNER" means that the experiment didn't
* expire but no winner was projected to be found. If the experiment status
* is changed via the API to ENDED this field is set to STOPPED_BY_USER.
* This field is read-only.
*/
reasonExperimentEnded?: string;
/**
* Boolean specifying whether variations URLS are rewritten to match those
* of the original. This field may not be changed for an experiments whose
* status is ENDED.
*/
rewriteVariationUrlsAsOriginal?: boolean;
/**
* Link for this experiment. This field is read-only.
*/
selfLink?: string;
/**
* The framework used to serve the experiment variations and evaluate the
* results. One of: - REDIRECT: Google Analytics redirects traffic to
* different variation pages, reports the chosen variation and evaluates the
* results. - API: Google Analytics chooses and reports the variation to
* serve and evaluates the results; the caller is responsible for serving
* the selected variation. - EXTERNAL: The variations will be served
* externally and the chosen variation reported to Google Analytics. The
* caller is responsible for serving the selected variation and evaluating
* the results.
*/
servingFramework?: string;
/**
* The snippet of code to include on the control page(s). This field is
* read-only.
*/
snippet?: string;
/**
* The starting time of the experiment (the time the status changed from
* READY_TO_RUN to RUNNING). This field is present only if the experiment
* has started. This field is read-only.
*/
startTime?: string;
/**
* Experiment status. Possible values: "DRAFT",
* "READY_TO_RUN", "RUNNING", "ENDED".
* Experiments can be created in the "DRAFT",
* "READY_TO_RUN" or "RUNNING" state. This field is
* required when creating an experiment.
*/
status?: string;
/**
* A floating-point number in (0, 1]. Specifies the fraction of the traffic
* that participates in the experiment. Can be changed for a running