/
classes.rb
1787 lines (1483 loc) · 72.4 KB
/
classes.rb
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.
#
# 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.
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module AnalyticsdataV1alpha
# The batch request containing multiple pivot report requests.
class BatchRunPivotReportsRequest
include Google::Apis::Core::Hashable
# The unique identifier of the property whose events are tracked.
# Corresponds to the JSON property `entity`
# @return [Google::Apis::AnalyticsdataV1alpha::Entity]
attr_accessor :entity
# Individual requests. Each request has a separate pivot report response. Each
# batch request is allowed up to 5 requests.
# Corresponds to the JSON property `requests`
# @return [Array<Google::Apis::AnalyticsdataV1alpha::RunPivotReportRequest>]
attr_accessor :requests
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@entity = args[:entity] if args.key?(:entity)
@requests = args[:requests] if args.key?(:requests)
end
end
# The batch response containing multiple pivot reports.
class BatchRunPivotReportsResponse
include Google::Apis::Core::Hashable
# Individual responses. Each response has a separate pivot report request.
# Corresponds to the JSON property `pivotReports`
# @return [Array<Google::Apis::AnalyticsdataV1alpha::RunPivotReportResponse>]
attr_accessor :pivot_reports
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@pivot_reports = args[:pivot_reports] if args.key?(:pivot_reports)
end
end
# The batch request containing multiple report requests.
class BatchRunReportsRequest
include Google::Apis::Core::Hashable
# The unique identifier of the property whose events are tracked.
# Corresponds to the JSON property `entity`
# @return [Google::Apis::AnalyticsdataV1alpha::Entity]
attr_accessor :entity
# Individual requests. Each request has a separate report response. Each batch
# request is allowed up to 5 requests.
# Corresponds to the JSON property `requests`
# @return [Array<Google::Apis::AnalyticsdataV1alpha::RunReportRequest>]
attr_accessor :requests
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@entity = args[:entity] if args.key?(:entity)
@requests = args[:requests] if args.key?(:requests)
end
end
# The batch response containing multiple reports.
class BatchRunReportsResponse
include Google::Apis::Core::Hashable
# Individual responses. Each response has a separate report request.
# Corresponds to the JSON property `reports`
# @return [Array<Google::Apis::AnalyticsdataV1alpha::RunReportResponse>]
attr_accessor :reports
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@reports = args[:reports] if args.key?(:reports)
end
end
# To express that the result needs to be between two numbers (inclusive).
class BetweenFilter
include Google::Apis::Core::Hashable
# To represent a number.
# Corresponds to the JSON property `fromValue`
# @return [Google::Apis::AnalyticsdataV1alpha::NumericValue]
attr_accessor :from_value
# To represent a number.
# Corresponds to the JSON property `toValue`
# @return [Google::Apis::AnalyticsdataV1alpha::NumericValue]
attr_accessor :to_value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@from_value = args[:from_value] if args.key?(:from_value)
@to_value = args[:to_value] if args.key?(:to_value)
end
end
# Used to convert a dimension value to a single case.
class CaseExpression
include Google::Apis::Core::Hashable
# Name of a dimension. The name must refer back to a name in dimensions field of
# the request.
# Corresponds to the JSON property `dimensionName`
# @return [String]
attr_accessor :dimension_name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@dimension_name = args[:dimension_name] if args.key?(:dimension_name)
end
end
# Defines a cohort. A cohort is a group of users who share a common
# characteristic. For example, all users with the same acquisition date belong
# to the same cohort.
class Cohort
include Google::Apis::Core::Hashable
# A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests are
# allowed up to 4 date ranges.
# Corresponds to the JSON property `dateRange`
# @return [Google::Apis::AnalyticsdataV1alpha::DateRange]
attr_accessor :date_range
# The dimension used by cohort. Only supports `firstTouchDate` for retention
# report.
# Corresponds to the JSON property `dimension`
# @return [String]
attr_accessor :dimension
# 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.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@date_range = args[:date_range] if args.key?(:date_range)
@dimension = args[:dimension] if args.key?(:dimension)
@name = args[:name] if args.key?(:name)
end
end
# Settings of a cohort report.
class CohortReportSettings
include Google::Apis::Core::Hashable
# If true, accumulates the result from first visit day to the end day. Not
# supported in `RunReportRequest`.
# Corresponds to the JSON property `accumulate`
# @return [Boolean]
attr_accessor :accumulate
alias_method :accumulate?, :accumulate
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@accumulate = args[:accumulate] if args.key?(:accumulate)
end
end
# Specification for a cohort report.
class CohortSpec
include Google::Apis::Core::Hashable
# Settings of a cohort report.
# Corresponds to the JSON property `cohortReportSettings`
# @return [Google::Apis::AnalyticsdataV1alpha::CohortReportSettings]
attr_accessor :cohort_report_settings
# The definition for the cohorts.
# Corresponds to the JSON property `cohorts`
# @return [Array<Google::Apis::AnalyticsdataV1alpha::Cohort>]
attr_accessor :cohorts
# Describes date range for a cohort report.
# Corresponds to the JSON property `cohortsRange`
# @return [Google::Apis::AnalyticsdataV1alpha::CohortsRange]
attr_accessor :cohorts_range
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@cohort_report_settings = args[:cohort_report_settings] if args.key?(:cohort_report_settings)
@cohorts = args[:cohorts] if args.key?(:cohorts)
@cohorts_range = args[:cohorts_range] if args.key?(:cohorts_range)
end
end
# Describes date range for a cohort report.
class CohortsRange
include Google::Apis::Core::Hashable
# For daily cohorts, this will be the end day offset. For weekly cohorts, this
# will be the week offset.
# Corresponds to the JSON property `endOffset`
# @return [Fixnum]
attr_accessor :end_offset
# Reporting date range for each cohort is calculated based on these three fields.
# Corresponds to the JSON property `granularity`
# @return [String]
attr_accessor :granularity
# For daily cohorts, this will be the start day offset. For weekly cohorts, this
# will be the week offset.
# Corresponds to the JSON property `startOffset`
# @return [Fixnum]
attr_accessor :start_offset
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@end_offset = args[:end_offset] if args.key?(:end_offset)
@granularity = args[:granularity] if args.key?(:granularity)
@start_offset = args[:start_offset] if args.key?(:start_offset)
end
end
# Used to combine dimension values to a single dimension.
class ConcatenateExpression
include Google::Apis::Core::Hashable
# 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".
# Corresponds to the JSON property `delimiter`
# @return [String]
attr_accessor :delimiter
# Names of dimensions. The names must refer back to names in the dimensions
# field of the request.
# Corresponds to the JSON property `dimensionNames`
# @return [Array<String>]
attr_accessor :dimension_names
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@delimiter = args[:delimiter] if args.key?(:delimiter)
@dimension_names = args[:dimension_names] if args.key?(:dimension_names)
end
end
# A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests are
# allowed up to 4 date ranges.
class DateRange
include Google::Apis::Core::Hashable
# 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.
# Corresponds to the JSON property `endDate`
# @return [String]
attr_accessor :end_date
# 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.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# 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.
# Corresponds to the JSON property `startDate`
# @return [String]
attr_accessor :start_date
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@end_date = args[:end_date] if args.key?(:end_date)
@name = args[:name] if args.key?(:name)
@start_date = args[:start_date] if args.key?(:start_date)
end
end
# 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, city could be "Paris" or "New York".
# Requests are allowed up to 8 dimensions.
class Dimension
include Google::Apis::Core::Hashable
# Used to express a dimension which is the result of a formula of multiple
# dimensions. Example usages: 1) lower_case(dimension) 2) concatenate(dimension1,
# symbol, dimension2).
# Corresponds to the JSON property `dimensionExpression`
# @return [Google::Apis::AnalyticsdataV1alpha::DimensionExpression]
attr_accessor :dimension_expression
# 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. If `dimensionExpression` is specified, `name` can be any
# string that you would like. For example if a `dimensionExpression`
# concatenates `country` and `city`, you could call that dimension `
# countryAndCity`. Dimensions are referenced by `name` in `dimensionFilter`, `
# orderBys`, `dimensionExpression`, and `pivots`.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@dimension_expression = args[:dimension_expression] if args.key?(:dimension_expression)
@name = args[:name] if args.key?(:name)
end
end
# Used to express a dimension which is the result of a formula of multiple
# dimensions. Example usages: 1) lower_case(dimension) 2) concatenate(dimension1,
# symbol, dimension2).
class DimensionExpression
include Google::Apis::Core::Hashable
# Used to combine dimension values to a single dimension.
# Corresponds to the JSON property `concatenate`
# @return [Google::Apis::AnalyticsdataV1alpha::ConcatenateExpression]
attr_accessor :concatenate
# Used to convert a dimension value to a single case.
# Corresponds to the JSON property `lowerCase`
# @return [Google::Apis::AnalyticsdataV1alpha::CaseExpression]
attr_accessor :lower_case
# Used to convert a dimension value to a single case.
# Corresponds to the JSON property `upperCase`
# @return [Google::Apis::AnalyticsdataV1alpha::CaseExpression]
attr_accessor :upper_case
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@concatenate = args[:concatenate] if args.key?(:concatenate)
@lower_case = args[:lower_case] if args.key?(:lower_case)
@upper_case = args[:upper_case] if args.key?(:upper_case)
end
end
# Describes a dimension column in the report. Dimensions requested in a report
# produce column entries within rows and DimensionHeaders. However, dimensions
# used exclusively within filters or expressions do not produce columns in a
# report; correspondingly, those dimensions do not produce headers.
class DimensionHeader
include Google::Apis::Core::Hashable
# The dimension's name.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@name = args[:name] if args.key?(:name)
end
end
# Explains a dimension.
class DimensionMetadata
include Google::Apis::Core::Hashable
# This dimension's name. Useable in [Dimension](#Dimension)'s `name`. For
# example, `eventName`.
# Corresponds to the JSON property `apiName`
# @return [String]
attr_accessor :api_name
# True if the dimension is a custom dimension for this property.
# Corresponds to the JSON property `customDefinition`
# @return [Boolean]
attr_accessor :custom_definition
alias_method :custom_definition?, :custom_definition
# Still usable but deprecated names for this dimension. If populated, this
# dimension is available by either `apiName` or one of `deprecatedApiNames` for
# a period of time. After the deprecation period, the dimension will be
# available only by `apiName`.
# Corresponds to the JSON property `deprecatedApiNames`
# @return [Array<String>]
attr_accessor :deprecated_api_names
# Description of how this dimension is used and calculated.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# This dimension's name within the Google Analytics user interface. For example,
# `Event name`.
# Corresponds to the JSON property `uiName`
# @return [String]
attr_accessor :ui_name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@api_name = args[:api_name] if args.key?(:api_name)
@custom_definition = args[:custom_definition] if args.key?(:custom_definition)
@deprecated_api_names = args[:deprecated_api_names] if args.key?(:deprecated_api_names)
@description = args[:description] if args.key?(:description)
@ui_name = args[:ui_name] if args.key?(:ui_name)
end
end
# Sorts by dimension values.
class DimensionOrderBy
include Google::Apis::Core::Hashable
# A dimension name in the request to order by.
# Corresponds to the JSON property `dimensionName`
# @return [String]
attr_accessor :dimension_name
# Controls the rule for dimension value ordering.
# Corresponds to the JSON property `orderType`
# @return [String]
attr_accessor :order_type
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@dimension_name = args[:dimension_name] if args.key?(:dimension_name)
@order_type = args[:order_type] if args.key?(:order_type)
end
end
# The value of a dimension.
class DimensionValue
include Google::Apis::Core::Hashable
# Value as a string if the dimension type is a string.
# Corresponds to the JSON property `value`
# @return [String]
attr_accessor :value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@value = args[:value] if args.key?(:value)
end
end
# The unique identifier of the property whose events are tracked.
class Entity
include Google::Apis::Core::Hashable
# A Google Analytics GA4 property id. To learn more, see [where to find your
# Property ID](https://developers.google.com/analytics/devguides/reporting/data/
# v1/property-id).
# Corresponds to the JSON property `propertyId`
# @return [String]
attr_accessor :property_id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@property_id = args[:property_id] if args.key?(:property_id)
end
end
# An expression to filter dimension or metric values.
class Filter
include Google::Apis::Core::Hashable
# To express that the result needs to be between two numbers (inclusive).
# Corresponds to the JSON property `betweenFilter`
# @return [Google::Apis::AnalyticsdataV1alpha::BetweenFilter]
attr_accessor :between_filter
# The dimension name or metric name. Must be a name defined in dimensions or
# metrics.
# Corresponds to the JSON property `fieldName`
# @return [String]
attr_accessor :field_name
# The result needs to be in a list of string values.
# Corresponds to the JSON property `inListFilter`
# @return [Google::Apis::AnalyticsdataV1alpha::InListFilter]
attr_accessor :in_list_filter
# A filter for null values. If True, a null dimension value is matched by this
# filter. Null filter is commonly used inside a NOT filter expression. For
# example, a NOT expression of a null filter removes rows when a dimension is
# null.
# Corresponds to the JSON property `nullFilter`
# @return [Boolean]
attr_accessor :null_filter
alias_method :null_filter?, :null_filter
# Filters for numeric or date values.
# Corresponds to the JSON property `numericFilter`
# @return [Google::Apis::AnalyticsdataV1alpha::NumericFilter]
attr_accessor :numeric_filter
# The filter for string
# Corresponds to the JSON property `stringFilter`
# @return [Google::Apis::AnalyticsdataV1alpha::StringFilter]
attr_accessor :string_filter
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@between_filter = args[:between_filter] if args.key?(:between_filter)
@field_name = args[:field_name] if args.key?(:field_name)
@in_list_filter = args[:in_list_filter] if args.key?(:in_list_filter)
@null_filter = args[:null_filter] if args.key?(:null_filter)
@numeric_filter = args[:numeric_filter] if args.key?(:numeric_filter)
@string_filter = args[:string_filter] if args.key?(:string_filter)
end
end
# To express dimension or metric filters. The fields in the same
# FilterExpression need to be either all dimensions or all metrics.
class FilterExpression
include Google::Apis::Core::Hashable
# A list of filter expressions.
# Corresponds to the JSON property `andGroup`
# @return [Google::Apis::AnalyticsdataV1alpha::FilterExpressionList]
attr_accessor :and_group
# An expression to filter dimension or metric values.
# Corresponds to the JSON property `filter`
# @return [Google::Apis::AnalyticsdataV1alpha::Filter]
attr_accessor :filter
# To express dimension or metric filters. The fields in the same
# FilterExpression need to be either all dimensions or all metrics.
# Corresponds to the JSON property `notExpression`
# @return [Google::Apis::AnalyticsdataV1alpha::FilterExpression]
attr_accessor :not_expression
# A list of filter expressions.
# Corresponds to the JSON property `orGroup`
# @return [Google::Apis::AnalyticsdataV1alpha::FilterExpressionList]
attr_accessor :or_group
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@and_group = args[:and_group] if args.key?(:and_group)
@filter = args[:filter] if args.key?(:filter)
@not_expression = args[:not_expression] if args.key?(:not_expression)
@or_group = args[:or_group] if args.key?(:or_group)
end
end
# A list of filter expressions.
class FilterExpressionList
include Google::Apis::Core::Hashable
# A list of filter expressions.
# Corresponds to the JSON property `expressions`
# @return [Array<Google::Apis::AnalyticsdataV1alpha::FilterExpression>]
attr_accessor :expressions
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@expressions = args[:expressions] if args.key?(:expressions)
end
end
# The result needs to be in a list of string values.
class InListFilter
include Google::Apis::Core::Hashable
# If true, the string value is case sensitive.
# Corresponds to the JSON property `caseSensitive`
# @return [Boolean]
attr_accessor :case_sensitive
alias_method :case_sensitive?, :case_sensitive
# The list of string values. Must be non-empty.
# Corresponds to the JSON property `values`
# @return [Array<String>]
attr_accessor :values
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@case_sensitive = args[:case_sensitive] if args.key?(:case_sensitive)
@values = args[:values] if args.key?(:values)
end
end
# The dimensions and metrics currently accepted in reporting methods.
class Metadata
include Google::Apis::Core::Hashable
# The dimension descriptions.
# Corresponds to the JSON property `dimensions`
# @return [Array<Google::Apis::AnalyticsdataV1alpha::DimensionMetadata>]
attr_accessor :dimensions
# The metric descriptions.
# Corresponds to the JSON property `metrics`
# @return [Array<Google::Apis::AnalyticsdataV1alpha::MetricMetadata>]
attr_accessor :metrics
# Resource name of this metadata.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@dimensions = args[:dimensions] if args.key?(:dimensions)
@metrics = args[:metrics] if args.key?(:metrics)
@name = args[:name] if args.key?(:name)
end
end
# The quantitative measurements of a report. For example, the metric `eventCount`
# is the total number of events. Requests are allowed up to 10 metrics.
class Metric
include Google::Apis::Core::Hashable
# A mathematical expression for derived metrics. For example, the metric Event
# count per user is `eventCount/totalUsers`.
# Corresponds to the JSON property `expression`
# @return [String]
attr_accessor :expression
# Indicates if a metric is invisible in the report response. If a metric is
# invisible, the metric will not produce a column in the response, but can be
# used in `metricFilter`, `orderBys`, or a metric `expression`.
# Corresponds to the JSON property `invisible`
# @return [Boolean]
attr_accessor :invisible
alias_method :invisible?, :invisible
# The name of the metric. See the [API Metrics](https://developers.google.com/
# analytics/devguides/reporting/data/v1/api-schema#metrics) for the list of
# metric names. If `expression` is specified, `name` can be any string that you
# would like. For example if `expression` is `screenPageViews/sessions`, you
# could call that metric's name = `viewsPerSession`. Metrics are referenced by `
# name` in `metricFilter`, `orderBys`, and metric `expression`.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@expression = args[:expression] if args.key?(:expression)
@invisible = args[:invisible] if args.key?(:invisible)
@name = args[:name] if args.key?(:name)
end
end
# Describes a metric column in the report. Visible metrics requested in a report
# produce column entries within rows and MetricHeaders. However, metrics used
# exclusively within filters or expressions do not produce columns in a report;
# correspondingly, those metrics do not produce headers.
class MetricHeader
include Google::Apis::Core::Hashable
# The metric's name.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The metric's data type.
# Corresponds to the JSON property `type`
# @return [String]
attr_accessor :type
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@name = args[:name] if args.key?(:name)
@type = args[:type] if args.key?(:type)
end
end
# Explains a metric.
class MetricMetadata
include Google::Apis::Core::Hashable
# A metric name. Useable in [Metric](#Metric)'s `name`. For example, `eventCount`
# .
# Corresponds to the JSON property `apiName`
# @return [String]
attr_accessor :api_name
# True if the metric is a custom metric for this property.
# Corresponds to the JSON property `customDefinition`
# @return [Boolean]
attr_accessor :custom_definition
alias_method :custom_definition?, :custom_definition
# Still usable but deprecated names for this metric. If populated, this metric
# is available by either `apiName` or one of `deprecatedApiNames` for a period
# of time. After the deprecation period, the metric will be available only by `
# apiName`.
# Corresponds to the JSON property `deprecatedApiNames`
# @return [Array<String>]
attr_accessor :deprecated_api_names
# Description of how this metric is used and calculated.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# The mathematical expression for this derived metric. Can be used in [Metric](#
# Metric)'s `expression` field for equivalent reports. Most metrics are not
# expressions, and for non-expressions, this field is empty.
# Corresponds to the JSON property `expression`
# @return [String]
attr_accessor :expression
# The type of this metric.
# Corresponds to the JSON property `type`
# @return [String]
attr_accessor :type
# This metric's name within the Google Analytics user interface. For example, `
# Event count`.
# Corresponds to the JSON property `uiName`
# @return [String]
attr_accessor :ui_name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@api_name = args[:api_name] if args.key?(:api_name)
@custom_definition = args[:custom_definition] if args.key?(:custom_definition)
@deprecated_api_names = args[:deprecated_api_names] if args.key?(:deprecated_api_names)
@description = args[:description] if args.key?(:description)
@expression = args[:expression] if args.key?(:expression)
@type = args[:type] if args.key?(:type)
@ui_name = args[:ui_name] if args.key?(:ui_name)
end
end
# Sorts by metric values.
class MetricOrderBy
include Google::Apis::Core::Hashable
# A metric name in the request to order by.
# Corresponds to the JSON property `metricName`
# @return [String]
attr_accessor :metric_name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@metric_name = args[:metric_name] if args.key?(:metric_name)
end
end
# The value of a metric.
class MetricValue
include Google::Apis::Core::Hashable
# Measurement value. See MetricHeader for type.
# Corresponds to the JSON property `value`
# @return [String]
attr_accessor :value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@value = args[:value] if args.key?(:value)
end
end
# Filters for numeric or date values.
class NumericFilter
include Google::Apis::Core::Hashable
# The operation type for this filter.
# Corresponds to the JSON property `operation`
# @return [String]
attr_accessor :operation
# To represent a number.
# Corresponds to the JSON property `value`
# @return [Google::Apis::AnalyticsdataV1alpha::NumericValue]
attr_accessor :value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@operation = args[:operation] if args.key?(:operation)
@value = args[:value] if args.key?(:value)
end
end
# To represent a number.
class NumericValue
include Google::Apis::Core::Hashable
# Double value
# Corresponds to the JSON property `doubleValue`
# @return [Float]
attr_accessor :double_value
# Integer value
# Corresponds to the JSON property `int64Value`
# @return [Fixnum]
attr_accessor :int64_value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@double_value = args[:double_value] if args.key?(:double_value)
@int64_value = args[:int64_value] if args.key?(:int64_value)
end
end
# The sort options.
class OrderBy
include Google::Apis::Core::Hashable
# If true, sorts by descending order.
# Corresponds to the JSON property `desc`
# @return [Boolean]
attr_accessor :desc
alias_method :desc?, :desc
# Sorts by dimension values.
# Corresponds to the JSON property `dimension`
# @return [Google::Apis::AnalyticsdataV1alpha::DimensionOrderBy]
attr_accessor :dimension
# Sorts by metric values.
# Corresponds to the JSON property `metric`
# @return [Google::Apis::AnalyticsdataV1alpha::MetricOrderBy]
attr_accessor :metric
# Sorts by a pivot column group.
# Corresponds to the JSON property `pivot`
# @return [Google::Apis::AnalyticsdataV1alpha::PivotOrderBy]
attr_accessor :pivot
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@desc = args[:desc] if args.key?(:desc)
@dimension = args[:dimension] if args.key?(:dimension)
@metric = args[:metric] if args.key?(:metric)
@pivot = args[:pivot] if args.key?(:pivot)
end
end
# Describes the visible dimension columns and rows in the report response.
class Pivot
include Google::Apis::Core::Hashable
# Dimension names for visible columns in the report response. Including "
# dateRange" produces a date range column; for each row in the response,
# dimension values in the date range column will indicate the corresponding date
# range from the request.
# Corresponds to the JSON property `fieldNames`
# @return [Array<String>]
attr_accessor :field_names
# The number of rows to return in this pivot. If unspecified, 10 rows are
# returned. If -1, all rows are returned.
# Corresponds to the JSON property `limit`