From 1ab75340a9407e6add781206a0dddfee6e408037 Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Wed, 10 Nov 2021 09:54:35 -0600 Subject: [PATCH] fix: correct Client and Connection type annotations --- google/cloud/_http/__init__.py | 9 +++++---- google/cloud/client/__init__.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/google/cloud/_http/__init__.py b/google/cloud/_http/__init__.py index 7c9cbc9..4c3ed96 100644 --- a/google/cloud/_http/__init__.py +++ b/google/cloud/_http/__init__.py @@ -19,6 +19,7 @@ import json import os import platform +from typing import Optional from urllib.parse import urlencode import warnings @@ -168,19 +169,19 @@ class JSONConnection(Connection): must be updated by subclasses. """ - API_BASE_URL = None + API_BASE_URL: Optional[str] = None """The base of the API call URL.""" - API_BASE_MTLS_URL = None + API_BASE_MTLS_URL: Optional[str] = None """The base of the API call URL for mutual TLS.""" ALLOW_AUTO_SWITCH_TO_MTLS_URL = False """Indicates if auto switch to mTLS url is allowed.""" - API_VERSION = None + API_VERSION: Optional[str] = None """The version of the API, used in building the API call's URL.""" - API_URL_TEMPLATE = None + API_URL_TEMPLATE: Optional[str] = None """A template for the URL of a particular API call.""" def get_api_base_url_for_mtls(self, api_base_url=None): diff --git a/google/cloud/client/__init__.py b/google/cloud/client/__init__.py index b3ca4b8..5bd12f2 100644 --- a/google/cloud/client/__init__.py +++ b/google/cloud/client/__init__.py @@ -144,7 +144,7 @@ class Client(_ClientFactoryMixin): to acquire default credentials. """ - SCOPE: Union[Tuple[str], None] = None + SCOPE: Union[Tuple[str, ...], None] = None """The scopes required for authenticating with a service. Needs to be set by subclasses.