diff --git a/google/analytics/data_v1beta/services/beta_analytics_data/async_client.py b/google/analytics/data_v1beta/services/beta_analytics_data/async_client.py index fce3be5..4c6f746 100644 --- a/google/analytics/data_v1beta/services/beta_analytics_data/async_client.py +++ b/google/analytics/data_v1beta/services/beta_analytics_data/async_client.py @@ -210,15 +210,18 @@ async def run_report( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> analytics_data_api.RunReportResponse: - r"""Returns a customized report of your Google Analytics - event data. Reports contain statistics derived from data - collected by the Google Analytics tracking code. The - data returned from the API is as a table with columns - for the requested dimensions and metrics. Metrics are - individual measurements of user activity on your - property, such as active users or event count. - Dimensions break down metrics across some common - criteria, such as country or event name. + r"""Returns a customized report of your Google Analytics event data. + Reports contain statistics derived from data collected by the + Google Analytics tracking code. The data returned from the API + is as a table with columns for the requested dimensions and + metrics. Metrics are individual measurements of user activity on + your property, such as active users or event count. Dimensions + break down metrics across some common criteria, such as country + or event name. + + For a guide to constructing requests & understanding responses, + see `Creating a + Report `__. .. code-block:: python @@ -633,7 +636,7 @@ async def sample_get_metadata(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_metadata, - default_timeout=None, + default_timeout=60.0, client_info=DEFAULT_CLIENT_INFO, ) @@ -662,10 +665,16 @@ async def run_realtime_report( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> analytics_data_api.RunRealtimeReportResponse: - r"""The Google Analytics Realtime API returns a - customized report of realtime event data for your - property. These reports show events and usage from the - last 30 minutes. + r"""Returns a customized report of realtime event data for your + property. Events appear in realtime reports seconds after they + have been sent to the Google Analytics. Realtime reports show + events and usage data for the periods of time ranging from the + present moment to 30 minutes ago (up to 60 minutes for Google + Analytics 360 properties). + + For a guide to constructing realtime requests & understanding + responses, see `Creating a Realtime + Report `__. .. code-block:: python @@ -809,7 +818,7 @@ async def sample_check_compatibility(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.check_compatibility, - default_timeout=None, + default_timeout=60.0, client_info=DEFAULT_CLIENT_INFO, ) diff --git a/google/analytics/data_v1beta/services/beta_analytics_data/client.py b/google/analytics/data_v1beta/services/beta_analytics_data/client.py index e5315f8..d4e5da8 100644 --- a/google/analytics/data_v1beta/services/beta_analytics_data/client.py +++ b/google/analytics/data_v1beta/services/beta_analytics_data/client.py @@ -433,15 +433,18 @@ def run_report( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> analytics_data_api.RunReportResponse: - r"""Returns a customized report of your Google Analytics - event data. Reports contain statistics derived from data - collected by the Google Analytics tracking code. The - data returned from the API is as a table with columns - for the requested dimensions and metrics. Metrics are - individual measurements of user activity on your - property, such as active users or event count. - Dimensions break down metrics across some common - criteria, such as country or event name. + r"""Returns a customized report of your Google Analytics event data. + Reports contain statistics derived from data collected by the + Google Analytics tracking code. The data returned from the API + is as a table with columns for the requested dimensions and + metrics. Metrics are individual measurements of user activity on + your property, such as active users or event count. Dimensions + break down metrics across some common criteria, such as country + or event name. + + For a guide to constructing requests & understanding responses, + see `Creating a + Report `__. .. code-block:: python @@ -889,10 +892,16 @@ def run_realtime_report( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> analytics_data_api.RunRealtimeReportResponse: - r"""The Google Analytics Realtime API returns a - customized report of realtime event data for your - property. These reports show events and usage from the - last 30 minutes. + r"""Returns a customized report of realtime event data for your + property. Events appear in realtime reports seconds after they + have been sent to the Google Analytics. Realtime reports show + events and usage data for the periods of time ranging from the + present moment to 30 minutes ago (up to 60 minutes for Google + Analytics 360 properties). + + For a guide to constructing realtime requests & understanding + responses, see `Creating a Realtime + Report `__. .. code-block:: python diff --git a/google/analytics/data_v1beta/services/beta_analytics_data/transports/base.py b/google/analytics/data_v1beta/services/beta_analytics_data/transports/base.py index 33eaafe..017debc 100644 --- a/google/analytics/data_v1beta/services/beta_analytics_data/transports/base.py +++ b/google/analytics/data_v1beta/services/beta_analytics_data/transports/base.py @@ -152,7 +152,7 @@ def _prep_wrapped_messages(self, client_info): ), self.get_metadata: gapic_v1.method.wrap_method( self.get_metadata, - default_timeout=None, + default_timeout=60.0, client_info=client_info, ), self.run_realtime_report: gapic_v1.method.wrap_method( @@ -162,7 +162,7 @@ def _prep_wrapped_messages(self, client_info): ), self.check_compatibility: gapic_v1.method.wrap_method( self.check_compatibility, - default_timeout=None, + default_timeout=60.0, client_info=client_info, ), } diff --git a/google/analytics/data_v1beta/services/beta_analytics_data/transports/grpc.py b/google/analytics/data_v1beta/services/beta_analytics_data/transports/grpc.py index 6d0a470..3964332 100644 --- a/google/analytics/data_v1beta/services/beta_analytics_data/transports/grpc.py +++ b/google/analytics/data_v1beta/services/beta_analytics_data/transports/grpc.py @@ -237,15 +237,18 @@ def run_report( ]: r"""Return a callable for the run report method over gRPC. - Returns a customized report of your Google Analytics - event data. Reports contain statistics derived from data - collected by the Google Analytics tracking code. The - data returned from the API is as a table with columns - for the requested dimensions and metrics. Metrics are - individual measurements of user activity on your - property, such as active users or event count. - Dimensions break down metrics across some common - criteria, such as country or event name. + Returns a customized report of your Google Analytics event data. + Reports contain statistics derived from data collected by the + Google Analytics tracking code. The data returned from the API + is as a table with columns for the requested dimensions and + metrics. Metrics are individual measurements of user activity on + your property, such as active users or event count. Dimensions + break down metrics across some common criteria, such as country + or event name. + + For a guide to constructing requests & understanding responses, + see `Creating a + Report `__. Returns: Callable[[~.RunReportRequest], @@ -404,10 +407,16 @@ def run_realtime_report( ]: r"""Return a callable for the run realtime report method over gRPC. - The Google Analytics Realtime API returns a - customized report of realtime event data for your - property. These reports show events and usage from the - last 30 minutes. + Returns a customized report of realtime event data for your + property. Events appear in realtime reports seconds after they + have been sent to the Google Analytics. Realtime reports show + events and usage data for the periods of time ranging from the + present moment to 30 minutes ago (up to 60 minutes for Google + Analytics 360 properties). + + For a guide to constructing realtime requests & understanding + responses, see `Creating a Realtime + Report `__. Returns: Callable[[~.RunRealtimeReportRequest], diff --git a/google/analytics/data_v1beta/services/beta_analytics_data/transports/grpc_asyncio.py b/google/analytics/data_v1beta/services/beta_analytics_data/transports/grpc_asyncio.py index 1173713..37bb305 100644 --- a/google/analytics/data_v1beta/services/beta_analytics_data/transports/grpc_asyncio.py +++ b/google/analytics/data_v1beta/services/beta_analytics_data/transports/grpc_asyncio.py @@ -241,15 +241,18 @@ def run_report( ]: r"""Return a callable for the run report method over gRPC. - Returns a customized report of your Google Analytics - event data. Reports contain statistics derived from data - collected by the Google Analytics tracking code. The - data returned from the API is as a table with columns - for the requested dimensions and metrics. Metrics are - individual measurements of user activity on your - property, such as active users or event count. - Dimensions break down metrics across some common - criteria, such as country or event name. + Returns a customized report of your Google Analytics event data. + Reports contain statistics derived from data collected by the + Google Analytics tracking code. The data returned from the API + is as a table with columns for the requested dimensions and + metrics. Metrics are individual measurements of user activity on + your property, such as active users or event count. Dimensions + break down metrics across some common criteria, such as country + or event name. + + For a guide to constructing requests & understanding responses, + see `Creating a + Report `__. Returns: Callable[[~.RunReportRequest], @@ -410,10 +413,16 @@ def run_realtime_report( ]: r"""Return a callable for the run realtime report method over gRPC. - The Google Analytics Realtime API returns a - customized report of realtime event data for your - property. These reports show events and usage from the - last 30 minutes. + Returns a customized report of realtime event data for your + property. Events appear in realtime reports seconds after they + have been sent to the Google Analytics. Realtime reports show + events and usage data for the periods of time ranging from the + present moment to 30 minutes ago (up to 60 minutes for Google + Analytics 360 properties). + + For a guide to constructing realtime requests & understanding + responses, see `Creating a Realtime + Report `__. Returns: Callable[[~.RunRealtimeReportRequest], diff --git a/google/analytics/data_v1beta/types/analytics_data_api.py b/google/analytics/data_v1beta/types/analytics_data_api.py index 62bc65c..80c086d 100644 --- a/google/analytics/data_v1beta/types/analytics_data_api.py +++ b/google/analytics/data_v1beta/types/analytics_data_api.py @@ -192,9 +192,10 @@ class RunReportRequest(proto.Message): Filters `__ for examples. Metrics cannot be used in this filter. metric_filter (google.analytics.data_v1beta.types.FilterExpression): - The filter clause of metrics. Applied at post - aggregation phase, similar to SQL having-clause. - Dimensions cannot be used in this filter. + The filter clause of metrics. Applied after + aggregating the report's rows, similar to SQL + having-clause. Dimensions cannot be used in this + filter. offset (int): The row count of the start row. The first row is counted as row 0. @@ -798,15 +799,12 @@ class RunRealtimeReportRequest(proto.Message): metrics (Sequence[google.analytics.data_v1beta.types.Metric]): The metrics requested and displayed. dimension_filter (google.analytics.data_v1beta.types.FilterExpression): - The filter clause of dimensions. Dimensions - must be requested to be used in this filter. - Metrics cannot be used in this filter. + The filter clause of dimensions. Metrics + cannot be used in this filter. metric_filter (google.analytics.data_v1beta.types.FilterExpression): The filter clause of metrics. Applied at post aggregation phase, similar to SQL having-clause. - Metrics must be requested to be used in this - filter. Dimensions cannot be used in this - filter. + Dimensions cannot be used in this filter. limit (int): The number of rows to return. If unspecified, 10,000 rows are returned. The API returns a maximum of 100,000 rows per diff --git a/google/analytics/data_v1beta/types/data.py b/google/analytics/data_v1beta/types/data.py index 25ea6e6..64b74b7 100644 --- a/google/analytics/data_v1beta/types/data.py +++ b/google/analytics/data_v1beta/types/data.py @@ -151,9 +151,9 @@ class MinuteRange(proto.Message): If unspecified, ``startMinutesAgo`` is defaulted to 29. Standard Analytics properties can request up to the last 30 - minutes of event data (``startMinutesAgo <= 29``), and - Google Analytics 360 properties can request up to the last - 60 minutes of event data (``startMinutesAgo <= 59``). + minutes of event data (``startMinutesAgo <= 29``), and 360 + Analytics properties can request up to the last 60 minutes + of event data (``startMinutesAgo <= 59``). This field is a member of `oneof`_ ``_start_minutes_ago``. end_minutes_ago (int): @@ -165,8 +165,8 @@ class MinuteRange(proto.Message): 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 - Google Analytics 360 properties can request any minute in - the last 60 minutes of event data (``endMinutesAgo <= 59``). + 360 Analytics properties can request any minute in the last + 60 minutes of event data (``endMinutesAgo <= 59``). This field is a member of `oneof`_ ``_end_minutes_ago``. name (str): @@ -198,8 +198,8 @@ 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 9 dimensions. + for example, the city could be "Paris" or "New York". Requests + are allowed up to 9 dimensions. Attributes: name (str): @@ -376,9 +376,9 @@ class Metric(proto.Message): class FilterExpression(proto.Message): - r"""To express dimension or metric filters. - The fields in the same FilterExpression need to be either all - dimensions or all metrics. + r"""To express dimension or metric filters. The fields in the + same FilterExpression need to be either all dimensions or all + metrics. This message has `oneof`_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. @@ -401,9 +401,10 @@ class FilterExpression(proto.Message): This field is a member of `oneof`_ ``expr``. filter (google.analytics.data_v1beta.types.Filter): - A primitive filter. - All fields in filter in same FilterExpression - needs to be either all dimensions or metrics. + A primitive filter. In the same + FilterExpression, all of the filter's field + names need to be either all dimensions or all + metrics. This field is a member of `oneof`_ ``expr``. """ @@ -461,8 +462,12 @@ class Filter(proto.Message): Attributes: field_name (str): - The dimension name or metric name. Must be a - name defined in dimensions or metrics. + The dimension name or metric name. + In most methods, dimensions & metrics can be + used for the first time in this field. However + in a RunPivotReportRequest, this field must be + additionally specified by name in the + RunPivotReportRequest's dimensions or metrics. string_filter (google.analytics.data_v1beta.types.Filter.StringFilter): Strings related filter. @@ -620,7 +625,10 @@ class BetweenFilter(proto.Message): class OrderBy(proto.Message): - r"""The sort options. + r"""Order bys define how rows will be sorted in the response. For + example, ordering rows by descending event count is one + ordering, and ordering rows by the event name string is a + different ordering. This message has `oneof`_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. @@ -1072,6 +1080,18 @@ class ResponseMetaData(proto.Message): empty for this reason. This field is a member of `oneof`_ ``_empty_reason``. + subject_to_thresholding (bool): + If ``subjectToThresholding`` is true, this report is subject + to thresholding and only returns data that meets the minimum + aggregation thresholds. It is possible for a request to be + subject to thresholding thresholding and no data is absent + from the report, and this happens when all data is above the + thresholds. To learn more, see `Data + thresholds `__ + and `About Demographics and + Interests `__. + + This field is a member of `oneof`_ ``_subject_to_thresholding``. """ class SchemaRestrictionResponse(proto.Message): @@ -1142,6 +1162,11 @@ class ActiveMetricRestriction(proto.Message): number=7, optional=True, ) + subject_to_thresholding = proto.Field( + proto.BOOL, + number=8, + optional=True, + ) class DimensionHeader(proto.Message): @@ -1373,8 +1398,8 @@ class PropertyQuota(proto.Message): 5,000 tokens per hour; Analytics 360 Properties can use 50,000 tokens per hour. An API request consumes a single number of tokens, and that - number is deducted from both the hourly and - daily quotas. + number is deducted from all of the hourly, + daily, and per project hourly quotas. concurrent_requests (google.analytics.data_v1beta.types.QuotaStatus): Standard Analytics Properties can send up to 10 concurrent requests; Analytics 360 Properties @@ -1392,6 +1417,16 @@ class PropertyQuota(proto.Message): request is individually counted for this quota if the request contains potentially thresholded dimensions. + tokens_per_project_per_hour (google.analytics.data_v1beta.types.QuotaStatus): + Analytics Properties can use up to 25% of + their tokens per project per hour. This amounts + to standard Analytics Properties can use up to + 1,250 tokens per project per hour, and Analytics + 360 Properties can use 12,500 tokens per project + per hour. An API request consumes a single + number of tokens, and that number is deducted + from all of the hourly, daily, and per project + hourly quotas. """ tokens_per_day = proto.Field( @@ -1419,6 +1454,11 @@ class PropertyQuota(proto.Message): number=5, message="QuotaStatus", ) + tokens_per_project_per_hour = proto.Field( + proto.MESSAGE, + number=6, + message="QuotaStatus", + ) class QuotaStatus(proto.Message):