From 39cde776f312662bb8a73e65256b2870cb580d71 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Wed, 31 Mar 2021 05:48:07 -0700 Subject: [PATCH 1/3] changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. --- google-analytics-data-v1beta-py.tar.gz | 0 synth.metadata | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 google-analytics-data-v1beta-py.tar.gz diff --git a/google-analytics-data-v1beta-py.tar.gz b/google-analytics-data-v1beta-py.tar.gz new file mode 100644 index 0000000..e69de29 diff --git a/synth.metadata b/synth.metadata index 78be853..30e6b56 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/python-analytics-data.git", - "sha": "ad51cf28f6c3e306780ca48eb26299b4158068ad" + "sha": "1c1d58f1ee88e50ce92c40b0ec58c19cec631297" } }, { @@ -117,6 +117,7 @@ "docs/data_v1beta/services.rst", "docs/data_v1beta/types.rst", "docs/multiprocessing.rst", + "google-analytics-data-v1beta-py.tar.gz", "google/analytics/data/__init__.py", "google/analytics/data/py.typed", "google/analytics/data_v1alpha/__init__.py", From 54cd80912f781a80d9d95f09686b4dbbf1d52178 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Wed, 31 Mar 2021 05:49:28 -0700 Subject: [PATCH 2/3] chore(python): add kokoro configs for periodic builds against head This change should be non-destructive. Note for library repo maintainers: After applying this change, you can easily add (or change) periodic builds against head by adding config files in google3. See python-pubsub repo for example. Source-Author: Takashi Matsuo Source-Date: Fri Mar 19 11:17:59 2021 -0700 Source-Repo: googleapis/synthtool Source-Sha: 79c8dd7ee768292f933012d3a69a5b4676404cda Source-Link: https://github.com/googleapis/synthtool/commit/79c8dd7ee768292f933012d3a69a5b4676404cda --- google-analytics-data-v1beta-py.tar.gz | 0 synth.metadata | 1 - 2 files changed, 1 deletion(-) delete mode 100644 google-analytics-data-v1beta-py.tar.gz diff --git a/google-analytics-data-v1beta-py.tar.gz b/google-analytics-data-v1beta-py.tar.gz deleted file mode 100644 index e69de29..0000000 diff --git a/synth.metadata b/synth.metadata index 30e6b56..b369731 100644 --- a/synth.metadata +++ b/synth.metadata @@ -117,7 +117,6 @@ "docs/data_v1beta/services.rst", "docs/data_v1beta/types.rst", "docs/multiprocessing.rst", - "google-analytics-data-v1beta-py.tar.gz", "google/analytics/data/__init__.py", "google/analytics/data/py.typed", "google/analytics/data_v1alpha/__init__.py", From 46dfa9b704837620d7c1f5f4c7baba5785b28763 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Wed, 31 Mar 2021 05:50:38 -0700 Subject: [PATCH 3/3] feat: add `kind` field which is used to distinguish between response types feat: add `potentially_thresholded_requests_per_hour` field to `PropertyQuota` PiperOrigin-RevId: 365882072 Source-Author: Google APIs Source-Date: Tue Mar 30 13:17:13 2021 -0700 Source-Repo: googleapis/googleapis Source-Sha: 95dd24960cf9f794ef583e59ad9f1fabe1c4a924 Source-Link: https://github.com/googleapis/googleapis/commit/95dd24960cf9f794ef583e59ad9f1fabe1c4a924 --- .../data_v1beta/types/analytics_data_api.py | 35 +++++++++++++ google/analytics/data_v1beta/types/data.py | 16 ++++-- synth.metadata | 4 +- .../data_v1beta/test_beta_analytics_data.py | 52 +++++++++++++++---- 4 files changed, 92 insertions(+), 15 deletions(-) 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 b369731..1729cec 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,8 +11,8 @@ "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():