diff --git a/google/analytics/data/__init__.py b/google/analytics/data/__init__.py index 7f10e59..f6e294d 100644 --- a/google/analytics/data/__init__.py +++ b/google/analytics/data/__init__.py @@ -60,6 +60,7 @@ from google.analytics.data_v1beta.types.data import MetricHeader from google.analytics.data_v1beta.types.data import MetricMetadata from google.analytics.data_v1beta.types.data import MetricValue +from google.analytics.data_v1beta.types.data import MinuteRange from google.analytics.data_v1beta.types.data import NumericValue from google.analytics.data_v1beta.types.data import OrderBy from google.analytics.data_v1beta.types.data import Pivot @@ -104,6 +105,7 @@ "MetricHeader", "MetricMetadata", "MetricValue", + "MinuteRange", "NumericValue", "OrderBy", "Pivot", diff --git a/google/analytics/data_v1beta/__init__.py b/google/analytics/data_v1beta/__init__.py index b7282cc..0f581f7 100644 --- a/google/analytics/data_v1beta/__init__.py +++ b/google/analytics/data_v1beta/__init__.py @@ -46,6 +46,7 @@ from .types.data import MetricHeader from .types.data import MetricMetadata from .types.data import MetricValue +from .types.data import MinuteRange from .types.data import NumericValue from .types.data import OrderBy from .types.data import Pivot @@ -86,6 +87,7 @@ "MetricMetadata", "MetricType", "MetricValue", + "MinuteRange", "NumericValue", "OrderBy", "Pivot", diff --git a/google/analytics/data_v1beta/types/__init__.py b/google/analytics/data_v1beta/types/__init__.py index 3ccd5c9..80f4321 100644 --- a/google/analytics/data_v1beta/types/__init__.py +++ b/google/analytics/data_v1beta/types/__init__.py @@ -45,6 +45,7 @@ MetricHeader, MetricMetadata, MetricValue, + MinuteRange, NumericValue, OrderBy, Pivot, @@ -88,6 +89,7 @@ "MetricHeader", "MetricMetadata", "MetricValue", + "MinuteRange", "NumericValue", "OrderBy", "Pivot", diff --git a/google/analytics/data_v1beta/types/analytics_data_api.py b/google/analytics/data_v1beta/types/analytics_data_api.py index 70fd077..8a188ac 100644 --- a/google/analytics/data_v1beta/types/analytics_data_api.py +++ b/google/analytics/data_v1beta/types/analytics_data_api.py @@ -547,6 +547,15 @@ class RunRealtimeReportRequest(proto.Message): Toggles whether to return the current state of this Analytics Property's Realtime quota. Quota is returned in `PropertyQuota <#PropertyQuota>`__. + minute_ranges (Sequence[google.analytics.data_v1beta.types.MinuteRange]): + The minute ranges of event data to read. If + unspecified, one minute range for the last 30 + minutes will be used. If multiple minute ranges + are requested, each response row will contain a + zero based minute range index. If two minute + ranges overlap, the event data for the + overlapping minutes is included in the response + rows for both minute ranges. """ property = proto.Field(proto.STRING, number=1,) @@ -562,6 +571,9 @@ class RunRealtimeReportRequest(proto.Message): ) order_bys = proto.RepeatedField(proto.MESSAGE, number=8, message=data.OrderBy,) return_property_quota = proto.Field(proto.BOOL, number=9,) + minute_ranges = proto.RepeatedField( + proto.MESSAGE, number=10, message=data.MinuteRange, + ) class RunRealtimeReportResponse(proto.Message): diff --git a/google/analytics/data_v1beta/types/data.py b/google/analytics/data_v1beta/types/data.py index 573f56e..58c19aa 100644 --- a/google/analytics/data_v1beta/types/data.py +++ b/google/analytics/data_v1beta/types/data.py @@ -22,6 +22,7 @@ "MetricAggregation", "MetricType", "DateRange", + "MinuteRange", "Dimension", "DimensionExpression", "Metric", @@ -107,12 +108,54 @@ class DateRange(proto.Message): name = proto.Field(proto.STRING, number=3,) +class MinuteRange(proto.Message): + r"""A contiguous set of minutes: startMinutesAgo, startMinutesAgo + + 1, ..., endMinutesAgo. Requests are allowed up to 2 minute + ranges. + + Attributes: + start_minutes_ago (int): + The inclusive start minute for the query as a number of + minutes before now. For example, ``"startMinutesAgo": 29`` + specifies the report should include event data from 29 + minutes ago and after. Cannot be after ``endMinutesAgo``. + + If unspecified, ``startMinutesAgo`` is defaulted to 29. + Standard Analytics properties can request up to the last 30 + minutes of event data (``startMinutesAgo <= 29``), and 360 + Analytics properties can request up to the last 60 minutes + of event data (``startMinutesAgo <= 59``). + end_minutes_ago (int): + The inclusive end minute for the query as a number of + minutes before now. Cannot be before ``startMinutesAgo``. + For example, ``"endMinutesAgo": 15`` specifies the report + should include event data from prior to 15 minutes ago. + + If unspecified, ``endMinutesAgo`` is defaulted to 0. + Standard Analytics properties can request any minute in the + last 30 minutes of event data (``endMinutesAgo <= 29``), and + 360 Analytics properties can request any minute in the last + 60 minutes of event data (``endMinutesAgo <= 59``). + name (str): + Assigns a name to this minute 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, minute ranges are named by their zero based + index in the request: ``date_range_0``, ``date_range_1``, + etc. + """ + + start_minutes_ago = proto.Field(proto.INT32, number=1, optional=True,) + end_minutes_ago = proto.Field(proto.INT32, number=2, optional=True,) + name = proto.Field(proto.STRING, number=3,) + + class Dimension(proto.Message): r"""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. + allowed up to 9 dimensions. Attributes: name (str):