Skip to content

Commit 2c4e4d1

Browse files
feat: [google-analytics-data] add the comparisons field to the Metadata resource (#12978)
BEGIN_COMMIT_OVERRIDE feat: add the `comparisons` field to the `Metadata` resource feat: add the `comparisons` field to the `RunReportRequest`, `RunPivotReportRequest` resources feat: add the `Comparison` type feat: add the `ComparisonMetadata` type docs: a comment for field `custom_definition` in message `DimensionMetadata` is changed END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. feat: add the `comparisons` field to the `RunReportRequest`, `RunPivotReportRequest` resources feat: add the `Comparison` type feat: add the `ComparisonMetadata` type docs: a comment for field `custom_definition` in message `DimensionMetadata` is changed PiperOrigin-RevId: 658850708 Source-Link: googleapis/googleapis@a1cc0b4 Source-Link: googleapis/googleapis-gen@8f3e7bc Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFuYWx5dGljcy1kYXRhLy5Pd2xCb3QueWFtbCIsImgiOiI4ZjNlN2JjYzlmOGZmNmY4N2JkZDRhN2QxM2QyZWMyNWU4ZjYzMzNhIn0= --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: ohmayr <omairnaveed@ymail.com>
1 parent f16067b commit 2c4e4d1

11 files changed

Lines changed: 136 additions & 9 deletions

File tree

packages/google-analytics-data/google/analytics/data/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
CohortReportSettings,
5757
CohortSpec,
5858
CohortsRange,
59+
Comparison,
60+
ComparisonMetadata,
5961
Compatibility,
6062
DateRange,
6163
Dimension,
@@ -120,6 +122,8 @@
120122
"CohortReportSettings",
121123
"CohortSpec",
122124
"CohortsRange",
125+
"Comparison",
126+
"ComparisonMetadata",
123127
"DateRange",
124128
"Dimension",
125129
"DimensionCompatibility",

packages/google-analytics-data/google/analytics/data/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.18.10" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-analytics-data/google/analytics/data_v1alpha/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.18.10" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-analytics-data/google/analytics/data_v1beta/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
CohortReportSettings,
5555
CohortSpec,
5656
CohortsRange,
57+
Comparison,
58+
ComparisonMetadata,
5759
Compatibility,
5860
DateRange,
5961
Dimension,
@@ -104,6 +106,8 @@
104106
"CohortReportSettings",
105107
"CohortSpec",
106108
"CohortsRange",
109+
"Comparison",
110+
"ComparisonMetadata",
107111
"Compatibility",
108112
"CreateAudienceExportRequest",
109113
"DateRange",

packages/google-analytics-data/google/analytics/data_v1beta/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.18.10" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-analytics-data/google/analytics/data_v1beta/types/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
CohortReportSettings,
4646
CohortSpec,
4747
CohortsRange,
48+
Comparison,
49+
ComparisonMetadata,
4850
Compatibility,
4951
DateRange,
5052
Dimension,
@@ -107,6 +109,8 @@
107109
"CohortReportSettings",
108110
"CohortSpec",
109111
"CohortsRange",
112+
"Comparison",
113+
"ComparisonMetadata",
110114
"DateRange",
111115
"Dimension",
112116
"DimensionCompatibility",

packages/google-analytics-data/google/analytics/data_v1beta/types/analytics_data_api.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ class Metadata(proto.Message):
157157
The dimension descriptions.
158158
metrics (MutableSequence[google.analytics.data_v1beta.types.MetricMetadata]):
159159
The metric descriptions.
160+
comparisons (MutableSequence[google.analytics.data_v1beta.types.ComparisonMetadata]):
161+
The comparison descriptions.
160162
"""
161163

162164
name: str = proto.Field(
@@ -173,6 +175,11 @@ class Metadata(proto.Message):
173175
number=2,
174176
message=data.MetricMetadata,
175177
)
178+
comparisons: MutableSequence[data.ComparisonMetadata] = proto.RepeatedField(
179+
proto.MESSAGE,
180+
number=4,
181+
message=data.ComparisonMetadata,
182+
)
176183

177184

178185
class RunReportRequest(proto.Message):
@@ -269,6 +276,11 @@ class RunReportRequest(proto.Message):
269276
Toggles whether to return the current state of this
270277
Analytics Property's quota. Quota is returned in
271278
`PropertyQuota <#PropertyQuota>`__.
279+
comparisons (MutableSequence[google.analytics.data_v1beta.types.Comparison]):
280+
Optional. The configuration of comparisons
281+
requested and displayed. The request only
282+
requires a comparisons field in order to receive
283+
a comparison column in the response.
272284
"""
273285

274286
property: str = proto.Field(
@@ -335,6 +347,11 @@ class RunReportRequest(proto.Message):
335347
proto.BOOL,
336348
number=14,
337349
)
350+
comparisons: MutableSequence[data.Comparison] = proto.RepeatedField(
351+
proto.MESSAGE,
352+
number=15,
353+
message=data.Comparison,
354+
)
338355

339356

340357
class RunReportResponse(proto.Message):
@@ -504,6 +521,12 @@ class RunPivotReportRequest(proto.Message):
504521
Toggles whether to return the current state of this
505522
Analytics Property's quota. Quota is returned in
506523
`PropertyQuota <#PropertyQuota>`__.
524+
comparisons (MutableSequence[google.analytics.data_v1beta.types.Comparison]):
525+
Optional. The configuration of comparisons
526+
requested and displayed. The request requires
527+
both a comparisons field and a comparisons
528+
dimension to receive a comparison column in the
529+
response.
507530
"""
508531

509532
property: str = proto.Field(
@@ -557,6 +580,11 @@ class RunPivotReportRequest(proto.Message):
557580
proto.BOOL,
558581
number=11,
559582
)
583+
comparisons: MutableSequence[data.Comparison] = proto.RepeatedField(
584+
proto.MESSAGE,
585+
number=12,
586+
message=data.Comparison,
587+
)
560588

561589

562590
class RunPivotReportResponse(proto.Message):

packages/google-analytics-data/google/analytics/data_v1beta/types/data.py

Lines changed: 89 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"Dimension",
3232
"DimensionExpression",
3333
"Metric",
34+
"Comparison",
3435
"FilterExpression",
3536
"FilterExpressionList",
3637
"Filter",
@@ -54,6 +55,7 @@
5455
"QuotaStatus",
5556
"DimensionMetadata",
5657
"MetricMetadata",
58+
"ComparisonMetadata",
5759
"DimensionCompatibility",
5860
"MetricCompatibility",
5961
},
@@ -471,6 +473,56 @@ class Metric(proto.Message):
471473
)
472474

473475

476+
class Comparison(proto.Message):
477+
r"""Defines an individual comparison. Most requests will include
478+
multiple comparisons so that the report compares between the
479+
comparisons.
480+
481+
This message has `oneof`_ fields (mutually exclusive fields).
482+
For each oneof, at most one member field can be set at the same time.
483+
Setting any member of the oneof automatically clears all other
484+
members.
485+
486+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
487+
488+
Attributes:
489+
name (str):
490+
Each comparison produces separate rows in the
491+
response. In the response, this comparison is
492+
identified by this name. If name is unspecified,
493+
we will use the saved comparisons display name.
494+
495+
This field is a member of `oneof`_ ``_name``.
496+
dimension_filter (google.analytics.data_v1beta.types.FilterExpression):
497+
A basic comparison.
498+
499+
This field is a member of `oneof`_ ``one_comparison``.
500+
comparison (str):
501+
A saved comparison identified by the
502+
comparison's resource name. For example,
503+
'comparisons/1234'.
504+
505+
This field is a member of `oneof`_ ``one_comparison``.
506+
"""
507+
508+
name: str = proto.Field(
509+
proto.STRING,
510+
number=1,
511+
optional=True,
512+
)
513+
dimension_filter: "FilterExpression" = proto.Field(
514+
proto.MESSAGE,
515+
number=2,
516+
oneof="one_comparison",
517+
message="FilterExpression",
518+
)
519+
comparison: str = proto.Field(
520+
proto.STRING,
521+
number=3,
522+
oneof="one_comparison",
523+
)
524+
525+
474526
class FilterExpression(proto.Message):
475527
r"""To express dimension or metric filters. The fields in the
476528
same FilterExpression need to be either all dimensions or all
@@ -1751,8 +1803,14 @@ class DimensionMetadata(proto.Message):
17511803
the deprecation period, the dimension will be available only
17521804
by ``apiName``.
17531805
custom_definition (bool):
1754-
True if the dimension is a custom dimension
1755-
for this property.
1806+
True if the dimension is custom to this
1807+
property. This includes user, event, & item
1808+
scoped custom dimensions; to learn more about
1809+
custom dimensions, see
1810+
https://support.google.com/analytics/answer/14240153.
1811+
This also include custom channel groups; to
1812+
learn more about custom channel groups, see
1813+
https://support.google.com/analytics/answer/13051316.
17561814
category (str):
17571815
The display name of the category that this
17581816
dimension belongs to. Similar dimensions and
@@ -1889,6 +1947,35 @@ class BlockedReason(proto.Enum):
18891947
)
18901948

18911949

1950+
class ComparisonMetadata(proto.Message):
1951+
r"""The metadata for a single comparison.
1952+
1953+
Attributes:
1954+
api_name (str):
1955+
This comparison's resource name. Useable in
1956+
`Comparison <#Comparison>`__'s ``comparison`` field. For
1957+
example, 'comparisons/1234'.
1958+
ui_name (str):
1959+
This comparison's name within the Google
1960+
Analytics user interface.
1961+
description (str):
1962+
This comparison's description.
1963+
"""
1964+
1965+
api_name: str = proto.Field(
1966+
proto.STRING,
1967+
number=1,
1968+
)
1969+
ui_name: str = proto.Field(
1970+
proto.STRING,
1971+
number=2,
1972+
)
1973+
description: str = proto.Field(
1974+
proto.STRING,
1975+
number=3,
1976+
)
1977+
1978+
18921979
class DimensionCompatibility(proto.Message):
18931980
r"""The compatibility for a single dimension.
18941981

packages/google-analytics-data/samples/generated_samples/snippet_metadata_google.analytics.data.v1alpha.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-analytics-data",
11-
"version": "0.18.10"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-analytics-data/samples/generated_samples/snippet_metadata_google.analytics.data.v1beta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-analytics-data",
11-
"version": "0.18.10"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)