diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 9ee60f7e..2567653c 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: - image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:aea14a583128771ae8aefa364e1652f3c56070168ef31beb203534222d842b8b + image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest + digest: sha256:87eee22d276554e4e52863ec9b1cb6a7245815dfae20439712bf644348215a5a diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml index cfdce680..b22a7c8d 100644 --- a/.github/.OwlBot.yaml +++ b/.github/.OwlBot.yaml @@ -13,7 +13,7 @@ # limitations under the License. docker: - image: gcr.io/repo-automation-bots/owlbot-python:latest + image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest deep-remove-regex: - /owl-bot-staging diff --git a/.kokoro/build.sh b/.kokoro/build.sh index ab5bfd73..f30ecf8a 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -41,7 +41,7 @@ python3 -m pip install --upgrade --quiet nox python3 -m nox --version # If this is a continuous build, send the test log to the FlakyBot. -# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot. +# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot. if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then cleanup() { chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot diff --git a/.kokoro/test-samples-impl.sh b/.kokoro/test-samples-impl.sh index 311a8d54..8a324c9c 100755 --- a/.kokoro/test-samples-impl.sh +++ b/.kokoro/test-samples-impl.sh @@ -80,7 +80,7 @@ for file in samples/**/requirements.txt; do EXIT=$? # If this is a periodic build, send the test log to the FlakyBot. - # See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot. + # See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot. if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot $KOKORO_GFILE_DIR/linux_amd64/flakybot diff --git a/CHANGELOG.md b/CHANGELOG.md index f48eb5f8..6fb0a6d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [0.3.3](https://www.github.com/googleapis/python-recommendations-ai/compare/v0.3.2...v0.3.3) (2021-09-24) + + +### Bug Fixes + +* add 'dict' annotation type to 'request' ([ff8c418](https://www.github.com/googleapis/python-recommendations-ai/commit/ff8c4189e70770b83b84eb0d6cf886104d62d36a)) + ### [0.3.2](https://www.github.com/googleapis/python-recommendations-ai/compare/v0.3.1...v0.3.2) (2021-07-28) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index e81cf88c..78e41b24 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -50,9 +50,9 @@ You'll have to create a development environment using a Git checkout: # Configure remotes such that you can pull changes from the googleapis/python-recommendations-ai # repository into your local repository. $ git remote add upstream git@github.com:googleapis/python-recommendations-ai.git - # fetch and merge changes from upstream into master + # fetch and merge changes from upstream into main $ git fetch upstream - $ git merge upstream/master + $ git merge upstream/main Now your local repo is set up such that you will push changes to your GitHub repo, from which you can submit a pull request. @@ -110,12 +110,12 @@ Coding Style variables:: export GOOGLE_CLOUD_TESTING_REMOTE="upstream" - export GOOGLE_CLOUD_TESTING_BRANCH="master" + export GOOGLE_CLOUD_TESTING_BRANCH="main" By doing this, you are specifying the location of the most up-to-date - version of ``python-recommendations-ai``. The the suggested remote name ``upstream`` - should point to the official ``googleapis`` checkout and the - the branch should be the main branch on that remote (``master``). + version of ``python-recommendations-ai``. The + remote name ``upstream`` should point to the official ``googleapis`` + checkout and the branch should be the default branch on that remote (``main``). - This repository contains configuration for the `pre-commit `__ tool, which automates checking @@ -209,7 +209,7 @@ The `description on PyPI`_ for the project comes directly from the ``README``. Due to the reStructuredText (``rst``) parser used by PyPI, relative links which will work on GitHub (e.g. ``CONTRIBUTING.rst`` instead of -``https://github.com/googleapis/python-recommendations-ai/blob/master/CONTRIBUTING.rst``) +``https://github.com/googleapis/python-recommendations-ai/blob/main/CONTRIBUTING.rst``) may cause problems creating links or rendering the description. .. _description on PyPI: https://pypi.org/project/google-cloud-recommendations-ai @@ -234,7 +234,7 @@ We support: Supported versions can be found in our ``noxfile.py`` `config`_. -.. _config: https://github.com/googleapis/python-recommendations-ai/blob/master/noxfile.py +.. _config: https://github.com/googleapis/python-recommendations-ai/blob/main/noxfile.py We also explicitly decided to support Python 3 beginning with version 3.6. diff --git a/README.rst b/README.rst index 1125f65c..b6e10e2e 100644 --- a/README.rst +++ b/README.rst @@ -9,7 +9,7 @@ Python Client for Recommendations AI - `Product Documentation`_ .. |beta| image:: https://img.shields.io/badge/support-beta-orange.svg - :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#beta-support + :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#beta-support .. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-recommendations-ai.svg :target: https://pypi.org/project/google-cloud-recommendations-ai/ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-recommendations-ai.svg @@ -79,4 +79,4 @@ Next Steps APIs that we cover. .. _Recommendations AI API Product documentation: https://cloud.google.com/recommendations-ai -.. _README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst \ No newline at end of file +.. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index dd621a00..626ef613 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -76,8 +76,8 @@ # The encoding of source files. # source_encoding = 'utf-8-sig' -# The master toctree document. -master_doc = "index" +# The root toctree document. +root_doc = "index" # General information about the project. project = "google-cloud-recommendations-ai" @@ -110,6 +110,7 @@ # directories to ignore when looking for source files. exclude_patterns = [ "_build", + "**/.nox/**/*", "samples/AUTHORING_GUIDE.md", "samples/CONTRIBUTING.md", "samples/snippets/README.rst", @@ -279,7 +280,7 @@ # author, documentclass [howto, manual, or own class]). latex_documents = [ ( - master_doc, + root_doc, "google-cloud-recommendations-ai.tex", "google-cloud-recommendations-ai Documentation", author, @@ -314,7 +315,7 @@ # (source start file, name, description, authors, manual section). man_pages = [ ( - master_doc, + root_doc, "google-cloud-recommendations-ai", "google-cloud-recommendations-ai Documentation", [author], @@ -333,7 +334,7 @@ # dir menu entry, description, category) texinfo_documents = [ ( - master_doc, + root_doc, "google-cloud-recommendations-ai", "google-cloud-recommendations-ai Documentation", author, diff --git a/google/cloud/recommendationengine_v1beta1/services/catalog_service/client.py b/google/cloud/recommendationengine_v1beta1/services/catalog_service/client.py index d26ffb59..09cde147 100644 --- a/google/cloud/recommendationengine_v1beta1/services/catalog_service/client.py +++ b/google/cloud/recommendationengine_v1beta1/services/catalog_service/client.py @@ -17,7 +17,7 @@ from distutils import util import os import re -from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union +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 @@ -360,7 +360,7 @@ def __init__( def create_catalog_item( self, - request: catalog_service.CreateCatalogItemRequest = None, + request: Union[catalog_service.CreateCatalogItemRequest, dict] = None, *, parent: str = None, catalog_item: catalog.CatalogItem = None, @@ -371,7 +371,7 @@ def create_catalog_item( r"""Creates a catalog item. Args: - request (google.cloud.recommendationengine_v1beta1.types.CreateCatalogItemRequest): + request (Union[google.cloud.recommendationengine_v1beta1.types.CreateCatalogItemRequest, dict]): The request object. Request message for CreateCatalogItem method. parent (str): @@ -439,7 +439,7 @@ def create_catalog_item( def get_catalog_item( self, - request: catalog_service.GetCatalogItemRequest = None, + request: Union[catalog_service.GetCatalogItemRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -449,7 +449,7 @@ def get_catalog_item( r"""Gets a specific catalog item. Args: - request (google.cloud.recommendationengine_v1beta1.types.GetCatalogItemRequest): + request (Union[google.cloud.recommendationengine_v1beta1.types.GetCatalogItemRequest, dict]): The request object. Request message for GetCatalogItem method. name (str): @@ -510,7 +510,7 @@ def get_catalog_item( def list_catalog_items( self, - request: catalog_service.ListCatalogItemsRequest = None, + request: Union[catalog_service.ListCatalogItemsRequest, dict] = None, *, parent: str = None, filter: str = None, @@ -521,7 +521,7 @@ def list_catalog_items( r"""Gets a list of catalog items. Args: - request (google.cloud.recommendationengine_v1beta1.types.ListCatalogItemsRequest): + request (Union[google.cloud.recommendationengine_v1beta1.types.ListCatalogItemsRequest, dict]): The request object. Request message for ListCatalogItems method. parent (str): @@ -600,7 +600,7 @@ def list_catalog_items( def update_catalog_item( self, - request: catalog_service.UpdateCatalogItemRequest = None, + request: Union[catalog_service.UpdateCatalogItemRequest, dict] = None, *, name: str = None, catalog_item: catalog.CatalogItem = None, @@ -613,7 +613,7 @@ def update_catalog_item( supported. Non-existing items will be created. Args: - request (google.cloud.recommendationengine_v1beta1.types.UpdateCatalogItemRequest): + request (Union[google.cloud.recommendationengine_v1beta1.types.UpdateCatalogItemRequest, dict]): The request object. Request message for UpdateCatalogItem method. name (str): @@ -693,7 +693,7 @@ def update_catalog_item( def delete_catalog_item( self, - request: catalog_service.DeleteCatalogItemRequest = None, + request: Union[catalog_service.DeleteCatalogItemRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -703,7 +703,7 @@ def delete_catalog_item( r"""Deletes a catalog item. Args: - request (google.cloud.recommendationengine_v1beta1.types.DeleteCatalogItemRequest): + request (Union[google.cloud.recommendationengine_v1beta1.types.DeleteCatalogItemRequest, dict]): The request object. Request message for DeleteCatalogItem method. name (str): @@ -757,7 +757,7 @@ def delete_catalog_item( def import_catalog_items( self, - request: import_.ImportCatalogItemsRequest = None, + request: Union[import_.ImportCatalogItemsRequest, dict] = None, *, parent: str = None, request_id: str = None, @@ -776,7 +776,7 @@ def import_catalog_items( successfully updated. Args: - request (google.cloud.recommendationengine_v1beta1.types.ImportCatalogItemsRequest): + request (Union[google.cloud.recommendationengine_v1beta1.types.ImportCatalogItemsRequest, dict]): The request object. Request message for Import methods. parent (str): Required. diff --git a/google/cloud/recommendationengine_v1beta1/services/catalog_service/transports/base.py b/google/cloud/recommendationengine_v1beta1/services/catalog_service/transports/base.py index 91bb327b..aba97928 100644 --- a/google/cloud/recommendationengine_v1beta1/services/catalog_service/transports/base.py +++ b/google/cloud/recommendationengine_v1beta1/services/catalog_service/transports/base.py @@ -122,7 +122,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/recommendationengine_v1beta1/services/catalog_service/transports/grpc.py b/google/cloud/recommendationengine_v1beta1/services/catalog_service/transports/grpc.py index ba82c381..0f6a96d1 100644 --- a/google/cloud/recommendationengine_v1beta1/services/catalog_service/transports/grpc.py +++ b/google/cloud/recommendationengine_v1beta1/services/catalog_service/transports/grpc.py @@ -86,16 +86,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/recommendationengine_v1beta1/services/catalog_service/transports/grpc_asyncio.py b/google/cloud/recommendationengine_v1beta1/services/catalog_service/transports/grpc_asyncio.py index 962f0afb..b5bfe539 100644 --- a/google/cloud/recommendationengine_v1beta1/services/catalog_service/transports/grpc_asyncio.py +++ b/google/cloud/recommendationengine_v1beta1/services/catalog_service/transports/grpc_asyncio.py @@ -133,16 +133,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/client.py b/google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/client.py index eaa4e55a..ecbcc4ae 100644 --- a/google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/client.py +++ b/google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/client.py @@ -17,7 +17,7 @@ from distutils import util import os import re -from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union +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 @@ -395,7 +395,10 @@ def __init__( def create_prediction_api_key_registration( self, - request: prediction_apikey_registry_service.CreatePredictionApiKeyRegistrationRequest = None, + request: Union[ + prediction_apikey_registry_service.CreatePredictionApiKeyRegistrationRequest, + dict, + ] = None, *, parent: str = None, prediction_api_key_registration: prediction_apikey_registry_service.PredictionApiKeyRegistration = None, @@ -406,7 +409,7 @@ def create_prediction_api_key_registration( r"""Register an API key for use with predict method. Args: - request (google.cloud.recommendationengine_v1beta1.types.CreatePredictionApiKeyRegistrationRequest): + request (Union[google.cloud.recommendationengine_v1beta1.types.CreatePredictionApiKeyRegistrationRequest, dict]): The request object. Request message for the `CreatePredictionApiKeyRegistration` method. parent (str): @@ -483,7 +486,10 @@ def create_prediction_api_key_registration( def list_prediction_api_key_registrations( self, - request: prediction_apikey_registry_service.ListPredictionApiKeyRegistrationsRequest = None, + request: Union[ + prediction_apikey_registry_service.ListPredictionApiKeyRegistrationsRequest, + dict, + ] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -494,7 +500,7 @@ def list_prediction_api_key_registrations( method. Args: - request (google.cloud.recommendationengine_v1beta1.types.ListPredictionApiKeyRegistrationsRequest): + request (Union[google.cloud.recommendationengine_v1beta1.types.ListPredictionApiKeyRegistrationsRequest, dict]): The request object. Request message for the `ListPredictionApiKeyRegistrations`. parent (str): @@ -571,7 +577,10 @@ def list_prediction_api_key_registrations( def delete_prediction_api_key_registration( self, - request: prediction_apikey_registry_service.DeletePredictionApiKeyRegistrationRequest = None, + request: Union[ + prediction_apikey_registry_service.DeletePredictionApiKeyRegistrationRequest, + dict, + ] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -581,7 +590,7 @@ def delete_prediction_api_key_registration( r"""Unregister an apiKey from using for predict method. Args: - request (google.cloud.recommendationengine_v1beta1.types.DeletePredictionApiKeyRegistrationRequest): + request (Union[google.cloud.recommendationengine_v1beta1.types.DeletePredictionApiKeyRegistrationRequest, dict]): The request object. Request message for `DeletePredictionApiKeyRegistration` method. name (str): diff --git a/google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/transports/base.py b/google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/transports/base.py index d13921ca..fdecd78c 100644 --- a/google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/transports/base.py +++ b/google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/transports/base.py @@ -120,7 +120,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/transports/grpc.py b/google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/transports/grpc.py index 40e30a79..ce696ccc 100644 --- a/google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/transports/grpc.py +++ b/google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/transports/grpc.py @@ -88,16 +88,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/transports/grpc_asyncio.py b/google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/transports/grpc_asyncio.py index bb568d8d..81bec6b7 100644 --- a/google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/transports/grpc_asyncio.py +++ b/google/cloud/recommendationengine_v1beta1/services/prediction_api_key_registry/transports/grpc_asyncio.py @@ -135,16 +135,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/recommendationengine_v1beta1/services/prediction_service/client.py b/google/cloud/recommendationengine_v1beta1/services/prediction_service/client.py index d5a811e2..fee4948e 100644 --- a/google/cloud/recommendationengine_v1beta1/services/prediction_service/client.py +++ b/google/cloud/recommendationengine_v1beta1/services/prediction_service/client.py @@ -17,7 +17,7 @@ from distutils import util import os import re -from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union +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 @@ -361,7 +361,7 @@ def __init__( def predict( self, - request: prediction_service.PredictRequest = None, + request: Union[prediction_service.PredictRequest, dict] = None, *, name: str = None, user_event: gcr_user_event.UserEvent = None, @@ -376,7 +376,7 @@ def predict( more `__. Args: - request (google.cloud.recommendationengine_v1beta1.types.PredictRequest): + request (Union[google.cloud.recommendationengine_v1beta1.types.PredictRequest, dict]): The request object. Request message for Predict method. name (str): Required. Full resource name of the format: diff --git a/google/cloud/recommendationengine_v1beta1/services/prediction_service/transports/base.py b/google/cloud/recommendationengine_v1beta1/services/prediction_service/transports/base.py index 1762da2a..61068e86 100644 --- a/google/cloud/recommendationengine_v1beta1/services/prediction_service/transports/base.py +++ b/google/cloud/recommendationengine_v1beta1/services/prediction_service/transports/base.py @@ -117,7 +117,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/recommendationengine_v1beta1/services/prediction_service/transports/grpc.py b/google/cloud/recommendationengine_v1beta1/services/prediction_service/transports/grpc.py index 93ee9231..fa9d8335 100644 --- a/google/cloud/recommendationengine_v1beta1/services/prediction_service/transports/grpc.py +++ b/google/cloud/recommendationengine_v1beta1/services/prediction_service/transports/grpc.py @@ -80,16 +80,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/recommendationengine_v1beta1/services/prediction_service/transports/grpc_asyncio.py b/google/cloud/recommendationengine_v1beta1/services/prediction_service/transports/grpc_asyncio.py index 95797987..f290c6cb 100644 --- a/google/cloud/recommendationengine_v1beta1/services/prediction_service/transports/grpc_asyncio.py +++ b/google/cloud/recommendationengine_v1beta1/services/prediction_service/transports/grpc_asyncio.py @@ -127,16 +127,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/recommendationengine_v1beta1/services/user_event_service/client.py b/google/cloud/recommendationengine_v1beta1/services/user_event_service/client.py index fc329b59..4f0726a0 100644 --- a/google/cloud/recommendationengine_v1beta1/services/user_event_service/client.py +++ b/google/cloud/recommendationengine_v1beta1/services/user_event_service/client.py @@ -17,7 +17,7 @@ from distutils import util import os import re -from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union +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 @@ -367,7 +367,7 @@ def __init__( def write_user_event( self, - request: user_event_service.WriteUserEventRequest = None, + request: Union[user_event_service.WriteUserEventRequest, dict] = None, *, parent: str = None, user_event: gcr_user_event.UserEvent = None, @@ -378,7 +378,7 @@ def write_user_event( r"""Writes a single user event. Args: - request (google.cloud.recommendationengine_v1beta1.types.WriteUserEventRequest): + request (Union[google.cloud.recommendationengine_v1beta1.types.WriteUserEventRequest, dict]): The request object. Request message for WriteUserEvent method. parent (str): @@ -448,7 +448,7 @@ def write_user_event( def collect_user_event( self, - request: user_event_service.CollectUserEventRequest = None, + request: Union[user_event_service.CollectUserEventRequest, dict] = None, *, parent: str = None, user_event: str = None, @@ -466,7 +466,7 @@ def collect_user_event( directly. Args: - request (google.cloud.recommendationengine_v1beta1.types.CollectUserEventRequest): + request (Union[google.cloud.recommendationengine_v1beta1.types.CollectUserEventRequest, dict]): The request object. Request message for CollectUserEvent method. parent (str): @@ -606,7 +606,7 @@ def collect_user_event( def list_user_events( self, - request: user_event_service.ListUserEventsRequest = None, + request: Union[user_event_service.ListUserEventsRequest, dict] = None, *, parent: str = None, filter: str = None, @@ -618,7 +618,7 @@ def list_user_events( potential filtering. Args: - request (google.cloud.recommendationengine_v1beta1.types.ListUserEventsRequest): + request (Union[google.cloud.recommendationengine_v1beta1.types.ListUserEventsRequest, dict]): The request object. Request message for ListUserEvents method. parent (str): @@ -731,7 +731,7 @@ def list_user_events( def purge_user_events( self, - request: user_event_service.PurgeUserEventsRequest = None, + request: Union[user_event_service.PurgeUserEventsRequest, dict] = None, *, parent: str = None, filter: str = None, @@ -747,7 +747,7 @@ def purge_user_events( command first. Args: - request (google.cloud.recommendationengine_v1beta1.types.PurgeUserEventsRequest): + request (Union[google.cloud.recommendationengine_v1beta1.types.PurgeUserEventsRequest, dict]): The request object. Request message for PurgeUserEvents method. parent (str): @@ -858,7 +858,7 @@ def purge_user_events( def import_user_events( self, - request: import_.ImportUserEventsRequest = None, + request: Union[import_.ImportUserEventsRequest, dict] = None, *, parent: str = None, request_id: str = None, @@ -877,7 +877,7 @@ def import_user_events( ImportMetadata. Args: - request (google.cloud.recommendationengine_v1beta1.types.ImportUserEventsRequest): + request (Union[google.cloud.recommendationengine_v1beta1.types.ImportUserEventsRequest, dict]): The request object. Request message for the ImportUserEvents request. parent (str): diff --git a/google/cloud/recommendationengine_v1beta1/services/user_event_service/transports/base.py b/google/cloud/recommendationengine_v1beta1/services/user_event_service/transports/base.py index eea694c2..401b0e7d 100644 --- a/google/cloud/recommendationengine_v1beta1/services/user_event_service/transports/base.py +++ b/google/cloud/recommendationengine_v1beta1/services/user_event_service/transports/base.py @@ -122,7 +122,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/recommendationengine_v1beta1/services/user_event_service/transports/grpc.py b/google/cloud/recommendationengine_v1beta1/services/user_event_service/transports/grpc.py index d4f94a9c..383800b2 100644 --- a/google/cloud/recommendationengine_v1beta1/services/user_event_service/transports/grpc.py +++ b/google/cloud/recommendationengine_v1beta1/services/user_event_service/transports/grpc.py @@ -86,16 +86,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/recommendationengine_v1beta1/services/user_event_service/transports/grpc_asyncio.py b/google/cloud/recommendationengine_v1beta1/services/user_event_service/transports/grpc_asyncio.py index 720bd026..03441e44 100644 --- a/google/cloud/recommendationengine_v1beta1/services/user_event_service/transports/grpc_asyncio.py +++ b/google/cloud/recommendationengine_v1beta1/services/user_event_service/transports/grpc_asyncio.py @@ -133,16 +133,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/noxfile.py b/noxfile.py index 03aa2f58..2bf3ffd7 100644 --- a/noxfile.py +++ b/noxfile.py @@ -84,9 +84,15 @@ def default(session): constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) - session.install("asyncmock", "pytest-asyncio", "-c", constraints_path) - - session.install("mock", "pytest", "pytest-cov", "-c", constraints_path) + session.install( + "mock", + "asyncmock", + "pytest", + "pytest-cov", + "pytest-asyncio", + "-c", + constraints_path, + ) session.install("-e", ".", "-c", constraints_path) diff --git a/owlbot.py b/owlbot.py index 68c2a481..4b6c5a97 100644 --- a/owlbot.py +++ b/owlbot.py @@ -94,8 +94,11 @@ # Add templated files # ---------------------------------------------------------------------------- templated_files = common.py_library(cov_level=98, microgenerator=True) + s.move( templated_files, excludes=[".coveragerc"] ) # the microgenerator has a good coveragerc file +python.py_samples(skip_readmes=True) + s.shell.run(["nox", "-s", "blacken"], hide_output=False) \ No newline at end of file diff --git a/renovate.json b/renovate.json index c0489556..c21036d3 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,9 @@ { "extends": [ - "config:base", ":preserveSemverRanges" + "config:base", + "group:all", + ":preserveSemverRanges", + ":disableDependencyDashboard" ], "ignorePaths": [".pre-commit-config.yaml"], "pip_requirements": { diff --git a/scripts/fixup_recommendationengine_v1beta1_keywords.py b/scripts/fixup_recommendationengine_v1beta1_keywords.py index 9652c971..6bb5115d 100644 --- a/scripts/fixup_recommendationengine_v1beta1_keywords.py +++ b/scripts/fixup_recommendationengine_v1beta1_keywords.py @@ -39,21 +39,21 @@ def partition( class recommendationengineCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'collect_user_event': ('parent', 'user_event', 'uri', 'ets', ), - 'create_catalog_item': ('parent', 'catalog_item', ), - 'create_prediction_api_key_registration': ('parent', 'prediction_api_key_registration', ), - 'delete_catalog_item': ('name', ), - 'delete_prediction_api_key_registration': ('name', ), - 'get_catalog_item': ('name', ), - 'import_catalog_items': ('parent', 'input_config', 'request_id', 'errors_config', ), - 'import_user_events': ('parent', 'input_config', 'request_id', 'errors_config', ), - 'list_catalog_items': ('parent', 'page_size', 'page_token', 'filter', ), - 'list_prediction_api_key_registrations': ('parent', 'page_size', 'page_token', ), - 'list_user_events': ('parent', 'page_size', 'page_token', 'filter', ), - 'predict': ('name', 'user_event', 'page_size', 'page_token', 'filter', 'dry_run', 'params', 'labels', ), - 'purge_user_events': ('parent', 'filter', 'force', ), - 'update_catalog_item': ('name', 'catalog_item', 'update_mask', ), - 'write_user_event': ('parent', 'user_event', ), + 'collect_user_event': ('parent', 'user_event', 'uri', 'ets', ), + 'create_catalog_item': ('parent', 'catalog_item', ), + 'create_prediction_api_key_registration': ('parent', 'prediction_api_key_registration', ), + 'delete_catalog_item': ('name', ), + 'delete_prediction_api_key_registration': ('name', ), + 'get_catalog_item': ('name', ), + 'import_catalog_items': ('parent', 'input_config', 'request_id', 'errors_config', ), + 'import_user_events': ('parent', 'input_config', 'request_id', 'errors_config', ), + 'list_catalog_items': ('parent', 'page_size', 'page_token', 'filter', ), + 'list_prediction_api_key_registrations': ('parent', 'page_size', 'page_token', ), + 'list_user_events': ('parent', 'page_size', 'page_token', 'filter', ), + 'predict': ('name', 'user_event', 'page_size', 'page_token', 'filter', 'dry_run', 'params', 'labels', ), + 'purge_user_events': ('parent', 'filter', 'force', ), + 'update_catalog_item': ('name', 'catalog_item', 'update_mask', ), + 'write_user_event': ('parent', 'user_event', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -72,7 +72,7 @@ def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: return updated kwargs, ctrl_kwargs = partition( - lambda a: not a.keyword.value in self.CTRL_PARAMS, + lambda a: a.keyword.value not in self.CTRL_PARAMS, kwargs ) diff --git a/scripts/readme-gen/templates/install_deps.tmpl.rst b/scripts/readme-gen/templates/install_deps.tmpl.rst index a0406dba..275d6498 100644 --- a/scripts/readme-gen/templates/install_deps.tmpl.rst +++ b/scripts/readme-gen/templates/install_deps.tmpl.rst @@ -12,7 +12,7 @@ Install Dependencies .. _Python Development Environment Setup Guide: https://cloud.google.com/python/setup -#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. +#. Create a virtualenv. Samples are compatible with Python 3.6+. .. code-block:: bash diff --git a/setup.py b/setup.py index 40a85daa..24b94244 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ import os import setuptools # type: ignore -version = "0.3.2" +version = "0.3.3" package_root = os.path.abspath(os.path.dirname(__file__))