diff --git a/packages/google-cloud-certificate-manager/.coveragerc b/packages/google-cloud-certificate-manager/.coveragerc index 942b1c99ad6f..d3e09016865d 100644 --- a/packages/google-cloud-certificate-manager/.coveragerc +++ b/packages/google-cloud-certificate-manager/.coveragerc @@ -10,8 +10,3 @@ exclude_lines = pragma: NO COVER # Ignore debug-only repr def __repr__ - # Ignore pkg_resources exceptions. - # This is added at the module level as a safeguard for if someone - # generates the code and tries to run it without pip installing. This - # makes it virtually impossible to test properly. - except pkg_resources.DistributionNotFound diff --git a/packages/google-cloud-certificate-manager/google/cloud/certificate_manager_v1/gapic_version.py b/packages/google-cloud-certificate-manager/google/cloud/certificate_manager_v1/gapic_version.py new file mode 100644 index 000000000000..45cbc6dd48c8 --- /dev/null +++ b/packages/google-cloud-certificate-manager/google/cloud/certificate_manager_v1/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# 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. +# +__version__ = "1.1.1" # {x-release-please-version} diff --git a/packages/google-cloud-certificate-manager/google/cloud/certificate_manager_v1/services/certificate_manager/async_client.py b/packages/google-cloud-certificate-manager/google/cloud/certificate_manager_v1/services/certificate_manager/async_client.py index f659b90186b1..0c2c23b11577 100644 --- a/packages/google-cloud-certificate-manager/google/cloud/certificate_manager_v1/services/certificate_manager/async_client.py +++ b/packages/google-cloud-certificate-manager/google/cloud/certificate_manager_v1/services/certificate_manager/async_client.py @@ -34,7 +34,8 @@ from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.certificate_manager_v1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -289,7 +290,7 @@ async def list_certificates( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListCertificatesAsyncPager: r"""Lists Certificates in a given project and location. @@ -415,7 +416,7 @@ async def get_certificate( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> certificate_manager.Certificate: r"""Gets details of a single Certificate. @@ -528,7 +529,7 @@ async def create_certificate( certificate: Optional[certificate_manager.Certificate] = None, certificate_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a new Certificate in a given project and @@ -560,7 +561,7 @@ async def sample_create_certificate(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -677,7 +678,7 @@ async def update_certificate( certificate: Optional[certificate_manager.Certificate] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates a Certificate. @@ -706,7 +707,7 @@ async def sample_update_certificate(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -816,7 +817,7 @@ async def delete_certificate( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deletes a single Certificate. @@ -846,7 +847,7 @@ async def sample_delete_certificate(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -951,7 +952,7 @@ async def list_certificate_maps( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListCertificateMapsAsyncPager: r"""Lists CertificateMaps in a given project and @@ -1078,7 +1079,7 @@ async def get_certificate_map( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> certificate_manager.CertificateMap: r"""Gets details of a single CertificateMap. @@ -1194,7 +1195,7 @@ async def create_certificate_map( certificate_map: Optional[certificate_manager.CertificateMap] = None, certificate_map_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a new CertificateMap in a given project and @@ -1226,7 +1227,7 @@ async def sample_create_certificate_map(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1343,7 +1344,7 @@ async def update_certificate_map( certificate_map: Optional[certificate_manager.CertificateMap] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates a CertificateMap. @@ -1372,7 +1373,7 @@ async def sample_update_certificate_map(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1482,7 +1483,7 @@ async def delete_certificate_map( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deletes a single CertificateMap. A Certificate Map @@ -1515,7 +1516,7 @@ async def sample_delete_certificate_map(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1621,7 +1622,7 @@ async def list_certificate_map_entries( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListCertificateMapEntriesAsyncPager: r"""Lists CertificateMapEntries in a given project and @@ -1749,7 +1750,7 @@ async def get_certificate_map_entry( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> certificate_manager.CertificateMapEntry: r"""Gets details of a single CertificateMapEntry. @@ -1863,7 +1864,7 @@ async def create_certificate_map_entry( certificate_map_entry: Optional[certificate_manager.CertificateMapEntry] = None, certificate_map_entry_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a new CertificateMapEntry in a given project @@ -1899,7 +1900,7 @@ async def sample_create_certificate_map_entry(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2019,7 +2020,7 @@ async def update_certificate_map_entry( certificate_map_entry: Optional[certificate_manager.CertificateMapEntry] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates a CertificateMapEntry. @@ -2052,7 +2053,7 @@ async def sample_update_certificate_map_entry(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2163,7 +2164,7 @@ async def delete_certificate_map_entry( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deletes a single CertificateMapEntry. @@ -2193,7 +2194,7 @@ async def sample_delete_certificate_map_entry(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2299,7 +2300,7 @@ async def list_dns_authorizations( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListDnsAuthorizationsAsyncPager: r"""Lists DnsAuthorizations in a given project and @@ -2426,7 +2427,7 @@ async def get_dns_authorization( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> certificate_manager.DnsAuthorization: r"""Gets details of a single DnsAuthorization. @@ -2543,7 +2544,7 @@ async def create_dns_authorization( dns_authorization: Optional[certificate_manager.DnsAuthorization] = None, dns_authorization_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a new DnsAuthorization in a given project and @@ -2579,7 +2580,7 @@ async def sample_create_dns_authorization(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2695,7 +2696,7 @@ async def update_dns_authorization( dns_authorization: Optional[certificate_manager.DnsAuthorization] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates a DnsAuthorization. @@ -2728,7 +2729,7 @@ async def sample_update_dns_authorization(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2837,7 +2838,7 @@ async def delete_dns_authorization( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deletes a single DnsAuthorization. @@ -2867,7 +2868,7 @@ async def sample_delete_dns_authorization(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2975,7 +2976,7 @@ async def list_certificate_issuance_configs( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListCertificateIssuanceConfigsAsyncPager: r"""Lists CertificateIssuanceConfigs in a given project @@ -3104,7 +3105,7 @@ async def get_certificate_issuance_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> certificate_issuance_config.CertificateIssuanceConfig: r"""Gets details of a single CertificateIssuanceConfig. @@ -3227,7 +3228,7 @@ async def create_certificate_issuance_config( ] = None, certificate_issuance_config_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a new CertificateIssuanceConfig in a given @@ -3265,7 +3266,7 @@ async def sample_create_certificate_issuance_config(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -3391,7 +3392,7 @@ async def delete_certificate_issuance_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deletes a single CertificateIssuanceConfig. @@ -3421,7 +3422,7 @@ async def sample_delete_certificate_issuance_config(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -3526,7 +3527,7 @@ async def list_operations( request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -3580,7 +3581,7 @@ async def get_operation( request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -3634,7 +3635,7 @@ async def delete_operation( request: Optional[operations_pb2.DeleteOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a long-running operation. @@ -3689,7 +3690,7 @@ async def cancel_operation( request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -3743,7 +3744,7 @@ async def get_location( request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -3797,7 +3798,7 @@ async def list_locations( request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -3853,14 +3854,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-certificate-manager", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("CertificateManagerAsyncClient",) diff --git a/packages/google-cloud-certificate-manager/google/cloud/certificate_manager_v1/services/certificate_manager/client.py b/packages/google-cloud-certificate-manager/google/cloud/certificate_manager_v1/services/certificate_manager/client.py index 9beae64bb9bd..df9937e3d9bb 100644 --- a/packages/google-cloud-certificate-manager/google/cloud/certificate_manager_v1/services/certificate_manager/client.py +++ b/packages/google-cloud-certificate-manager/google/cloud/certificate_manager_v1/services/certificate_manager/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.certificate_manager_v1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -603,7 +604,7 @@ def list_certificates( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListCertificatesPager: r"""Lists Certificates in a given project and location. @@ -720,7 +721,7 @@ def get_certificate( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> certificate_manager.Certificate: r"""Gets details of a single Certificate. @@ -824,7 +825,7 @@ def create_certificate( certificate: Optional[certificate_manager.Certificate] = None, certificate_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a new Certificate in a given project and @@ -964,7 +965,7 @@ def update_certificate( certificate: Optional[certificate_manager.Certificate] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates a Certificate. @@ -1094,7 +1095,7 @@ def delete_certificate( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deletes a single Certificate. @@ -1220,7 +1221,7 @@ def list_certificate_maps( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListCertificateMapsPager: r"""Lists CertificateMaps in a given project and @@ -1338,7 +1339,7 @@ def get_certificate_map( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> certificate_manager.CertificateMap: r"""Gets details of a single CertificateMap. @@ -1445,7 +1446,7 @@ def create_certificate_map( certificate_map: Optional[certificate_manager.CertificateMap] = None, certificate_map_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a new CertificateMap in a given project and @@ -1585,7 +1586,7 @@ def update_certificate_map( certificate_map: Optional[certificate_manager.CertificateMap] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates a CertificateMap. @@ -1715,7 +1716,7 @@ def delete_certificate_map( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deletes a single CertificateMap. A Certificate Map @@ -1845,7 +1846,7 @@ def list_certificate_map_entries( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListCertificateMapEntriesPager: r"""Lists CertificateMapEntries in a given project and @@ -1968,7 +1969,7 @@ def get_certificate_map_entry( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> certificate_manager.CertificateMapEntry: r"""Gets details of a single CertificateMapEntry. @@ -2075,7 +2076,7 @@ def create_certificate_map_entry( certificate_map_entry: Optional[certificate_manager.CertificateMapEntry] = None, certificate_map_entry_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a new CertificateMapEntry in a given project @@ -2226,7 +2227,7 @@ def update_certificate_map_entry( certificate_map_entry: Optional[certificate_manager.CertificateMapEntry] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates a CertificateMapEntry. @@ -2365,7 +2366,7 @@ def delete_certificate_map_entry( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deletes a single CertificateMapEntry. @@ -2496,7 +2497,7 @@ def list_dns_authorizations( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListDnsAuthorizationsPager: r"""Lists DnsAuthorizations in a given project and @@ -2614,7 +2615,7 @@ def get_dns_authorization( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> certificate_manager.DnsAuthorization: r"""Gets details of a single DnsAuthorization. @@ -2722,7 +2723,7 @@ def create_dns_authorization( dns_authorization: Optional[certificate_manager.DnsAuthorization] = None, dns_authorization_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a new DnsAuthorization in a given project and @@ -2865,7 +2866,7 @@ def update_dns_authorization( dns_authorization: Optional[certificate_manager.DnsAuthorization] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates a DnsAuthorization. @@ -2998,7 +2999,7 @@ def delete_dns_authorization( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deletes a single DnsAuthorization. @@ -3127,7 +3128,7 @@ def list_certificate_issuance_configs( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListCertificateIssuanceConfigsPager: r"""Lists CertificateIssuanceConfigs in a given project @@ -3251,7 +3252,7 @@ def get_certificate_issuance_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> certificate_issuance_config.CertificateIssuanceConfig: r"""Gets details of a single CertificateIssuanceConfig. @@ -3369,7 +3370,7 @@ def create_certificate_issuance_config( ] = None, certificate_issuance_config_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a new CertificateIssuanceConfig in a given @@ -3529,7 +3530,7 @@ def delete_certificate_issuance_config( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deletes a single CertificateIssuanceConfig. @@ -3674,7 +3675,7 @@ def list_operations( request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -3728,7 +3729,7 @@ def get_operation( request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -3782,7 +3783,7 @@ def delete_operation( request: Optional[operations_pb2.DeleteOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a long-running operation. @@ -3837,7 +3838,7 @@ def cancel_operation( request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -3891,7 +3892,7 @@ def get_location( request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -3945,7 +3946,7 @@ def list_locations( request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -3995,14 +3996,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-certificate-manager", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("CertificateManagerClient",) diff --git a/packages/google-cloud-certificate-manager/google/cloud/certificate_manager_v1/services/certificate_manager/transports/base.py b/packages/google-cloud-certificate-manager/google/cloud/certificate_manager_v1/services/certificate_manager/transports/base.py index 858d8c171776..d4944093ed8d 100644 --- a/packages/google-cloud-certificate-manager/google/cloud/certificate_manager_v1/services/certificate_manager/transports/base.py +++ b/packages/google-cloud-certificate-manager/google/cloud/certificate_manager_v1/services/certificate_manager/transports/base.py @@ -25,22 +25,17 @@ from google.cloud.location import locations_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.certificate_manager_v1 import gapic_version as package_version from google.cloud.certificate_manager_v1.types import certificate_issuance_config from google.cloud.certificate_manager_v1.types import ( certificate_issuance_config as gcc_certificate_issuance_config, ) from google.cloud.certificate_manager_v1.types import certificate_manager -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-certificate-manager", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class CertificateManagerTransport(abc.ABC): diff --git a/packages/google-cloud-certificate-manager/release-please-config.json b/packages/google-cloud-certificate-manager/release-please-config.json index 761fb1eb648b..b67b866f0413 100644 --- a/packages/google-cloud-certificate-manager/release-please-config.json +++ b/packages/google-cloud-certificate-manager/release-please-config.json @@ -4,6 +4,7 @@ ".": { "release-type": "python", "extra-files": [ + "google/cloud/certificate_manager_v1/gapic_version.py", "google/cloud/certificate_manager/gapic_version.py", { "type": "json", diff --git a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_certificate_async.py b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_certificate_async.py index d464e000c838..c612eb183177 100644 --- a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_certificate_async.py +++ b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_certificate_async.py @@ -49,7 +49,7 @@ async def sample_create_certificate(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_certificate_issuance_config_async.py b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_certificate_issuance_config_async.py index ebe7bd858365..f1b3371b9c9e 100644 --- a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_certificate_issuance_config_async.py +++ b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_certificate_issuance_config_async.py @@ -55,7 +55,7 @@ async def sample_create_certificate_issuance_config(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_certificate_map_async.py b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_certificate_map_async.py index 93fa122e9564..87dc10506fbc 100644 --- a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_certificate_map_async.py +++ b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_certificate_map_async.py @@ -49,7 +49,7 @@ async def sample_create_certificate_map(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_certificate_map_entry_async.py b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_certificate_map_entry_async.py index cfcbf7f98003..bdc6dd70bfee 100644 --- a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_certificate_map_entry_async.py +++ b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_certificate_map_entry_async.py @@ -53,7 +53,7 @@ async def sample_create_certificate_map_entry(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_dns_authorization_async.py b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_dns_authorization_async.py index f0466f35f9ab..8f9d3f1471bc 100644 --- a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_dns_authorization_async.py +++ b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_create_dns_authorization_async.py @@ -53,7 +53,7 @@ async def sample_create_dns_authorization(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_certificate_async.py b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_certificate_async.py index 2fe42cab5d23..b839f86a6420 100644 --- a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_certificate_async.py +++ b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_certificate_async.py @@ -48,7 +48,7 @@ async def sample_delete_certificate(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_certificate_issuance_config_async.py b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_certificate_issuance_config_async.py index c5192624b733..ed57ab23274d 100644 --- a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_certificate_issuance_config_async.py +++ b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_certificate_issuance_config_async.py @@ -48,7 +48,7 @@ async def sample_delete_certificate_issuance_config(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_certificate_map_async.py b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_certificate_map_async.py index 1c286666c329..72a92d3684af 100644 --- a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_certificate_map_async.py +++ b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_certificate_map_async.py @@ -48,7 +48,7 @@ async def sample_delete_certificate_map(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_certificate_map_entry_async.py b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_certificate_map_entry_async.py index c86b1d86fd91..7241c67bb88b 100644 --- a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_certificate_map_entry_async.py +++ b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_certificate_map_entry_async.py @@ -48,7 +48,7 @@ async def sample_delete_certificate_map_entry(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_dns_authorization_async.py b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_dns_authorization_async.py index 03ee74658765..adea72f65ece 100644 --- a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_dns_authorization_async.py +++ b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_delete_dns_authorization_async.py @@ -48,7 +48,7 @@ async def sample_delete_dns_authorization(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_update_certificate_async.py b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_update_certificate_async.py index d033441704a9..1687d6134475 100644 --- a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_update_certificate_async.py +++ b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_update_certificate_async.py @@ -47,7 +47,7 @@ async def sample_update_certificate(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_update_certificate_map_async.py b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_update_certificate_map_async.py index baf91d7298e3..ee7727c4de99 100644 --- a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_update_certificate_map_async.py +++ b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_update_certificate_map_async.py @@ -47,7 +47,7 @@ async def sample_update_certificate_map(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_update_certificate_map_entry_async.py b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_update_certificate_map_entry_async.py index 45b911c47a44..05f7389b7552 100644 --- a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_update_certificate_map_entry_async.py +++ b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_update_certificate_map_entry_async.py @@ -51,7 +51,7 @@ async def sample_update_certificate_map_entry(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_update_dns_authorization_async.py b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_update_dns_authorization_async.py index 6c4009742d9f..7764a3b6a135 100644 --- a/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_update_dns_authorization_async.py +++ b/packages/google-cloud-certificate-manager/samples/generated_samples/certificatemanager_v1_generated_certificate_manager_update_dns_authorization_async.py @@ -51,7 +51,7 @@ async def sample_update_dns_authorization(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-certificate-manager/setup.py b/packages/google-cloud-certificate-manager/setup.py index 88e16c66c8d3..8d203428e379 100644 --- a/packages/google-cloud-certificate-manager/setup.py +++ b/packages/google-cloud-certificate-manager/setup.py @@ -38,7 +38,7 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 1.33.2, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*", + "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", "proto-plus >= 1.22.0, <2.0.0dev", "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", ] diff --git a/packages/google-cloud-certificate-manager/testing/constraints-3.7.txt b/packages/google-cloud-certificate-manager/testing/constraints-3.7.txt index 6f3158cc2034..6c44adfea7ee 100644 --- a/packages/google-cloud-certificate-manager/testing/constraints-3.7.txt +++ b/packages/google-cloud-certificate-manager/testing/constraints-3.7.txt @@ -4,6 +4,6 @@ # Pin the version to the lower bound. # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 -google-api-core==1.33.2 +google-api-core==1.34.0 proto-plus==1.22.0 protobuf==3.19.5