Skip to content

Commit

Permalink
feat: [google-analytics-data] add SamplingLevel type to Data API v1…
Browse files Browse the repository at this point in the history
…alpha (#13177)

- [ ] Regenerate this pull request now.

BEGIN_COMMIT_OVERRIDE
feat: add `SamplingLevel` type to Data API v1alpha
feat: add `sampling_level` to the `ReportDefinition` type
END_COMMIT_OVERRIDE



PiperOrigin-RevId: 686560382

Source-Link:
googleapis/googleapis@7b6975c

Source-Link:
googleapis/googleapis-gen@52607af
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFuYWx5dGljcy1kYXRhLy5Pd2xCb3QueWFtbCIsImgiOiI1MjYwN2FmMDMwMjgzN2NlODgwNDcxYTk0ZTQ3M2RlYWI1Y2EwZTRmIn0=

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Victor Chudnovsky <vchudnov@google.com>
  • Loading branch information
3 people authored Oct 19, 2024
1 parent 18b266f commit d395233
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
ResponseMetaData,
RestrictedMetricType,
Row,
SamplingLevel,
SamplingMetadata,
Segment,
SegmentEventFilter,
Expand Down Expand Up @@ -207,6 +208,7 @@
"Row",
"RunFunnelReportRequest",
"RunFunnelReportResponse",
"SamplingLevel",
"SamplingMetadata",
"Segment",
"SegmentEventFilter",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
ResponseMetaData,
RestrictedMetricType,
Row,
SamplingLevel,
SamplingMetadata,
Segment,
SegmentEventFilter,
Expand Down Expand Up @@ -221,6 +222,7 @@
"MetricAggregation",
"MetricType",
"RestrictedMetricType",
"SamplingLevel",
"SessionCriteriaScoping",
"SessionExclusionDuration",
"UserCriteriaScoping",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,8 @@ class ReportTask(proto.Message):
class ReportDefinition(proto.Message):
r"""The definition of how a report should be run.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
dimensions (MutableSequence[google.analytics.data_v1alpha.types.Dimension]):
Optional. The dimensions requested and
Expand Down Expand Up @@ -1299,6 +1301,10 @@ class ReportDefinition(proto.Message):
then a query for the ``eventName`` dimension and
``eventCount`` metric will not have a row containing
eventName: "purchase" and eventCount: 0.
sampling_level (google.analytics.data_v1alpha.types.SamplingLevel):
Optional. The report's sampling level.
This field is a member of `oneof`_ ``_sampling_level``.
"""

dimensions: MutableSequence[data.Dimension] = proto.RepeatedField(
Expand Down Expand Up @@ -1359,6 +1365,12 @@ class ReportDefinition(proto.Message):
proto.BOOL,
number=13,
)
sampling_level: data.SamplingLevel = proto.Field(
proto.ENUM,
number=14,
optional=True,
enum=data.SamplingLevel,
)

class ReportMetadata(proto.Message):
r"""The report metadata for a specific report task.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"MetricAggregation",
"MetricType",
"RestrictedMetricType",
"SamplingLevel",
"DateRange",
"Dimension",
"DimensionExpression",
Expand Down Expand Up @@ -308,6 +309,32 @@ class RestrictedMetricType(proto.Enum):
REVENUE_DATA = 2


class SamplingLevel(proto.Enum):
r"""Categories of sampling levels for the requests.
Values:
SAMPLING_LEVEL_UNSPECIFIED (0):
Unspecified type.
LOW (1):
Applies a sampling level of 10 million to
standard properties and 100 million to Google
Analytics 360 properties.
MEDIUM (2):
Exclusive to Google Analytics 360 properties
with a sampling level of 1 billion.
UNSAMPLED (3):
Exclusive to Google Analytics 360 properties.
Unsampled explorations are more accurate and can
reveal insights that aren't visible in standard
explorations. To learn more, see
https://support.google.com/analytics/answer/10896953.
"""
SAMPLING_LEVEL_UNSPECIFIED = 0
LOW = 1
MEDIUM = 2
UNSAMPLED = 3


class DateRange(proto.Message):
r"""A contiguous set of days: ``startDate``, ``startDate + 1``, ...,
``endDate``. Requests are allowed up to 4 date ranges.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11681,6 +11681,7 @@ def test_create_report_task_rest_call_success(request_type):
"cohort_report_settings": {"accumulate": True},
},
"keep_empty_rows": True,
"sampling_level": 1,
},
"report_metadata": {
"state": 1,
Expand Down

0 comments on commit d395233

Please sign in to comment.