-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
analyticsdata-gen.go
5043 lines (4496 loc) · 220 KB
/
analyticsdata-gen.go
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 2024 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package analyticsdata provides access to the Google Analytics Data API.
//
// For product documentation, see: https://developers.google.com/analytics/devguides/reporting/data/v1/
//
// # Library status
//
// These client libraries are officially supported by Google. However, this
// library is considered complete and is in maintenance mode. This means
// that we will address critical bugs and security issues but will not add
// any new features.
//
// When possible, we recommend using our newer
// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
// that are still actively being worked and iterated on.
//
// # Creating a client
//
// Usage example:
//
// import "google.golang.org/api/analyticsdata/v1beta"
// ...
// ctx := context.Background()
// analyticsdataService, err := analyticsdata.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for
// authentication. For information on how to create and obtain Application
// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// # Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate.
// To restrict scopes, use [google.golang.org/api/option.WithScopes]:
//
// analyticsdataService, err := analyticsdata.NewService(ctx, option.WithScopes(analyticsdata.AnalyticsReadonlyScope))
//
// To use an API key for authentication (note: some APIs do not support API
// keys), use [google.golang.org/api/option.WithAPIKey]:
//
// analyticsdataService, err := analyticsdata.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
// flow, use [google.golang.org/api/option.WithTokenSource]:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// analyticsdataService, err := analyticsdata.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See [google.golang.org/api/option.ClientOption] for details on options.
package analyticsdata // import "google.golang.org/api/analyticsdata/v1beta"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
internal "google.golang.org/api/internal"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
var _ = internal.Version
const apiId = "analyticsdata:v1beta"
const apiName = "analyticsdata"
const apiVersion = "v1beta"
const basePath = "https://analyticsdata.googleapis.com/"
const basePathTemplate = "https://analyticsdata.UNIVERSE_DOMAIN/"
const mtlsBasePath = "https://analyticsdata.mtls.googleapis.com/"
const defaultUniverseDomain = "googleapis.com"
// OAuth2 scopes used by this API.
const (
// View and manage your Google Analytics data
AnalyticsScope = "https://www.googleapis.com/auth/analytics"
// See and download your Google Analytics data
AnalyticsReadonlyScope = "https://www.googleapis.com/auth/analytics.readonly"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := internaloption.WithDefaultScopes(
"https://www.googleapis.com/auth/analytics",
"https://www.googleapis.com/auth/analytics.readonly",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
opts = append(opts, internaloption.WithDefaultUniverseDomain(defaultUniverseDomain))
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Properties = NewPropertiesService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Properties *PropertiesService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewPropertiesService(s *Service) *PropertiesService {
rs := &PropertiesService{s: s}
rs.AudienceExports = NewPropertiesAudienceExportsService(s)
return rs
}
type PropertiesService struct {
s *Service
AudienceExports *PropertiesAudienceExportsService
}
func NewPropertiesAudienceExportsService(s *Service) *PropertiesAudienceExportsService {
rs := &PropertiesAudienceExportsService{s: s}
return rs
}
type PropertiesAudienceExportsService struct {
s *Service
}
// ActiveMetricRestriction: A metric actively restricted in creating the
// report.
type ActiveMetricRestriction struct {
// MetricName: The name of the restricted metric.
MetricName string `json:"metricName,omitempty"`
// RestrictedMetricTypes: The reason for this metric's restriction.
//
// Possible values:
// "RESTRICTED_METRIC_TYPE_UNSPECIFIED" - Unspecified type.
// "COST_DATA" - Cost metrics such as `adCost`.
// "REVENUE_DATA" - Revenue metrics such as `purchaseRevenue`.
RestrictedMetricTypes []string `json:"restrictedMetricTypes,omitempty"`
// ForceSendFields is a list of field names (e.g. "MetricName") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "MetricName") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ActiveMetricRestriction) MarshalJSON() ([]byte, error) {
type NoMethod ActiveMetricRestriction
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AudienceExport: An audience export is a list of users in an audience
// at the time of the list's creation. One audience may have multiple
// audience exports created for different days.
type AudienceExport struct {
// Audience: Required. The audience resource name. This resource name
// identifies the audience being listed and is shared between the
// Analytics Data & Admin APIs. Format:
// `properties/{property}/audiences/{audience}`
Audience string `json:"audience,omitempty"`
// AudienceDisplayName: Output only. The descriptive display name for
// this audience. For example, "Purchasers".
AudienceDisplayName string `json:"audienceDisplayName,omitempty"`
// BeginCreatingTime: Output only. The time when CreateAudienceExport
// was called and the AudienceExport began the `CREATING` state.
BeginCreatingTime string `json:"beginCreatingTime,omitempty"`
// CreationQuotaTokensCharged: Output only. The total quota tokens
// charged during creation of the AudienceExport. Because this token
// count is based on activity from the `CREATING` state, this tokens
// charged will be fixed once an AudienceExport enters the `ACTIVE` or
// `FAILED` states.
CreationQuotaTokensCharged int64 `json:"creationQuotaTokensCharged,omitempty"`
// Dimensions: Required. The dimensions requested and displayed in the
// query response.
Dimensions []*V1betaAudienceDimension `json:"dimensions,omitempty"`
// ErrorMessage: Output only. Error message is populated when an
// audience export fails during creation. A common reason for such a
// failure is quota exhaustion.
ErrorMessage string `json:"errorMessage,omitempty"`
// Name: Output only. Identifier. The audience export resource name
// assigned during creation. This resource name identifies this
// `AudienceExport`. Format:
// `properties/{property}/audienceExports/{audience_export}`
Name string `json:"name,omitempty"`
// PercentageCompleted: Output only. The percentage completed for this
// audience export ranging between 0 to 100.
PercentageCompleted float64 `json:"percentageCompleted,omitempty"`
// RowCount: Output only. The total number of rows in the AudienceExport
// result.
RowCount int64 `json:"rowCount,omitempty"`
// State: Output only. The current state for this AudienceExport.
//
// Possible values:
// "STATE_UNSPECIFIED" - Unspecified state will never be used.
// "CREATING" - The AudienceExport is currently creating and will be
// available in the future. Creating occurs immediately after the
// CreateAudienceExport call.
// "ACTIVE" - The AudienceExport is fully created and ready for
// querying. An AudienceExport is updated to active asynchronously from
// a request; this occurs some time (for example 15 minutes) after the
// initial create call.
// "FAILED" - The AudienceExport failed to be created. It is possible
// that re-requesting this audience export will succeed.
State string `json:"state,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Audience") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Audience") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AudienceExport) MarshalJSON() ([]byte, error) {
type NoMethod AudienceExport
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *AudienceExport) UnmarshalJSON(data []byte) error {
type NoMethod AudienceExport
var s1 struct {
PercentageCompleted gensupport.JSONFloat64 `json:"percentageCompleted"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.PercentageCompleted = float64(s1.PercentageCompleted)
return nil
}
// AudienceListMetadata: This metadata is currently blank.
type AudienceListMetadata struct {
}
// BatchRunPivotReportsRequest: The batch request containing multiple
// pivot report requests.
type BatchRunPivotReportsRequest struct {
// Requests: Individual requests. Each request has a separate pivot
// report response. Each batch request is allowed up to 5 requests.
Requests []*RunPivotReportRequest `json:"requests,omitempty"`
// ForceSendFields is a list of field names (e.g. "Requests") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Requests") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BatchRunPivotReportsRequest) MarshalJSON() ([]byte, error) {
type NoMethod BatchRunPivotReportsRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BatchRunPivotReportsResponse: The batch response containing multiple
// pivot reports.
type BatchRunPivotReportsResponse struct {
// Kind: Identifies what kind of resource this message is. This `kind`
// is always the fixed string "analyticsData#batchRunPivotReports".
// Useful to distinguish between response types in JSON.
Kind string `json:"kind,omitempty"`
// PivotReports: Individual responses. Each response has a separate
// pivot report request.
PivotReports []*RunPivotReportResponse `json:"pivotReports,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BatchRunPivotReportsResponse) MarshalJSON() ([]byte, error) {
type NoMethod BatchRunPivotReportsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BatchRunReportsRequest: The batch request containing multiple report
// requests.
type BatchRunReportsRequest struct {
// Requests: Individual requests. Each request has a separate report
// response. Each batch request is allowed up to 5 requests.
Requests []*RunReportRequest `json:"requests,omitempty"`
// ForceSendFields is a list of field names (e.g. "Requests") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Requests") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BatchRunReportsRequest) MarshalJSON() ([]byte, error) {
type NoMethod BatchRunReportsRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BatchRunReportsResponse: The batch response containing multiple
// reports.
type BatchRunReportsResponse struct {
// Kind: Identifies what kind of resource this message is. This `kind`
// is always the fixed string "analyticsData#batchRunReports". Useful to
// distinguish between response types in JSON.
Kind string `json:"kind,omitempty"`
// Reports: Individual responses. Each response has a separate report
// request.
Reports []*RunReportResponse `json:"reports,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BatchRunReportsResponse) MarshalJSON() ([]byte, error) {
type NoMethod BatchRunReportsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BetweenFilter: To express that the result needs to be between two
// numbers (inclusive).
type BetweenFilter struct {
// FromValue: Begins with this number.
FromValue *NumericValue `json:"fromValue,omitempty"`
// ToValue: Ends with this number.
ToValue *NumericValue `json:"toValue,omitempty"`
// ForceSendFields is a list of field names (e.g. "FromValue") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "FromValue") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BetweenFilter) MarshalJSON() ([]byte, error) {
type NoMethod BetweenFilter
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CaseExpression: Used to convert a dimension value to a single case.
type CaseExpression struct {
// DimensionName: Name of a dimension. The name must refer back to a
// name in dimensions field of the request.
DimensionName string `json:"dimensionName,omitempty"`
// ForceSendFields is a list of field names (e.g. "DimensionName") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DimensionName") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CaseExpression) MarshalJSON() ([]byte, error) {
type NoMethod CaseExpression
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CheckCompatibilityRequest: The request for compatibility information
// for a report's dimensions and metrics. Check compatibility provides a
// preview of the compatibility of a report; fields shared with the
// `runReport` request should be the same values as in your `runReport`
// request.
type CheckCompatibilityRequest struct {
// CompatibilityFilter: Filters the dimensions and metrics in the
// response to just this compatibility. Commonly used as
// `”compatibilityFilter”: “COMPATIBLE”` to only return
// compatible dimensions & metrics.
//
// Possible values:
// "COMPATIBILITY_UNSPECIFIED" - Unspecified compatibility.
// "COMPATIBLE" - The dimension or metric is compatible. This
// dimension or metric can be successfully added to a report.
// "INCOMPATIBLE" - The dimension or metric is incompatible. This
// dimension or metric cannot be successfully added to a report.
CompatibilityFilter string `json:"compatibilityFilter,omitempty"`
// DimensionFilter: The filter clause of dimensions. `dimensionFilter`
// should be the same value as in your `runReport` request.
DimensionFilter *FilterExpression `json:"dimensionFilter,omitempty"`
// Dimensions: The dimensions in this report. `dimensions` should be the
// same value as in your `runReport` request.
Dimensions []*Dimension `json:"dimensions,omitempty"`
// MetricFilter: The filter clause of metrics. `metricFilter` should be
// the same value as in your `runReport` request
MetricFilter *FilterExpression `json:"metricFilter,omitempty"`
// Metrics: The metrics in this report. `metrics` should be the same
// value as in your `runReport` request.
Metrics []*Metric `json:"metrics,omitempty"`
// ForceSendFields is a list of field names (e.g. "CompatibilityFilter")
// to unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CompatibilityFilter") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *CheckCompatibilityRequest) MarshalJSON() ([]byte, error) {
type NoMethod CheckCompatibilityRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CheckCompatibilityResponse: The compatibility response with the
// compatibility of each dimension & metric.
type CheckCompatibilityResponse struct {
// DimensionCompatibilities: The compatibility of each dimension.
DimensionCompatibilities []*DimensionCompatibility `json:"dimensionCompatibilities,omitempty"`
// MetricCompatibilities: The compatibility of each metric.
MetricCompatibilities []*MetricCompatibility `json:"metricCompatibilities,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g.
// "DimensionCompatibilities") to unconditionally include in API
// requests. By default, fields with empty or default values are omitted
// from API requests. However, any non-pointer, non-interface field
// appearing in ForceSendFields will be sent to the server regardless of
// whether the field is empty or not. This may be used to include empty
// fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DimensionCompatibilities")
// to include in API requests with the JSON null value. By default,
// fields with empty values are omitted from API requests. However, any
// field with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *CheckCompatibilityResponse) MarshalJSON() ([]byte, error) {
type NoMethod CheckCompatibilityResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Cohort: Defines a cohort selection criteria. A cohort is a group of
// users who share a common characteristic. For example, users with the
// same `firstSessionDate` belong to the same cohort.
type Cohort struct {
// DateRange: The cohort selects users whose first touch date is between
// start date and end date defined in the `dateRange`. This `dateRange`
// does not specify the full date range of event data that is present in
// a cohort report. In a cohort report, this `dateRange` is extended by
// the granularity and offset present in the `cohortsRange`; event data
// for the extended reporting date range is present in a cohort report.
// In a cohort request, this `dateRange` is required and the
// `dateRanges` in the `RunReportRequest` or `RunPivotReportRequest`
// must be unspecified. This `dateRange` should generally be aligned
// with the cohort's granularity. If `CohortsRange` uses daily
// granularity, this `dateRange` can be a single day. If `CohortsRange`
// uses weekly granularity, this `dateRange` can be aligned to a week
// boundary, starting at Sunday and ending Saturday. If `CohortsRange`
// uses monthly granularity, this `dateRange` can be aligned to a month,
// starting at the first and ending on the last day of the month.
DateRange *DateRange `json:"dateRange,omitempty"`
// Dimension: Dimension used by the cohort. Required and only supports
// `firstSessionDate`.
Dimension string `json:"dimension,omitempty"`
// Name: Assigns a name to this cohort. The dimension `cohort` is valued
// to this name in a report response. If set, cannot begin with
// `cohort_` or `RESERVED_`. If not set, cohorts are named by their zero
// based index `cohort_0`, `cohort_1`, etc.
Name string `json:"name,omitempty"`
// ForceSendFields is a list of field names (e.g. "DateRange") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DateRange") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Cohort) MarshalJSON() ([]byte, error) {
type NoMethod Cohort
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CohortReportSettings: Optional settings of a cohort report.
type CohortReportSettings struct {
// Accumulate: If true, accumulates the result from first touch day to
// the end day. Not supported in `RunReportRequest`.
Accumulate bool `json:"accumulate,omitempty"`
// ForceSendFields is a list of field names (e.g. "Accumulate") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Accumulate") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CohortReportSettings) MarshalJSON() ([]byte, error) {
type NoMethod CohortReportSettings
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CohortSpec: The specification of cohorts for a cohort report. Cohort
// reports create a time series of user retention for the cohort. For
// example, you could select the cohort of users that were acquired in
// the first week of September and follow that cohort for the next six
// weeks. Selecting the users acquired in the first week of September
// cohort is specified in the `cohort` object. Following that cohort for
// the next six weeks is specified in the `cohortsRange` object. For
// examples, see Cohort Report Examples
// (https://developers.google.com/analytics/devguides/reporting/data/v1/advanced#cohort_report_examples).
// The report response could show a weekly time series where say your
// app has retained 60% of this cohort after three weeks and 25% of this
// cohort after six weeks. These two percentages can be calculated by
// the metric `cohortActiveUsers/cohortTotalUsers` and will be separate
// rows in the report.
type CohortSpec struct {
// CohortReportSettings: Optional settings for a cohort report.
CohortReportSettings *CohortReportSettings `json:"cohortReportSettings,omitempty"`
// Cohorts: Defines the selection criteria to group users into cohorts.
// Most cohort reports define only a single cohort. If multiple cohorts
// are specified, each cohort can be recognized in the report by their
// name.
Cohorts []*Cohort `json:"cohorts,omitempty"`
// CohortsRange: Cohort reports follow cohorts over an extended
// reporting date range. This range specifies an offset duration to
// follow the cohorts over.
CohortsRange *CohortsRange `json:"cohortsRange,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "CohortReportSettings") to unconditionally include in API requests.
// By default, fields with empty or default values are omitted from API
// requests. However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CohortReportSettings") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *CohortSpec) MarshalJSON() ([]byte, error) {
type NoMethod CohortSpec
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CohortsRange: Configures the extended reporting date range for a
// cohort report. Specifies an offset duration to follow the cohorts
// over.
type CohortsRange struct {
// EndOffset: Required. `endOffset` specifies the end date of the
// extended reporting date range for a cohort report. `endOffset` can be
// any positive integer but is commonly set to 5 to 10 so that reports
// contain data on the cohort for the next several granularity time
// periods. If `granularity` is `DAILY`, the `endDate` of the extended
// reporting date range is `endDate` of the cohort plus `endOffset`
// days. If `granularity` is `WEEKLY`, the `endDate` of the extended
// reporting date range is `endDate` of the cohort plus `endOffset * 7`
// days. If `granularity` is `MONTHLY`, the `endDate` of the extended
// reporting date range is `endDate` of the cohort plus `endOffset * 30`
// days.
EndOffset int64 `json:"endOffset,omitempty"`
// Granularity: Required. The granularity used to interpret the
// `startOffset` and `endOffset` for the extended reporting date range
// for a cohort report.
//
// Possible values:
// "GRANULARITY_UNSPECIFIED" - Should never be specified.
// "DAILY" - Daily granularity. Commonly used if the cohort's
// `dateRange` is a single day and the request contains `cohortNthDay`.
// "WEEKLY" - Weekly granularity. Commonly used if the cohort's
// `dateRange` is a week in duration (starting on Sunday and ending on
// Saturday) and the request contains `cohortNthWeek`.
// "MONTHLY" - Monthly granularity. Commonly used if the cohort's
// `dateRange` is a month in duration and the request contains
// `cohortNthMonth`.
Granularity string `json:"granularity,omitempty"`
// StartOffset: `startOffset` specifies the start date of the extended
// reporting date range for a cohort report. `startOffset` is commonly
// set to 0 so that reports contain data from the acquisition of the
// cohort forward. If `granularity` is `DAILY`, the `startDate` of the
// extended reporting date range is `startDate` of the cohort plus
// `startOffset` days. If `granularity` is `WEEKLY`, the `startDate` of
// the extended reporting date range is `startDate` of the cohort plus
// `startOffset * 7` days. If `granularity` is `MONTHLY`, the
// `startDate` of the extended reporting date range is `startDate` of
// the cohort plus `startOffset * 30` days.
StartOffset int64 `json:"startOffset,omitempty"`
// ForceSendFields is a list of field names (e.g. "EndOffset") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "EndOffset") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CohortsRange) MarshalJSON() ([]byte, error) {
type NoMethod CohortsRange
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ConcatenateExpression: Used to combine dimension values to a single
// dimension.
type ConcatenateExpression struct {
// Delimiter: The delimiter placed between dimension names. Delimiters
// are often single characters such as "|" or "," but can be longer
// strings. If a dimension value contains the delimiter, both will be
// present in response with no distinction. For example if dimension 1
// value = "US,FR", dimension 2 value = "JP", and delimiter = ",", then
// the response will contain "US,FR,JP".
Delimiter string `json:"delimiter,omitempty"`
// DimensionNames: Names of dimensions. The names must refer back to
// names in the dimensions field of the request.
DimensionNames []string `json:"dimensionNames,omitempty"`
// ForceSendFields is a list of field names (e.g. "Delimiter") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Delimiter") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ConcatenateExpression) MarshalJSON() ([]byte, error) {
type NoMethod ConcatenateExpression
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DateRange: A contiguous set of days: `startDate`, `startDate + 1`,
// ..., `endDate`. Requests are allowed up to 4 date ranges.
type DateRange struct {
// EndDate: The inclusive end date for the query in the format
// `YYYY-MM-DD`. Cannot be before `start_date`. The format `NdaysAgo`,
// `yesterday`, or `today` is also accepted, and in that case, the date
// is inferred based on the property's reporting time zone.
EndDate string `json:"endDate,omitempty"`
// Name: Assigns a name to this date range. The dimension `dateRange` is
// valued to this name in a report response. If set, cannot begin with
// `date_range_` or `RESERVED_`. If not set, date ranges are named by
// their zero based index in the request: `date_range_0`,
// `date_range_1`, etc.
Name string `json:"name,omitempty"`
// StartDate: The inclusive start date for the query in the format
// `YYYY-MM-DD`. Cannot be after `end_date`. The format `NdaysAgo`,
// `yesterday`, or `today` is also accepted, and in that case, the date
// is inferred based on the property's reporting time zone.
StartDate string `json:"startDate,omitempty"`
// ForceSendFields is a list of field names (e.g. "EndDate") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "EndDate") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *DateRange) MarshalJSON() ([]byte, error) {
type NoMethod DateRange
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Dimension: Dimensions are attributes of your data. For example, the
// dimension city indicates the city from which an event originates.
// Dimension values in report responses are strings; for example, the
// city could be "Paris" or "New York". Requests are allowed up to 9
// dimensions.
type Dimension struct {
// DimensionExpression: One dimension can be the result of an expression
// of multiple dimensions. For example, dimension "country, city":
// concatenate(country, ", ", city).
DimensionExpression *DimensionExpression `json:"dimensionExpression,omitempty"`
// Name: The name of the dimension. See the API Dimensions
// (https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions)
// for the list of dimension names supported by core reporting methods
// such as `runReport` and `batchRunReports`. See Realtime Dimensions
// (https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-api-schema#dimensions)
// for the list of dimension names supported by the `runRealtimeReport`
// method. See Funnel Dimensions
// (https://developers.google.com/analytics/devguides/reporting/data/v1/exploration-api-schema#dimensions)
// for the list of dimension names supported by the `runFunnelReport`
// method. If `dimensionExpression` is specified, `name` can be any
// string that you would like within the allowed character set. For
// example if a `dimensionExpression` concatenates `country` and `city`,
// you could call that dimension `countryAndCity`. Dimension names that
// you choose must match the regular expression `^[a-zA-Z0-9_]$`.
// Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`,
// `dimensionExpression`, and `pivots`.
Name string `json:"name,omitempty"`
// ForceSendFields is a list of field names (e.g. "DimensionExpression")
// to unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DimensionExpression") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *Dimension) MarshalJSON() ([]byte, error) {
type NoMethod Dimension
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DimensionCompatibility: The compatibility for a single dimension.
type DimensionCompatibility struct {
// Compatibility: The compatibility of this dimension. If the
// compatibility is COMPATIBLE, this dimension can be successfully added
// to the report.
//
// Possible values:
// "COMPATIBILITY_UNSPECIFIED" - Unspecified compatibility.
// "COMPATIBLE" - The dimension or metric is compatible. This
// dimension or metric can be successfully added to a report.
// "INCOMPATIBLE" - The dimension or metric is incompatible. This
// dimension or metric cannot be successfully added to a report.
Compatibility string `json:"compatibility,omitempty"`
// DimensionMetadata: The dimension metadata contains the API name for
// this compatibility information. The dimension metadata also contains
// other helpful information like the UI name and description.
DimensionMetadata *DimensionMetadata `json:"dimensionMetadata,omitempty"`
// ForceSendFields is a list of field names (e.g. "Compatibility") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Compatibility") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.