diff --git a/google/analytics/data_v1beta/types/analytics_data_api.py b/google/analytics/data_v1beta/types/analytics_data_api.py index 8f8a10b..ca14a44 100644 --- a/google/analytics/data_v1beta/types/analytics_data_api.py +++ b/google/analytics/data_v1beta/types/analytics_data_api.py @@ -220,6 +220,11 @@ class RunReportResponse(proto.Message): property_quota (google.analytics.data_v1beta.types.PropertyQuota): This Analytics Property's quota state including this request. + kind (str): + Identifies what kind of resource this message is. This + ``kind`` is always the fixed string + "analyticsData#runReport". Useful to distinguish between + response types in JSON. """ dimension_headers = proto.RepeatedField( @@ -244,6 +249,8 @@ class RunReportResponse(proto.Message): property_quota = proto.Field(proto.MESSAGE, number=9, message=data.PropertyQuota,) + kind = proto.Field(proto.STRING, number=10) + class RunPivotReportRequest(proto.Message): r"""The request to generate a pivot report. @@ -405,6 +412,11 @@ class RunPivotReportResponse(proto.Message): property_quota (google.analytics.data_v1beta.types.PropertyQuota): This Analytics Property's quota state including this request. + kind (str): + Identifies what kind of resource this message is. This + ``kind`` is always the fixed string + "analyticsData#runPivotReport". Useful to distinguish + between response types in JSON. """ pivot_headers = proto.RepeatedField( @@ -427,6 +439,8 @@ class RunPivotReportResponse(proto.Message): property_quota = proto.Field(proto.MESSAGE, number=7, message=data.PropertyQuota,) + kind = proto.Field(proto.STRING, number=8) + class BatchRunReportsRequest(proto.Message): r"""The batch request containing multiple report requests. @@ -460,10 +474,17 @@ class BatchRunReportsResponse(proto.Message): reports (Sequence[google.analytics.data_v1beta.types.RunReportResponse]): Individual responses. Each response has a separate report request. + kind (str): + Identifies what kind of resource this message is. This + ``kind`` is always the fixed string + "analyticsData#batchRunReports". Useful to distinguish + between response types in JSON. """ reports = proto.RepeatedField(proto.MESSAGE, number=1, message="RunReportResponse",) + kind = proto.Field(proto.STRING, number=2) + class BatchRunPivotReportsRequest(proto.Message): r"""The batch request containing multiple pivot report requests. @@ -499,12 +520,19 @@ class BatchRunPivotReportsResponse(proto.Message): pivot_reports (Sequence[google.analytics.data_v1beta.types.RunPivotReportResponse]): Individual responses. Each response has a separate pivot report request. + kind (str): + Identifies what kind of resource this message is. This + ``kind`` is always the fixed string + "analyticsData#batchRunPivotReports". Useful to distinguish + between response types in JSON. """ pivot_reports = proto.RepeatedField( proto.MESSAGE, number=1, message="RunPivotReportResponse", ) + kind = proto.Field(proto.STRING, number=2) + class GetMetadataRequest(proto.Message): r"""Request for a property's dimension and metric metadata. @@ -634,6 +662,11 @@ class RunRealtimeReportResponse(proto.Message): property_quota (google.analytics.data_v1beta.types.PropertyQuota): This Analytics Property's Realtime quota state including this request. + kind (str): + Identifies what kind of resource this message is. This + ``kind`` is always the fixed string + "analyticsData#runRealtimeReport". Useful to distinguish + between response types in JSON. """ dimension_headers = proto.RepeatedField( @@ -656,5 +689,7 @@ class RunRealtimeReportResponse(proto.Message): property_quota = proto.Field(proto.MESSAGE, number=8, message=data.PropertyQuota,) + kind = proto.Field(proto.STRING, number=9) + __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/analytics/data_v1beta/types/data.py b/google/analytics/data_v1beta/types/data.py index 1f0fa19..c2c3313 100644 --- a/google/analytics/data_v1beta/types/data.py +++ b/google/analytics/data_v1beta/types/data.py @@ -562,9 +562,8 @@ class Pivot(proto.Message): is counted as row 0. limit (int): The number of unique combinations of dimension values to - return in this pivot. If unspecified, up to 10,000 unique - combinations of dimension values are returned. ``limit`` - must be positive. + return in this pivot. The ``limit`` parameter is required. A + ``limit`` of 10,000 is common for single pivot requests. The product of the ``limit`` for each ``pivot`` in a ``RunPivotReportRequest`` must not exceed 100,000. For @@ -955,6 +954,13 @@ class PropertyQuota(proto.Message): per hour; Analytics 360 Properties and cloud project pairs can have up to 50 server errors per hour. + potentially_thresholded_requests_per_hour (google.analytics.data_v1beta.types.QuotaStatus): + Analytics Properties can send up to 120 + requests with potentially thresholded dimensions + per hour. In a batch request, each report + request is individually counted for this quota + if the request contains potentially thresholded + dimensions. """ tokens_per_day = proto.Field(proto.MESSAGE, number=1, message="QuotaStatus",) @@ -967,6 +973,10 @@ class PropertyQuota(proto.Message): proto.MESSAGE, number=4, message="QuotaStatus", ) + potentially_thresholded_requests_per_hour = proto.Field( + proto.MESSAGE, number=5, message="QuotaStatus", + ) + class QuotaStatus(proto.Message): r"""Current state for a particular quota group. diff --git a/synth.metadata b/synth.metadata index 78be853..1729cec 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/python-analytics-data.git", - "sha": "ad51cf28f6c3e306780ca48eb26299b4158068ad" + "sha": "1c1d58f1ee88e50ce92c40b0ec58c19cec631297" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "149a3a84c29c9b8189576c7442ccb6dcf6a8f95b", - "internalRef": "364411656" + "sha": "95dd24960cf9f794ef583e59ad9f1fabe1c4a924", + "internalRef": "365882072" } }, { diff --git a/tests/unit/gapic/data_v1beta/test_beta_analytics_data.py b/tests/unit/gapic/data_v1beta/test_beta_analytics_data.py index 810069d..4a75e3e 100644 --- a/tests/unit/gapic/data_v1beta/test_beta_analytics_data.py +++ b/tests/unit/gapic/data_v1beta/test_beta_analytics_data.py @@ -471,7 +471,9 @@ def test_run_report( # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.run_report), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = analytics_data_api.RunReportResponse(row_count=992,) + call.return_value = analytics_data_api.RunReportResponse( + row_count=992, kind="kind_value", + ) response = client.run_report(request) @@ -487,6 +489,8 @@ def test_run_report( assert response.row_count == 992 + assert response.kind == "kind_value" + def test_run_report_from_dict(): test_run_report(request_type=dict) @@ -524,7 +528,7 @@ async def test_run_report_async( with mock.patch.object(type(client.transport.run_report), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - analytics_data_api.RunReportResponse(row_count=992,) + analytics_data_api.RunReportResponse(row_count=992, kind="kind_value",) ) response = await client.run_report(request) @@ -540,6 +544,8 @@ async def test_run_report_async( assert response.row_count == 992 + assert response.kind == "kind_value" + @pytest.mark.asyncio async def test_run_report_async_from_dict(): @@ -613,7 +619,9 @@ def test_run_pivot_report( # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.run_pivot_report), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = analytics_data_api.RunPivotReportResponse() + call.return_value = analytics_data_api.RunPivotReportResponse( + kind="kind_value", + ) response = client.run_pivot_report(request) @@ -627,6 +635,8 @@ def test_run_pivot_report( assert isinstance(response, analytics_data_api.RunPivotReportResponse) + assert response.kind == "kind_value" + def test_run_pivot_report_from_dict(): test_run_pivot_report(request_type=dict) @@ -665,7 +675,7 @@ async def test_run_pivot_report_async( with mock.patch.object(type(client.transport.run_pivot_report), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - analytics_data_api.RunPivotReportResponse() + analytics_data_api.RunPivotReportResponse(kind="kind_value",) ) response = await client.run_pivot_report(request) @@ -679,6 +689,8 @@ async def test_run_pivot_report_async( # Establish that the response is the type that we expect. assert isinstance(response, analytics_data_api.RunPivotReportResponse) + assert response.kind == "kind_value" + @pytest.mark.asyncio async def test_run_pivot_report_async_from_dict(): @@ -754,7 +766,9 @@ def test_batch_run_reports( type(client.transport.batch_run_reports), "__call__" ) as call: # Designate an appropriate return value for the call. - call.return_value = analytics_data_api.BatchRunReportsResponse() + call.return_value = analytics_data_api.BatchRunReportsResponse( + kind="kind_value", + ) response = client.batch_run_reports(request) @@ -768,6 +782,8 @@ def test_batch_run_reports( assert isinstance(response, analytics_data_api.BatchRunReportsResponse) + assert response.kind == "kind_value" + def test_batch_run_reports_from_dict(): test_batch_run_reports(request_type=dict) @@ -810,7 +826,7 @@ async def test_batch_run_reports_async( ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - analytics_data_api.BatchRunReportsResponse() + analytics_data_api.BatchRunReportsResponse(kind="kind_value",) ) response = await client.batch_run_reports(request) @@ -824,6 +840,8 @@ async def test_batch_run_reports_async( # Establish that the response is the type that we expect. assert isinstance(response, analytics_data_api.BatchRunReportsResponse) + assert response.kind == "kind_value" + @pytest.mark.asyncio async def test_batch_run_reports_async_from_dict(): @@ -903,7 +921,9 @@ def test_batch_run_pivot_reports( type(client.transport.batch_run_pivot_reports), "__call__" ) as call: # Designate an appropriate return value for the call. - call.return_value = analytics_data_api.BatchRunPivotReportsResponse() + call.return_value = analytics_data_api.BatchRunPivotReportsResponse( + kind="kind_value", + ) response = client.batch_run_pivot_reports(request) @@ -917,6 +937,8 @@ def test_batch_run_pivot_reports( assert isinstance(response, analytics_data_api.BatchRunPivotReportsResponse) + assert response.kind == "kind_value" + def test_batch_run_pivot_reports_from_dict(): test_batch_run_pivot_reports(request_type=dict) @@ -959,7 +981,7 @@ async def test_batch_run_pivot_reports_async( ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - analytics_data_api.BatchRunPivotReportsResponse() + analytics_data_api.BatchRunPivotReportsResponse(kind="kind_value",) ) response = await client.batch_run_pivot_reports(request) @@ -973,6 +995,8 @@ async def test_batch_run_pivot_reports_async( # Establish that the response is the type that we expect. assert isinstance(response, analytics_data_api.BatchRunPivotReportsResponse) + assert response.kind == "kind_value" + @pytest.mark.asyncio async def test_batch_run_pivot_reports_async_from_dict(): @@ -1265,7 +1289,9 @@ def test_run_realtime_report( type(client.transport.run_realtime_report), "__call__" ) as call: # Designate an appropriate return value for the call. - call.return_value = analytics_data_api.RunRealtimeReportResponse(row_count=992,) + call.return_value = analytics_data_api.RunRealtimeReportResponse( + row_count=992, kind="kind_value", + ) response = client.run_realtime_report(request) @@ -1281,6 +1307,8 @@ def test_run_realtime_report( assert response.row_count == 992 + assert response.kind == "kind_value" + def test_run_realtime_report_from_dict(): test_run_realtime_report(request_type=dict) @@ -1323,7 +1351,9 @@ async def test_run_realtime_report_async( ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - analytics_data_api.RunRealtimeReportResponse(row_count=992,) + analytics_data_api.RunRealtimeReportResponse( + row_count=992, kind="kind_value", + ) ) response = await client.run_realtime_report(request) @@ -1339,6 +1369,8 @@ async def test_run_realtime_report_async( assert response.row_count == 992 + assert response.kind == "kind_value" + @pytest.mark.asyncio async def test_run_realtime_report_async_from_dict():