From 6f9965c9203218d1a1e5eac5c05428db765b77a6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 2 Nov 2021 15:37:26 +0100 Subject: [PATCH 01/21] chore(deps): update dependency google-analytics-data to v0.10.0 (#160) --- samples/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index eac014f..4321b45 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-analytics-data==0.9.0 +google-analytics-data==0.10.0 google-auth-oauthlib==0.4.6 \ No newline at end of file From 7230ad1e566f4a50f8a02fd16f11e882454727f7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 9 Nov 2021 18:26:07 -0500 Subject: [PATCH 02/21] chore: use gapic-generator-python 0.56.2 (#162) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update Java and Python dependencies PiperOrigin-RevId: 408420890 Source-Link: https://github.com/googleapis/googleapis/commit/2921f9fb3bfbd16f6b2da0104373e2b47a80a65e Source-Link: https://github.com/googleapis/googleapis-gen/commit/6598ca8cbbf5226733a099c4506518a5af6ff74c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjU5OGNhOGNiYmY1MjI2NzMzYTA5OWM0NTA2NTE4YTVhZjZmZjc0YyJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../beta_analytics_data/async_client.py | 13 +++++---- .../services/beta_analytics_data/client.py | 25 +++++++++++----- .../beta_analytics_data/transports/base.py | 8 ++--- .../beta_analytics_data/transports/grpc.py | 4 +-- .../transports/grpc_asyncio.py | 4 +-- google/analytics/data_v1beta/types/data.py | 29 +++++++++++++++++++ .../data_v1beta/test_beta_analytics_data.py | 8 +++-- 7 files changed, 68 insertions(+), 23 deletions(-) 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 d5ac261..bc899f2 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 @@ -19,14 +19,17 @@ from typing import Dict, Sequence, Tuple, Type, Union import pkg_resources -from google.api_core.client_options import ClientOptions # type: ignore -from google.api_core import exceptions as core_exceptions # type: ignore -from google.api_core import gapic_v1 # type: ignore -from google.api_core import retry as retries # type: ignore +from google.api_core.client_options import ClientOptions +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -OptionalRetry = Union[retries.Retry, object] +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object] # type: ignore from google.analytics.data_v1beta.types import analytics_data_api from google.analytics.data_v1beta.types import data 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 6225f61..40f68a0 100644 --- a/google/analytics/data_v1beta/services/beta_analytics_data/client.py +++ b/google/analytics/data_v1beta/services/beta_analytics_data/client.py @@ -14,23 +14,25 @@ # limitations under the License. # from collections import OrderedDict -from distutils import util import os import re from typing import Dict, Optional, Sequence, Tuple, Type, Union import pkg_resources -from google.api_core import client_options as client_options_lib # type: ignore -from google.api_core import exceptions as core_exceptions # type: ignore -from google.api_core import gapic_v1 # type: ignore -from google.api_core import retry as retries # type: ignore +from google.api_core import client_options as client_options_lib +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore -OptionalRetry = Union[retries.Retry, object] +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object] # type: ignore from google.analytics.data_v1beta.types import analytics_data_api from google.analytics.data_v1beta.types import data @@ -280,8 +282,15 @@ def __init__( client_options = client_options_lib.ClientOptions() # Create SSL credentials for mutual TLS if needed. - use_client_cert = bool( - util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false")) + if os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") not in ( + "true", + "false", + ): + raise ValueError( + "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + use_client_cert = ( + os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true" ) client_cert_source_func = None 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 656959f..e17c437 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 @@ -18,10 +18,10 @@ import pkg_resources import google.auth # type: ignore -import google.api_core # type: ignore -from google.api_core import exceptions as core_exceptions # type: ignore -from google.api_core import gapic_v1 # type: ignore -from google.api_core import retry as retries # type: ignore +import google.api_core +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore 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 fe7c668..35e1ebd 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 @@ -16,8 +16,8 @@ import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union -from google.api_core import grpc_helpers # type: ignore -from google.api_core import gapic_v1 # type: ignore +from google.api_core import grpc_helpers +from google.api_core import gapic_v1 import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore 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 edcedcf..27dd2cd 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 @@ -16,8 +16,8 @@ import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union -from google.api_core import gapic_v1 # type: ignore -from google.api_core import grpc_helpers_async # type: ignore +from google.api_core import gapic_v1 +from google.api_core import grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore diff --git a/google/analytics/data_v1beta/types/data.py b/google/analytics/data_v1beta/types/data.py index 5d89f8c..19e8ddd 100644 --- a/google/analytics/data_v1beta/types/data.py +++ b/google/analytics/data_v1beta/types/data.py @@ -145,6 +145,7 @@ class MinuteRange(proto.Message): 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): The inclusive end minute for the query as a number of @@ -157,6 +158,7 @@ class MinuteRange(proto.Message): 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``). + This field is a member of `oneof`_ ``_end_minutes_ago``. name (str): Assigns a name to this minute range. The dimension @@ -226,15 +228,18 @@ class DimensionExpression(proto.Message): lower_case (google.analytics.data_v1beta.types.DimensionExpression.CaseExpression): Used to convert a dimension value to lower case. + This field is a member of `oneof`_ ``one_expression``. upper_case (google.analytics.data_v1beta.types.DimensionExpression.CaseExpression): Used to convert a dimension value to upper case. + This field is a member of `oneof`_ ``one_expression``. concatenate (google.analytics.data_v1beta.types.DimensionExpression.ConcatenateExpression): Used to combine dimension values to a single dimension. For example, dimension "country, city": concatenate(country, ", ", city). + This field is a member of `oneof`_ ``one_expression``. """ @@ -333,17 +338,21 @@ class FilterExpression(proto.Message): Attributes: and_group (google.analytics.data_v1beta.types.FilterExpressionList): The FilterExpressions in and_group have an AND relationship. + This field is a member of `oneof`_ ``expr``. or_group (google.analytics.data_v1beta.types.FilterExpressionList): The FilterExpressions in or_group have an OR relationship. + This field is a member of `oneof`_ ``expr``. not_expression (google.analytics.data_v1beta.types.FilterExpression): The FilterExpression is NOT of not_expression. + 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. + This field is a member of `oneof`_ ``expr``. """ @@ -388,15 +397,19 @@ class Filter(proto.Message): name defined in dimensions or metrics. string_filter (google.analytics.data_v1beta.types.Filter.StringFilter): Strings related filter. + This field is a member of `oneof`_ ``one_filter``. in_list_filter (google.analytics.data_v1beta.types.Filter.InListFilter): A filter for in list values. + This field is a member of `oneof`_ ``one_filter``. numeric_filter (google.analytics.data_v1beta.types.Filter.NumericFilter): A filter for numeric or date values. + This field is a member of `oneof`_ ``one_filter``. between_filter (google.analytics.data_v1beta.types.Filter.BetweenFilter): A filter for two values. + This field is a member of `oneof`_ ``one_filter``. """ @@ -508,13 +521,16 @@ class OrderBy(proto.Message): Attributes: metric (google.analytics.data_v1beta.types.OrderBy.MetricOrderBy): Sorts results by a metric's values. + This field is a member of `oneof`_ ``one_order_by``. dimension (google.analytics.data_v1beta.types.OrderBy.DimensionOrderBy): Sorts results by a dimension's values. + This field is a member of `oneof`_ ``one_order_by``. pivot (google.analytics.data_v1beta.types.OrderBy.PivotOrderBy): Sorts results by a metric's values within a pivot column group. + This field is a member of `oneof`_ ``one_order_by``. desc (bool): If true, sorts by descending order. @@ -836,6 +852,7 @@ class ResponseMetaData(proto.Message): creating this report. To learn more, see `Access and data-restriction management `__. + This field is a member of `oneof`_ ``_schema_restriction_response``. currency_code (str): The currency code used in this report. Intended to be used @@ -850,6 +867,7 @@ class ResponseMetaData(proto.Message): (https://en.wikipedia.org/wiki/ISO_4217); for example "USD", "EUR", "JPY". To learn more, see https://support.google.com/analytics/answer/9796179. + This field is a member of `oneof`_ ``_currency_code``. time_zone (str): The property's current timezone. Intended to be used to @@ -857,10 +875,12 @@ class ResponseMetaData(proto.Message): ``minute``. Formatted as strings from the IANA Time Zone database (https://www.iana.org/time-zones); for example "America/New_York" or "Asia/Tokyo". + This field is a member of `oneof`_ ``_time_zone``. empty_reason (str): If empty reason is specified, the report is empty for this reason. + This field is a member of `oneof`_ ``_empty_reason``. """ @@ -884,6 +904,7 @@ class ActiveMetricRestriction(proto.Message): Attributes: metric_name (str): The name of the restricted metric. + This field is a member of `oneof`_ ``_metric_name``. restricted_metric_types (Sequence[google.analytics.data_v1beta.types.RestrictedMetricType]): The reason for this metric's restriction. @@ -1036,6 +1057,7 @@ class DimensionValue(proto.Message): value (str): Value as a string if the dimension type is a string. + This field is a member of `oneof`_ ``one_value``. """ @@ -1050,6 +1072,7 @@ class MetricValue(proto.Message): Attributes: value (str): Measurement value. See MetricHeader for type. + This field is a member of `oneof`_ ``one_value``. """ @@ -1069,9 +1092,11 @@ class NumericValue(proto.Message): Attributes: int64_value (int): Integer value + This field is a member of `oneof`_ ``one_value``. double_value (float): Double value + This field is a member of `oneof`_ ``one_value``. """ @@ -1249,11 +1274,13 @@ class DimensionCompatibility(proto.Message): for this compatibility information. The dimension metadata also contains other helpful information like the UI name and description. + This field is a member of `oneof`_ ``_dimension_metadata``. compatibility (google.analytics.data_v1beta.types.Compatibility): The compatibility of this dimension. If the compatibility is COMPATIBLE, this dimension can be successfully added to the report. + This field is a member of `oneof`_ ``_compatibility``. """ @@ -1274,11 +1301,13 @@ class MetricCompatibility(proto.Message): this compatibility information. The metric metadata also contains other helpful information like the UI name and description. + This field is a member of `oneof`_ ``_metric_metadata``. compatibility (google.analytics.data_v1beta.types.Compatibility): The compatibility of this metric. If the compatibility is COMPATIBLE, this metric can be successfully added to the report. + This field is a member of `oneof`_ ``_compatibility``. """ 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 e52e083..48754ad 100644 --- a/tests/unit/gapic/data_v1beta/test_beta_analytics_data.py +++ b/tests/unit/gapic/data_v1beta/test_beta_analytics_data.py @@ -1210,7 +1210,9 @@ def test_get_metadata_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val def test_get_metadata_flattened_error(): @@ -1246,7 +1248,9 @@ async def test_get_metadata_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val @pytest.mark.asyncio From 6583d1d3c54ee1bc0edeec835a0d0d2319c13d9e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 11 Nov 2021 13:13:41 -0500 Subject: [PATCH 03/21] chore(python): add .github/CODEOWNERS as a templated file (#164) Source-Link: https://github.com/googleapis/synthtool/commit/c5026b3217973a8db55db8ee85feee0e9a65e295 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:0e18b9475fbeb12d9ad4302283171edebb6baf2dfca1bd215ee3b34ed79d95d7 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .github/CODEOWNERS | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 108063d..7519fa3 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:4ee57a76a176ede9087c14330c625a71553cf9c72828b2c0ca12f5338171ba60 + digest: sha256:0e18b9475fbeb12d9ad4302283171edebb6baf2dfca1bd215ee3b34ed79d95d7 diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 30c3973..44cc868 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,9 +3,10 @@ # # For syntax help see: # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax +# Note: This file is autogenerated. To make changes to the codeowner team, please update .repo-metadata.json. -# The @googleapis/yoshi-python is the default owner for changes in this repo -* @googleapis/yoshi-python +# @googleapis/yoshi-python is the default owner for changes in this repo +* @googleapis/yoshi-python -# The python-samples-reviewers team is the default owner for samples changes -/samples/ @googleapis/python-samples-owners \ No newline at end of file +# @googleapis/python-samples-owners is the default owner for samples changes +/samples/ @googleapis/python-samples-owners From 9f0c9ddb048a964cd67c327a84adce0109b86b67 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Tue, 28 Dec 2021 13:33:09 -0500 Subject: [PATCH 04/21] chore: add api_shortname to repo-metadata.json (#170) * chore: update .repo-metadata.json * revert --- .repo-metadata.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.repo-metadata.json b/.repo-metadata.json index eb44809..aacff7a 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -4,7 +4,7 @@ "product_documentation": "https://developers.google.com/analytics/", "client_documentation": "https://googleapis.dev/python/analyticsdata/latest", "issue_tracker": "https://issuetracker.google.com/issues?q=componentid:187400%2B%20", - "release_level": "beta", + "release_level": "preview", "language": "python", "library_type": "GAPIC_AUTO", "repo": "googleapis/python-analytics-data", @@ -12,5 +12,6 @@ "api_id": "analyticsdata.googleapis.com", "requires_billing": true, "default_version": "v1beta", - "codeowner_team": "" + "codeowner_team": "", + "api_shortname": "analyticsdata" } From 4905a085b63e50d40effd3ff996e2fb16bb83db6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:00:35 +0000 Subject: [PATCH 05/21] chore: use python-samples-reviewers (#172) --- .github/.OwlBot.lock.yaml | 2 +- .github/CODEOWNERS | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 7519fa3..f33299d 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:0e18b9475fbeb12d9ad4302283171edebb6baf2dfca1bd215ee3b34ed79d95d7 + digest: sha256:899d5d7cc340fa8ef9d8ae1a8cfba362c6898584f779e156f25ee828ba824610 diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 44cc868..e446644 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -8,5 +8,5 @@ # @googleapis/yoshi-python is the default owner for changes in this repo * @googleapis/yoshi-python -# @googleapis/python-samples-owners is the default owner for samples changes -/samples/ @googleapis/python-samples-owners +# @googleapis/python-samples-reviewers is the default owner for samples changes +/samples/ @googleapis/python-samples-reviewers From d10cd7cd82b8d08526f13cffb72d07e8883c3a0f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 7 Jan 2022 13:51:05 -0500 Subject: [PATCH 06/21] chore: use gapic-generator-python 0.58.4 (#171) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-python 0.58.4 fix: provide appropriate mock values for message body fields committer: dovs PiperOrigin-RevId: 419025932 Source-Link: https://github.com/googleapis/googleapis/commit/73da6697f598f1ba30618924936a59f8e457ec89 Source-Link: https://github.com/googleapis/googleapis-gen/commit/46df624a54b9ed47c1a7eefb7a49413cf7b82f98 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDZkZjYyNGE1NGI5ZWQ0N2MxYTdlZWZiN2E0OTQxM2NmN2I4MmY5OCJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- .../beta_analytics_data/transports/base.py | 1 - .../data_v1beta/test_beta_analytics_data.py | 87 +++++++------------ 2 files changed, 31 insertions(+), 57 deletions(-) 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 e17c437..63f81ed 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 @@ -102,7 +102,6 @@ def __init__( credentials, _ = google.auth.load_credentials_from_file( credentials_file, **scopes_kwargs, quota_project_id=quota_project_id ) - elif credentials is None: credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id 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 48754ad..8099bc2 100644 --- a/tests/unit/gapic/data_v1beta/test_beta_analytics_data.py +++ b/tests/unit/gapic/data_v1beta/test_beta_analytics_data.py @@ -251,20 +251,20 @@ def test_beta_analytics_data_client_client_options( # unsupported value. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): with pytest.raises(MutualTLSChannelError): - client = client_class() + client = client_class(transport=transport_name) # Check the case GOOGLE_API_USE_CLIENT_CERTIFICATE has unsupported value. with mock.patch.dict( os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} ): with pytest.raises(ValueError): - client = client_class() + client = client_class(transport=transport_name) # Check the case quota_project_id is provided options = client_options.ClientOptions(quota_project_id="octopus") with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(transport=transport_name, client_options=options) + client = client_class(client_options=options, transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -333,7 +333,7 @@ def test_beta_analytics_data_client_mtls_env_auto( ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(transport=transport_name, client_options=options) + client = client_class(client_options=options, transport=transport_name) if use_client_cert_env == "false": expected_client_cert_source = None @@ -428,7 +428,7 @@ def test_beta_analytics_data_client_client_options_scopes( options = client_options.ClientOptions(scopes=["1", "2"],) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(transport=transport_name, client_options=options) + client = client_class(client_options=options, transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -459,7 +459,7 @@ def test_beta_analytics_data_client_client_options_credentials_file( options = client_options.ClientOptions(credentials_file="credentials.json") with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(transport=transport_name, client_options=options) + client = client_class(client_options=options, transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file="credentials.json", @@ -492,9 +492,8 @@ def test_beta_analytics_data_client_client_options_from_dict(): ) -def test_run_report( - transport: str = "grpc", request_type=analytics_data_api.RunReportRequest -): +@pytest.mark.parametrize("request_type", [analytics_data_api.RunReportRequest, dict,]) +def test_run_report(request_type, transport: str = "grpc"): client = BetaAnalyticsDataClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -522,10 +521,6 @@ def test_run_report( assert response.kind == "kind_value" -def test_run_report_from_dict(): - test_run_report(request_type=dict) - - def test_run_report_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -630,9 +625,10 @@ async def test_run_report_field_headers_async(): assert ("x-goog-request-params", "property=property/value",) in kw["metadata"] -def test_run_pivot_report( - transport: str = "grpc", request_type=analytics_data_api.RunPivotReportRequest -): +@pytest.mark.parametrize( + "request_type", [analytics_data_api.RunPivotReportRequest, dict,] +) +def test_run_pivot_report(request_type, transport: str = "grpc"): client = BetaAnalyticsDataClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -659,10 +655,6 @@ def test_run_pivot_report( assert response.kind == "kind_value" -def test_run_pivot_report_from_dict(): - test_run_pivot_report(request_type=dict) - - def test_run_pivot_report_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -767,9 +759,10 @@ async def test_run_pivot_report_field_headers_async(): assert ("x-goog-request-params", "property=property/value",) in kw["metadata"] -def test_batch_run_reports( - transport: str = "grpc", request_type=analytics_data_api.BatchRunReportsRequest -): +@pytest.mark.parametrize( + "request_type", [analytics_data_api.BatchRunReportsRequest, dict,] +) +def test_batch_run_reports(request_type, transport: str = "grpc"): client = BetaAnalyticsDataClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -798,10 +791,6 @@ def test_batch_run_reports( assert response.kind == "kind_value" -def test_batch_run_reports_from_dict(): - test_batch_run_reports(request_type=dict) - - def test_batch_run_reports_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -914,9 +903,10 @@ async def test_batch_run_reports_field_headers_async(): assert ("x-goog-request-params", "property=property/value",) in kw["metadata"] -def test_batch_run_pivot_reports( - transport: str = "grpc", request_type=analytics_data_api.BatchRunPivotReportsRequest -): +@pytest.mark.parametrize( + "request_type", [analytics_data_api.BatchRunPivotReportsRequest, dict,] +) +def test_batch_run_pivot_reports(request_type, transport: str = "grpc"): client = BetaAnalyticsDataClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -945,10 +935,6 @@ def test_batch_run_pivot_reports( assert response.kind == "kind_value" -def test_batch_run_pivot_reports_from_dict(): - test_batch_run_pivot_reports(request_type=dict) - - def test_batch_run_pivot_reports_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -1061,9 +1047,8 @@ async def test_batch_run_pivot_reports_field_headers_async(): assert ("x-goog-request-params", "property=property/value",) in kw["metadata"] -def test_get_metadata( - transport: str = "grpc", request_type=analytics_data_api.GetMetadataRequest -): +@pytest.mark.parametrize("request_type", [analytics_data_api.GetMetadataRequest, dict,]) +def test_get_metadata(request_type, transport: str = "grpc"): client = BetaAnalyticsDataClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1088,10 +1073,6 @@ def test_get_metadata( assert response.name == "name_value" -def test_get_metadata_from_dict(): - test_get_metadata(request_type=dict) - - def test_get_metadata_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -1267,9 +1248,10 @@ async def test_get_metadata_flattened_error_async(): ) -def test_run_realtime_report( - transport: str = "grpc", request_type=analytics_data_api.RunRealtimeReportRequest -): +@pytest.mark.parametrize( + "request_type", [analytics_data_api.RunRealtimeReportRequest, dict,] +) +def test_run_realtime_report(request_type, transport: str = "grpc"): client = BetaAnalyticsDataClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1299,10 +1281,6 @@ def test_run_realtime_report( assert response.kind == "kind_value" -def test_run_realtime_report_from_dict(): - test_run_realtime_report(request_type=dict) - - def test_run_realtime_report_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -1418,9 +1396,10 @@ async def test_run_realtime_report_field_headers_async(): assert ("x-goog-request-params", "property=property/value",) in kw["metadata"] -def test_check_compatibility( - transport: str = "grpc", request_type=analytics_data_api.CheckCompatibilityRequest -): +@pytest.mark.parametrize( + "request_type", [analytics_data_api.CheckCompatibilityRequest, dict,] +) +def test_check_compatibility(request_type, transport: str = "grpc"): client = BetaAnalyticsDataClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1446,10 +1425,6 @@ def test_check_compatibility( assert isinstance(response, analytics_data_api.CheckCompatibilityResponse) -def test_check_compatibility_from_dict(): - test_check_compatibility(request_type=dict) - - def test_check_compatibility_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2089,7 +2064,7 @@ def test_parse_common_location_path(): assert expected == actual -def test_client_withDEFAULT_CLIENT_INFO(): +def test_client_with_default_client_info(): client_info = gapic_v1.client_info.ClientInfo() with mock.patch.object( From 5739635d584fea15e2b8b0e0ddcdb5a5434f4b1a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 Jan 2022 07:31:52 -0500 Subject: [PATCH 07/21] chore(samples): Add check for tests in directory (#174) Source-Link: https://github.com/googleapis/synthtool/commit/52aef91f8d25223d9dbdb4aebd94ba8eea2101f3 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:36a95b8f494e4674dc9eee9af98961293b51b86b3649942aac800ae6c1f796d4 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- samples/snippets/noxfile.py | 70 +++++++++++++++++++++---------------- 2 files changed, 40 insertions(+), 32 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index f33299d..6b8a73b 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:899d5d7cc340fa8ef9d8ae1a8cfba362c6898584f779e156f25ee828ba824610 + digest: sha256:36a95b8f494e4674dc9eee9af98961293b51b86b3649942aac800ae6c1f796d4 diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py index 93a9122..3bbef5d 100644 --- a/samples/snippets/noxfile.py +++ b/samples/snippets/noxfile.py @@ -14,6 +14,7 @@ from __future__ import print_function +import glob import os from pathlib import Path import sys @@ -184,37 +185,44 @@ def blacken(session: nox.sessions.Session) -> None: def _session_tests( session: nox.sessions.Session, post_install: Callable = None ) -> None: - if TEST_CONFIG["pip_version_override"]: - pip_version = TEST_CONFIG["pip_version_override"] - session.install(f"pip=={pip_version}") - """Runs py.test for a particular project.""" - if os.path.exists("requirements.txt"): - if os.path.exists("constraints.txt"): - session.install("-r", "requirements.txt", "-c", "constraints.txt") - else: - session.install("-r", "requirements.txt") - - if os.path.exists("requirements-test.txt"): - if os.path.exists("constraints-test.txt"): - session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt") - else: - session.install("-r", "requirements-test.txt") - - if INSTALL_LIBRARY_FROM_SOURCE: - session.install("-e", _get_repo_root()) - - if post_install: - post_install(session) - - session.run( - "pytest", - *(PYTEST_COMMON_ARGS + session.posargs), - # Pytest will return 5 when no tests are collected. This can happen - # on travis where slow and flaky tests are excluded. - # See http://doc.pytest.org/en/latest/_modules/_pytest/main.html - success_codes=[0, 5], - env=get_pytest_env_vars(), - ) + # check for presence of tests + test_list = glob.glob("*_test.py") + glob.glob("test_*.py") + if len(test_list) == 0: + print("No tests found, skipping directory.") + else: + if TEST_CONFIG["pip_version_override"]: + pip_version = TEST_CONFIG["pip_version_override"] + session.install(f"pip=={pip_version}") + """Runs py.test for a particular project.""" + if os.path.exists("requirements.txt"): + if os.path.exists("constraints.txt"): + session.install("-r", "requirements.txt", "-c", "constraints.txt") + else: + session.install("-r", "requirements.txt") + + if os.path.exists("requirements-test.txt"): + if os.path.exists("constraints-test.txt"): + session.install( + "-r", "requirements-test.txt", "-c", "constraints-test.txt" + ) + else: + session.install("-r", "requirements-test.txt") + + if INSTALL_LIBRARY_FROM_SOURCE: + session.install("-e", _get_repo_root()) + + if post_install: + post_install(session) + + session.run( + "pytest", + *(PYTEST_COMMON_ARGS + session.posargs), + # Pytest will return 5 when no tests are collected. This can happen + # on travis where slow and flaky tests are excluded. + # See http://doc.pytest.org/en/latest/_modules/_pytest/main.html + success_codes=[0, 5], + env=get_pytest_env_vars(), + ) @nox.session(python=ALL_VERSIONS) From 22e219ddc0a3a0aa997b284ca1508413a08a4724 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 13 Jan 2022 15:46:32 +0000 Subject: [PATCH 08/21] build: switch to release-please for tagging (#175) --- .github/.OwlBot.lock.yaml | 2 +- .github/release-please.yml | 1 + .github/release-trigger.yml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .github/release-trigger.yml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 6b8a73b..ff5126c 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:36a95b8f494e4674dc9eee9af98961293b51b86b3649942aac800ae6c1f796d4 + digest: sha256:dfa9b663b32de8b5b327e32c1da665a80de48876558dd58091d8160c60ad7355 diff --git a/.github/release-please.yml b/.github/release-please.yml index 4507ad0..466597e 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1 +1,2 @@ releaseType: python +handleGHRelease: true diff --git a/.github/release-trigger.yml b/.github/release-trigger.yml new file mode 100644 index 0000000..d4ca941 --- /dev/null +++ b/.github/release-trigger.yml @@ -0,0 +1 @@ +enabled: true From dcf1f175333790edf5500628d5a9d548d5f0594b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 14 Jan 2022 11:52:13 -0500 Subject: [PATCH 09/21] chore(python): update release.sh to use keystore (#176) Source-Link: https://github.com/googleapis/synthtool/commit/69fda12e2994f0b595a397e8bb6e3e9f380524eb Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:ae600f36b6bc972b368367b6f83a1d91ec2c82a4a116b383d67d547c56fe6de3 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/release.sh | 2 +- .kokoro/release/common.cfg | 12 +++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index ff5126c..eecb84c 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:dfa9b663b32de8b5b327e32c1da665a80de48876558dd58091d8160c60ad7355 + digest: sha256:ae600f36b6bc972b368367b6f83a1d91ec2c82a4a116b383d67d547c56fe6de3 diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 3c81019..56ed227 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -26,7 +26,7 @@ python3 -m pip install --upgrade twine wheel setuptools export PYTHONUNBUFFERED=1 # Move into the package, build the distribution and upload. -TWINE_PASSWORD=$(cat "${KOKORO_GFILE_DIR}/secret_manager/google-cloud-pypi-token") +TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1") cd github/python-analytics-data python3 setup.py sdist bdist_wheel twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/* diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index c5b901a..5dbd253 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -23,8 +23,18 @@ env_vars: { value: "github/python-analytics-data/.kokoro/release.sh" } +# Fetch PyPI password +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "google-cloud-pypi-token-keystore-1" + } + } +} + # Tokens needed to report release status back to GitHub env_vars: { key: "SECRET_MANAGER_KEYS" - value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem,google-cloud-pypi-token" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" } From f9c4a6f4f578e07de35d25ad43a749b22cc1dc88 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 18 Jan 2022 21:03:08 -0500 Subject: [PATCH 10/21] chore(python): Noxfile recognizes that tests can live in a folder (#179) Source-Link: https://github.com/googleapis/synthtool/commit/4760d8dce1351d93658cb11d02a1b7ceb23ae5d7 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f0e4b51deef56bed74d3e2359c583fc104a8d6367da3984fc5c66938db738828 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- samples/snippets/noxfile.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index eecb84c..52d79c1 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:ae600f36b6bc972b368367b6f83a1d91ec2c82a4a116b383d67d547c56fe6de3 + digest: sha256:f0e4b51deef56bed74d3e2359c583fc104a8d6367da3984fc5c66938db738828 diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py index 3bbef5d..20cdfc6 100644 --- a/samples/snippets/noxfile.py +++ b/samples/snippets/noxfile.py @@ -187,6 +187,7 @@ def _session_tests( ) -> None: # check for presence of tests test_list = glob.glob("*_test.py") + glob.glob("test_*.py") + test_list.extend(glob.glob("tests")) if len(test_list) == 0: print("No tests found, skipping directory.") else: From 6e84fd78b31805a8ee36016190b8338c91d3ffb4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 22 Jan 2022 06:21:40 -0500 Subject: [PATCH 11/21] ci(python): run lint / unit tests / docs as GH actions (#180) * ci(python): run lint / unit tests / docs as GH actions Source-Link: https://github.com/googleapis/synthtool/commit/57be0cdb0b94e1669cee0ca38d790de1dfdbcd44 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:ed1f9983d5a935a89fe8085e8bb97d94e41015252c5b6c9771257cf8624367e6 * add commit to trigger gh action * work around template bug * run post processor Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- .github/.OwlBot.lock.yaml | 16 +++++++++- .github/workflows/docs.yml | 38 +++++++++++++++++++++++ .github/workflows/lint.yml | 25 +++++++++++++++ .github/workflows/unittest.yml | 57 ++++++++++++++++++++++++++++++++++ owlbot.py | 8 ++--- 5 files changed, 137 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/unittest.yml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 52d79c1..b668c04 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,17 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:f0e4b51deef56bed74d3e2359c583fc104a8d6367da3984fc5c66938db738828 + digest: sha256:ed1f9983d5a935a89fe8085e8bb97d94e41015252c5b6c9771257cf8624367e6 + diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..f7b8344 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,38 @@ +on: + pull_request: + branches: + - main +name: docs +jobs: + docs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run docs + run: | + nox -s docs + docfx: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run docfx + run: | + nox -s docfx diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..1e8b05c --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +on: + pull_request: + branches: + - main +name: lint +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run lint + run: | + nox -s lint + - name: Run lint_setup_py + run: | + nox -s lint_setup_py diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml new file mode 100644 index 0000000..e84424b --- /dev/null +++ b/.github/workflows/unittest.yml @@ -0,0 +1,57 @@ +on: + pull_request: + branches: + - main +name: unittest +jobs: + unit: + runs-on: ubuntu-latest + strategy: + matrix: + python: ['3.6', '3.7', '3.8', '3.9', '3.10'] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run unit tests + env: + COVERAGE_FILE: .coverage-${{ matrix.python }} + run: | + nox -s unit-${{ matrix.python }} + - name: Upload coverage results + uses: actions/upload-artifact@v2 + with: + name: coverage-artifacts + path: .coverage-${{ matrix.python }} + + cover: + runs-on: ubuntu-latest + needs: + - unit + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + - name: Install coverage + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install coverage + - name: Download coverage results + uses: actions/download-artifact@v2 + with: + name: coverage-artifacts + path: .coverage-results/ + - name: Report coverage results + run: | + coverage combine .coverage-results/.coverage* + coverage report --show-missing --fail-under=99 diff --git a/owlbot.py b/owlbot.py index 98cb83e..cef558f 100644 --- a/owlbot.py +++ b/owlbot.py @@ -61,11 +61,7 @@ """``^[a-zA-Z0-9_]$``""", ) -# Block pushing non-cloud libraries to Cloud RAD -s.replace( - ".kokoro/docs/common.cfg", - r'value: "docs-staging-v2"', - r'value: "docs-staging-v2-staging"' -) +# Work around bug in templates https://github.com/googleapis/synthtool/pull/1335 +s.replace(".github/workflows/unittest.yml", "--fail-under=100", "--fail-under=99") s.shell.run(["nox", "-s", "blacken"], hide_output=False) From ec323ae5c385a792f608ea35f2ba6b1b4c6cfdb3 Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Mon, 24 Jan 2022 13:09:24 -0700 Subject: [PATCH 12/21] chore: make samples 3.6 check optional (#181) --- .github/sync-repo-settings.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 3e98ae7..37438d3 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -10,6 +10,5 @@ branchProtectionRules: - 'Kokoro' - 'cla/google' - 'Samples - Lint' - - 'Samples - Python 3.6' - 'Samples - Python 3.7' - 'Samples - Python 3.8' From ad51ffd1c461663d7ff055b69166004ea5a4d686 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 25 Jan 2022 09:58:56 -0500 Subject: [PATCH 13/21] feat: add api key support (#182) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: upgrade gapic-generator-java, gax-java and gapic-generator-python PiperOrigin-RevId: 423842556 Source-Link: https://github.com/googleapis/googleapis/commit/a616ca08f4b1416abbac7bc5dd6d61c791756a81 Source-Link: https://github.com/googleapis/googleapis-gen/commit/29b938c58c1e51d019f2ee539d55dc0a3c86a905 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjliOTM4YzU4YzFlNTFkMDE5ZjJlZTUzOWQ1NWRjMGEzYzg2YTkwNSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../beta_analytics_data/async_client.py | 38 ++++- .../services/beta_analytics_data/client.py | 127 +++++++++++------ .../data_v1beta/test_beta_analytics_data.py | 131 ++++++++++++++++++ 3 files changed, 252 insertions(+), 44 deletions(-) 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 bc899f2..2e18500 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 @@ -16,7 +16,7 @@ from collections import OrderedDict import functools import re -from typing import Dict, Sequence, Tuple, Type, Union +from typing import Dict, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core.client_options import ClientOptions @@ -106,6 +106,42 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): from_service_account_json = from_service_account_file + @classmethod + def get_mtls_endpoint_and_cert_source( + cls, client_options: Optional[ClientOptions] = None + ): + """Return the API endpoint and client cert source for mutual TLS. + + The client cert source is determined in the following order: + (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the + client cert source is None. + (2) if `client_options.client_cert_source` is provided, use the provided one; if the + default client cert source exists, use the default one; otherwise the client cert + source is None. + + The API endpoint is determined in the following order: + (1) if `client_options.api_endpoint` if provided, use the provided one. + (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the + default mTLS endpoint; if the environment variabel is "never", use the default API + endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise + use the default API endpoint. + + More details can be found at https://google.aip.dev/auth/4114. + + Args: + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. Only the `api_endpoint` and `client_cert_source` properties may be used + in this method. + + Returns: + Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the + client cert source to use. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If any errors happen. + """ + return BetaAnalyticsDataClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore + @property def transport(self) -> BetaAnalyticsDataTransport: """Returns the transport used by the client instance. 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 40f68a0..d68ae67 100644 --- a/google/analytics/data_v1beta/services/beta_analytics_data/client.py +++ b/google/analytics/data_v1beta/services/beta_analytics_data/client.py @@ -231,6 +231,73 @@ def parse_common_location_path(path: str) -> Dict[str, str]: m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)$", path) return m.groupdict() if m else {} + @classmethod + def get_mtls_endpoint_and_cert_source( + cls, client_options: Optional[client_options_lib.ClientOptions] = None + ): + """Return the API endpoint and client cert source for mutual TLS. + + The client cert source is determined in the following order: + (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the + client cert source is None. + (2) if `client_options.client_cert_source` is provided, use the provided one; if the + default client cert source exists, use the default one; otherwise the client cert + source is None. + + The API endpoint is determined in the following order: + (1) if `client_options.api_endpoint` if provided, use the provided one. + (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the + default mTLS endpoint; if the environment variabel is "never", use the default API + endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise + use the default API endpoint. + + More details can be found at https://google.aip.dev/auth/4114. + + Args: + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. Only the `api_endpoint` and `client_cert_source` properties may be used + in this method. + + Returns: + Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the + client cert source to use. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If any errors happen. + """ + if client_options is None: + client_options = client_options_lib.ClientOptions() + use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") + use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto") + if use_client_cert not in ("true", "false"): + raise ValueError( + "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + if use_mtls_endpoint not in ("auto", "never", "always"): + raise MutualTLSChannelError( + "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + # Figure out the client cert source to use. + client_cert_source = None + if use_client_cert == "true": + if client_options.client_cert_source: + client_cert_source = client_options.client_cert_source + elif mtls.has_default_client_cert_source(): + client_cert_source = mtls.default_client_cert_source() + + # Figure out which api endpoint to use. + if client_options.api_endpoint is not None: + api_endpoint = client_options.api_endpoint + elif use_mtls_endpoint == "always" or ( + use_mtls_endpoint == "auto" and client_cert_source + ): + api_endpoint = cls.DEFAULT_MTLS_ENDPOINT + else: + api_endpoint = cls.DEFAULT_ENDPOINT + + return api_endpoint, client_cert_source + def __init__( self, *, @@ -281,57 +348,22 @@ def __init__( if client_options is None: client_options = client_options_lib.ClientOptions() - # Create SSL credentials for mutual TLS if needed. - if os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") not in ( - "true", - "false", - ): - raise ValueError( - "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" - ) - use_client_cert = ( - os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true" + api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( + client_options ) - client_cert_source_func = None - is_mtls = False - if use_client_cert: - if client_options.client_cert_source: - is_mtls = True - client_cert_source_func = client_options.client_cert_source - else: - is_mtls = mtls.has_default_client_cert_source() - if is_mtls: - client_cert_source_func = mtls.default_client_cert_source() - else: - client_cert_source_func = None - - # Figure out which api endpoint to use. - if client_options.api_endpoint is not None: - api_endpoint = client_options.api_endpoint - else: - use_mtls_env = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto") - if use_mtls_env == "never": - api_endpoint = self.DEFAULT_ENDPOINT - elif use_mtls_env == "always": - api_endpoint = self.DEFAULT_MTLS_ENDPOINT - elif use_mtls_env == "auto": - if is_mtls: - api_endpoint = self.DEFAULT_MTLS_ENDPOINT - else: - api_endpoint = self.DEFAULT_ENDPOINT - else: - raise MutualTLSChannelError( - "Unsupported GOOGLE_API_USE_MTLS_ENDPOINT value. Accepted " - "values: never, auto, always" - ) + api_key_value = getattr(client_options, "api_key", None) + if api_key_value and credentials: + raise ValueError( + "client_options.api_key and credentials are mutually exclusive" + ) # Save or instantiate the transport. # Ordinarily, we provide the transport, but allowing a custom transport # instance provides an extensibility point for unusual situations. if isinstance(transport, BetaAnalyticsDataTransport): # transport is a BetaAnalyticsDataTransport instance. - if credentials or client_options.credentials_file: + if credentials or client_options.credentials_file or api_key_value: raise ValueError( "When providing a transport instance, " "provide its credentials directly." @@ -343,6 +375,15 @@ def __init__( ) self._transport = transport else: + import google.auth._default # type: ignore + + if api_key_value and hasattr( + google.auth._default, "get_api_key_credentials" + ): + credentials = google.auth._default.get_api_key_credentials( + api_key_value + ) + Transport = type(self).get_transport_class(transport) self._transport = Transport( credentials=credentials, 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 8099bc2..009991b 100644 --- a/tests/unit/gapic/data_v1beta/test_beta_analytics_data.py +++ b/tests/unit/gapic/data_v1beta/test_beta_analytics_data.py @@ -410,6 +410,87 @@ def test_beta_analytics_data_client_mtls_env_auto( ) +@pytest.mark.parametrize( + "client_class", [BetaAnalyticsDataClient, BetaAnalyticsDataAsyncClient] +) +@mock.patch.object( + BetaAnalyticsDataClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(BetaAnalyticsDataClient), +) +@mock.patch.object( + BetaAnalyticsDataAsyncClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(BetaAnalyticsDataAsyncClient), +) +def test_beta_analytics_data_client_get_mtls_endpoint_and_cert_source(client_class): + mock_client_cert_source = mock.Mock() + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "true". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source == mock_client_cert_source + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "false". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): + mock_client_cert_source = mock.Mock() + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "never". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "always". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert doesn't exist. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=False, + ): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert exists. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=True, + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=mock_client_cert_source, + ): + ( + api_endpoint, + cert_source, + ) = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source == mock_client_cert_source + + @pytest.mark.parametrize( "client_class,transport_class,transport_name", [ @@ -1556,6 +1637,23 @@ def test_credentials_transport_error(): transport=transport, ) + # It is an error to provide an api_key and a transport instance. + transport = transports.BetaAnalyticsDataGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = BetaAnalyticsDataClient(client_options=options, transport=transport,) + + # It is an error to provide an api_key and a credential. + options = mock.Mock() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = BetaAnalyticsDataClient( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + # It is an error to provide scopes and a transport instance. transport = transports.BetaAnalyticsDataGrpcTransport( credentials=ga_credentials.AnonymousCredentials(), @@ -2129,3 +2227,36 @@ def test_client_ctx(): with client: pass close.assert_called() + + +@pytest.mark.parametrize( + "client_class,transport_class", + [ + (BetaAnalyticsDataClient, transports.BetaAnalyticsDataGrpcTransport), + ( + BetaAnalyticsDataAsyncClient, + transports.BetaAnalyticsDataGrpcAsyncIOTransport, + ), + ], +) +def test_api_key_credentials(client_class, transport_class): + with mock.patch.object( + google.auth._default, "get_api_key_credentials", create=True + ) as get_api_key_credentials: + mock_cred = mock.Mock() + get_api_key_credentials.return_value = mock_cred + options = client_options.ClientOptions() + options.api_key = "api_key" + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options) + patched.assert_called_once_with( + credentials=mock_cred, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) From 97804feb1031e3ff6ac3e6f6113b1d3123f1ec91 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 3 Feb 2022 11:41:00 +0000 Subject: [PATCH 14/21] chore: use gapic-generator-python 0.62.1 (#185) - [ ] Regenerate this pull request now. fix: resolve DuplicateCredentialArgs error when using credentials_file committer: parthea PiperOrigin-RevId: 425964861 Source-Link: https://github.com/googleapis/googleapis/commit/84b1a5a4f6fb2d04905be58e586b8a7a4310a8cf Source-Link: https://github.com/googleapis/googleapis-gen/commit/4fb761bbd8506ac156f49bac5f18306aa8eb3aa8 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGZiNzYxYmJkODUwNmFjMTU2ZjQ5YmFjNWYxODMwNmFhOGViM2FhOCJ9 --- .../beta_analytics_data/async_client.py | 2 +- .../services/beta_analytics_data/client.py | 2 +- .../beta_analytics_data/transports/grpc.py | 5 +- .../transports/grpc_asyncio.py | 5 +- .../data_v1beta/test_beta_analytics_data.py | 82 ++++++++++++++++++- 5 files changed, 89 insertions(+), 7 deletions(-) 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 2e18500..d5450c7 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 @@ -467,7 +467,7 @@ async def get_metadata( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: 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 d68ae67..04cb410 100644 --- a/google/analytics/data_v1beta/services/beta_analytics_data/client.py +++ b/google/analytics/data_v1beta/services/beta_analytics_data/client.py @@ -665,7 +665,7 @@ def get_metadata( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: 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 35e1ebd..b1f1b6e 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 @@ -158,8 +158,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, 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 27dd2cd..4163d3b 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 @@ -203,8 +203,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, 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 009991b..1ab02ae 100644 --- a/tests/unit/gapic/data_v1beta/test_beta_analytics_data.py +++ b/tests/unit/gapic/data_v1beta/test_beta_analytics_data.py @@ -523,21 +523,28 @@ def test_beta_analytics_data_client_client_options_scopes( @pytest.mark.parametrize( - "client_class,transport_class,transport_name", + "client_class,transport_class,transport_name,grpc_helpers", [ - (BetaAnalyticsDataClient, transports.BetaAnalyticsDataGrpcTransport, "grpc"), + ( + BetaAnalyticsDataClient, + transports.BetaAnalyticsDataGrpcTransport, + "grpc", + grpc_helpers, + ), ( BetaAnalyticsDataAsyncClient, transports.BetaAnalyticsDataGrpcAsyncIOTransport, "grpc_asyncio", + grpc_helpers_async, ), ], ) def test_beta_analytics_data_client_client_options_credentials_file( - client_class, transport_class, transport_name + client_class, transport_class, transport_name, grpc_helpers ): # Check the case credentials file is provided. options = client_options.ClientOptions(credentials_file="credentials.json") + with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -573,6 +580,75 @@ def test_beta_analytics_data_client_client_options_from_dict(): ) +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + ( + BetaAnalyticsDataClient, + transports.BetaAnalyticsDataGrpcTransport, + "grpc", + grpc_helpers, + ), + ( + BetaAnalyticsDataAsyncClient, + transports.BetaAnalyticsDataGrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_beta_analytics_data_client_create_channel_credentials_file( + client_class, transport_class, transport_name, grpc_helpers +): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # test that the credentials from file are saved and used as the credentials. + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel" + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() + load_creds.return_value = (file_creds, None) + adc.return_value = (creds, None) + client = client_class(client_options=options, transport=transport_name) + create_channel.assert_called_with( + "analyticsdata.googleapis.com:443", + credentials=file_creds, + credentials_file=None, + quota_project_id=None, + default_scopes=( + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.readonly", + ), + scopes=None, + default_host="analyticsdata.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + @pytest.mark.parametrize("request_type", [analytics_data_api.RunReportRequest, dict,]) def test_run_report(request_type, transport: str = "grpc"): client = BetaAnalyticsDataClient( From ff739da3bdd5a284f9438b64138a50e5a026b864 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 4 Feb 2022 15:12:45 +0100 Subject: [PATCH 15/21] chore(deps): update dependency pytest to v7 (#187) --- samples/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/requirements-test.txt b/samples/snippets/requirements-test.txt index 9270945..4a46ff6 100644 --- a/samples/snippets/requirements-test.txt +++ b/samples/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==6.2.5 +pytest==7.0.0 From f34ee10dce4dae5f04aefedf9d8f3472491025d3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 4 Feb 2022 14:26:49 +0000 Subject: [PATCH 16/21] chore: use gapic-generator-python 0.63.1 (#186) - [x] Regenerate this pull request now. docs: add autogenerated code snippets PiperOrigin-RevId: 426256923 Source-Link: https://github.com/googleapis/googleapis/commit/9ebabfa115341b8016b6ed64b22c04260360a8ff Source-Link: https://github.com/googleapis/googleapis-gen/commit/a88175263e60a1d45d3a447848652b0f670b2cb8 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTg4MTc1MjYzZTYwYTFkNDVkM2E0NDc4NDg2NTJiMGY2NzBiMmNiOCJ9 --- .../beta_analytics_data/async_client.py | 134 ++++ .../services/beta_analytics_data/client.py | 141 ++++ ...tics_data_batch_run_pivot_reports_async.py | 44 ++ ...ytics_data_batch_run_pivot_reports_sync.py | 44 ++ ..._analytics_data_batch_run_reports_async.py | 44 ++ ...a_analytics_data_batch_run_reports_sync.py | 44 ++ ...nalytics_data_check_compatibility_async.py | 44 ++ ...analytics_data_check_compatibility_sync.py | 44 ++ ..._beta_analytics_data_get_metadata_async.py | 45 ++ ...a_beta_analytics_data_get_metadata_sync.py | 45 ++ ...a_analytics_data_run_pivot_report_async.py | 44 ++ ...ta_analytics_data_run_pivot_report_sync.py | 44 ++ ...nalytics_data_run_realtime_report_async.py | 44 ++ ...analytics_data_run_realtime_report_sync.py | 44 ++ ...ta_beta_analytics_data_run_report_async.py | 44 ++ ...eta_beta_analytics_data_run_report_sync.py | 44 ++ .../snippet_metadata_data_v1beta.json | 627 ++++++++++++++++++ 17 files changed, 1520 insertions(+) create mode 100644 samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_pivot_reports_async.py create mode 100644 samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_pivot_reports_sync.py create mode 100644 samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_reports_async.py create mode 100644 samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_reports_sync.py create mode 100644 samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_check_compatibility_async.py create mode 100644 samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_check_compatibility_sync.py create mode 100644 samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_get_metadata_async.py create mode 100644 samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_get_metadata_sync.py create mode 100644 samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_pivot_report_async.py create mode 100644 samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_pivot_report_sync.py create mode 100644 samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_realtime_report_async.py create mode 100644 samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_realtime_report_sync.py create mode 100644 samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_report_async.py create mode 100644 samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_report_sync.py create mode 100644 samples/generated_samples/snippet_metadata_data_v1beta.json 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 d5450c7..2d5991e 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 @@ -220,6 +220,25 @@ async def run_report( Dimensions break down metrics across some common criteria, such as country or event name. + + .. code-block:: + + from google.analytics import data_v1beta + + def sample_run_report(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.RunReportRequest( + ) + + # Make the request + response = client.run_report(request=request) + + # Handle response + print(response) + Args: request (Union[google.analytics.data_v1beta.types.RunReportRequest, dict]): The request object. The request to generate a report. @@ -273,6 +292,25 @@ async def run_pivot_report( in a pivot. Multiple pivots can be specified to further dissect your data. + + .. code-block:: + + from google.analytics import data_v1beta + + def sample_run_pivot_report(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.RunPivotReportRequest( + ) + + # Make the request + response = client.run_pivot_report(request=request) + + # Handle response + print(response) + Args: request (Union[google.analytics.data_v1beta.types.RunPivotReportRequest, dict]): The request object. The request to generate a pivot @@ -323,6 +361,25 @@ async def batch_run_reports( r"""Returns multiple reports in a batch. All reports must be for the same GA4 Property. + + .. code-block:: + + from google.analytics import data_v1beta + + def sample_batch_run_reports(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.BatchRunReportsRequest( + ) + + # Make the request + response = client.batch_run_reports(request=request) + + # Handle response + print(response) + Args: request (Union[google.analytics.data_v1beta.types.BatchRunReportsRequest, dict]): The request object. The batch request containing @@ -373,6 +430,25 @@ async def batch_run_pivot_reports( r"""Returns multiple pivot reports in a batch. All reports must be for the same GA4 Property. + + .. code-block:: + + from google.analytics import data_v1beta + + def sample_batch_run_pivot_reports(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.BatchRunPivotReportsRequest( + ) + + # Make the request + response = client.batch_run_pivot_reports(request=request) + + # Handle response + print(response) + Args: request (Union[google.analytics.data_v1beta.types.BatchRunPivotReportsRequest, dict]): The request object. The batch request containing @@ -433,6 +509,26 @@ async def get_metadata( metadata are dimensions and metrics applicable to any property such as ``country`` and ``totalUsers``. + + .. code-block:: + + from google.analytics import data_v1beta + + def sample_get_metadata(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.GetMetadataRequest( + name="name_value", + ) + + # Make the request + response = client.get_metadata(request=request) + + # Handle response + print(response) + Args: request (Union[google.analytics.data_v1beta.types.GetMetadataRequest, dict]): The request object. Request for a property's dimension @@ -516,6 +612,25 @@ async def run_realtime_report( property. These reports show events and usage from the last 30 minutes. + + .. code-block:: + + from google.analytics import data_v1beta + + def sample_run_realtime_report(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.RunRealtimeReportRequest( + ) + + # Make the request + response = client.run_realtime_report(request=request) + + # Handle response + print(response) + Args: request (Union[google.analytics.data_v1beta.types.RunRealtimeReportRequest, dict]): The request object. The request to generate a realtime @@ -575,6 +690,25 @@ async def check_compatibility( compatibility rules. This method checks compatibility for Core reports. + + .. code-block:: + + from google.analytics import data_v1beta + + def sample_check_compatibility(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.CheckCompatibilityRequest( + ) + + # Make the request + response = client.check_compatibility(request=request) + + # Handle response + print(response) + Args: request (Union[google.analytics.data_v1beta.types.CheckCompatibilityRequest, dict]): The request object. The request for compatibility 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 04cb410..2102964 100644 --- a/google/analytics/data_v1beta/services/beta_analytics_data/client.py +++ b/google/analytics/data_v1beta/services/beta_analytics_data/client.py @@ -414,6 +414,26 @@ def run_report( Dimensions break down metrics across some common criteria, such as country or event name. + + + .. code-block:: + + from google.analytics import data_v1beta + + def sample_run_report(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.RunReportRequest( + ) + + # Make the request + response = client.run_report(request=request) + + # Handle response + print(response) + Args: request (Union[google.analytics.data_v1beta.types.RunReportRequest, dict]): The request object. The request to generate a report. @@ -468,6 +488,26 @@ def run_pivot_report( in a pivot. Multiple pivots can be specified to further dissect your data. + + + .. code-block:: + + from google.analytics import data_v1beta + + def sample_run_pivot_report(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.RunPivotReportRequest( + ) + + # Make the request + response = client.run_pivot_report(request=request) + + # Handle response + print(response) + Args: request (Union[google.analytics.data_v1beta.types.RunPivotReportRequest, dict]): The request object. The request to generate a pivot @@ -519,6 +559,26 @@ def batch_run_reports( r"""Returns multiple reports in a batch. All reports must be for the same GA4 Property. + + + .. code-block:: + + from google.analytics import data_v1beta + + def sample_batch_run_reports(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.BatchRunReportsRequest( + ) + + # Make the request + response = client.batch_run_reports(request=request) + + # Handle response + print(response) + Args: request (Union[google.analytics.data_v1beta.types.BatchRunReportsRequest, dict]): The request object. The batch request containing @@ -570,6 +630,26 @@ def batch_run_pivot_reports( r"""Returns multiple pivot reports in a batch. All reports must be for the same GA4 Property. + + + .. code-block:: + + from google.analytics import data_v1beta + + def sample_batch_run_pivot_reports(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.BatchRunPivotReportsRequest( + ) + + # Make the request + response = client.batch_run_pivot_reports(request=request) + + # Handle response + print(response) + Args: request (Union[google.analytics.data_v1beta.types.BatchRunPivotReportsRequest, dict]): The request object. The batch request containing @@ -631,6 +711,27 @@ def get_metadata( metadata are dimensions and metrics applicable to any property such as ``country`` and ``totalUsers``. + + + .. code-block:: + + from google.analytics import data_v1beta + + def sample_get_metadata(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.GetMetadataRequest( + name="name_value", + ) + + # Make the request + response = client.get_metadata(request=request) + + # Handle response + print(response) + Args: request (Union[google.analytics.data_v1beta.types.GetMetadataRequest, dict]): The request object. Request for a property's dimension @@ -714,6 +815,26 @@ def run_realtime_report( property. These reports show events and usage from the last 30 minutes. + + + .. code-block:: + + from google.analytics import data_v1beta + + def sample_run_realtime_report(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.RunRealtimeReportRequest( + ) + + # Make the request + response = client.run_realtime_report(request=request) + + # Handle response + print(response) + Args: request (Union[google.analytics.data_v1beta.types.RunRealtimeReportRequest, dict]): The request object. The request to generate a realtime @@ -774,6 +895,26 @@ def check_compatibility( compatibility rules. This method checks compatibility for Core reports. + + + .. code-block:: + + from google.analytics import data_v1beta + + def sample_check_compatibility(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.CheckCompatibilityRequest( + ) + + # Make the request + response = client.check_compatibility(request=request) + + # Handle response + print(response) + Args: request (Union[google.analytics.data_v1beta.types.CheckCompatibilityRequest, dict]): The request object. The request for compatibility diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_pivot_reports_async.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_pivot_reports_async.py new file mode 100644 index 0000000..45b03c1 --- /dev/null +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_pivot_reports_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchRunPivotReports +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-analytics-data + + +# [START analyticsdata_generated_data_v1beta_BetaAnalyticsData_BatchRunPivotReports_async] +from google.analytics import data_v1beta + + +async def sample_batch_run_pivot_reports(): + # Create a client + client = data_v1beta.BetaAnalyticsDataAsyncClient() + + # Initialize request argument(s) + request = data_v1beta.BatchRunPivotReportsRequest( + ) + + # Make the request + response = await client.batch_run_pivot_reports(request=request) + + # Handle response + print(response) + +# [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_BatchRunPivotReports_async] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_pivot_reports_sync.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_pivot_reports_sync.py new file mode 100644 index 0000000..2f27cb6 --- /dev/null +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_pivot_reports_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchRunPivotReports +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-analytics-data + + +# [START analyticsdata_generated_data_v1beta_BetaAnalyticsData_BatchRunPivotReports_sync] +from google.analytics import data_v1beta + + +def sample_batch_run_pivot_reports(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.BatchRunPivotReportsRequest( + ) + + # Make the request + response = client.batch_run_pivot_reports(request=request) + + # Handle response + print(response) + +# [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_BatchRunPivotReports_sync] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_reports_async.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_reports_async.py new file mode 100644 index 0000000..77e37cd --- /dev/null +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_reports_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchRunReports +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-analytics-data + + +# [START analyticsdata_generated_data_v1beta_BetaAnalyticsData_BatchRunReports_async] +from google.analytics import data_v1beta + + +async def sample_batch_run_reports(): + # Create a client + client = data_v1beta.BetaAnalyticsDataAsyncClient() + + # Initialize request argument(s) + request = data_v1beta.BatchRunReportsRequest( + ) + + # Make the request + response = await client.batch_run_reports(request=request) + + # Handle response + print(response) + +# [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_BatchRunReports_async] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_reports_sync.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_reports_sync.py new file mode 100644 index 0000000..4c0b55c --- /dev/null +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_reports_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchRunReports +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-analytics-data + + +# [START analyticsdata_generated_data_v1beta_BetaAnalyticsData_BatchRunReports_sync] +from google.analytics import data_v1beta + + +def sample_batch_run_reports(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.BatchRunReportsRequest( + ) + + # Make the request + response = client.batch_run_reports(request=request) + + # Handle response + print(response) + +# [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_BatchRunReports_sync] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_check_compatibility_async.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_check_compatibility_async.py new file mode 100644 index 0000000..a2d6c0b --- /dev/null +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_check_compatibility_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CheckCompatibility +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-analytics-data + + +# [START analyticsdata_generated_data_v1beta_BetaAnalyticsData_CheckCompatibility_async] +from google.analytics import data_v1beta + + +async def sample_check_compatibility(): + # Create a client + client = data_v1beta.BetaAnalyticsDataAsyncClient() + + # Initialize request argument(s) + request = data_v1beta.CheckCompatibilityRequest( + ) + + # Make the request + response = await client.check_compatibility(request=request) + + # Handle response + print(response) + +# [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_CheckCompatibility_async] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_check_compatibility_sync.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_check_compatibility_sync.py new file mode 100644 index 0000000..b7ff49b --- /dev/null +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_check_compatibility_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CheckCompatibility +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-analytics-data + + +# [START analyticsdata_generated_data_v1beta_BetaAnalyticsData_CheckCompatibility_sync] +from google.analytics import data_v1beta + + +def sample_check_compatibility(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.CheckCompatibilityRequest( + ) + + # Make the request + response = client.check_compatibility(request=request) + + # Handle response + print(response) + +# [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_CheckCompatibility_sync] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_get_metadata_async.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_get_metadata_async.py new file mode 100644 index 0000000..f1220df --- /dev/null +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_get_metadata_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetMetadata +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-analytics-data + + +# [START analyticsdata_generated_data_v1beta_BetaAnalyticsData_GetMetadata_async] +from google.analytics import data_v1beta + + +async def sample_get_metadata(): + # Create a client + client = data_v1beta.BetaAnalyticsDataAsyncClient() + + # Initialize request argument(s) + request = data_v1beta.GetMetadataRequest( + name="name_value", + ) + + # Make the request + response = await client.get_metadata(request=request) + + # Handle response + print(response) + +# [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_GetMetadata_async] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_get_metadata_sync.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_get_metadata_sync.py new file mode 100644 index 0000000..9057d19 --- /dev/null +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_get_metadata_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetMetadata +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-analytics-data + + +# [START analyticsdata_generated_data_v1beta_BetaAnalyticsData_GetMetadata_sync] +from google.analytics import data_v1beta + + +def sample_get_metadata(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.GetMetadataRequest( + name="name_value", + ) + + # Make the request + response = client.get_metadata(request=request) + + # Handle response + print(response) + +# [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_GetMetadata_sync] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_pivot_report_async.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_pivot_report_async.py new file mode 100644 index 0000000..1906e87 --- /dev/null +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_pivot_report_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RunPivotReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-analytics-data + + +# [START analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunPivotReport_async] +from google.analytics import data_v1beta + + +async def sample_run_pivot_report(): + # Create a client + client = data_v1beta.BetaAnalyticsDataAsyncClient() + + # Initialize request argument(s) + request = data_v1beta.RunPivotReportRequest( + ) + + # Make the request + response = await client.run_pivot_report(request=request) + + # Handle response + print(response) + +# [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunPivotReport_async] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_pivot_report_sync.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_pivot_report_sync.py new file mode 100644 index 0000000..fd7e571 --- /dev/null +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_pivot_report_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RunPivotReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-analytics-data + + +# [START analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunPivotReport_sync] +from google.analytics import data_v1beta + + +def sample_run_pivot_report(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.RunPivotReportRequest( + ) + + # Make the request + response = client.run_pivot_report(request=request) + + # Handle response + print(response) + +# [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunPivotReport_sync] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_realtime_report_async.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_realtime_report_async.py new file mode 100644 index 0000000..c347e2c --- /dev/null +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_realtime_report_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RunRealtimeReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-analytics-data + + +# [START analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunRealtimeReport_async] +from google.analytics import data_v1beta + + +async def sample_run_realtime_report(): + # Create a client + client = data_v1beta.BetaAnalyticsDataAsyncClient() + + # Initialize request argument(s) + request = data_v1beta.RunRealtimeReportRequest( + ) + + # Make the request + response = await client.run_realtime_report(request=request) + + # Handle response + print(response) + +# [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunRealtimeReport_async] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_realtime_report_sync.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_realtime_report_sync.py new file mode 100644 index 0000000..54a83f5 --- /dev/null +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_realtime_report_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RunRealtimeReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-analytics-data + + +# [START analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunRealtimeReport_sync] +from google.analytics import data_v1beta + + +def sample_run_realtime_report(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.RunRealtimeReportRequest( + ) + + # Make the request + response = client.run_realtime_report(request=request) + + # Handle response + print(response) + +# [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunRealtimeReport_sync] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_report_async.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_report_async.py new file mode 100644 index 0000000..80e60ee --- /dev/null +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_report_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RunReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-analytics-data + + +# [START analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunReport_async] +from google.analytics import data_v1beta + + +async def sample_run_report(): + # Create a client + client = data_v1beta.BetaAnalyticsDataAsyncClient() + + # Initialize request argument(s) + request = data_v1beta.RunReportRequest( + ) + + # Make the request + response = await client.run_report(request=request) + + # Handle response + print(response) + +# [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunReport_async] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_report_sync.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_report_sync.py new file mode 100644 index 0000000..a4473fc --- /dev/null +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_report_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RunReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-analytics-data + + +# [START analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunReport_sync] +from google.analytics import data_v1beta + + +def sample_run_report(): + # Create a client + client = data_v1beta.BetaAnalyticsDataClient() + + # Initialize request argument(s) + request = data_v1beta.RunReportRequest( + ) + + # Make the request + response = client.run_report(request=request) + + # Handle response + print(response) + +# [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunReport_sync] diff --git a/samples/generated_samples/snippet_metadata_data_v1beta.json b/samples/generated_samples/snippet_metadata_data_v1beta.json new file mode 100644 index 0000000..da72466 --- /dev/null +++ b/samples/generated_samples/snippet_metadata_data_v1beta.json @@ -0,0 +1,627 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BetaAnalyticsData" + }, + "shortName": "BatchRunPivotReports" + } + }, + "file": "analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_pivot_reports_async.py", + "regionTag": "analyticsdata_generated_data_v1beta_BetaAnalyticsData_BatchRunPivotReports_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BetaAnalyticsData" + }, + "shortName": "BatchRunPivotReports" + } + }, + "file": "analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_pivot_reports_sync.py", + "regionTag": "analyticsdata_generated_data_v1beta_BetaAnalyticsData_BatchRunPivotReports_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BetaAnalyticsData" + }, + "shortName": "BatchRunReports" + } + }, + "file": "analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_reports_async.py", + "regionTag": "analyticsdata_generated_data_v1beta_BetaAnalyticsData_BatchRunReports_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BetaAnalyticsData" + }, + "shortName": "BatchRunReports" + } + }, + "file": "analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_reports_sync.py", + "regionTag": "analyticsdata_generated_data_v1beta_BetaAnalyticsData_BatchRunReports_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BetaAnalyticsData" + }, + "shortName": "CheckCompatibility" + } + }, + "file": "analyticsdata_generated_data_v1beta_beta_analytics_data_check_compatibility_async.py", + "regionTag": "analyticsdata_generated_data_v1beta_BetaAnalyticsData_CheckCompatibility_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BetaAnalyticsData" + }, + "shortName": "CheckCompatibility" + } + }, + "file": "analyticsdata_generated_data_v1beta_beta_analytics_data_check_compatibility_sync.py", + "regionTag": "analyticsdata_generated_data_v1beta_BetaAnalyticsData_CheckCompatibility_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BetaAnalyticsData" + }, + "shortName": "GetMetadata" + } + }, + "file": "analyticsdata_generated_data_v1beta_beta_analytics_data_get_metadata_async.py", + "regionTag": "analyticsdata_generated_data_v1beta_BetaAnalyticsData_GetMetadata_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BetaAnalyticsData" + }, + "shortName": "GetMetadata" + } + }, + "file": "analyticsdata_generated_data_v1beta_beta_analytics_data_get_metadata_sync.py", + "regionTag": "analyticsdata_generated_data_v1beta_BetaAnalyticsData_GetMetadata_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BetaAnalyticsData" + }, + "shortName": "RunPivotReport" + } + }, + "file": "analyticsdata_generated_data_v1beta_beta_analytics_data_run_pivot_report_async.py", + "regionTag": "analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunPivotReport_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BetaAnalyticsData" + }, + "shortName": "RunPivotReport" + } + }, + "file": "analyticsdata_generated_data_v1beta_beta_analytics_data_run_pivot_report_sync.py", + "regionTag": "analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunPivotReport_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BetaAnalyticsData" + }, + "shortName": "RunRealtimeReport" + } + }, + "file": "analyticsdata_generated_data_v1beta_beta_analytics_data_run_realtime_report_async.py", + "regionTag": "analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunRealtimeReport_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BetaAnalyticsData" + }, + "shortName": "RunRealtimeReport" + } + }, + "file": "analyticsdata_generated_data_v1beta_beta_analytics_data_run_realtime_report_sync.py", + "regionTag": "analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunRealtimeReport_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "BetaAnalyticsData" + }, + "shortName": "RunReport" + } + }, + "file": "analyticsdata_generated_data_v1beta_beta_analytics_data_run_report_async.py", + "regionTag": "analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunReport_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "BetaAnalyticsData" + }, + "shortName": "RunReport" + } + }, + "file": "analyticsdata_generated_data_v1beta_beta_analytics_data_run_report_sync.py", + "regionTag": "analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunReport_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} From 5f71121ec29e0fad646464bf4a71b72f69beddea Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Feb 2022 11:46:50 -0700 Subject: [PATCH 17/21] chore: use gapic-generator-python 0.63.2 (#189) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-python 0.63.2 PiperOrigin-RevId: 427792504 Source-Link: https://github.com/googleapis/googleapis/commit/55b9e1e0b3106c850d13958352bc0751147b6b15 Source-Link: https://github.com/googleapis/googleapis-gen/commit/bf4e86b753f42cb0edb1fd51fbe840d7da0a1cde Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../services/beta_analytics_data/async_client.py | 14 +++++++------- .../services/beta_analytics_data/client.py | 14 +++++++------- ...analytics_data_batch_run_pivot_reports_async.py | 2 +- ..._analytics_data_batch_run_pivot_reports_sync.py | 2 +- ..._beta_analytics_data_batch_run_reports_async.py | 2 +- ...a_beta_analytics_data_batch_run_reports_sync.py | 2 +- ...eta_analytics_data_check_compatibility_async.py | 2 +- ...beta_analytics_data_check_compatibility_sync.py | 2 +- ...1beta_beta_analytics_data_get_metadata_async.py | 2 +- ...v1beta_beta_analytics_data_get_metadata_sync.py | 2 +- ...a_beta_analytics_data_run_pivot_report_async.py | 2 +- ...ta_beta_analytics_data_run_pivot_report_sync.py | 2 +- ...eta_analytics_data_run_realtime_report_async.py | 2 +- ...beta_analytics_data_run_realtime_report_sync.py | 2 +- ..._v1beta_beta_analytics_data_run_report_async.py | 2 +- ...a_v1beta_beta_analytics_data_run_report_sync.py | 2 +- 16 files changed, 28 insertions(+), 28 deletions(-) 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 2d5991e..55b5855 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 @@ -236,7 +236,7 @@ def sample_run_report(): # Make the request response = client.run_report(request=request) - # Handle response + # Handle the response print(response) Args: @@ -308,7 +308,7 @@ def sample_run_pivot_report(): # Make the request response = client.run_pivot_report(request=request) - # Handle response + # Handle the response print(response) Args: @@ -377,7 +377,7 @@ def sample_batch_run_reports(): # Make the request response = client.batch_run_reports(request=request) - # Handle response + # Handle the response print(response) Args: @@ -446,7 +446,7 @@ def sample_batch_run_pivot_reports(): # Make the request response = client.batch_run_pivot_reports(request=request) - # Handle response + # Handle the response print(response) Args: @@ -526,7 +526,7 @@ def sample_get_metadata(): # Make the request response = client.get_metadata(request=request) - # Handle response + # Handle the response print(response) Args: @@ -628,7 +628,7 @@ def sample_run_realtime_report(): # Make the request response = client.run_realtime_report(request=request) - # Handle response + # Handle the response print(response) Args: @@ -706,7 +706,7 @@ def sample_check_compatibility(): # Make the request response = client.check_compatibility(request=request) - # Handle response + # Handle the response print(response) Args: 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 2102964..45216d4 100644 --- a/google/analytics/data_v1beta/services/beta_analytics_data/client.py +++ b/google/analytics/data_v1beta/services/beta_analytics_data/client.py @@ -431,7 +431,7 @@ def sample_run_report(): # Make the request response = client.run_report(request=request) - # Handle response + # Handle the response print(response) Args: @@ -505,7 +505,7 @@ def sample_run_pivot_report(): # Make the request response = client.run_pivot_report(request=request) - # Handle response + # Handle the response print(response) Args: @@ -576,7 +576,7 @@ def sample_batch_run_reports(): # Make the request response = client.batch_run_reports(request=request) - # Handle response + # Handle the response print(response) Args: @@ -647,7 +647,7 @@ def sample_batch_run_pivot_reports(): # Make the request response = client.batch_run_pivot_reports(request=request) - # Handle response + # Handle the response print(response) Args: @@ -729,7 +729,7 @@ def sample_get_metadata(): # Make the request response = client.get_metadata(request=request) - # Handle response + # Handle the response print(response) Args: @@ -832,7 +832,7 @@ def sample_run_realtime_report(): # Make the request response = client.run_realtime_report(request=request) - # Handle response + # Handle the response print(response) Args: @@ -912,7 +912,7 @@ def sample_check_compatibility(): # Make the request response = client.check_compatibility(request=request) - # Handle response + # Handle the response print(response) Args: diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_pivot_reports_async.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_pivot_reports_async.py index 45b03c1..364ec7f 100644 --- a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_pivot_reports_async.py +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_pivot_reports_async.py @@ -38,7 +38,7 @@ async def sample_batch_run_pivot_reports(): # Make the request response = await client.batch_run_pivot_reports(request=request) - # Handle response + # Handle the response print(response) # [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_BatchRunPivotReports_async] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_pivot_reports_sync.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_pivot_reports_sync.py index 2f27cb6..33ffcb3 100644 --- a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_pivot_reports_sync.py +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_pivot_reports_sync.py @@ -38,7 +38,7 @@ def sample_batch_run_pivot_reports(): # Make the request response = client.batch_run_pivot_reports(request=request) - # Handle response + # Handle the response print(response) # [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_BatchRunPivotReports_sync] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_reports_async.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_reports_async.py index 77e37cd..d7391ed 100644 --- a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_reports_async.py +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_reports_async.py @@ -38,7 +38,7 @@ async def sample_batch_run_reports(): # Make the request response = await client.batch_run_reports(request=request) - # Handle response + # Handle the response print(response) # [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_BatchRunReports_async] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_reports_sync.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_reports_sync.py index 4c0b55c..9f70791 100644 --- a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_reports_sync.py +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_batch_run_reports_sync.py @@ -38,7 +38,7 @@ def sample_batch_run_reports(): # Make the request response = client.batch_run_reports(request=request) - # Handle response + # Handle the response print(response) # [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_BatchRunReports_sync] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_check_compatibility_async.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_check_compatibility_async.py index a2d6c0b..c709d9d 100644 --- a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_check_compatibility_async.py +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_check_compatibility_async.py @@ -38,7 +38,7 @@ async def sample_check_compatibility(): # Make the request response = await client.check_compatibility(request=request) - # Handle response + # Handle the response print(response) # [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_CheckCompatibility_async] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_check_compatibility_sync.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_check_compatibility_sync.py index b7ff49b..6e07165 100644 --- a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_check_compatibility_sync.py +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_check_compatibility_sync.py @@ -38,7 +38,7 @@ def sample_check_compatibility(): # Make the request response = client.check_compatibility(request=request) - # Handle response + # Handle the response print(response) # [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_CheckCompatibility_sync] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_get_metadata_async.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_get_metadata_async.py index f1220df..061bf19 100644 --- a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_get_metadata_async.py +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_get_metadata_async.py @@ -39,7 +39,7 @@ async def sample_get_metadata(): # Make the request response = await client.get_metadata(request=request) - # Handle response + # Handle the response print(response) # [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_GetMetadata_async] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_get_metadata_sync.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_get_metadata_sync.py index 9057d19..824990e 100644 --- a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_get_metadata_sync.py +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_get_metadata_sync.py @@ -39,7 +39,7 @@ def sample_get_metadata(): # Make the request response = client.get_metadata(request=request) - # Handle response + # Handle the response print(response) # [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_GetMetadata_sync] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_pivot_report_async.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_pivot_report_async.py index 1906e87..3029d66 100644 --- a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_pivot_report_async.py +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_pivot_report_async.py @@ -38,7 +38,7 @@ async def sample_run_pivot_report(): # Make the request response = await client.run_pivot_report(request=request) - # Handle response + # Handle the response print(response) # [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunPivotReport_async] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_pivot_report_sync.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_pivot_report_sync.py index fd7e571..697aedf 100644 --- a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_pivot_report_sync.py +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_pivot_report_sync.py @@ -38,7 +38,7 @@ def sample_run_pivot_report(): # Make the request response = client.run_pivot_report(request=request) - # Handle response + # Handle the response print(response) # [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunPivotReport_sync] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_realtime_report_async.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_realtime_report_async.py index c347e2c..d55a368 100644 --- a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_realtime_report_async.py +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_realtime_report_async.py @@ -38,7 +38,7 @@ async def sample_run_realtime_report(): # Make the request response = await client.run_realtime_report(request=request) - # Handle response + # Handle the response print(response) # [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunRealtimeReport_async] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_realtime_report_sync.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_realtime_report_sync.py index 54a83f5..ac27be4 100644 --- a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_realtime_report_sync.py +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_realtime_report_sync.py @@ -38,7 +38,7 @@ def sample_run_realtime_report(): # Make the request response = client.run_realtime_report(request=request) - # Handle response + # Handle the response print(response) # [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunRealtimeReport_sync] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_report_async.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_report_async.py index 80e60ee..e15981c 100644 --- a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_report_async.py +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_report_async.py @@ -38,7 +38,7 @@ async def sample_run_report(): # Make the request response = await client.run_report(request=request) - # Handle response + # Handle the response print(response) # [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunReport_async] diff --git a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_report_sync.py b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_report_sync.py index a4473fc..d0b888a 100644 --- a/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_report_sync.py +++ b/samples/generated_samples/analyticsdata_generated_data_v1beta_beta_analytics_data_run_report_sync.py @@ -38,7 +38,7 @@ def sample_run_report(): # Make the request response = client.run_report(request=request) - # Handle response + # Handle the response print(response) # [END analyticsdata_generated_data_v1beta_BetaAnalyticsData_RunReport_sync] From 11b2b1fa081820e9f9a0c69592ec7fb552069202 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 14 Feb 2022 16:52:22 +0100 Subject: [PATCH 18/21] chore(deps): update dependency pytest to v7.0.1 (#190) --- samples/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/requirements-test.txt b/samples/snippets/requirements-test.txt index 4a46ff6..c2845bf 100644 --- a/samples/snippets/requirements-test.txt +++ b/samples/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.0.0 +pytest==7.0.1 From dbba91295c9deacca67f8862da628e05cee6c4cc Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Tue, 15 Feb 2022 08:51:57 -0700 Subject: [PATCH 19/21] fix(deps): delete unused dependency libcst (#191) * fix(deps): delete unused dependency libcst * chore: remove libcst from constraints --- setup.py | 1 - testing/constraints-3.6.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/setup.py b/setup.py index 08a0925..465dc13 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,6 @@ # Until this issue is closed # https://github.com/googleapis/google-cloud-python/issues/10566 "google-api-core[grpc] >= 1.28.0, <3.0.0dev", - "libcst >= 0.2.5", "proto-plus >= 1.4.0", "packaging >= 14.3", ), diff --git a/testing/constraints-3.6.txt b/testing/constraints-3.6.txt index 61f0ec4..5c1659b 100644 --- a/testing/constraints-3.6.txt +++ b/testing/constraints-3.6.txt @@ -6,6 +6,5 @@ # e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", # Then this file should have foo==1.14.0 google-api-core==1.28.0 -libcst==0.2.5 proto-plus==1.4.0 packaging==14.3 From 2cf111f50d6f917c9d319522f40f06a00befb878 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 24 Feb 2022 16:44:50 +0100 Subject: [PATCH 20/21] chore(deps): update dependency google-auth-oauthlib to v0.5.0 (#192) --- samples/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index 4321b45..91f58db 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1,2 +1,2 @@ google-analytics-data==0.10.0 -google-auth-oauthlib==0.4.6 \ No newline at end of file +google-auth-oauthlib==0.5.0 \ No newline at end of file From 8b8575fa842db29a69ca50b738057c14fcd3c4d8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 24 Feb 2022 08:55:53 -0700 Subject: [PATCH 21/21] chore(main): release 0.11.0 (#183) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 18 ++++++++++++++++++ setup.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a75de78..2983d0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [0.11.0](https://github.com/googleapis/python-analytics-data/compare/v0.10.0...v0.11.0) (2022-02-24) + + +### Features + +* add api key support ([#182](https://github.com/googleapis/python-analytics-data/issues/182)) ([ad51ffd](https://github.com/googleapis/python-analytics-data/commit/ad51ffd1c461663d7ff055b69166004ea5a4d686)) + + +### Bug Fixes + +* **deps:** delete unused dependency libcst ([#191](https://github.com/googleapis/python-analytics-data/issues/191)) ([dbba912](https://github.com/googleapis/python-analytics-data/commit/dbba91295c9deacca67f8862da628e05cee6c4cc)) +* resolve DuplicateCredentialArgs error when using credentials_file ([97804fe](https://github.com/googleapis/python-analytics-data/commit/97804feb1031e3ff6ac3e6f6113b1d3123f1ec91)) + + +### Documentation + +* add autogenerated code snippets ([f34ee10](https://github.com/googleapis/python-analytics-data/commit/f34ee10dce4dae5f04aefedf9d8f3472491025d3)) + ## [0.10.0](https://www.github.com/googleapis/python-analytics-data/compare/v0.9.0...v0.10.0) (2021-11-01) diff --git a/setup.py b/setup.py index 465dc13..6dba6c2 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ import os import setuptools # type: ignore -version = "0.10.0" +version = "0.11.0" package_root = os.path.abspath(os.path.dirname(__file__))