diff --git a/google/cloud/compute/__init__.py b/google/cloud/compute/__init__.py index 00e8a1a5e..5c5700cb0 100644 --- a/google/cloud/compute/__init__.py +++ b/google/cloud/compute/__init__.py @@ -1510,6 +1510,10 @@ from google.cloud.compute_v1.types.compute import SetBackendServiceTargetSslProxyRequest from google.cloud.compute_v1.types.compute import SetBackendServiceTargetTcpProxyRequest from google.cloud.compute_v1.types.compute import SetBackupTargetPoolRequest +from google.cloud.compute_v1.types.compute import ( + SetCertificateMapTargetHttpsProxyRequest, +) +from google.cloud.compute_v1.types.compute import SetCertificateMapTargetSslProxyRequest from google.cloud.compute_v1.types.compute import ( SetCommonInstanceMetadataProjectRequest, ) @@ -1661,6 +1665,9 @@ from google.cloud.compute_v1.types.compute import TargetHttpProxyAggregatedList from google.cloud.compute_v1.types.compute import TargetHttpProxyList from google.cloud.compute_v1.types.compute import TargetHttpsProxiesScopedList +from google.cloud.compute_v1.types.compute import ( + TargetHttpsProxiesSetCertificateMapRequest, +) from google.cloud.compute_v1.types.compute import ( TargetHttpsProxiesSetQuicOverrideRequest, ) @@ -1687,6 +1694,9 @@ from google.cloud.compute_v1.types.compute import ( TargetSslProxiesSetBackendServiceRequest, ) +from google.cloud.compute_v1.types.compute import ( + TargetSslProxiesSetCertificateMapRequest, +) from google.cloud.compute_v1.types.compute import TargetSslProxiesSetProxyHeaderRequest from google.cloud.compute_v1.types.compute import ( TargetSslProxiesSetSslCertificatesRequest, @@ -2926,6 +2936,8 @@ "SetBackendServiceTargetSslProxyRequest", "SetBackendServiceTargetTcpProxyRequest", "SetBackupTargetPoolRequest", + "SetCertificateMapTargetHttpsProxyRequest", + "SetCertificateMapTargetSslProxyRequest", "SetCommonInstanceMetadataProjectRequest", "SetDefaultNetworkTierProjectRequest", "SetDeletionProtectionInstanceRequest", @@ -3039,6 +3051,7 @@ "TargetHttpProxyAggregatedList", "TargetHttpProxyList", "TargetHttpsProxiesScopedList", + "TargetHttpsProxiesSetCertificateMapRequest", "TargetHttpsProxiesSetQuicOverrideRequest", "TargetHttpsProxiesSetSslCertificatesRequest", "TargetHttpsProxy", @@ -3059,6 +3072,7 @@ "TargetPoolsScopedList", "TargetReference", "TargetSslProxiesSetBackendServiceRequest", + "TargetSslProxiesSetCertificateMapRequest", "TargetSslProxiesSetProxyHeaderRequest", "TargetSslProxiesSetSslCertificatesRequest", "TargetSslProxy", diff --git a/google/cloud/compute_v1/__init__.py b/google/cloud/compute_v1/__init__.py index c331c598b..9e6504a41 100644 --- a/google/cloud/compute_v1/__init__.py +++ b/google/cloud/compute_v1/__init__.py @@ -1120,6 +1120,8 @@ from .types.compute import SetBackendServiceTargetSslProxyRequest from .types.compute import SetBackendServiceTargetTcpProxyRequest from .types.compute import SetBackupTargetPoolRequest +from .types.compute import SetCertificateMapTargetHttpsProxyRequest +from .types.compute import SetCertificateMapTargetSslProxyRequest from .types.compute import SetCommonInstanceMetadataProjectRequest from .types.compute import SetDefaultNetworkTierProjectRequest from .types.compute import SetDeletionProtectionInstanceRequest @@ -1233,6 +1235,7 @@ from .types.compute import TargetHttpProxyAggregatedList from .types.compute import TargetHttpProxyList from .types.compute import TargetHttpsProxiesScopedList +from .types.compute import TargetHttpsProxiesSetCertificateMapRequest from .types.compute import TargetHttpsProxiesSetQuicOverrideRequest from .types.compute import TargetHttpsProxiesSetSslCertificatesRequest from .types.compute import TargetHttpsProxy @@ -1253,6 +1256,7 @@ from .types.compute import TargetPoolsScopedList from .types.compute import TargetReference from .types.compute import TargetSslProxiesSetBackendServiceRequest +from .types.compute import TargetSslProxiesSetCertificateMapRequest from .types.compute import TargetSslProxiesSetProxyHeaderRequest from .types.compute import TargetSslProxiesSetSslCertificatesRequest from .types.compute import TargetSslProxy @@ -2444,6 +2448,8 @@ "SetBackendServiceTargetSslProxyRequest", "SetBackendServiceTargetTcpProxyRequest", "SetBackupTargetPoolRequest", + "SetCertificateMapTargetHttpsProxyRequest", + "SetCertificateMapTargetSslProxyRequest", "SetCommonInstanceMetadataProjectRequest", "SetDefaultNetworkTierProjectRequest", "SetDeletionProtectionInstanceRequest", @@ -2564,6 +2570,7 @@ "TargetHttpProxyList", "TargetHttpsProxiesClient", "TargetHttpsProxiesScopedList", + "TargetHttpsProxiesSetCertificateMapRequest", "TargetHttpsProxiesSetQuicOverrideRequest", "TargetHttpsProxiesSetSslCertificatesRequest", "TargetHttpsProxy", @@ -2587,6 +2594,7 @@ "TargetReference", "TargetSslProxiesClient", "TargetSslProxiesSetBackendServiceRequest", + "TargetSslProxiesSetCertificateMapRequest", "TargetSslProxiesSetProxyHeaderRequest", "TargetSslProxiesSetSslCertificatesRequest", "TargetSslProxy", diff --git a/google/cloud/compute_v1/gapic_metadata.json b/google/cloud/compute_v1/gapic_metadata.json index 90c22bc58..5573237ad 100644 --- a/google/cloud/compute_v1/gapic_metadata.json +++ b/google/cloud/compute_v1/gapic_metadata.json @@ -3561,6 +3561,11 @@ "patch" ] }, + "SetCertificateMap": { + "methods": [ + "set_certificate_map" + ] + }, "SetQuicOverride": { "methods": [ "set_quic_override" @@ -3713,6 +3718,11 @@ "set_backend_service" ] }, + "SetCertificateMap": { + "methods": [ + "set_certificate_map" + ] + }, "SetProxyHeader": { "methods": [ "set_proxy_header" diff --git a/google/cloud/compute_v1/services/accelerator_types/client.py b/google/cloud/compute_v1/services/accelerator_types/client.py index c694f7491..4db60230c 100644 --- a/google/cloud/compute_v1/services/accelerator_types/client.py +++ b/google/cloud/compute_v1/services/accelerator_types/client.py @@ -402,6 +402,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/accelerator_types/transports/base.py b/google/cloud/compute_v1/services/accelerator_types/transports/base.py index 0bd9a173b..0a73edd8c 100644 --- a/google/cloud/compute_v1/services/accelerator_types/transports/base.py +++ b/google/cloud/compute_v1/services/accelerator_types/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -85,11 +86,6 @@ def __init__( be used for service account credentials. """ - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -110,6 +106,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -122,6 +123,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/accelerator_types/transports/rest.py b/google/cloud/compute_v1/services/accelerator_types/transports/rest.py index e950eb282..37cdfd11d 100644 --- a/google/cloud/compute_v1/services/accelerator_types/transports/rest.py +++ b/google/cloud/compute_v1/services/accelerator_types/transports/rest.py @@ -198,6 +198,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[AcceleratorTypesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -250,6 +251,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/addresses/client.py b/google/cloud/compute_v1/services/addresses/client.py index a35dc3d32..4da5f6abf 100644 --- a/google/cloud/compute_v1/services/addresses/client.py +++ b/google/cloud/compute_v1/services/addresses/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/addresses/transports/base.py b/google/cloud/compute_v1/services/addresses/transports/base.py index 5ea827e6b..90680e00f 100644 --- a/google/cloud/compute_v1/services/addresses/transports/base.py +++ b/google/cloud/compute_v1/services/addresses/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/addresses/transports/rest.py b/google/cloud/compute_v1/services/addresses/transports/rest.py index 4eb486fc4..a27fc2541 100644 --- a/google/cloud/compute_v1/services/addresses/transports/rest.py +++ b/google/cloud/compute_v1/services/addresses/transports/rest.py @@ -238,6 +238,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[AddressesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -290,6 +291,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/autoscalers/client.py b/google/cloud/compute_v1/services/autoscalers/client.py index 8db3e7774..f0eaa547e 100644 --- a/google/cloud/compute_v1/services/autoscalers/client.py +++ b/google/cloud/compute_v1/services/autoscalers/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/autoscalers/transports/base.py b/google/cloud/compute_v1/services/autoscalers/transports/base.py index f0c98e3b0..2473483ff 100644 --- a/google/cloud/compute_v1/services/autoscalers/transports/base.py +++ b/google/cloud/compute_v1/services/autoscalers/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/autoscalers/transports/rest.py b/google/cloud/compute_v1/services/autoscalers/transports/rest.py index e4f05e272..2fce84cf9 100644 --- a/google/cloud/compute_v1/services/autoscalers/transports/rest.py +++ b/google/cloud/compute_v1/services/autoscalers/transports/rest.py @@ -300,6 +300,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[AutoscalersRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -352,6 +353,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/backend_buckets/client.py b/google/cloud/compute_v1/services/backend_buckets/client.py index 87120a970..396e2983b 100644 --- a/google/cloud/compute_v1/services/backend_buckets/client.py +++ b/google/cloud/compute_v1/services/backend_buckets/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def add_signed_url_key_unary( diff --git a/google/cloud/compute_v1/services/backend_buckets/transports/base.py b/google/cloud/compute_v1/services/backend_buckets/transports/base.py index da8fd23b0..3f102d1c7 100644 --- a/google/cloud/compute_v1/services/backend_buckets/transports/base.py +++ b/google/cloud/compute_v1/services/backend_buckets/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/backend_buckets/transports/rest.py b/google/cloud/compute_v1/services/backend_buckets/transports/rest.py index 8d803019f..b7e1e3f92 100644 --- a/google/cloud/compute_v1/services/backend_buckets/transports/rest.py +++ b/google/cloud/compute_v1/services/backend_buckets/transports/rest.py @@ -369,6 +369,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[BackendBucketsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -421,6 +422,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/backend_services/client.py b/google/cloud/compute_v1/services/backend_services/client.py index 6255b641c..590b70f0e 100644 --- a/google/cloud/compute_v1/services/backend_services/client.py +++ b/google/cloud/compute_v1/services/backend_services/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def add_signed_url_key_unary( diff --git a/google/cloud/compute_v1/services/backend_services/transports/base.py b/google/cloud/compute_v1/services/backend_services/transports/base.py index 0136b20cc..00347bded 100644 --- a/google/cloud/compute_v1/services/backend_services/transports/base.py +++ b/google/cloud/compute_v1/services/backend_services/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/backend_services/transports/rest.py b/google/cloud/compute_v1/services/backend_services/transports/rest.py index 1129919cd..345c4606c 100644 --- a/google/cloud/compute_v1/services/backend_services/transports/rest.py +++ b/google/cloud/compute_v1/services/backend_services/transports/rest.py @@ -461,6 +461,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[BackendServicesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -513,6 +514,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/disk_types/client.py b/google/cloud/compute_v1/services/disk_types/client.py index 82b086f1a..a49471523 100644 --- a/google/cloud/compute_v1/services/disk_types/client.py +++ b/google/cloud/compute_v1/services/disk_types/client.py @@ -398,6 +398,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/disk_types/transports/base.py b/google/cloud/compute_v1/services/disk_types/transports/base.py index a72169361..e76f9e412 100644 --- a/google/cloud/compute_v1/services/disk_types/transports/base.py +++ b/google/cloud/compute_v1/services/disk_types/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -85,11 +86,6 @@ def __init__( be used for service account credentials. """ - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -110,6 +106,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -122,6 +123,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/disk_types/transports/rest.py b/google/cloud/compute_v1/services/disk_types/transports/rest.py index 5e46c8904..70e1e4027 100644 --- a/google/cloud/compute_v1/services/disk_types/transports/rest.py +++ b/google/cloud/compute_v1/services/disk_types/transports/rest.py @@ -186,6 +186,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[DiskTypesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -238,6 +239,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/disks/client.py b/google/cloud/compute_v1/services/disks/client.py index 422291c4b..479758825 100644 --- a/google/cloud/compute_v1/services/disks/client.py +++ b/google/cloud/compute_v1/services/disks/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def add_resource_policies_unary( diff --git a/google/cloud/compute_v1/services/disks/transports/base.py b/google/cloud/compute_v1/services/disks/transports/base.py index 0ceedc279..5b0113fe5 100644 --- a/google/cloud/compute_v1/services/disks/transports/base.py +++ b/google/cloud/compute_v1/services/disks/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/disks/transports/rest.py b/google/cloud/compute_v1/services/disks/transports/rest.py index 72f36c542..f0f7ccaee 100644 --- a/google/cloud/compute_v1/services/disks/transports/rest.py +++ b/google/cloud/compute_v1/services/disks/transports/rest.py @@ -464,6 +464,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[DisksRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -516,6 +517,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/external_vpn_gateways/client.py b/google/cloud/compute_v1/services/external_vpn_gateways/client.py index dbd7a5a72..9a75df844 100644 --- a/google/cloud/compute_v1/services/external_vpn_gateways/client.py +++ b/google/cloud/compute_v1/services/external_vpn_gateways/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/external_vpn_gateways/transports/base.py b/google/cloud/compute_v1/services/external_vpn_gateways/transports/base.py index fb4b92c1c..6e97d6b9c 100644 --- a/google/cloud/compute_v1/services/external_vpn_gateways/transports/base.py +++ b/google/cloud/compute_v1/services/external_vpn_gateways/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/external_vpn_gateways/transports/rest.py b/google/cloud/compute_v1/services/external_vpn_gateways/transports/rest.py index d32c58572..07c4f9210 100644 --- a/google/cloud/compute_v1/services/external_vpn_gateways/transports/rest.py +++ b/google/cloud/compute_v1/services/external_vpn_gateways/transports/rest.py @@ -283,6 +283,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[ExternalVpnGatewaysRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -335,6 +336,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/firewall_policies/client.py b/google/cloud/compute_v1/services/firewall_policies/client.py index b4395a558..8c7a29b29 100644 --- a/google/cloud/compute_v1/services/firewall_policies/client.py +++ b/google/cloud/compute_v1/services/firewall_policies/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def add_association_unary( diff --git a/google/cloud/compute_v1/services/firewall_policies/transports/base.py b/google/cloud/compute_v1/services/firewall_policies/transports/base.py index 4957b8a2d..9820d92cb 100644 --- a/google/cloud/compute_v1/services/firewall_policies/transports/base.py +++ b/google/cloud/compute_v1/services/firewall_policies/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/firewall_policies/transports/rest.py b/google/cloud/compute_v1/services/firewall_policies/transports/rest.py index d5ad59cb8..ef07471cf 100644 --- a/google/cloud/compute_v1/services/firewall_policies/transports/rest.py +++ b/google/cloud/compute_v1/services/firewall_policies/transports/rest.py @@ -627,6 +627,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[FirewallPoliciesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -679,6 +680,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/firewalls/client.py b/google/cloud/compute_v1/services/firewalls/client.py index 50216443f..e05152d5c 100644 --- a/google/cloud/compute_v1/services/firewalls/client.py +++ b/google/cloud/compute_v1/services/firewalls/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/firewalls/transports/base.py b/google/cloud/compute_v1/services/firewalls/transports/base.py index a9efcaf3e..ad6bb4583 100644 --- a/google/cloud/compute_v1/services/firewalls/transports/base.py +++ b/google/cloud/compute_v1/services/firewalls/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/firewalls/transports/rest.py b/google/cloud/compute_v1/services/firewalls/transports/rest.py index 202a7a4bc..c94c18031 100644 --- a/google/cloud/compute_v1/services/firewalls/transports/rest.py +++ b/google/cloud/compute_v1/services/firewalls/transports/rest.py @@ -266,6 +266,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[FirewallsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -318,6 +319,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/forwarding_rules/client.py b/google/cloud/compute_v1/services/forwarding_rules/client.py index 051d891ef..8d1543b1f 100644 --- a/google/cloud/compute_v1/services/forwarding_rules/client.py +++ b/google/cloud/compute_v1/services/forwarding_rules/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/forwarding_rules/transports/base.py b/google/cloud/compute_v1/services/forwarding_rules/transports/base.py index 884e2b0ae..f3d92c76d 100644 --- a/google/cloud/compute_v1/services/forwarding_rules/transports/base.py +++ b/google/cloud/compute_v1/services/forwarding_rules/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/forwarding_rules/transports/rest.py b/google/cloud/compute_v1/services/forwarding_rules/transports/rest.py index 2de85b199..e61d999a0 100644 --- a/google/cloud/compute_v1/services/forwarding_rules/transports/rest.py +++ b/google/cloud/compute_v1/services/forwarding_rules/transports/rest.py @@ -335,6 +335,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[ForwardingRulesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -387,6 +388,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/global_addresses/client.py b/google/cloud/compute_v1/services/global_addresses/client.py index 1c0e81ce3..47e6c959e 100644 --- a/google/cloud/compute_v1/services/global_addresses/client.py +++ b/google/cloud/compute_v1/services/global_addresses/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/global_addresses/transports/base.py b/google/cloud/compute_v1/services/global_addresses/transports/base.py index 6f741c1f3..547d8bbaa 100644 --- a/google/cloud/compute_v1/services/global_addresses/transports/base.py +++ b/google/cloud/compute_v1/services/global_addresses/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/global_addresses/transports/rest.py b/google/cloud/compute_v1/services/global_addresses/transports/rest.py index 165a7ffde..dcbdf9d20 100644 --- a/google/cloud/compute_v1/services/global_addresses/transports/rest.py +++ b/google/cloud/compute_v1/services/global_addresses/transports/rest.py @@ -219,6 +219,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[GlobalAddressesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -271,6 +272,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/global_forwarding_rules/client.py b/google/cloud/compute_v1/services/global_forwarding_rules/client.py index 9a7b77e09..7325a7f29 100644 --- a/google/cloud/compute_v1/services/global_forwarding_rules/client.py +++ b/google/cloud/compute_v1/services/global_forwarding_rules/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/global_forwarding_rules/transports/base.py b/google/cloud/compute_v1/services/global_forwarding_rules/transports/base.py index 6375f059a..7627defd1 100644 --- a/google/cloud/compute_v1/services/global_forwarding_rules/transports/base.py +++ b/google/cloud/compute_v1/services/global_forwarding_rules/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/global_forwarding_rules/transports/rest.py b/google/cloud/compute_v1/services/global_forwarding_rules/transports/rest.py index 05e3f8e54..45663f980 100644 --- a/google/cloud/compute_v1/services/global_forwarding_rules/transports/rest.py +++ b/google/cloud/compute_v1/services/global_forwarding_rules/transports/rest.py @@ -305,6 +305,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[GlobalForwardingRulesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -357,6 +358,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/global_network_endpoint_groups/client.py b/google/cloud/compute_v1/services/global_network_endpoint_groups/client.py index 664df1d3c..053ba40c4 100644 --- a/google/cloud/compute_v1/services/global_network_endpoint_groups/client.py +++ b/google/cloud/compute_v1/services/global_network_endpoint_groups/client.py @@ -405,6 +405,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def attach_network_endpoints_unary( diff --git a/google/cloud/compute_v1/services/global_network_endpoint_groups/transports/base.py b/google/cloud/compute_v1/services/global_network_endpoint_groups/transports/base.py index 5c85ac823..57cf05ae2 100644 --- a/google/cloud/compute_v1/services/global_network_endpoint_groups/transports/base.py +++ b/google/cloud/compute_v1/services/global_network_endpoint_groups/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/global_network_endpoint_groups/transports/rest.py b/google/cloud/compute_v1/services/global_network_endpoint_groups/transports/rest.py index ef5e09ea6..e11c14366 100644 --- a/google/cloud/compute_v1/services/global_network_endpoint_groups/transports/rest.py +++ b/google/cloud/compute_v1/services/global_network_endpoint_groups/transports/rest.py @@ -328,6 +328,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[GlobalNetworkEndpointGroupsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -380,6 +381,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/global_operations/client.py b/google/cloud/compute_v1/services/global_operations/client.py index 64760866b..cc4429c28 100644 --- a/google/cloud/compute_v1/services/global_operations/client.py +++ b/google/cloud/compute_v1/services/global_operations/client.py @@ -400,6 +400,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/global_operations/transports/base.py b/google/cloud/compute_v1/services/global_operations/transports/base.py index 2be12872f..41463e0da 100644 --- a/google/cloud/compute_v1/services/global_operations/transports/base.py +++ b/google/cloud/compute_v1/services/global_operations/transports/base.py @@ -57,6 +57,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -84,11 +85,6 @@ def __init__( be used for service account credentials. """ - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -109,6 +105,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -121,6 +122,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/global_operations/transports/rest.py b/google/cloud/compute_v1/services/global_operations/transports/rest.py index 4b146c805..b95e54a76 100644 --- a/google/cloud/compute_v1/services/global_operations/transports/rest.py +++ b/google/cloud/compute_v1/services/global_operations/transports/rest.py @@ -253,6 +253,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[GlobalOperationsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -305,6 +306,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/global_organization_operations/client.py b/google/cloud/compute_v1/services/global_organization_operations/client.py index 01a356b84..f64641ecd 100644 --- a/google/cloud/compute_v1/services/global_organization_operations/client.py +++ b/google/cloud/compute_v1/services/global_organization_operations/client.py @@ -402,6 +402,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete( diff --git a/google/cloud/compute_v1/services/global_organization_operations/transports/base.py b/google/cloud/compute_v1/services/global_organization_operations/transports/base.py index 3d3f10a54..4c2badcb0 100644 --- a/google/cloud/compute_v1/services/global_organization_operations/transports/base.py +++ b/google/cloud/compute_v1/services/global_organization_operations/transports/base.py @@ -57,6 +57,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -84,11 +85,6 @@ def __init__( be used for service account credentials. """ - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -109,6 +105,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -121,6 +122,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/global_organization_operations/transports/rest.py b/google/cloud/compute_v1/services/global_organization_operations/transports/rest.py index a7fa98f23..b720db958 100644 --- a/google/cloud/compute_v1/services/global_organization_operations/transports/rest.py +++ b/google/cloud/compute_v1/services/global_organization_operations/transports/rest.py @@ -199,6 +199,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[GlobalOrganizationOperationsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -251,6 +252,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/global_public_delegated_prefixes/client.py b/google/cloud/compute_v1/services/global_public_delegated_prefixes/client.py index 81ddf1759..507a53819 100644 --- a/google/cloud/compute_v1/services/global_public_delegated_prefixes/client.py +++ b/google/cloud/compute_v1/services/global_public_delegated_prefixes/client.py @@ -405,6 +405,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/global_public_delegated_prefixes/transports/base.py b/google/cloud/compute_v1/services/global_public_delegated_prefixes/transports/base.py index c162ad580..9fc076e11 100644 --- a/google/cloud/compute_v1/services/global_public_delegated_prefixes/transports/base.py +++ b/google/cloud/compute_v1/services/global_public_delegated_prefixes/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/global_public_delegated_prefixes/transports/rest.py b/google/cloud/compute_v1/services/global_public_delegated_prefixes/transports/rest.py index 22c6eabeb..40fa00b21 100644 --- a/google/cloud/compute_v1/services/global_public_delegated_prefixes/transports/rest.py +++ b/google/cloud/compute_v1/services/global_public_delegated_prefixes/transports/rest.py @@ -263,6 +263,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[GlobalPublicDelegatedPrefixesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -315,6 +316,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/health_checks/client.py b/google/cloud/compute_v1/services/health_checks/client.py index 093a83b96..afac752b9 100644 --- a/google/cloud/compute_v1/services/health_checks/client.py +++ b/google/cloud/compute_v1/services/health_checks/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/health_checks/transports/base.py b/google/cloud/compute_v1/services/health_checks/transports/base.py index 8b12f4624..67a80617f 100644 --- a/google/cloud/compute_v1/services/health_checks/transports/base.py +++ b/google/cloud/compute_v1/services/health_checks/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/health_checks/transports/rest.py b/google/cloud/compute_v1/services/health_checks/transports/rest.py index f7a0fcd86..c196cc6dd 100644 --- a/google/cloud/compute_v1/services/health_checks/transports/rest.py +++ b/google/cloud/compute_v1/services/health_checks/transports/rest.py @@ -302,6 +302,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[HealthChecksRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -354,6 +355,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/image_family_views/client.py b/google/cloud/compute_v1/services/image_family_views/client.py index 51fbf0906..0bf2fbcfc 100644 --- a/google/cloud/compute_v1/services/image_family_views/client.py +++ b/google/cloud/compute_v1/services/image_family_views/client.py @@ -399,6 +399,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def get( diff --git a/google/cloud/compute_v1/services/image_family_views/transports/base.py b/google/cloud/compute_v1/services/image_family_views/transports/base.py index 7b465f87d..39dd186e4 100644 --- a/google/cloud/compute_v1/services/image_family_views/transports/base.py +++ b/google/cloud/compute_v1/services/image_family_views/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -85,11 +86,6 @@ def __init__( be used for service account credentials. """ - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -110,6 +106,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -122,6 +123,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/image_family_views/transports/rest.py b/google/cloud/compute_v1/services/image_family_views/transports/rest.py index 2ab7f3cab..a756b7b61 100644 --- a/google/cloud/compute_v1/services/image_family_views/transports/rest.py +++ b/google/cloud/compute_v1/services/image_family_views/transports/rest.py @@ -135,6 +135,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[ImageFamilyViewsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -187,6 +188,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/images/client.py b/google/cloud/compute_v1/services/images/client.py index 18beb1b00..52da0726d 100644 --- a/google/cloud/compute_v1/services/images/client.py +++ b/google/cloud/compute_v1/services/images/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/images/transports/base.py b/google/cloud/compute_v1/services/images/transports/base.py index 14c84882b..0e1a69d42 100644 --- a/google/cloud/compute_v1/services/images/transports/base.py +++ b/google/cloud/compute_v1/services/images/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/images/transports/rest.py b/google/cloud/compute_v1/services/images/transports/rest.py index b97d1c8fe..2af6574c1 100644 --- a/google/cloud/compute_v1/services/images/transports/rest.py +++ b/google/cloud/compute_v1/services/images/transports/rest.py @@ -404,6 +404,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[ImagesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -456,6 +457,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/instance_group_managers/client.py b/google/cloud/compute_v1/services/instance_group_managers/client.py index 2df3ffdf0..3307f91a3 100644 --- a/google/cloud/compute_v1/services/instance_group_managers/client.py +++ b/google/cloud/compute_v1/services/instance_group_managers/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def abandon_instances_unary( @@ -1083,9 +1084,9 @@ def create_instances_unary( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> compute.Operation: - r"""Creates instances with per-instance configs in this - managed instance group. Instances are created using the - current instance template. The create instances + r"""Creates instances with per-instance configurations in + this managed instance group. Instances are created using + the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the @@ -1209,9 +1210,9 @@ def create_instances( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> extended_operation.ExtendedOperation: - r"""Creates instances with per-instance configs in this - managed instance group. Instances are created using the - current instance template. The create instances + r"""Creates instances with per-instance configurations in + this managed instance group. Instances are created using + the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the @@ -1884,8 +1885,8 @@ def delete_per_instance_configs_unary( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> compute.Operation: - r"""Deletes selected per-instance configs for the managed - instance group. + r"""Deletes selected per-instance configurations for the + managed instance group. Args: request (Union[google.cloud.compute_v1.types.DeletePerInstanceConfigsInstanceGroupManagerRequest, dict]): @@ -2015,8 +2016,8 @@ def delete_per_instance_configs( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> extended_operation.ExtendedOperation: - r"""Deletes selected per-instance configs for the managed - instance group. + r"""Deletes selected per-instance configurations for the + managed instance group. Args: request (Union[google.cloud.compute_v1.types.DeletePerInstanceConfigsInstanceGroupManagerRequest, dict]): @@ -2865,9 +2866,9 @@ def list_per_instance_configs( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListPerInstanceConfigsPager: - r"""Lists all of the per-instance configs defined for the - managed instance group. The orderBy query parameter is - not supported. + r"""Lists all of the per-instance configurations defined + for the managed instance group. The orderBy query + parameter is not supported. Args: request (Union[google.cloud.compute_v1.types.ListPerInstanceConfigsInstanceGroupManagersRequest, dict]): @@ -3265,10 +3266,10 @@ def patch_per_instance_configs_unary( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> compute.Operation: - r"""Inserts or patches per-instance configs for the - managed instance group. perInstanceConfig.name serves as - a key used to distinguish whether to perform insert or - patch. + r"""Inserts or patches per-instance configurations for + the managed instance group. perInstanceConfig.name + serves as a key used to distinguish whether to perform + insert or patch. Args: request (Union[google.cloud.compute_v1.types.PatchPerInstanceConfigsInstanceGroupManagerRequest, dict]): @@ -3398,10 +3399,10 @@ def patch_per_instance_configs( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> extended_operation.ExtendedOperation: - r"""Inserts or patches per-instance configs for the - managed instance group. perInstanceConfig.name serves as - a key used to distinguish whether to perform insert or - patch. + r"""Inserts or patches per-instance configurations for + the managed instance group. perInstanceConfig.name + serves as a key used to distinguish whether to perform + insert or patch. Args: request (Union[google.cloud.compute_v1.types.PatchPerInstanceConfigsInstanceGroupManagerRequest, dict]): @@ -4702,10 +4703,10 @@ def update_per_instance_configs_unary( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> compute.Operation: - r"""Inserts or updates per-instance configs for the - managed instance group. perInstanceConfig.name serves as - a key used to distinguish whether to perform insert or - patch. + r"""Inserts or updates per-instance configurations for + the managed instance group. perInstanceConfig.name + serves as a key used to distinguish whether to perform + insert or patch. Args: request (Union[google.cloud.compute_v1.types.UpdatePerInstanceConfigsInstanceGroupManagerRequest, dict]): @@ -4835,10 +4836,10 @@ def update_per_instance_configs( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> extended_operation.ExtendedOperation: - r"""Inserts or updates per-instance configs for the - managed instance group. perInstanceConfig.name serves as - a key used to distinguish whether to perform insert or - patch. + r"""Inserts or updates per-instance configurations for + the managed instance group. perInstanceConfig.name + serves as a key used to distinguish whether to perform + insert or patch. Args: request (Union[google.cloud.compute_v1.types.UpdatePerInstanceConfigsInstanceGroupManagerRequest, dict]): diff --git a/google/cloud/compute_v1/services/instance_group_managers/transports/base.py b/google/cloud/compute_v1/services/instance_group_managers/transports/base.py index 7022a3a58..7070d1e92 100644 --- a/google/cloud/compute_v1/services/instance_group_managers/transports/base.py +++ b/google/cloud/compute_v1/services/instance_group_managers/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/instance_group_managers/transports/rest.py b/google/cloud/compute_v1/services/instance_group_managers/transports/rest.py index 2abd0cd2f..98206fdae 100644 --- a/google/cloud/compute_v1/services/instance_group_managers/transports/rest.py +++ b/google/cloud/compute_v1/services/instance_group_managers/transports/rest.py @@ -724,6 +724,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[InstanceGroupManagersRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -776,6 +777,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/instance_groups/client.py b/google/cloud/compute_v1/services/instance_groups/client.py index 5919a6bd5..66f0dd20f 100644 --- a/google/cloud/compute_v1/services/instance_groups/client.py +++ b/google/cloud/compute_v1/services/instance_groups/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def add_instances_unary( @@ -1445,8 +1446,10 @@ def list_instances( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListInstancesPager: - r"""Lists the instances in the specified instance group. - The orderBy query parameter is not supported. + r"""Lists the instances in the specified instance group. The orderBy + query parameter is not supported. The filter query parameter is + supported, but only for expressions that use ``eq`` (equal) or + ``ne`` (not equal) operators. Args: request (Union[google.cloud.compute_v1.types.ListInstancesInstanceGroupsRequest, dict]): diff --git a/google/cloud/compute_v1/services/instance_groups/transports/base.py b/google/cloud/compute_v1/services/instance_groups/transports/base.py index c9b937038..b1a5560de 100644 --- a/google/cloud/compute_v1/services/instance_groups/transports/base.py +++ b/google/cloud/compute_v1/services/instance_groups/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/instance_groups/transports/rest.py b/google/cloud/compute_v1/services/instance_groups/transports/rest.py index 1fbe34e86..ab57599a3 100644 --- a/google/cloud/compute_v1/services/instance_groups/transports/rest.py +++ b/google/cloud/compute_v1/services/instance_groups/transports/rest.py @@ -365,6 +365,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[InstanceGroupsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -417,6 +418,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/instance_templates/client.py b/google/cloud/compute_v1/services/instance_templates/client.py index 6ff9fe105..65dd89cfa 100644 --- a/google/cloud/compute_v1/services/instance_templates/client.py +++ b/google/cloud/compute_v1/services/instance_templates/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/instance_templates/transports/base.py b/google/cloud/compute_v1/services/instance_templates/transports/base.py index a7cc83059..d6d7d0c79 100644 --- a/google/cloud/compute_v1/services/instance_templates/transports/base.py +++ b/google/cloud/compute_v1/services/instance_templates/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/instance_templates/transports/rest.py b/google/cloud/compute_v1/services/instance_templates/transports/rest.py index 03773396c..6ddedc88e 100644 --- a/google/cloud/compute_v1/services/instance_templates/transports/rest.py +++ b/google/cloud/compute_v1/services/instance_templates/transports/rest.py @@ -309,6 +309,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[InstanceTemplatesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -361,6 +362,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/instances/client.py b/google/cloud/compute_v1/services/instances/client.py index 1682b53e8..b18aec666 100644 --- a/google/cloud/compute_v1/services/instances/client.py +++ b/google/cloud/compute_v1/services/instances/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def add_access_config_unary( @@ -6169,7 +6170,7 @@ def set_scheduling_unary( a ``TERMINATED`` state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set - VM availability policies. + VM host maintenance policy. Args: request (Union[google.cloud.compute_v1.types.SetSchedulingInstanceRequest, dict]): @@ -6281,7 +6282,7 @@ def set_scheduling( a ``TERMINATED`` state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set - VM availability policies. + VM host maintenance policy. Args: request (Union[google.cloud.compute_v1.types.SetSchedulingInstanceRequest, dict]): diff --git a/google/cloud/compute_v1/services/instances/transports/base.py b/google/cloud/compute_v1/services/instances/transports/base.py index 0b3b75c30..895a98f18 100644 --- a/google/cloud/compute_v1/services/instances/transports/base.py +++ b/google/cloud/compute_v1/services/instances/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/instances/transports/rest.py b/google/cloud/compute_v1/services/instances/transports/rest.py index 3287d7b77..4f3b55970 100644 --- a/google/cloud/compute_v1/services/instances/transports/rest.py +++ b/google/cloud/compute_v1/services/instances/transports/rest.py @@ -1417,6 +1417,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[InstancesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -1469,6 +1470,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/interconnect_attachments/client.py b/google/cloud/compute_v1/services/interconnect_attachments/client.py index eaee09c0f..afddcec6e 100644 --- a/google/cloud/compute_v1/services/interconnect_attachments/client.py +++ b/google/cloud/compute_v1/services/interconnect_attachments/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/interconnect_attachments/transports/base.py b/google/cloud/compute_v1/services/interconnect_attachments/transports/base.py index bd497c3c4..5fac6563e 100644 --- a/google/cloud/compute_v1/services/interconnect_attachments/transports/base.py +++ b/google/cloud/compute_v1/services/interconnect_attachments/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/interconnect_attachments/transports/rest.py b/google/cloud/compute_v1/services/interconnect_attachments/transports/rest.py index 9cdf32906..cb176d128 100644 --- a/google/cloud/compute_v1/services/interconnect_attachments/transports/rest.py +++ b/google/cloud/compute_v1/services/interconnect_attachments/transports/rest.py @@ -283,6 +283,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[InterconnectAttachmentsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -335,6 +336,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/interconnect_locations/client.py b/google/cloud/compute_v1/services/interconnect_locations/client.py index 99756dd32..640e9dc5c 100644 --- a/google/cloud/compute_v1/services/interconnect_locations/client.py +++ b/google/cloud/compute_v1/services/interconnect_locations/client.py @@ -400,6 +400,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def get( diff --git a/google/cloud/compute_v1/services/interconnect_locations/transports/base.py b/google/cloud/compute_v1/services/interconnect_locations/transports/base.py index cc72fa009..ab2fea8a7 100644 --- a/google/cloud/compute_v1/services/interconnect_locations/transports/base.py +++ b/google/cloud/compute_v1/services/interconnect_locations/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -85,11 +86,6 @@ def __init__( be used for service account credentials. """ - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -110,6 +106,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -122,6 +123,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/interconnect_locations/transports/rest.py b/google/cloud/compute_v1/services/interconnect_locations/transports/rest.py index be64e853c..3cda30c3b 100644 --- a/google/cloud/compute_v1/services/interconnect_locations/transports/rest.py +++ b/google/cloud/compute_v1/services/interconnect_locations/transports/rest.py @@ -167,6 +167,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[InterconnectLocationsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -219,6 +220,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/interconnects/client.py b/google/cloud/compute_v1/services/interconnects/client.py index 39c4b4d8b..18a590f7e 100644 --- a/google/cloud/compute_v1/services/interconnects/client.py +++ b/google/cloud/compute_v1/services/interconnects/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/interconnects/transports/base.py b/google/cloud/compute_v1/services/interconnects/transports/base.py index 014ee925a..3377db854 100644 --- a/google/cloud/compute_v1/services/interconnects/transports/base.py +++ b/google/cloud/compute_v1/services/interconnects/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/interconnects/transports/rest.py b/google/cloud/compute_v1/services/interconnects/transports/rest.py index e27a5ed15..c6a71d4af 100644 --- a/google/cloud/compute_v1/services/interconnects/transports/rest.py +++ b/google/cloud/compute_v1/services/interconnects/transports/rest.py @@ -277,6 +277,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[InterconnectsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -329,6 +330,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/license_codes/client.py b/google/cloud/compute_v1/services/license_codes/client.py index 5f868c5db..a5adb2f15 100644 --- a/google/cloud/compute_v1/services/license_codes/client.py +++ b/google/cloud/compute_v1/services/license_codes/client.py @@ -397,6 +397,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def get( diff --git a/google/cloud/compute_v1/services/license_codes/transports/base.py b/google/cloud/compute_v1/services/license_codes/transports/base.py index a4e0bec56..64a2f638c 100644 --- a/google/cloud/compute_v1/services/license_codes/transports/base.py +++ b/google/cloud/compute_v1/services/license_codes/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -85,11 +86,6 @@ def __init__( be used for service account credentials. """ - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -110,6 +106,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -122,6 +123,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/license_codes/transports/rest.py b/google/cloud/compute_v1/services/license_codes/transports/rest.py index cb6e05d64..da11f507e 100644 --- a/google/cloud/compute_v1/services/license_codes/transports/rest.py +++ b/google/cloud/compute_v1/services/license_codes/transports/rest.py @@ -162,6 +162,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[LicenseCodesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -214,6 +215,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/licenses/client.py b/google/cloud/compute_v1/services/licenses/client.py index ea0994d9b..f8bdb3847 100644 --- a/google/cloud/compute_v1/services/licenses/client.py +++ b/google/cloud/compute_v1/services/licenses/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/licenses/transports/base.py b/google/cloud/compute_v1/services/licenses/transports/base.py index 09c2984e4..98481a72d 100644 --- a/google/cloud/compute_v1/services/licenses/transports/base.py +++ b/google/cloud/compute_v1/services/licenses/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/licenses/transports/rest.py b/google/cloud/compute_v1/services/licenses/transports/rest.py index 1a41096fe..39aad0e54 100644 --- a/google/cloud/compute_v1/services/licenses/transports/rest.py +++ b/google/cloud/compute_v1/services/licenses/transports/rest.py @@ -296,6 +296,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[LicensesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -348,6 +349,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/machine_images/client.py b/google/cloud/compute_v1/services/machine_images/client.py index 8a23b4e88..71bd9e2d1 100644 --- a/google/cloud/compute_v1/services/machine_images/client.py +++ b/google/cloud/compute_v1/services/machine_images/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/machine_images/transports/base.py b/google/cloud/compute_v1/services/machine_images/transports/base.py index 39973c130..680fba4ec 100644 --- a/google/cloud/compute_v1/services/machine_images/transports/base.py +++ b/google/cloud/compute_v1/services/machine_images/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/machine_images/transports/rest.py b/google/cloud/compute_v1/services/machine_images/transports/rest.py index c05e76c6c..4513de8c5 100644 --- a/google/cloud/compute_v1/services/machine_images/transports/rest.py +++ b/google/cloud/compute_v1/services/machine_images/transports/rest.py @@ -307,6 +307,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[MachineImagesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -359,6 +360,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/machine_types/client.py b/google/cloud/compute_v1/services/machine_types/client.py index cf3a52b0a..33b5a55ee 100644 --- a/google/cloud/compute_v1/services/machine_types/client.py +++ b/google/cloud/compute_v1/services/machine_types/client.py @@ -398,6 +398,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/machine_types/transports/base.py b/google/cloud/compute_v1/services/machine_types/transports/base.py index 08ac22eb0..cd206ac20 100644 --- a/google/cloud/compute_v1/services/machine_types/transports/base.py +++ b/google/cloud/compute_v1/services/machine_types/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -85,11 +86,6 @@ def __init__( be used for service account credentials. """ - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -110,6 +106,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -122,6 +123,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/machine_types/transports/rest.py b/google/cloud/compute_v1/services/machine_types/transports/rest.py index 1eb13a27e..877ed8585 100644 --- a/google/cloud/compute_v1/services/machine_types/transports/rest.py +++ b/google/cloud/compute_v1/services/machine_types/transports/rest.py @@ -190,6 +190,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[MachineTypesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -242,6 +243,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/network_edge_security_services/client.py b/google/cloud/compute_v1/services/network_edge_security_services/client.py index 4ea101af5..864faebc1 100644 --- a/google/cloud/compute_v1/services/network_edge_security_services/client.py +++ b/google/cloud/compute_v1/services/network_edge_security_services/client.py @@ -405,6 +405,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/network_edge_security_services/transports/base.py b/google/cloud/compute_v1/services/network_edge_security_services/transports/base.py index 2ab5a47a3..53218938e 100644 --- a/google/cloud/compute_v1/services/network_edge_security_services/transports/base.py +++ b/google/cloud/compute_v1/services/network_edge_security_services/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/network_edge_security_services/transports/rest.py b/google/cloud/compute_v1/services/network_edge_security_services/transports/rest.py index 424f9f213..e4884da18 100644 --- a/google/cloud/compute_v1/services/network_edge_security_services/transports/rest.py +++ b/google/cloud/compute_v1/services/network_edge_security_services/transports/rest.py @@ -260,6 +260,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[NetworkEdgeSecurityServicesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -312,6 +313,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/network_endpoint_groups/client.py b/google/cloud/compute_v1/services/network_endpoint_groups/client.py index bebbd2e7d..863d54e6e 100644 --- a/google/cloud/compute_v1/services/network_endpoint_groups/client.py +++ b/google/cloud/compute_v1/services/network_endpoint_groups/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/network_endpoint_groups/transports/base.py b/google/cloud/compute_v1/services/network_endpoint_groups/transports/base.py index e46e01941..af200540c 100644 --- a/google/cloud/compute_v1/services/network_endpoint_groups/transports/base.py +++ b/google/cloud/compute_v1/services/network_endpoint_groups/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/network_endpoint_groups/transports/rest.py b/google/cloud/compute_v1/services/network_endpoint_groups/transports/rest.py index 2d3fa1c3e..e551e96f8 100644 --- a/google/cloud/compute_v1/services/network_endpoint_groups/transports/rest.py +++ b/google/cloud/compute_v1/services/network_endpoint_groups/transports/rest.py @@ -386,6 +386,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[NetworkEndpointGroupsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -438,6 +439,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/network_firewall_policies/client.py b/google/cloud/compute_v1/services/network_firewall_policies/client.py index 38c850d5e..4df918004 100644 --- a/google/cloud/compute_v1/services/network_firewall_policies/client.py +++ b/google/cloud/compute_v1/services/network_firewall_policies/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def add_association_unary( diff --git a/google/cloud/compute_v1/services/network_firewall_policies/transports/base.py b/google/cloud/compute_v1/services/network_firewall_policies/transports/base.py index c7ba0809c..baadf4f16 100644 --- a/google/cloud/compute_v1/services/network_firewall_policies/transports/base.py +++ b/google/cloud/compute_v1/services/network_firewall_policies/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/network_firewall_policies/transports/rest.py b/google/cloud/compute_v1/services/network_firewall_policies/transports/rest.py index d37688d42..6ae4327b1 100644 --- a/google/cloud/compute_v1/services/network_firewall_policies/transports/rest.py +++ b/google/cloud/compute_v1/services/network_firewall_policies/transports/rest.py @@ -582,6 +582,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[NetworkFirewallPoliciesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -634,6 +635,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/networks/client.py b/google/cloud/compute_v1/services/networks/client.py index 3ad45944b..e6918d254 100644 --- a/google/cloud/compute_v1/services/networks/client.py +++ b/google/cloud/compute_v1/services/networks/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def add_peering_unary( diff --git a/google/cloud/compute_v1/services/networks/transports/base.py b/google/cloud/compute_v1/services/networks/transports/base.py index 72ca901f5..cb26675d1 100644 --- a/google/cloud/compute_v1/services/networks/transports/base.py +++ b/google/cloud/compute_v1/services/networks/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/networks/transports/rest.py b/google/cloud/compute_v1/services/networks/transports/rest.py index 70053ef9b..f9ac535f4 100644 --- a/google/cloud/compute_v1/services/networks/transports/rest.py +++ b/google/cloud/compute_v1/services/networks/transports/rest.py @@ -408,6 +408,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[NetworksRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -460,6 +461,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/node_groups/client.py b/google/cloud/compute_v1/services/node_groups/client.py index 43a68b977..e0e603508 100644 --- a/google/cloud/compute_v1/services/node_groups/client.py +++ b/google/cloud/compute_v1/services/node_groups/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def add_nodes_unary( diff --git a/google/cloud/compute_v1/services/node_groups/transports/base.py b/google/cloud/compute_v1/services/node_groups/transports/base.py index b8a1ff4c8..503b99171 100644 --- a/google/cloud/compute_v1/services/node_groups/transports/base.py +++ b/google/cloud/compute_v1/services/node_groups/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/node_groups/transports/rest.py b/google/cloud/compute_v1/services/node_groups/transports/rest.py index 89101fc0c..2970ccb6a 100644 --- a/google/cloud/compute_v1/services/node_groups/transports/rest.py +++ b/google/cloud/compute_v1/services/node_groups/transports/rest.py @@ -472,6 +472,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[NodeGroupsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -524,6 +525,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/node_templates/client.py b/google/cloud/compute_v1/services/node_templates/client.py index 0cb641262..7435683fd 100644 --- a/google/cloud/compute_v1/services/node_templates/client.py +++ b/google/cloud/compute_v1/services/node_templates/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/node_templates/transports/base.py b/google/cloud/compute_v1/services/node_templates/transports/base.py index 833fabfb5..9b82d3ea2 100644 --- a/google/cloud/compute_v1/services/node_templates/transports/base.py +++ b/google/cloud/compute_v1/services/node_templates/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/node_templates/transports/rest.py b/google/cloud/compute_v1/services/node_templates/transports/rest.py index 82f5d8f41..05145aacb 100644 --- a/google/cloud/compute_v1/services/node_templates/transports/rest.py +++ b/google/cloud/compute_v1/services/node_templates/transports/rest.py @@ -337,6 +337,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[NodeTemplatesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -389,6 +390,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/node_types/client.py b/google/cloud/compute_v1/services/node_types/client.py index b346bc048..e1737dc81 100644 --- a/google/cloud/compute_v1/services/node_types/client.py +++ b/google/cloud/compute_v1/services/node_types/client.py @@ -398,6 +398,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/node_types/transports/base.py b/google/cloud/compute_v1/services/node_types/transports/base.py index d4e73610c..be90a131d 100644 --- a/google/cloud/compute_v1/services/node_types/transports/base.py +++ b/google/cloud/compute_v1/services/node_types/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -85,11 +86,6 @@ def __init__( be used for service account credentials. """ - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -110,6 +106,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -122,6 +123,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/node_types/transports/rest.py b/google/cloud/compute_v1/services/node_types/transports/rest.py index 2783eaf04..2b11335ee 100644 --- a/google/cloud/compute_v1/services/node_types/transports/rest.py +++ b/google/cloud/compute_v1/services/node_types/transports/rest.py @@ -186,6 +186,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[NodeTypesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -238,6 +239,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/packet_mirrorings/client.py b/google/cloud/compute_v1/services/packet_mirrorings/client.py index 1753c109c..f36c99c36 100644 --- a/google/cloud/compute_v1/services/packet_mirrorings/client.py +++ b/google/cloud/compute_v1/services/packet_mirrorings/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/packet_mirrorings/transports/base.py b/google/cloud/compute_v1/services/packet_mirrorings/transports/base.py index 9d3773396..25112448a 100644 --- a/google/cloud/compute_v1/services/packet_mirrorings/transports/base.py +++ b/google/cloud/compute_v1/services/packet_mirrorings/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/packet_mirrorings/transports/rest.py b/google/cloud/compute_v1/services/packet_mirrorings/transports/rest.py index adcc9799e..b2e2c127a 100644 --- a/google/cloud/compute_v1/services/packet_mirrorings/transports/rest.py +++ b/google/cloud/compute_v1/services/packet_mirrorings/transports/rest.py @@ -313,6 +313,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[PacketMirroringsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -365,6 +366,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/projects/client.py b/google/cloud/compute_v1/services/projects/client.py index 2dc2e150e..5277d2b51 100644 --- a/google/cloud/compute_v1/services/projects/client.py +++ b/google/cloud/compute_v1/services/projects/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def disable_xpn_host_unary( diff --git a/google/cloud/compute_v1/services/projects/transports/base.py b/google/cloud/compute_v1/services/projects/transports/base.py index aa85530a8..7b3923a5b 100644 --- a/google/cloud/compute_v1/services/projects/transports/base.py +++ b/google/cloud/compute_v1/services/projects/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/projects/transports/rest.py b/google/cloud/compute_v1/services/projects/transports/rest.py index ca129f034..639db0743 100644 --- a/google/cloud/compute_v1/services/projects/transports/rest.py +++ b/google/cloud/compute_v1/services/projects/transports/rest.py @@ -480,6 +480,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[ProjectsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -532,6 +533,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/public_advertised_prefixes/client.py b/google/cloud/compute_v1/services/public_advertised_prefixes/client.py index 644317f02..e31553c7a 100644 --- a/google/cloud/compute_v1/services/public_advertised_prefixes/client.py +++ b/google/cloud/compute_v1/services/public_advertised_prefixes/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/public_advertised_prefixes/transports/base.py b/google/cloud/compute_v1/services/public_advertised_prefixes/transports/base.py index 24482c35c..34ae39e1c 100644 --- a/google/cloud/compute_v1/services/public_advertised_prefixes/transports/base.py +++ b/google/cloud/compute_v1/services/public_advertised_prefixes/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/public_advertised_prefixes/transports/rest.py b/google/cloud/compute_v1/services/public_advertised_prefixes/transports/rest.py index b6ff5522a..594969245 100644 --- a/google/cloud/compute_v1/services/public_advertised_prefixes/transports/rest.py +++ b/google/cloud/compute_v1/services/public_advertised_prefixes/transports/rest.py @@ -251,6 +251,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[PublicAdvertisedPrefixesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -303,6 +304,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/public_delegated_prefixes/client.py b/google/cloud/compute_v1/services/public_delegated_prefixes/client.py index 93d3c67e0..a963dfccc 100644 --- a/google/cloud/compute_v1/services/public_delegated_prefixes/client.py +++ b/google/cloud/compute_v1/services/public_delegated_prefixes/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/public_delegated_prefixes/transports/base.py b/google/cloud/compute_v1/services/public_delegated_prefixes/transports/base.py index 367c4215d..3c57ce973 100644 --- a/google/cloud/compute_v1/services/public_delegated_prefixes/transports/base.py +++ b/google/cloud/compute_v1/services/public_delegated_prefixes/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/public_delegated_prefixes/transports/rest.py b/google/cloud/compute_v1/services/public_delegated_prefixes/transports/rest.py index ac94d5258..f7e20b547 100644 --- a/google/cloud/compute_v1/services/public_delegated_prefixes/transports/rest.py +++ b/google/cloud/compute_v1/services/public_delegated_prefixes/transports/rest.py @@ -283,6 +283,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[PublicDelegatedPrefixesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -335,6 +336,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_autoscalers/client.py b/google/cloud/compute_v1/services/region_autoscalers/client.py index de8cd705e..5739f1b10 100644 --- a/google/cloud/compute_v1/services/region_autoscalers/client.py +++ b/google/cloud/compute_v1/services/region_autoscalers/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/region_autoscalers/transports/base.py b/google/cloud/compute_v1/services/region_autoscalers/transports/base.py index 37d0aafca..d3662e029 100644 --- a/google/cloud/compute_v1/services/region_autoscalers/transports/base.py +++ b/google/cloud/compute_v1/services/region_autoscalers/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_autoscalers/transports/rest.py b/google/cloud/compute_v1/services/region_autoscalers/transports/rest.py index 80308cb44..da2006aa0 100644 --- a/google/cloud/compute_v1/services/region_autoscalers/transports/rest.py +++ b/google/cloud/compute_v1/services/region_autoscalers/transports/rest.py @@ -277,6 +277,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionAutoscalersRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -329,6 +330,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_backend_services/client.py b/google/cloud/compute_v1/services/region_backend_services/client.py index 8074e1c6a..c3bff48f5 100644 --- a/google/cloud/compute_v1/services/region_backend_services/client.py +++ b/google/cloud/compute_v1/services/region_backend_services/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/region_backend_services/transports/base.py b/google/cloud/compute_v1/services/region_backend_services/transports/base.py index 71bb4d0ee..e469d2ad0 100644 --- a/google/cloud/compute_v1/services/region_backend_services/transports/base.py +++ b/google/cloud/compute_v1/services/region_backend_services/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_backend_services/transports/rest.py b/google/cloud/compute_v1/services/region_backend_services/transports/rest.py index 5774b057c..0b8e92922 100644 --- a/google/cloud/compute_v1/services/region_backend_services/transports/rest.py +++ b/google/cloud/compute_v1/services/region_backend_services/transports/rest.py @@ -307,6 +307,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionBackendServicesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -359,6 +360,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_commitments/client.py b/google/cloud/compute_v1/services/region_commitments/client.py index dfa90e8bc..2b464abb2 100644 --- a/google/cloud/compute_v1/services/region_commitments/client.py +++ b/google/cloud/compute_v1/services/region_commitments/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/region_commitments/transports/base.py b/google/cloud/compute_v1/services/region_commitments/transports/base.py index 8476ce024..1ae892deb 100644 --- a/google/cloud/compute_v1/services/region_commitments/transports/base.py +++ b/google/cloud/compute_v1/services/region_commitments/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_commitments/transports/rest.py b/google/cloud/compute_v1/services/region_commitments/transports/rest.py index 8f1c17cc1..b93627d1a 100644 --- a/google/cloud/compute_v1/services/region_commitments/transports/rest.py +++ b/google/cloud/compute_v1/services/region_commitments/transports/rest.py @@ -251,6 +251,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionCommitmentsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -303,6 +304,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_disk_types/client.py b/google/cloud/compute_v1/services/region_disk_types/client.py index 60d8aff89..5671e4152 100644 --- a/google/cloud/compute_v1/services/region_disk_types/client.py +++ b/google/cloud/compute_v1/services/region_disk_types/client.py @@ -400,6 +400,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def get( diff --git a/google/cloud/compute_v1/services/region_disk_types/transports/base.py b/google/cloud/compute_v1/services/region_disk_types/transports/base.py index 0339af72a..ea700192b 100644 --- a/google/cloud/compute_v1/services/region_disk_types/transports/base.py +++ b/google/cloud/compute_v1/services/region_disk_types/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -85,11 +86,6 @@ def __init__( be used for service account credentials. """ - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -110,6 +106,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -122,6 +123,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_disk_types/transports/rest.py b/google/cloud/compute_v1/services/region_disk_types/transports/rest.py index 815818e66..ae0ff748a 100644 --- a/google/cloud/compute_v1/services/region_disk_types/transports/rest.py +++ b/google/cloud/compute_v1/services/region_disk_types/transports/rest.py @@ -165,6 +165,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionDiskTypesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -217,6 +218,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_disks/client.py b/google/cloud/compute_v1/services/region_disks/client.py index c69755771..ead7f33f1 100644 --- a/google/cloud/compute_v1/services/region_disks/client.py +++ b/google/cloud/compute_v1/services/region_disks/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def add_resource_policies_unary( diff --git a/google/cloud/compute_v1/services/region_disks/transports/base.py b/google/cloud/compute_v1/services/region_disks/transports/base.py index 144a4051c..ec993834b 100644 --- a/google/cloud/compute_v1/services/region_disks/transports/base.py +++ b/google/cloud/compute_v1/services/region_disks/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_disks/transports/rest.py b/google/cloud/compute_v1/services/region_disks/transports/rest.py index 464b7214c..2cae58c03 100644 --- a/google/cloud/compute_v1/services/region_disks/transports/rest.py +++ b/google/cloud/compute_v1/services/region_disks/transports/rest.py @@ -446,6 +446,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionDisksRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -498,6 +499,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_health_check_services/client.py b/google/cloud/compute_v1/services/region_health_check_services/client.py index c90a1531b..99bfe1240 100644 --- a/google/cloud/compute_v1/services/region_health_check_services/client.py +++ b/google/cloud/compute_v1/services/region_health_check_services/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/region_health_check_services/transports/base.py b/google/cloud/compute_v1/services/region_health_check_services/transports/base.py index a28844ccd..618ef2c80 100644 --- a/google/cloud/compute_v1/services/region_health_check_services/transports/base.py +++ b/google/cloud/compute_v1/services/region_health_check_services/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_health_check_services/transports/rest.py b/google/cloud/compute_v1/services/region_health_check_services/transports/rest.py index 46cfcdb6f..2cdf6a458 100644 --- a/google/cloud/compute_v1/services/region_health_check_services/transports/rest.py +++ b/google/cloud/compute_v1/services/region_health_check_services/transports/rest.py @@ -255,6 +255,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionHealthCheckServicesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -307,6 +308,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_health_checks/client.py b/google/cloud/compute_v1/services/region_health_checks/client.py index a17934fb1..b61125814 100644 --- a/google/cloud/compute_v1/services/region_health_checks/client.py +++ b/google/cloud/compute_v1/services/region_health_checks/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/region_health_checks/transports/base.py b/google/cloud/compute_v1/services/region_health_checks/transports/base.py index f65954e41..9d30b2c6b 100644 --- a/google/cloud/compute_v1/services/region_health_checks/transports/base.py +++ b/google/cloud/compute_v1/services/region_health_checks/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_health_checks/transports/rest.py b/google/cloud/compute_v1/services/region_health_checks/transports/rest.py index 7fbbb270e..127d721a2 100644 --- a/google/cloud/compute_v1/services/region_health_checks/transports/rest.py +++ b/google/cloud/compute_v1/services/region_health_checks/transports/rest.py @@ -275,6 +275,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionHealthChecksRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -327,6 +328,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_instance_group_managers/client.py b/google/cloud/compute_v1/services/region_instance_group_managers/client.py index 9cac948c4..ad6005696 100644 --- a/google/cloud/compute_v1/services/region_instance_group_managers/client.py +++ b/google/cloud/compute_v1/services/region_instance_group_managers/client.py @@ -405,6 +405,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def abandon_instances_unary( @@ -1007,9 +1008,9 @@ def create_instances_unary( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> compute.Operation: - r"""Creates instances with per-instance configs in this - regional managed instance group. Instances are created - using the current instance template. The create + r"""Creates instances with per-instance configurations in + this regional managed instance group. Instances are + created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify @@ -1140,9 +1141,9 @@ def create_instances( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> extended_operation.ExtendedOperation: - r"""Creates instances with per-instance configs in this - regional managed instance group. Instances are created - using the current instance template. The create + r"""Creates instances with per-instance configurations in + this regional managed instance group. Instances are + created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify @@ -1826,8 +1827,8 @@ def delete_per_instance_configs_unary( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> compute.Operation: - r"""Deletes selected per-instance configs for the managed - instance group. + r"""Deletes selected per-instance configurations for the + managed instance group. Args: request (Union[google.cloud.compute_v1.types.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest, dict]): @@ -1956,8 +1957,8 @@ def delete_per_instance_configs( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> extended_operation.ExtendedOperation: - r"""Deletes selected per-instance configs for the managed - instance group. + r"""Deletes selected per-instance configurations for the + managed instance group. Args: request (Union[google.cloud.compute_v1.types.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest, dict]): @@ -2805,9 +2806,9 @@ def list_per_instance_configs( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListPerInstanceConfigsPager: - r"""Lists all of the per-instance configs defined for the - managed instance group. The orderBy query parameter is - not supported. + r"""Lists all of the per-instance configurations defined + for the managed instance group. The orderBy query + parameter is not supported. Args: request (Union[google.cloud.compute_v1.types.ListPerInstanceConfigsRegionInstanceGroupManagersRequest, dict]): @@ -3204,10 +3205,10 @@ def patch_per_instance_configs_unary( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> compute.Operation: - r"""Inserts or patches per-instance configs for the - managed instance group. perInstanceConfig.name serves as - a key used to distinguish whether to perform insert or - patch. + r"""Inserts or patches per-instance configurations for + the managed instance group. perInstanceConfig.name + serves as a key used to distinguish whether to perform + insert or patch. Args: request (Union[google.cloud.compute_v1.types.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest, dict]): @@ -3336,10 +3337,10 @@ def patch_per_instance_configs( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> extended_operation.ExtendedOperation: - r"""Inserts or patches per-instance configs for the - managed instance group. perInstanceConfig.name serves as - a key used to distinguish whether to perform insert or - patch. + r"""Inserts or patches per-instance configurations for + the managed instance group. perInstanceConfig.name + serves as a key used to distinguish whether to perform + insert or patch. Args: request (Union[google.cloud.compute_v1.types.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest, dict]): @@ -4607,10 +4608,10 @@ def update_per_instance_configs_unary( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> compute.Operation: - r"""Inserts or updates per-instance configs for the - managed instance group. perInstanceConfig.name serves as - a key used to distinguish whether to perform insert or - patch. + r"""Inserts or updates per-instance configurations for + the managed instance group. perInstanceConfig.name + serves as a key used to distinguish whether to perform + insert or patch. Args: request (Union[google.cloud.compute_v1.types.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, dict]): @@ -4739,10 +4740,10 @@ def update_per_instance_configs( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> extended_operation.ExtendedOperation: - r"""Inserts or updates per-instance configs for the - managed instance group. perInstanceConfig.name serves as - a key used to distinguish whether to perform insert or - patch. + r"""Inserts or updates per-instance configurations for + the managed instance group. perInstanceConfig.name + serves as a key used to distinguish whether to perform + insert or patch. Args: request (Union[google.cloud.compute_v1.types.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, dict]): diff --git a/google/cloud/compute_v1/services/region_instance_group_managers/transports/base.py b/google/cloud/compute_v1/services/region_instance_group_managers/transports/base.py index 5f803d6c8..adfb06ccd 100644 --- a/google/cloud/compute_v1/services/region_instance_group_managers/transports/base.py +++ b/google/cloud/compute_v1/services/region_instance_group_managers/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_instance_group_managers/transports/rest.py b/google/cloud/compute_v1/services/region_instance_group_managers/transports/rest.py index b22e81c21..077fef85d 100644 --- a/google/cloud/compute_v1/services/region_instance_group_managers/transports/rest.py +++ b/google/cloud/compute_v1/services/region_instance_group_managers/transports/rest.py @@ -707,6 +707,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionInstanceGroupManagersRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -759,6 +760,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_instance_groups/client.py b/google/cloud/compute_v1/services/region_instance_groups/client.py index 79d9e87cd..63729401d 100644 --- a/google/cloud/compute_v1/services/region_instance_groups/client.py +++ b/google/cloud/compute_v1/services/region_instance_groups/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def get( diff --git a/google/cloud/compute_v1/services/region_instance_groups/transports/base.py b/google/cloud/compute_v1/services/region_instance_groups/transports/base.py index 09f64a5f4..f840dec46 100644 --- a/google/cloud/compute_v1/services/region_instance_groups/transports/base.py +++ b/google/cloud/compute_v1/services/region_instance_groups/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_instance_groups/transports/rest.py b/google/cloud/compute_v1/services/region_instance_groups/transports/rest.py index d280c0094..9b78bc044 100644 --- a/google/cloud/compute_v1/services/region_instance_groups/transports/rest.py +++ b/google/cloud/compute_v1/services/region_instance_groups/transports/rest.py @@ -227,6 +227,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionInstanceGroupsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -279,6 +280,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_instances/client.py b/google/cloud/compute_v1/services/region_instances/client.py index 81c44d187..38c53791f 100644 --- a/google/cloud/compute_v1/services/region_instances/client.py +++ b/google/cloud/compute_v1/services/region_instances/client.py @@ -402,6 +402,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def bulk_insert_unary( diff --git a/google/cloud/compute_v1/services/region_instances/transports/base.py b/google/cloud/compute_v1/services/region_instances/transports/base.py index adfcd3fd3..06b2ba7ac 100644 --- a/google/cloud/compute_v1/services/region_instances/transports/base.py +++ b/google/cloud/compute_v1/services/region_instances/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_instances/transports/rest.py b/google/cloud/compute_v1/services/region_instances/transports/rest.py index 2a0c80eb6..d0601a4da 100644 --- a/google/cloud/compute_v1/services/region_instances/transports/rest.py +++ b/google/cloud/compute_v1/services/region_instances/transports/rest.py @@ -135,6 +135,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionInstancesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -187,6 +188,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_network_endpoint_groups/client.py b/google/cloud/compute_v1/services/region_network_endpoint_groups/client.py index ab167c17e..68af0694c 100644 --- a/google/cloud/compute_v1/services/region_network_endpoint_groups/client.py +++ b/google/cloud/compute_v1/services/region_network_endpoint_groups/client.py @@ -405,6 +405,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/region_network_endpoint_groups/transports/base.py b/google/cloud/compute_v1/services/region_network_endpoint_groups/transports/base.py index 0c0455105..8c270e8c1 100644 --- a/google/cloud/compute_v1/services/region_network_endpoint_groups/transports/base.py +++ b/google/cloud/compute_v1/services/region_network_endpoint_groups/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_network_endpoint_groups/transports/rest.py b/google/cloud/compute_v1/services/region_network_endpoint_groups/transports/rest.py index f9ddc6e13..53fe0f9b5 100644 --- a/google/cloud/compute_v1/services/region_network_endpoint_groups/transports/rest.py +++ b/google/cloud/compute_v1/services/region_network_endpoint_groups/transports/rest.py @@ -229,6 +229,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionNetworkEndpointGroupsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -281,6 +282,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_network_firewall_policies/client.py b/google/cloud/compute_v1/services/region_network_firewall_policies/client.py index 7213dec6d..b8afeecc1 100644 --- a/google/cloud/compute_v1/services/region_network_firewall_policies/client.py +++ b/google/cloud/compute_v1/services/region_network_firewall_policies/client.py @@ -405,6 +405,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def add_association_unary( diff --git a/google/cloud/compute_v1/services/region_network_firewall_policies/transports/base.py b/google/cloud/compute_v1/services/region_network_firewall_policies/transports/base.py index 50d78fcf6..72a5c8002 100644 --- a/google/cloud/compute_v1/services/region_network_firewall_policies/transports/base.py +++ b/google/cloud/compute_v1/services/region_network_firewall_policies/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_network_firewall_policies/transports/rest.py b/google/cloud/compute_v1/services/region_network_firewall_policies/transports/rest.py index 8b79da036..af18633fa 100644 --- a/google/cloud/compute_v1/services/region_network_firewall_policies/transports/rest.py +++ b/google/cloud/compute_v1/services/region_network_firewall_policies/transports/rest.py @@ -637,6 +637,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionNetworkFirewallPoliciesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -689,6 +690,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_notification_endpoints/client.py b/google/cloud/compute_v1/services/region_notification_endpoints/client.py index 7c67c8f9f..2b8ee11df 100644 --- a/google/cloud/compute_v1/services/region_notification_endpoints/client.py +++ b/google/cloud/compute_v1/services/region_notification_endpoints/client.py @@ -405,6 +405,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/region_notification_endpoints/transports/base.py b/google/cloud/compute_v1/services/region_notification_endpoints/transports/base.py index 270a4e4d2..d4c3eeaf4 100644 --- a/google/cloud/compute_v1/services/region_notification_endpoints/transports/base.py +++ b/google/cloud/compute_v1/services/region_notification_endpoints/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_notification_endpoints/transports/rest.py b/google/cloud/compute_v1/services/region_notification_endpoints/transports/rest.py index c1897adc3..4c2ae319f 100644 --- a/google/cloud/compute_v1/services/region_notification_endpoints/transports/rest.py +++ b/google/cloud/compute_v1/services/region_notification_endpoints/transports/rest.py @@ -229,6 +229,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionNotificationEndpointsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -281,6 +282,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_operations/client.py b/google/cloud/compute_v1/services/region_operations/client.py index 8d849d99b..b5bbeebc9 100644 --- a/google/cloud/compute_v1/services/region_operations/client.py +++ b/google/cloud/compute_v1/services/region_operations/client.py @@ -400,6 +400,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete( diff --git a/google/cloud/compute_v1/services/region_operations/transports/base.py b/google/cloud/compute_v1/services/region_operations/transports/base.py index 28d578dad..2cd93083c 100644 --- a/google/cloud/compute_v1/services/region_operations/transports/base.py +++ b/google/cloud/compute_v1/services/region_operations/transports/base.py @@ -57,6 +57,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -84,11 +85,6 @@ def __init__( be used for service account credentials. """ - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -109,6 +105,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -121,6 +122,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_operations/transports/rest.py b/google/cloud/compute_v1/services/region_operations/transports/rest.py index 7c25de5f8..387dcc34f 100644 --- a/google/cloud/compute_v1/services/region_operations/transports/rest.py +++ b/google/cloud/compute_v1/services/region_operations/transports/rest.py @@ -221,6 +221,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionOperationsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -273,6 +274,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_security_policies/client.py b/google/cloud/compute_v1/services/region_security_policies/client.py index 460fdf4d6..6daa9c1fa 100644 --- a/google/cloud/compute_v1/services/region_security_policies/client.py +++ b/google/cloud/compute_v1/services/region_security_policies/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/region_security_policies/transports/base.py b/google/cloud/compute_v1/services/region_security_policies/transports/base.py index 38f4f56c1..fd9a02a53 100644 --- a/google/cloud/compute_v1/services/region_security_policies/transports/base.py +++ b/google/cloud/compute_v1/services/region_security_policies/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_security_policies/transports/rest.py b/google/cloud/compute_v1/services/region_security_policies/transports/rest.py index 5a337c156..665966eb3 100644 --- a/google/cloud/compute_v1/services/region_security_policies/transports/rest.py +++ b/google/cloud/compute_v1/services/region_security_policies/transports/rest.py @@ -249,6 +249,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionSecurityPoliciesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -301,6 +302,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_ssl_certificates/client.py b/google/cloud/compute_v1/services/region_ssl_certificates/client.py index 131a0a735..3e12948ae 100644 --- a/google/cloud/compute_v1/services/region_ssl_certificates/client.py +++ b/google/cloud/compute_v1/services/region_ssl_certificates/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/region_ssl_certificates/transports/base.py b/google/cloud/compute_v1/services/region_ssl_certificates/transports/base.py index 613b6e896..8080f01cc 100644 --- a/google/cloud/compute_v1/services/region_ssl_certificates/transports/base.py +++ b/google/cloud/compute_v1/services/region_ssl_certificates/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_ssl_certificates/transports/rest.py b/google/cloud/compute_v1/services/region_ssl_certificates/transports/rest.py index a87894924..d3609b298 100644 --- a/google/cloud/compute_v1/services/region_ssl_certificates/transports/rest.py +++ b/google/cloud/compute_v1/services/region_ssl_certificates/transports/rest.py @@ -221,6 +221,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionSslCertificatesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -273,6 +274,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_target_http_proxies/client.py b/google/cloud/compute_v1/services/region_target_http_proxies/client.py index 7bf699115..22431dc62 100644 --- a/google/cloud/compute_v1/services/region_target_http_proxies/client.py +++ b/google/cloud/compute_v1/services/region_target_http_proxies/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/region_target_http_proxies/transports/base.py b/google/cloud/compute_v1/services/region_target_http_proxies/transports/base.py index 04ba9ca5a..c30da1304 100644 --- a/google/cloud/compute_v1/services/region_target_http_proxies/transports/base.py +++ b/google/cloud/compute_v1/services/region_target_http_proxies/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_target_http_proxies/transports/rest.py b/google/cloud/compute_v1/services/region_target_http_proxies/transports/rest.py index 146f06504..ea25088c3 100644 --- a/google/cloud/compute_v1/services/region_target_http_proxies/transports/rest.py +++ b/google/cloud/compute_v1/services/region_target_http_proxies/transports/rest.py @@ -251,6 +251,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionTargetHttpProxiesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -303,6 +304,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_target_https_proxies/client.py b/google/cloud/compute_v1/services/region_target_https_proxies/client.py index 614fbbeb4..4c74c8e2d 100644 --- a/google/cloud/compute_v1/services/region_target_https_proxies/client.py +++ b/google/cloud/compute_v1/services/region_target_https_proxies/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/region_target_https_proxies/transports/base.py b/google/cloud/compute_v1/services/region_target_https_proxies/transports/base.py index e742a83a0..378aae59e 100644 --- a/google/cloud/compute_v1/services/region_target_https_proxies/transports/base.py +++ b/google/cloud/compute_v1/services/region_target_https_proxies/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_target_https_proxies/transports/rest.py b/google/cloud/compute_v1/services/region_target_https_proxies/transports/rest.py index 8a6594abf..2c8201695 100644 --- a/google/cloud/compute_v1/services/region_target_https_proxies/transports/rest.py +++ b/google/cloud/compute_v1/services/region_target_https_proxies/transports/rest.py @@ -312,6 +312,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionTargetHttpsProxiesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -364,6 +365,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/region_url_maps/client.py b/google/cloud/compute_v1/services/region_url_maps/client.py index 71c2e1562..b21f1dfb3 100644 --- a/google/cloud/compute_v1/services/region_url_maps/client.py +++ b/google/cloud/compute_v1/services/region_url_maps/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/region_url_maps/transports/base.py b/google/cloud/compute_v1/services/region_url_maps/transports/base.py index 283b1e958..c53624271 100644 --- a/google/cloud/compute_v1/services/region_url_maps/transports/base.py +++ b/google/cloud/compute_v1/services/region_url_maps/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/region_url_maps/transports/rest.py b/google/cloud/compute_v1/services/region_url_maps/transports/rest.py index d63c8f495..05c6b658e 100644 --- a/google/cloud/compute_v1/services/region_url_maps/transports/rest.py +++ b/google/cloud/compute_v1/services/region_url_maps/transports/rest.py @@ -305,6 +305,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionUrlMapsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -357,6 +358,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/regions/client.py b/google/cloud/compute_v1/services/regions/client.py index a55fa06ab..701adf670 100644 --- a/google/cloud/compute_v1/services/regions/client.py +++ b/google/cloud/compute_v1/services/regions/client.py @@ -398,6 +398,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def get( diff --git a/google/cloud/compute_v1/services/regions/transports/base.py b/google/cloud/compute_v1/services/regions/transports/base.py index e11530b25..8daa01372 100644 --- a/google/cloud/compute_v1/services/regions/transports/base.py +++ b/google/cloud/compute_v1/services/regions/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -85,11 +86,6 @@ def __init__( be used for service account credentials. """ - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -110,6 +106,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -122,6 +123,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/regions/transports/rest.py b/google/cloud/compute_v1/services/regions/transports/rest.py index 9d08a95a1..ad2cffd31 100644 --- a/google/cloud/compute_v1/services/regions/transports/rest.py +++ b/google/cloud/compute_v1/services/regions/transports/rest.py @@ -156,6 +156,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RegionsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -208,6 +209,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/reservations/client.py b/google/cloud/compute_v1/services/reservations/client.py index 58910d764..901cabd8a 100644 --- a/google/cloud/compute_v1/services/reservations/client.py +++ b/google/cloud/compute_v1/services/reservations/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/reservations/transports/base.py b/google/cloud/compute_v1/services/reservations/transports/base.py index c5937df15..b26d2d444 100644 --- a/google/cloud/compute_v1/services/reservations/transports/base.py +++ b/google/cloud/compute_v1/services/reservations/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/reservations/transports/rest.py b/google/cloud/compute_v1/services/reservations/transports/rest.py index 0259e01b9..94ea0cfd2 100644 --- a/google/cloud/compute_v1/services/reservations/transports/rest.py +++ b/google/cloud/compute_v1/services/reservations/transports/rest.py @@ -388,6 +388,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[ReservationsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -440,6 +441,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/resource_policies/client.py b/google/cloud/compute_v1/services/resource_policies/client.py index e97f0935a..b8f2fac51 100644 --- a/google/cloud/compute_v1/services/resource_policies/client.py +++ b/google/cloud/compute_v1/services/resource_policies/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/resource_policies/transports/base.py b/google/cloud/compute_v1/services/resource_policies/transports/base.py index 559ae713c..e891d6625 100644 --- a/google/cloud/compute_v1/services/resource_policies/transports/base.py +++ b/google/cloud/compute_v1/services/resource_policies/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/resource_policies/transports/rest.py b/google/cloud/compute_v1/services/resource_policies/transports/rest.py index 626a3248e..4a448f438 100644 --- a/google/cloud/compute_v1/services/resource_policies/transports/rest.py +++ b/google/cloud/compute_v1/services/resource_policies/transports/rest.py @@ -341,6 +341,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[ResourcePoliciesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -393,6 +394,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/routers/client.py b/google/cloud/compute_v1/services/routers/client.py index 3ccacd453..d8f74b82c 100644 --- a/google/cloud/compute_v1/services/routers/client.py +++ b/google/cloud/compute_v1/services/routers/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/routers/transports/base.py b/google/cloud/compute_v1/services/routers/transports/base.py index 279ad2b9b..ce70e7764 100644 --- a/google/cloud/compute_v1/services/routers/transports/base.py +++ b/google/cloud/compute_v1/services/routers/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/routers/transports/rest.py b/google/cloud/compute_v1/services/routers/transports/rest.py index 0d0d5db6a..7443edbfb 100644 --- a/google/cloud/compute_v1/services/routers/transports/rest.py +++ b/google/cloud/compute_v1/services/routers/transports/rest.py @@ -378,6 +378,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RoutersRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -430,6 +431,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/routes/client.py b/google/cloud/compute_v1/services/routes/client.py index 5f51c5990..3db632ec0 100644 --- a/google/cloud/compute_v1/services/routes/client.py +++ b/google/cloud/compute_v1/services/routes/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/routes/transports/base.py b/google/cloud/compute_v1/services/routes/transports/base.py index 47c8f2d4e..0fe184add 100644 --- a/google/cloud/compute_v1/services/routes/transports/base.py +++ b/google/cloud/compute_v1/services/routes/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/routes/transports/rest.py b/google/cloud/compute_v1/services/routes/transports/rest.py index 094fb26c0..b22c9db26 100644 --- a/google/cloud/compute_v1/services/routes/transports/rest.py +++ b/google/cloud/compute_v1/services/routes/transports/rest.py @@ -208,6 +208,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[RoutesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -260,6 +261,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/security_policies/client.py b/google/cloud/compute_v1/services/security_policies/client.py index 951fddb57..1f1655201 100644 --- a/google/cloud/compute_v1/services/security_policies/client.py +++ b/google/cloud/compute_v1/services/security_policies/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def add_rule_unary( diff --git a/google/cloud/compute_v1/services/security_policies/transports/base.py b/google/cloud/compute_v1/services/security_policies/transports/base.py index bba5c6805..e28b6fa23 100644 --- a/google/cloud/compute_v1/services/security_policies/transports/base.py +++ b/google/cloud/compute_v1/services/security_policies/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/security_policies/transports/rest.py b/google/cloud/compute_v1/services/security_policies/transports/rest.py index 930502190..dc1422cb4 100644 --- a/google/cloud/compute_v1/services/security_policies/transports/rest.py +++ b/google/cloud/compute_v1/services/security_policies/transports/rest.py @@ -428,6 +428,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[SecurityPoliciesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -480,6 +481,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/service_attachments/client.py b/google/cloud/compute_v1/services/service_attachments/client.py index d28952c21..f2d73b3e0 100644 --- a/google/cloud/compute_v1/services/service_attachments/client.py +++ b/google/cloud/compute_v1/services/service_attachments/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/service_attachments/transports/base.py b/google/cloud/compute_v1/services/service_attachments/transports/base.py index 2105cf0bd..01d343923 100644 --- a/google/cloud/compute_v1/services/service_attachments/transports/base.py +++ b/google/cloud/compute_v1/services/service_attachments/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/service_attachments/transports/rest.py b/google/cloud/compute_v1/services/service_attachments/transports/rest.py index a4b69e801..661a11781 100644 --- a/google/cloud/compute_v1/services/service_attachments/transports/rest.py +++ b/google/cloud/compute_v1/services/service_attachments/transports/rest.py @@ -371,6 +371,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[ServiceAttachmentsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -423,6 +424,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/snapshots/client.py b/google/cloud/compute_v1/services/snapshots/client.py index 7da04b7e3..8c2e70bc4 100644 --- a/google/cloud/compute_v1/services/snapshots/client.py +++ b/google/cloud/compute_v1/services/snapshots/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/snapshots/transports/base.py b/google/cloud/compute_v1/services/snapshots/transports/base.py index 1b7b847dc..23aa7c328 100644 --- a/google/cloud/compute_v1/services/snapshots/transports/base.py +++ b/google/cloud/compute_v1/services/snapshots/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/snapshots/transports/rest.py b/google/cloud/compute_v1/services/snapshots/transports/rest.py index 9347dca31..99ce7b878 100644 --- a/google/cloud/compute_v1/services/snapshots/transports/rest.py +++ b/google/cloud/compute_v1/services/snapshots/transports/rest.py @@ -326,6 +326,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[SnapshotsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -378,6 +379,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/ssl_certificates/client.py b/google/cloud/compute_v1/services/ssl_certificates/client.py index b0b8b64e0..ab2616aaa 100644 --- a/google/cloud/compute_v1/services/ssl_certificates/client.py +++ b/google/cloud/compute_v1/services/ssl_certificates/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/ssl_certificates/transports/base.py b/google/cloud/compute_v1/services/ssl_certificates/transports/base.py index 270cadbcd..5de00b078 100644 --- a/google/cloud/compute_v1/services/ssl_certificates/transports/base.py +++ b/google/cloud/compute_v1/services/ssl_certificates/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/ssl_certificates/transports/rest.py b/google/cloud/compute_v1/services/ssl_certificates/transports/rest.py index 7a06b2682..20a6f5121 100644 --- a/google/cloud/compute_v1/services/ssl_certificates/transports/rest.py +++ b/google/cloud/compute_v1/services/ssl_certificates/transports/rest.py @@ -251,6 +251,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[SslCertificatesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -303,6 +304,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/ssl_policies/client.py b/google/cloud/compute_v1/services/ssl_policies/client.py index d3947521c..962dc5330 100644 --- a/google/cloud/compute_v1/services/ssl_policies/client.py +++ b/google/cloud/compute_v1/services/ssl_policies/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/ssl_policies/transports/base.py b/google/cloud/compute_v1/services/ssl_policies/transports/base.py index 78832bdd1..dc02c2c8e 100644 --- a/google/cloud/compute_v1/services/ssl_policies/transports/base.py +++ b/google/cloud/compute_v1/services/ssl_policies/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/ssl_policies/transports/rest.py b/google/cloud/compute_v1/services/ssl_policies/transports/rest.py index a9d3e00fe..4d9f988fa 100644 --- a/google/cloud/compute_v1/services/ssl_policies/transports/rest.py +++ b/google/cloud/compute_v1/services/ssl_policies/transports/rest.py @@ -274,6 +274,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[SslPoliciesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -326,6 +327,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/subnetworks/client.py b/google/cloud/compute_v1/services/subnetworks/client.py index cd32eb967..6effb3997 100644 --- a/google/cloud/compute_v1/services/subnetworks/client.py +++ b/google/cloud/compute_v1/services/subnetworks/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/subnetworks/transports/base.py b/google/cloud/compute_v1/services/subnetworks/transports/base.py index 6eb37d8d7..77ade9670 100644 --- a/google/cloud/compute_v1/services/subnetworks/transports/base.py +++ b/google/cloud/compute_v1/services/subnetworks/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/subnetworks/transports/rest.py b/google/cloud/compute_v1/services/subnetworks/transports/rest.py index f6e538bd6..46022bc18 100644 --- a/google/cloud/compute_v1/services/subnetworks/transports/rest.py +++ b/google/cloud/compute_v1/services/subnetworks/transports/rest.py @@ -450,6 +450,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[SubnetworksRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -502,6 +503,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/target_grpc_proxies/client.py b/google/cloud/compute_v1/services/target_grpc_proxies/client.py index 339668319..9e8839788 100644 --- a/google/cloud/compute_v1/services/target_grpc_proxies/client.py +++ b/google/cloud/compute_v1/services/target_grpc_proxies/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/target_grpc_proxies/transports/base.py b/google/cloud/compute_v1/services/target_grpc_proxies/transports/base.py index b4174837f..6b9ffa183 100644 --- a/google/cloud/compute_v1/services/target_grpc_proxies/transports/base.py +++ b/google/cloud/compute_v1/services/target_grpc_proxies/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/target_grpc_proxies/transports/rest.py b/google/cloud/compute_v1/services/target_grpc_proxies/transports/rest.py index 2d9ded560..75a3fec4e 100644 --- a/google/cloud/compute_v1/services/target_grpc_proxies/transports/rest.py +++ b/google/cloud/compute_v1/services/target_grpc_proxies/transports/rest.py @@ -249,6 +249,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[TargetGrpcProxiesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -301,6 +302,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/target_http_proxies/client.py b/google/cloud/compute_v1/services/target_http_proxies/client.py index 8edebcf47..d5559950d 100644 --- a/google/cloud/compute_v1/services/target_http_proxies/client.py +++ b/google/cloud/compute_v1/services/target_http_proxies/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/target_http_proxies/transports/base.py b/google/cloud/compute_v1/services/target_http_proxies/transports/base.py index f0f219912..78e874e50 100644 --- a/google/cloud/compute_v1/services/target_http_proxies/transports/base.py +++ b/google/cloud/compute_v1/services/target_http_proxies/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/target_http_proxies/transports/rest.py b/google/cloud/compute_v1/services/target_http_proxies/transports/rest.py index 9c4a1f31f..4afaa4f36 100644 --- a/google/cloud/compute_v1/services/target_http_proxies/transports/rest.py +++ b/google/cloud/compute_v1/services/target_http_proxies/transports/rest.py @@ -309,6 +309,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[TargetHttpProxiesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -361,6 +362,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/target_https_proxies/client.py b/google/cloud/compute_v1/services/target_https_proxies/client.py index acd4cbfb5..f3c9fdbe7 100644 --- a/google/cloud/compute_v1/services/target_https_proxies/client.py +++ b/google/cloud/compute_v1/services/target_https_proxies/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( @@ -1309,6 +1310,246 @@ def error_code(self): # Done; return the response. return response + def set_certificate_map_unary( + self, + request: Union[compute.SetCertificateMapTargetHttpsProxyRequest, dict] = None, + *, + project: str = None, + target_https_proxy: str = None, + target_https_proxies_set_certificate_map_request_resource: compute.TargetHttpsProxiesSetCertificateMapRequest = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Operation: + r"""Changes the Certificate Map for TargetHttpsProxy. + + Args: + request (Union[google.cloud.compute_v1.types.SetCertificateMapTargetHttpsProxyRequest, dict]): + The request object. A request message for + TargetHttpsProxies.SetCertificateMap. See the method + description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + target_https_proxy (str): + Name of the TargetHttpsProxy resource + whose CertificateMap is to be set. The + name must be 1-63 characters long, and + comply with RFC1035. + + This corresponds to the ``target_https_proxy`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + target_https_proxies_set_certificate_map_request_resource (google.cloud.compute_v1.types.TargetHttpsProxiesSetCertificateMapRequest): + The body resource for this request + This corresponds to the ``target_https_proxies_set_certificate_map_request_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # 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( + [ + project, + target_https_proxy, + target_https_proxies_set_certificate_map_request_resource, + ] + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.SetCertificateMapTargetHttpsProxyRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.SetCertificateMapTargetHttpsProxyRequest): + request = compute.SetCertificateMapTargetHttpsProxyRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if target_https_proxy is not None: + request.target_https_proxy = target_https_proxy + if target_https_proxies_set_certificate_map_request_resource is not None: + request.target_https_proxies_set_certificate_map_request_resource = ( + target_https_proxies_set_certificate_map_request_resource + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.set_certificate_map] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("target_https_proxy", request.target_https_proxy), + ) + ), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def set_certificate_map( + self, + request: Union[compute.SetCertificateMapTargetHttpsProxyRequest, dict] = None, + *, + project: str = None, + target_https_proxy: str = None, + target_https_proxies_set_certificate_map_request_resource: compute.TargetHttpsProxiesSetCertificateMapRequest = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> extended_operation.ExtendedOperation: + r"""Changes the Certificate Map for TargetHttpsProxy. + + Args: + request (Union[google.cloud.compute_v1.types.SetCertificateMapTargetHttpsProxyRequest, dict]): + The request object. A request message for + TargetHttpsProxies.SetCertificateMap. See the method + description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + target_https_proxy (str): + Name of the TargetHttpsProxy resource + whose CertificateMap is to be set. The + name must be 1-63 characters long, and + comply with RFC1035. + + This corresponds to the ``target_https_proxy`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + target_https_proxies_set_certificate_map_request_resource (google.cloud.compute_v1.types.TargetHttpsProxiesSetCertificateMapRequest): + The body resource for this request + This corresponds to the ``target_https_proxies_set_certificate_map_request_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # 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( + [ + project, + target_https_proxy, + target_https_proxies_set_certificate_map_request_resource, + ] + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.SetCertificateMapTargetHttpsProxyRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.SetCertificateMapTargetHttpsProxyRequest): + request = compute.SetCertificateMapTargetHttpsProxyRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if target_https_proxy is not None: + request.target_https_proxy = target_https_proxy + if target_https_proxies_set_certificate_map_request_resource is not None: + request.target_https_proxies_set_certificate_map_request_resource = ( + target_https_proxies_set_certificate_map_request_resource + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.set_certificate_map] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("target_https_proxy", request.target_https_proxy), + ) + ), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + operation_service = self._transport._global_operations_client + operation_request = compute.GetGlobalOperationRequest() + operation_request.project = request.project + operation_request.operation = response.name + + get_operation = functools.partial(operation_service.get, operation_request) + # Cancel is not part of extended operations yet. + cancel_operation = lambda: None + + # Note: this class is an implementation detail to provide a uniform + # set of names for certain fields in the extended operation proto message. + # See google.api_core.extended_operation.ExtendedOperation for details + # on these properties and the expected interface. + class _CustomOperation(extended_operation.ExtendedOperation): + @property + def error_message(self): + return self._extended_operation.http_error_message + + @property + def error_code(self): + return self._extended_operation.http_error_status_code + + response = _CustomOperation.make(get_operation, cancel_operation, response) + + # Done; return the response. + return response + def set_quic_override_unary( self, request: Union[compute.SetQuicOverrideTargetHttpsProxyRequest, dict] = None, diff --git a/google/cloud/compute_v1/services/target_https_proxies/transports/base.py b/google/cloud/compute_v1/services/target_https_proxies/transports/base.py index 1e514689e..d5a5ea86b 100644 --- a/google/cloud/compute_v1/services/target_https_proxies/transports/base.py +++ b/google/cloud/compute_v1/services/target_https_proxies/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { @@ -156,6 +162,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.set_certificate_map: gapic_v1.method.wrap_method( + self.set_certificate_map, + default_timeout=None, + client_info=client_info, + ), self.set_quic_override: gapic_v1.method.wrap_method( self.set_quic_override, default_timeout=None, @@ -244,6 +255,15 @@ def patch( ]: raise NotImplementedError() + @property + def set_certificate_map( + self, + ) -> Callable[ + [compute.SetCertificateMapTargetHttpsProxyRequest], + Union[compute.Operation, Awaitable[compute.Operation]], + ]: + raise NotImplementedError() + @property def set_quic_override( self, diff --git a/google/cloud/compute_v1/services/target_https_proxies/transports/rest.py b/google/cloud/compute_v1/services/target_https_proxies/transports/rest.py index dde91b55e..73a8fc70b 100644 --- a/google/cloud/compute_v1/services/target_https_proxies/transports/rest.py +++ b/google/cloud/compute_v1/services/target_https_proxies/transports/rest.py @@ -110,6 +110,13 @@ def pre_patch(request, metadata): def post_patch(response): logging.log(f"Received response: {response}") + def pre_set_certificate_map(request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_set_certificate_map(response): + logging.log(f"Received response: {response}") + def pre_set_quic_override(request, metadata): logging.log(f"Received request: {request}") return request, metadata @@ -276,6 +283,31 @@ def post_patch(self, response: compute.Operation) -> compute.Operation: """ return response + def pre_set_certificate_map( + self, + request: compute.SetCertificateMapTargetHttpsProxyRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[ + compute.SetCertificateMapTargetHttpsProxyRequest, Sequence[Tuple[str, str]] + ]: + """Pre-rpc interceptor for set_certificate_map + + Override in a subclass to manipulate the request or metadata + before they are sent to the TargetHttpsProxies server. + """ + return request, metadata + + def post_set_certificate_map( + self, response: compute.Operation + ) -> compute.Operation: + """Post-rpc interceptor for set_certificate_map + + Override in a subclass to manipulate the response + after it is returned by the TargetHttpsProxies server but before + it is returned to user code. + """ + return response + def pre_set_quic_override( self, request: compute.SetQuicOverrideTargetHttpsProxyRequest, @@ -399,6 +431,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[TargetHttpsProxiesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -451,6 +484,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST @@ -1071,6 +1105,124 @@ def __call__( resp = self._interceptor.post_patch(resp) return resp + class _SetCertificateMap(TargetHttpsProxiesRestStub): + def __hash__(self): + return hash("SetCertificateMap") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + def __call__( + self, + request: compute.SetCertificateMapTargetHttpsProxyRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Operation: + r"""Call the set certificate map method over HTTP. + + Args: + request (~.compute.SetCertificateMapTargetHttpsProxyRequest): + The request object. A request message for + TargetHttpsProxies.SetCertificateMap. + See the method description for details. + + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + ~.compute.Operation: + Represents an Operation resource. Google Compute Engine + has three Operation resources: \* + `Global `__ + \* + `Regional `__ + \* + `Zonal `__ + You can use an operation resource to manage asynchronous + API requests. For more information, read Handling API + responses. Operations can be global, regional or zonal. + - For global operations, use the ``globalOperations`` + resource. - For regional operations, use the + ``regionOperations`` resource. - For zonal operations, + use the ``zonalOperations`` resource. For more + information, read Global, Regional, and Zonal Resources. + + """ + + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}/setCertificateMap", + "body": "target_https_proxies_set_certificate_map_request_resource", + }, + ] + request, metadata = self._interceptor.pre_set_certificate_map( + request, metadata + ) + request_kwargs = compute.SetCertificateMapTargetHttpsProxyRequest.to_dict( + request + ) + transcoded_request = path_template.transcode(http_options, **request_kwargs) + + # Jsonify the request body + body = compute.TargetHttpsProxiesSetCertificateMapRequest.to_json( + compute.TargetHttpsProxiesSetCertificateMapRequest( + transcoded_request["body"] + ), + including_default_value_fields=False, + use_integers_for_enums=False, + ) + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + compute.SetCertificateMapTargetHttpsProxyRequest.to_json( + compute.SetCertificateMapTargetHttpsProxyRequest( + transcoded_request["query_params"] + ), + including_default_value_fields=False, + use_integers_for_enums=False, + ) + ) + + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params), + data=body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.Operation.from_json( + response.content, ignore_unknown_fields=True + ) + resp = self._interceptor.post_set_certificate_map(resp) + return resp + class _SetQuicOverride(TargetHttpsProxiesRestStub): def __hash__(self): return hash("SetQuicOverride") @@ -1586,6 +1738,16 @@ def patch( # In C++ this would require a dynamic_cast return self._Patch(self._session, self._host, self._interceptor) # type: ignore + @property + def set_certificate_map( + self, + ) -> Callable[ + [compute.SetCertificateMapTargetHttpsProxyRequest], compute.Operation + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._SetCertificateMap(self._session, self._host, self._interceptor) # type: ignore + @property def set_quic_override( self, diff --git a/google/cloud/compute_v1/services/target_instances/client.py b/google/cloud/compute_v1/services/target_instances/client.py index 6d8a52b5f..31754c0e4 100644 --- a/google/cloud/compute_v1/services/target_instances/client.py +++ b/google/cloud/compute_v1/services/target_instances/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/target_instances/transports/base.py b/google/cloud/compute_v1/services/target_instances/transports/base.py index 092c60f40..d8908bf05 100644 --- a/google/cloud/compute_v1/services/target_instances/transports/base.py +++ b/google/cloud/compute_v1/services/target_instances/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/target_instances/transports/rest.py b/google/cloud/compute_v1/services/target_instances/transports/rest.py index 3f4ea5d72..f1d8d0dd6 100644 --- a/google/cloud/compute_v1/services/target_instances/transports/rest.py +++ b/google/cloud/compute_v1/services/target_instances/transports/rest.py @@ -251,6 +251,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[TargetInstancesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -303,6 +304,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/target_pools/client.py b/google/cloud/compute_v1/services/target_pools/client.py index 4e494d325..99cac12b8 100644 --- a/google/cloud/compute_v1/services/target_pools/client.py +++ b/google/cloud/compute_v1/services/target_pools/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def add_health_check_unary( diff --git a/google/cloud/compute_v1/services/target_pools/transports/base.py b/google/cloud/compute_v1/services/target_pools/transports/base.py index d1a3df898..8fe23a334 100644 --- a/google/cloud/compute_v1/services/target_pools/transports/base.py +++ b/google/cloud/compute_v1/services/target_pools/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/target_pools/transports/rest.py b/google/cloud/compute_v1/services/target_pools/transports/rest.py index 0c6ced026..6ac5c54bd 100644 --- a/google/cloud/compute_v1/services/target_pools/transports/rest.py +++ b/google/cloud/compute_v1/services/target_pools/transports/rest.py @@ -416,6 +416,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[TargetPoolsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -468,6 +469,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/target_ssl_proxies/client.py b/google/cloud/compute_v1/services/target_ssl_proxies/client.py index a99818395..439d54724 100644 --- a/google/cloud/compute_v1/services/target_ssl_proxies/client.py +++ b/google/cloud/compute_v1/services/target_ssl_proxies/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( @@ -1225,6 +1226,246 @@ def error_code(self): # Done; return the response. return response + def set_certificate_map_unary( + self, + request: Union[compute.SetCertificateMapTargetSslProxyRequest, dict] = None, + *, + project: str = None, + target_ssl_proxy: str = None, + target_ssl_proxies_set_certificate_map_request_resource: compute.TargetSslProxiesSetCertificateMapRequest = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Operation: + r"""Changes the Certificate Map for TargetSslProxy. + + Args: + request (Union[google.cloud.compute_v1.types.SetCertificateMapTargetSslProxyRequest, dict]): + The request object. A request message for + TargetSslProxies.SetCertificateMap. See the method + description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + target_ssl_proxy (str): + Name of the TargetSslProxy resource + whose CertificateMap is to be set. The + name must be 1-63 characters long, and + comply with RFC1035. + + This corresponds to the ``target_ssl_proxy`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + target_ssl_proxies_set_certificate_map_request_resource (google.cloud.compute_v1.types.TargetSslProxiesSetCertificateMapRequest): + The body resource for this request + This corresponds to the ``target_ssl_proxies_set_certificate_map_request_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # 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( + [ + project, + target_ssl_proxy, + target_ssl_proxies_set_certificate_map_request_resource, + ] + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.SetCertificateMapTargetSslProxyRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.SetCertificateMapTargetSslProxyRequest): + request = compute.SetCertificateMapTargetSslProxyRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if target_ssl_proxy is not None: + request.target_ssl_proxy = target_ssl_proxy + if target_ssl_proxies_set_certificate_map_request_resource is not None: + request.target_ssl_proxies_set_certificate_map_request_resource = ( + target_ssl_proxies_set_certificate_map_request_resource + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.set_certificate_map] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("target_ssl_proxy", request.target_ssl_proxy), + ) + ), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def set_certificate_map( + self, + request: Union[compute.SetCertificateMapTargetSslProxyRequest, dict] = None, + *, + project: str = None, + target_ssl_proxy: str = None, + target_ssl_proxies_set_certificate_map_request_resource: compute.TargetSslProxiesSetCertificateMapRequest = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> extended_operation.ExtendedOperation: + r"""Changes the Certificate Map for TargetSslProxy. + + Args: + request (Union[google.cloud.compute_v1.types.SetCertificateMapTargetSslProxyRequest, dict]): + The request object. A request message for + TargetSslProxies.SetCertificateMap. See the method + description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + target_ssl_proxy (str): + Name of the TargetSslProxy resource + whose CertificateMap is to be set. The + name must be 1-63 characters long, and + comply with RFC1035. + + This corresponds to the ``target_ssl_proxy`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + target_ssl_proxies_set_certificate_map_request_resource (google.cloud.compute_v1.types.TargetSslProxiesSetCertificateMapRequest): + The body resource for this request + This corresponds to the ``target_ssl_proxies_set_certificate_map_request_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # 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( + [ + project, + target_ssl_proxy, + target_ssl_proxies_set_certificate_map_request_resource, + ] + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.SetCertificateMapTargetSslProxyRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.SetCertificateMapTargetSslProxyRequest): + request = compute.SetCertificateMapTargetSslProxyRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if target_ssl_proxy is not None: + request.target_ssl_proxy = target_ssl_proxy + if target_ssl_proxies_set_certificate_map_request_resource is not None: + request.target_ssl_proxies_set_certificate_map_request_resource = ( + target_ssl_proxies_set_certificate_map_request_resource + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.set_certificate_map] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("target_ssl_proxy", request.target_ssl_proxy), + ) + ), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + operation_service = self._transport._global_operations_client + operation_request = compute.GetGlobalOperationRequest() + operation_request.project = request.project + operation_request.operation = response.name + + get_operation = functools.partial(operation_service.get, operation_request) + # Cancel is not part of extended operations yet. + cancel_operation = lambda: None + + # Note: this class is an implementation detail to provide a uniform + # set of names for certain fields in the extended operation proto message. + # See google.api_core.extended_operation.ExtendedOperation for details + # on these properties and the expected interface. + class _CustomOperation(extended_operation.ExtendedOperation): + @property + def error_message(self): + return self._extended_operation.http_error_message + + @property + def error_code(self): + return self._extended_operation.http_error_status_code + + response = _CustomOperation.make(get_operation, cancel_operation, response) + + # Done; return the response. + return response + def set_proxy_header_unary( self, request: Union[compute.SetProxyHeaderTargetSslProxyRequest, dict] = None, diff --git a/google/cloud/compute_v1/services/target_ssl_proxies/transports/base.py b/google/cloud/compute_v1/services/target_ssl_proxies/transports/base.py index 0fef507c7..346c01fa7 100644 --- a/google/cloud/compute_v1/services/target_ssl_proxies/transports/base.py +++ b/google/cloud/compute_v1/services/target_ssl_proxies/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { @@ -151,6 +157,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.set_certificate_map: gapic_v1.method.wrap_method( + self.set_certificate_map, + default_timeout=None, + client_info=client_info, + ), self.set_proxy_header: gapic_v1.method.wrap_method( self.set_proxy_header, default_timeout=None, @@ -222,6 +233,15 @@ def set_backend_service( ]: raise NotImplementedError() + @property + def set_certificate_map( + self, + ) -> Callable[ + [compute.SetCertificateMapTargetSslProxyRequest], + Union[compute.Operation, Awaitable[compute.Operation]], + ]: + raise NotImplementedError() + @property def set_proxy_header( self, diff --git a/google/cloud/compute_v1/services/target_ssl_proxies/transports/rest.py b/google/cloud/compute_v1/services/target_ssl_proxies/transports/rest.py index 8adc557ff..2618f66c0 100644 --- a/google/cloud/compute_v1/services/target_ssl_proxies/transports/rest.py +++ b/google/cloud/compute_v1/services/target_ssl_proxies/transports/rest.py @@ -103,6 +103,13 @@ def pre_set_backend_service(request, metadata): def post_set_backend_service(response): logging.log(f"Received response: {response}") + def pre_set_certificate_map(request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_set_certificate_map(response): + logging.log(f"Received response: {response}") + def pre_set_proxy_header(request, metadata): logging.log(f"Received request: {request}") return request, metadata @@ -241,6 +248,31 @@ def post_set_backend_service( """ return response + def pre_set_certificate_map( + self, + request: compute.SetCertificateMapTargetSslProxyRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[ + compute.SetCertificateMapTargetSslProxyRequest, Sequence[Tuple[str, str]] + ]: + """Pre-rpc interceptor for set_certificate_map + + Override in a subclass to manipulate the request or metadata + before they are sent to the TargetSslProxies server. + """ + return request, metadata + + def post_set_certificate_map( + self, response: compute.Operation + ) -> compute.Operation: + """Post-rpc interceptor for set_certificate_map + + Override in a subclass to manipulate the response + after it is returned by the TargetSslProxies server but before + it is returned to user code. + """ + return response + def pre_set_proxy_header( self, request: compute.SetProxyHeaderTargetSslProxyRequest, @@ -341,6 +373,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[TargetSslProxiesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -393,6 +426,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST @@ -924,6 +958,124 @@ def __call__( resp = self._interceptor.post_set_backend_service(resp) return resp + class _SetCertificateMap(TargetSslProxiesRestStub): + def __hash__(self): + return hash("SetCertificateMap") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + def __call__( + self, + request: compute.SetCertificateMapTargetSslProxyRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Operation: + r"""Call the set certificate map method over HTTP. + + Args: + request (~.compute.SetCertificateMapTargetSslProxyRequest): + The request object. A request message for + TargetSslProxies.SetCertificateMap. See + the method description for details. + + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + ~.compute.Operation: + Represents an Operation resource. Google Compute Engine + has three Operation resources: \* + `Global `__ + \* + `Regional `__ + \* + `Zonal `__ + You can use an operation resource to manage asynchronous + API requests. For more information, read Handling API + responses. Operations can be global, regional or zonal. + - For global operations, use the ``globalOperations`` + resource. - For regional operations, use the + ``regionOperations`` resource. - For zonal operations, + use the ``zonalOperations`` resource. For more + information, read Global, Regional, and Zonal Resources. + + """ + + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setCertificateMap", + "body": "target_ssl_proxies_set_certificate_map_request_resource", + }, + ] + request, metadata = self._interceptor.pre_set_certificate_map( + request, metadata + ) + request_kwargs = compute.SetCertificateMapTargetSslProxyRequest.to_dict( + request + ) + transcoded_request = path_template.transcode(http_options, **request_kwargs) + + # Jsonify the request body + body = compute.TargetSslProxiesSetCertificateMapRequest.to_json( + compute.TargetSslProxiesSetCertificateMapRequest( + transcoded_request["body"] + ), + including_default_value_fields=False, + use_integers_for_enums=False, + ) + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + compute.SetCertificateMapTargetSslProxyRequest.to_json( + compute.SetCertificateMapTargetSslProxyRequest( + transcoded_request["query_params"] + ), + including_default_value_fields=False, + use_integers_for_enums=False, + ) + ) + + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params), + data=body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.Operation.from_json( + response.content, ignore_unknown_fields=True + ) + resp = self._interceptor.post_set_certificate_map(resp) + return resp + class _SetProxyHeader(TargetSslProxiesRestStub): def __hash__(self): return hash("SetProxyHeader") @@ -1312,6 +1464,14 @@ def set_backend_service( # In C++ this would require a dynamic_cast return self._SetBackendService(self._session, self._host, self._interceptor) # type: ignore + @property + def set_certificate_map( + self, + ) -> Callable[[compute.SetCertificateMapTargetSslProxyRequest], compute.Operation]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._SetCertificateMap(self._session, self._host, self._interceptor) # type: ignore + @property def set_proxy_header( self, diff --git a/google/cloud/compute_v1/services/target_tcp_proxies/client.py b/google/cloud/compute_v1/services/target_tcp_proxies/client.py index bfca724dc..8d40bbe57 100644 --- a/google/cloud/compute_v1/services/target_tcp_proxies/client.py +++ b/google/cloud/compute_v1/services/target_tcp_proxies/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete_unary( diff --git a/google/cloud/compute_v1/services/target_tcp_proxies/transports/base.py b/google/cloud/compute_v1/services/target_tcp_proxies/transports/base.py index 89ea75337..c112385f9 100644 --- a/google/cloud/compute_v1/services/target_tcp_proxies/transports/base.py +++ b/google/cloud/compute_v1/services/target_tcp_proxies/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/target_tcp_proxies/transports/rest.py b/google/cloud/compute_v1/services/target_tcp_proxies/transports/rest.py index ee9906585..fdd3e79ad 100644 --- a/google/cloud/compute_v1/services/target_tcp_proxies/transports/rest.py +++ b/google/cloud/compute_v1/services/target_tcp_proxies/transports/rest.py @@ -281,6 +281,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[TargetTcpProxiesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -333,6 +334,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/target_vpn_gateways/client.py b/google/cloud/compute_v1/services/target_vpn_gateways/client.py index 6b06e3954..54ff39ec0 100644 --- a/google/cloud/compute_v1/services/target_vpn_gateways/client.py +++ b/google/cloud/compute_v1/services/target_vpn_gateways/client.py @@ -403,6 +403,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/target_vpn_gateways/transports/base.py b/google/cloud/compute_v1/services/target_vpn_gateways/transports/base.py index d2a5c07fe..2ce8ad95a 100644 --- a/google/cloud/compute_v1/services/target_vpn_gateways/transports/base.py +++ b/google/cloud/compute_v1/services/target_vpn_gateways/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/target_vpn_gateways/transports/rest.py b/google/cloud/compute_v1/services/target_vpn_gateways/transports/rest.py index 4e47912aa..9055a257f 100644 --- a/google/cloud/compute_v1/services/target_vpn_gateways/transports/rest.py +++ b/google/cloud/compute_v1/services/target_vpn_gateways/transports/rest.py @@ -253,6 +253,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[TargetVpnGatewaysRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -305,6 +306,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/url_maps/client.py b/google/cloud/compute_v1/services/url_maps/client.py index 7569387a2..37be4908d 100644 --- a/google/cloud/compute_v1/services/url_maps/client.py +++ b/google/cloud/compute_v1/services/url_maps/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/url_maps/transports/base.py b/google/cloud/compute_v1/services/url_maps/transports/base.py index abfef4137..eccbf3820 100644 --- a/google/cloud/compute_v1/services/url_maps/transports/base.py +++ b/google/cloud/compute_v1/services/url_maps/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/url_maps/transports/rest.py b/google/cloud/compute_v1/services/url_maps/transports/rest.py index 24435909f..f0c3afddc 100644 --- a/google/cloud/compute_v1/services/url_maps/transports/rest.py +++ b/google/cloud/compute_v1/services/url_maps/transports/rest.py @@ -348,6 +348,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[UrlMapsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -400,6 +401,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/vpn_gateways/client.py b/google/cloud/compute_v1/services/vpn_gateways/client.py index 8d7bbe5c6..1366a3534 100644 --- a/google/cloud/compute_v1/services/vpn_gateways/client.py +++ b/google/cloud/compute_v1/services/vpn_gateways/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/vpn_gateways/transports/base.py b/google/cloud/compute_v1/services/vpn_gateways/transports/base.py index 11a9c48c2..5cf0b9986 100644 --- a/google/cloud/compute_v1/services/vpn_gateways/transports/base.py +++ b/google/cloud/compute_v1/services/vpn_gateways/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/vpn_gateways/transports/rest.py b/google/cloud/compute_v1/services/vpn_gateways/transports/rest.py index 34e857a9a..0d98a28ea 100644 --- a/google/cloud/compute_v1/services/vpn_gateways/transports/rest.py +++ b/google/cloud/compute_v1/services/vpn_gateways/transports/rest.py @@ -332,6 +332,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[VpnGatewaysRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -384,6 +385,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/vpn_tunnels/client.py b/google/cloud/compute_v1/services/vpn_tunnels/client.py index 35c863a68..f5342c576 100644 --- a/google/cloud/compute_v1/services/vpn_tunnels/client.py +++ b/google/cloud/compute_v1/services/vpn_tunnels/client.py @@ -401,6 +401,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def aggregated_list( diff --git a/google/cloud/compute_v1/services/vpn_tunnels/transports/base.py b/google/cloud/compute_v1/services/vpn_tunnels/transports/base.py index c7a2ecc74..da2930620 100644 --- a/google/cloud/compute_v1/services/vpn_tunnels/transports/base.py +++ b/google/cloud/compute_v1/services/vpn_tunnels/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -86,11 +87,6 @@ def __init__( """ self._extended_operations_services: Dict[str, Any] = {} - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -111,6 +107,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -123,6 +124,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/vpn_tunnels/transports/rest.py b/google/cloud/compute_v1/services/vpn_tunnels/transports/rest.py index ffbc93c08..534e84a57 100644 --- a/google/cloud/compute_v1/services/vpn_tunnels/transports/rest.py +++ b/google/cloud/compute_v1/services/vpn_tunnels/transports/rest.py @@ -244,6 +244,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[VpnTunnelsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -296,6 +297,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/zone_operations/client.py b/google/cloud/compute_v1/services/zone_operations/client.py index 04cdd25eb..58d57d678 100644 --- a/google/cloud/compute_v1/services/zone_operations/client.py +++ b/google/cloud/compute_v1/services/zone_operations/client.py @@ -400,6 +400,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def delete( diff --git a/google/cloud/compute_v1/services/zone_operations/transports/base.py b/google/cloud/compute_v1/services/zone_operations/transports/base.py index e0440e27c..3a4cd8611 100644 --- a/google/cloud/compute_v1/services/zone_operations/transports/base.py +++ b/google/cloud/compute_v1/services/zone_operations/transports/base.py @@ -57,6 +57,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -84,11 +85,6 @@ def __init__( be used for service account credentials. """ - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -109,6 +105,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -121,6 +122,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/zone_operations/transports/rest.py b/google/cloud/compute_v1/services/zone_operations/transports/rest.py index 990a34f34..6d2aee325 100644 --- a/google/cloud/compute_v1/services/zone_operations/transports/rest.py +++ b/google/cloud/compute_v1/services/zone_operations/transports/rest.py @@ -221,6 +221,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[ZoneOperationsRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -273,6 +274,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/services/zones/client.py b/google/cloud/compute_v1/services/zones/client.py index df4de77cc..a4c262a37 100644 --- a/google/cloud/compute_v1/services/zones/client.py +++ b/google/cloud/compute_v1/services/zones/client.py @@ -398,6 +398,7 @@ def __init__( quota_project_id=client_options.quota_project_id, client_info=client_info, always_use_jwt_access=True, + api_audience=client_options.api_audience, ) def get( diff --git a/google/cloud/compute_v1/services/zones/transports/base.py b/google/cloud/compute_v1/services/zones/transports/base.py index 080debe2f..688bc5dce 100644 --- a/google/cloud/compute_v1/services/zones/transports/base.py +++ b/google/cloud/compute_v1/services/zones/transports/base.py @@ -58,6 +58,7 @@ def __init__( quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, **kwargs, ) -> None: """Instantiate the transport. @@ -85,11 +86,6 @@ def __init__( be used for service account credentials. """ - # Save the hostname. Default to port 443 (HTTPS) if none is specified. - if ":" not in host: - host += ":443" - self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} # Save the scopes. @@ -110,6 +106,11 @@ def __init__( credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) # If the credentials are service account credentials, then always try to use self signed JWT. if ( @@ -122,6 +123,11 @@ def __init__( # Save the credentials. self._credentials = credentials + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { diff --git a/google/cloud/compute_v1/services/zones/transports/rest.py b/google/cloud/compute_v1/services/zones/transports/rest.py index fd3045495..71912d7a5 100644 --- a/google/cloud/compute_v1/services/zones/transports/rest.py +++ b/google/cloud/compute_v1/services/zones/transports/rest.py @@ -156,6 +156,7 @@ def __init__( always_use_jwt_access: Optional[bool] = False, url_scheme: str = "https", interceptor: Optional[ZonesRestInterceptor] = None, + api_audience: Optional[str] = None, ) -> None: """Instantiate the transport. @@ -208,6 +209,7 @@ def __init__( credentials=credentials, client_info=client_info, always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, ) self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST diff --git a/google/cloud/compute_v1/types/__init__.py b/google/cloud/compute_v1/types/__init__.py index 5cac0d165..a852f3517 100644 --- a/google/cloud/compute_v1/types/__init__.py +++ b/google/cloud/compute_v1/types/__init__.py @@ -1026,6 +1026,8 @@ SetBackendServiceTargetSslProxyRequest, SetBackendServiceTargetTcpProxyRequest, SetBackupTargetPoolRequest, + SetCertificateMapTargetHttpsProxyRequest, + SetCertificateMapTargetSslProxyRequest, SetCommonInstanceMetadataProjectRequest, SetDefaultNetworkTierProjectRequest, SetDeletionProtectionInstanceRequest, @@ -1139,6 +1141,7 @@ TargetHttpProxyAggregatedList, TargetHttpProxyList, TargetHttpsProxiesScopedList, + TargetHttpsProxiesSetCertificateMapRequest, TargetHttpsProxiesSetQuicOverrideRequest, TargetHttpsProxiesSetSslCertificatesRequest, TargetHttpsProxy, @@ -1159,6 +1162,7 @@ TargetPoolsScopedList, TargetReference, TargetSslProxiesSetBackendServiceRequest, + TargetSslProxiesSetCertificateMapRequest, TargetSslProxiesSetProxyHeaderRequest, TargetSslProxiesSetSslCertificatesRequest, TargetSslProxy, @@ -2282,6 +2286,8 @@ "SetBackendServiceTargetSslProxyRequest", "SetBackendServiceTargetTcpProxyRequest", "SetBackupTargetPoolRequest", + "SetCertificateMapTargetHttpsProxyRequest", + "SetCertificateMapTargetSslProxyRequest", "SetCommonInstanceMetadataProjectRequest", "SetDefaultNetworkTierProjectRequest", "SetDeletionProtectionInstanceRequest", @@ -2395,6 +2401,7 @@ "TargetHttpProxyAggregatedList", "TargetHttpProxyList", "TargetHttpsProxiesScopedList", + "TargetHttpsProxiesSetCertificateMapRequest", "TargetHttpsProxiesSetQuicOverrideRequest", "TargetHttpsProxiesSetSslCertificatesRequest", "TargetHttpsProxy", @@ -2415,6 +2422,7 @@ "TargetPoolsScopedList", "TargetReference", "TargetSslProxiesSetBackendServiceRequest", + "TargetSslProxiesSetCertificateMapRequest", "TargetSslProxiesSetProxyHeaderRequest", "TargetSslProxiesSetSslCertificatesRequest", "TargetSslProxy", diff --git a/google/cloud/compute_v1/types/compute.py b/google/cloud/compute_v1/types/compute.py index 2b4731961..0eb47fbeb 100644 --- a/google/cloud/compute_v1/types/compute.py +++ b/google/cloud/compute_v1/types/compute.py @@ -1032,6 +1032,8 @@ "SetBackendServiceTargetSslProxyRequest", "SetBackendServiceTargetTcpProxyRequest", "SetBackupTargetPoolRequest", + "SetCertificateMapTargetHttpsProxyRequest", + "SetCertificateMapTargetSslProxyRequest", "SetCommonInstanceMetadataProjectRequest", "SetDefaultNetworkTierProjectRequest", "SetDeletionProtectionInstanceRequest", @@ -1145,6 +1147,7 @@ "TargetHttpProxyAggregatedList", "TargetHttpProxyList", "TargetHttpsProxiesScopedList", + "TargetHttpsProxiesSetCertificateMapRequest", "TargetHttpsProxiesSetQuicOverrideRequest", "TargetHttpsProxiesSetSslCertificatesRequest", "TargetHttpsProxy", @@ -1165,6 +1168,7 @@ "TargetPoolsScopedList", "TargetReference", "TargetSslProxiesSetBackendServiceRequest", + "TargetSslProxiesSetCertificateMapRequest", "TargetSslProxiesSetProxyHeaderRequest", "TargetSslProxiesSetSslCertificatesRequest", "TargetSslProxy", @@ -2814,6 +2818,10 @@ class AddRuleSecurityPolicyRequest(proto.Message): Name of the security policy to update. security_policy_rule_resource (google.cloud.compute_v1.types.SecurityPolicyRule): The body resource for this request + validate_only (bool): + If true, the request will not be committed. + + This field is a member of `oneof`_ ``_validate_only``. """ project = proto.Field( @@ -2829,6 +2837,11 @@ class AddRuleSecurityPolicyRequest(proto.Message): number=402693443, message="SecurityPolicyRule", ) + validate_only = proto.Field( + proto.BOOL, + number=242744629, + optional=True, + ) class AddSignedUrlKeyBackendBucketRequest(proto.Message): @@ -3136,6 +3149,7 @@ class Purpose(proto.Enum): IPSEC_INTERCONNECT = 340437251 NAT_AUTO = 163666477 PRIVATE_SERVICE_CONNECT = 48134724 + SERVERLESS = 270492508 SHARED_LOADBALANCER_VIP = 294447572 VPC_PEERING = 400800170 @@ -3468,13 +3482,16 @@ class AggregatedListAcceleratorTypesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -3492,6 +3509,19 @@ class AggregatedListAcceleratorTypesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -3588,13 +3618,16 @@ class AggregatedListAddressesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -3612,6 +3645,19 @@ class AggregatedListAddressesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -3708,13 +3754,16 @@ class AggregatedListAutoscalersRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -3732,6 +3781,19 @@ class AggregatedListAutoscalersRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -3828,13 +3890,16 @@ class AggregatedListBackendServicesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -3852,6 +3917,19 @@ class AggregatedListBackendServicesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -3948,13 +4026,16 @@ class AggregatedListDiskTypesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -3972,6 +4053,19 @@ class AggregatedListDiskTypesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -4068,13 +4162,16 @@ class AggregatedListDisksRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -4092,6 +4189,19 @@ class AggregatedListDisksRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -4188,13 +4298,16 @@ class AggregatedListForwardingRulesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -4212,6 +4325,19 @@ class AggregatedListForwardingRulesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -4308,13 +4434,16 @@ class AggregatedListGlobalOperationsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -4332,6 +4461,19 @@ class AggregatedListGlobalOperationsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -4428,13 +4570,16 @@ class AggregatedListHealthChecksRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -4452,6 +4597,19 @@ class AggregatedListHealthChecksRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -4548,13 +4706,16 @@ class AggregatedListInstanceGroupManagersRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -4572,6 +4733,19 @@ class AggregatedListInstanceGroupManagersRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -4668,13 +4842,16 @@ class AggregatedListInstanceGroupsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -4692,6 +4869,19 @@ class AggregatedListInstanceGroupsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -4788,13 +4978,16 @@ class AggregatedListInstancesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -4812,6 +5005,19 @@ class AggregatedListInstancesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -4908,13 +5114,16 @@ class AggregatedListInterconnectAttachmentsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -4932,6 +5141,19 @@ class AggregatedListInterconnectAttachmentsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -5028,13 +5250,16 @@ class AggregatedListMachineTypesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -5052,6 +5277,19 @@ class AggregatedListMachineTypesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -5149,13 +5387,16 @@ class AggregatedListNetworkEdgeSecurityServicesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -5173,6 +5414,19 @@ class AggregatedListNetworkEdgeSecurityServicesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -5269,13 +5523,16 @@ class AggregatedListNetworkEndpointGroupsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -5293,6 +5550,19 @@ class AggregatedListNetworkEndpointGroupsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -5389,13 +5659,16 @@ class AggregatedListNodeGroupsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -5413,6 +5686,19 @@ class AggregatedListNodeGroupsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -5509,13 +5795,16 @@ class AggregatedListNodeTemplatesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -5533,6 +5822,19 @@ class AggregatedListNodeTemplatesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -5629,13 +5931,16 @@ class AggregatedListNodeTypesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -5653,6 +5958,19 @@ class AggregatedListNodeTypesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -5749,13 +6067,16 @@ class AggregatedListPacketMirroringsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -5773,6 +6094,19 @@ class AggregatedListPacketMirroringsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -5869,13 +6203,16 @@ class AggregatedListPublicDelegatedPrefixesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -5893,6 +6230,19 @@ class AggregatedListPublicDelegatedPrefixesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -5989,13 +6339,16 @@ class AggregatedListRegionCommitmentsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -6013,6 +6366,19 @@ class AggregatedListRegionCommitmentsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -6109,13 +6475,16 @@ class AggregatedListReservationsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -6133,6 +6502,19 @@ class AggregatedListReservationsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -6229,13 +6611,16 @@ class AggregatedListResourcePoliciesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -6253,6 +6638,19 @@ class AggregatedListResourcePoliciesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -6349,13 +6747,16 @@ class AggregatedListRoutersRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -6373,6 +6774,19 @@ class AggregatedListRoutersRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -6469,13 +6883,16 @@ class AggregatedListSecurityPoliciesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -6493,6 +6910,19 @@ class AggregatedListSecurityPoliciesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -6589,13 +7019,16 @@ class AggregatedListServiceAttachmentsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -6613,6 +7046,19 @@ class AggregatedListServiceAttachmentsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -6709,13 +7155,16 @@ class AggregatedListSslCertificatesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -6733,6 +7182,19 @@ class AggregatedListSslCertificatesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -6829,13 +7291,16 @@ class AggregatedListSubnetworksRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -6853,6 +7318,19 @@ class AggregatedListSubnetworksRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -6949,13 +7427,16 @@ class AggregatedListTargetHttpProxiesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -6973,6 +7454,19 @@ class AggregatedListTargetHttpProxiesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -7069,13 +7563,16 @@ class AggregatedListTargetHttpsProxiesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -7093,6 +7590,19 @@ class AggregatedListTargetHttpsProxiesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -7189,13 +7699,16 @@ class AggregatedListTargetInstancesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -7213,6 +7726,19 @@ class AggregatedListTargetInstancesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -7309,13 +7835,16 @@ class AggregatedListTargetPoolsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -7333,6 +7862,19 @@ class AggregatedListTargetPoolsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -7429,13 +7971,16 @@ class AggregatedListTargetVpnGatewaysRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -7453,6 +7998,19 @@ class AggregatedListTargetVpnGatewaysRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -7549,13 +8107,16 @@ class AggregatedListUrlMapsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -7573,6 +8134,19 @@ class AggregatedListUrlMapsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -7669,13 +8243,16 @@ class AggregatedListVpnGatewaysRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -7693,6 +8270,19 @@ class AggregatedListVpnGatewaysRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -7789,13 +8379,16 @@ class AggregatedListVpnTunnelsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -7813,6 +8406,19 @@ class AggregatedListVpnTunnelsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. include_all_scopes (bool): @@ -8040,7 +8646,7 @@ class AllocationSpecificSKUAllocationReservedInstanceProperties(proto.Message): class AllocationSpecificSKUReservation(proto.Message): r"""This reservation type allows to pre allocate specific - instance configuration. Next ID: 5 + instance configuration. Next ID: 6 Attributes: assured_count (int): @@ -8620,8 +9226,10 @@ class AttachedDiskInitializeParams(proto.Message): r"""[Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. This - property is mutually exclusive with the source property; you can - only define one or the other, but not both. + field is persisted and returned for instanceTemplate and not + returned in the context of instance. This property is mutually + exclusive with the source property; you can only define one or the + other, but not both. Attributes: description (str): @@ -10476,8 +11084,8 @@ class BackendBucketCdnPolicyCacheKeyPolicy(proto.Message): used in the cache key. query_string_whitelist (Sequence[str]): Names of query string parameters to include - in cache keys. All other parameters will be - excluded. '&' and '=' will be percent encoded + in cache keys. Default parameters are always + included. '&' and '=' will be percent encoded and not treated as delimiters. """ @@ -10618,10 +11226,10 @@ class BackendService(proto.Message): Director and requires GENERATED_COOKIE or HTTP_COOKIE session affinity. If set to 0, the cookie is non-persistent and lasts only until the end of the browser session (or - equivalent). The maximum allowed value is one day (86,400). - Not supported when the backend service is referenced by a - URL map that is bound to target gRPC proxy that has - validateForProxyless field set to true. + equivalent). The maximum allowed value is two weeks + (1,209,600). Not supported when the backend service is + referenced by a URL map that is bound to target gRPC proxy + that has validateForProxyless field set to true. This field is a member of `oneof`_ ``_affinity_cookie_ttl_sec``. backends (Sequence[google.cloud.compute_v1.types.Backend]): @@ -10899,6 +11507,10 @@ class BackendService(proto.Message): [Output Only] Server-defined URL for the resource. This field is a member of `oneof`_ ``_self_link``. + service_bindings (Sequence[str]): + URLs of networkservices.ServiceBinding resources. Can only + be set if load balancing scheme is INTERNAL_SELF_MANAGED. If + set, lists of backends and health checks must be both empty. session_affinity (str): Type of session affinity to use. The default is NONE. Only NONE and HEADER_FIELD are supported when the backend service @@ -11196,6 +11808,10 @@ class SessionAffinity(proto.Enum): number=456214797, optional=True, ) + service_bindings = proto.RepeatedField( + proto.STRING, + number=133581016, + ) session_affinity = proto.Field( proto.STRING, number=463888561, @@ -12056,7 +12672,7 @@ class BackendServiceLogConfig(proto.Message): 1]. This configures the sampling rate of requests to the load balancer where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. The - default value is 1.0. + default value is 0.0. This field is a member of `oneof`_ ``_sample_rate``. """ @@ -12566,16 +13182,16 @@ class Binding(proto.Message): This field is a member of `oneof`_ ``_condition``. members (Sequence[str]): - Specifies the principals requesting access for a Cloud - Platform resource. ``members`` can have the following - values: \* ``allUsers``: A special identifier that - represents anyone who is on the internet; with or without a - Google account. \* ``allAuthenticatedUsers``: A special - identifier that represents anyone who is authenticated with - a Google account or a service account. \* - ``user:{emailid}``: An email address that represents a - specific Google account. For example, ``alice@example.com`` - . \* ``serviceAccount:{emailid}``: An email address that + Specifies the principals requesting access for a Google + Cloud resource. ``members`` can have the following values: + \* ``allUsers``: A special identifier that represents anyone + who is on the internet; with or without a Google account. \* + ``allAuthenticatedUsers``: A special identifier that + represents anyone who is authenticated with a Google account + or a service account. \* ``user:{emailid}``: An email + address that represents a specific Google account. For + example, ``alice@example.com`` . \* + ``serviceAccount:{emailid}``: An email address that represents a service account. For example, ``my-other-app@appspot.gserviceaccount.com``. \* ``group:{emailid}``: An email address that represents a @@ -13376,6 +13992,7 @@ class Type(proto.Enum): GENERAL_PURPOSE_N2D = 232471400 GENERAL_PURPOSE_T2D = 232477166 MEMORY_OPTIMIZED = 281753417 + MEMORY_OPTIMIZED_M3 = 276301372 TYPE_UNSPECIFIED = 437714322 auto_renew = proto.Field( @@ -21540,26 +22157,33 @@ class ForwardingRule(proto.Message): Attributes: I_p_address (str): - IP address that this forwarding rule serves. When a client - sends traffic to this IP address, the forwarding rule - directs the traffic to the target that you specify in the - forwarding rule. If you don't specify a reserved IP address, - an ephemeral IP address is assigned. Methods for specifying - an IP address: \* IPv4 dotted decimal, as in ``100.1.2.3`` - \* Full URL, as in + IP address for which this forwarding rule accepts traffic. + When a client sends traffic to this IP address, the + forwarding rule directs the traffic to the referenced target + or backendService. While creating a forwarding rule, + specifying an IPAddress is required under the following + circumstances: - When the target is set to targetGrpcProxy + and validateForProxyless is set to true, the IPAddress + should be set to 0.0.0.0. - When the target is a Private + Service Connect Google APIs bundle, you must specify an + IPAddress. Otherwise, you can optionally specify an IP + address that references an existing static (reserved) IP + address resource. When omitted, Google Cloud assigns an + ephemeral IP address. Use one of the following formats to + specify an IP address while creating a forwarding rule: \* + IP address number, as in ``100.1.2.3`` \* Full resource URL, + as in https://www.googleapis.com/compute/v1/projects/project_id/regions/region /addresses/address-name \* Partial URL or by name, as in: - projects/project_id/regions/region/addresses/address-name - regions/region/addresses/address-name - - global/addresses/address-name - address-name The - loadBalancingScheme and the forwarding rule's target - determine the type of IP address that you can use. For - detailed information, see `IP address + global/addresses/address-name - address-name The forwarding + rule's target or backendService, and in most cases, also the + loadBalancingScheme, determine the type of IP address that + you can use. For detailed information, see `IP address specifications `__. - Must be set to ``0.0.0.0`` when the target is - targetGrpcProxy that has validateForProxyless field set to - true. For Private Service Connect forwarding rules that - forward traffic to Google APIs, IP address must be provided. + When reading an IPAddress, the API always returns the IP + address number. This field is a member of `oneof`_ ``_I_p_address``. I_p_protocol (str): @@ -21739,6 +22363,13 @@ class ForwardingRule(proto.Message): values. This field is a member of `oneof`_ ``_network_tier``. + no_automate_dns_zone (bool): + This is used in PSC consumer ForwardingRule + to control whether it should try to + auto-generate a DNS zone or not. Non-PSC + forwarding rules do not use this field. + + This field is a member of `oneof`_ ``_no_automate_dns_zone``. port_range (str): This field can be used only if: - Load balancing scheme is one of EXTERNAL, INTERNAL_SELF_MANAGED or INTERNAL_MANAGED - @@ -21984,6 +22615,11 @@ class PscConnectionStatus(proto.Enum): number=517397843, optional=True, ) + no_automate_dns_zone = proto.Field( + proto.BOOL, + number=64546991, + optional=True, + ) port_range = proto.Field( proto.STRING, number=217518079, @@ -24028,13 +24664,16 @@ class GetNatMappingInfoRoutersRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -24052,6 +24691,19 @@ class GetNatMappingInfoRoutersRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -25759,13 +26411,16 @@ class GetXpnResourcesProjectsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -25783,6 +26438,19 @@ class GetXpnResourcesProjectsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -26662,10 +27330,11 @@ class HealthCheck(proto.Message): This field is a member of `oneof`_ ``_timeout_sec``. type_ (str): Specifies the type of the healthCheck, either - TCP, SSL, HTTP, HTTPS or HTTP2. Exactly one of - the protocol-specific health check field must be - specified, which must match type field. Check - the Type enum for the list of possible values. + TCP, SSL, HTTP, HTTPS, HTTP2 or GRPC. Exactly + one of the protocol-specific health check fields + must be specified, which must match type field. + Check the Type enum for the list of possible + values. This field is a member of `oneof`_ ``_type``. unhealthy_threshold (int): @@ -26678,8 +27347,9 @@ class HealthCheck(proto.Message): class Type(proto.Enum): r"""Specifies the type of the healthCheck, either TCP, SSL, HTTP, - HTTPS or HTTP2. Exactly one of the protocol-specific health - check field must be specified, which must match type field. + HTTPS, HTTP2 or GRPC. Exactly one of the protocol-specific + health check fields must be specified, which must match type + field. """ UNDEFINED_TYPE = 0 GRPC = 2196510 @@ -27475,10 +28145,11 @@ class HostRule(proto.Message): The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. \* matches any string of ([a-z0-9-.]*). In that - case, \* must be the first character and must be followed in - the pattern by either - or .. \* based matching is not - supported when the URL map is bound to a target gRPC proxy - that has the validateForProxyless field set to true. + case, \* must be the first character, and if followed by + anything, the immediate following character must be either - + or .. \* based matching is not supported when the URL map is + bound to a target gRPC proxy that has the + validateForProxyless field set to true. path_matcher (str): The name of the PathMatcher to use to match the path portion of the URL if the hostRule @@ -28087,7 +28758,11 @@ class HttpRouteAction(proto.Message): percentage of requests. timeout and retry_policy is ignored by clients that are configured with a fault_injection_policy if: 1. The traffic is generated by fault injection AND 2. - The fault injection is not a delay fault injection. + The fault injection is not a delay fault injection. Fault + injection is not supported with the global external HTTP(S) + load balancer (classic). To see which load balancers support + fault injection, see Load balancing: Routing and traffic + management features. This field is a member of `oneof`_ ``_fault_injection_policy``. max_stream_duration (google.cloud.compute_v1.types.Duration): @@ -28654,9 +29329,9 @@ class Image(proto.Message): This field is a member of `oneof`_ ``_source_snapshot_id``. source_type (str): The type of the image used to create this - disk. The default and only value is RAW Check - the SourceType enum for the list of possible - values. + disk. The default and only valid value is RAW. + Check the SourceType enum for the list of + possible values. This field is a member of `oneof`_ ``_source_type``. status (str): @@ -28674,7 +29349,7 @@ class Image(proto.Message): class SourceType(proto.Enum): r"""The type of the image used to create this disk. The default - and only value is RAW + and only valid value is RAW. """ UNDEFINED_SOURCE_TYPE = 0 RAW = 80904 @@ -31598,6 +32273,10 @@ class InsertSecurityPolicyRequest(proto.Message): This field is a member of `oneof`_ ``_request_id``. security_policy_resource (google.cloud.compute_v1.types.SecurityPolicy): The body resource for this request + validate_only (bool): + If true, the request will not be committed. + + This field is a member of `oneof`_ ``_validate_only``. """ project = proto.Field( @@ -31614,6 +32293,11 @@ class InsertSecurityPolicyRequest(proto.Message): number=216159612, message="SecurityPolicy", ) + validate_only = proto.Field( + proto.BOOL, + number=242744629, + optional=True, + ) class InsertServiceAttachmentRequest(proto.Message): @@ -33958,13 +34642,13 @@ class InstanceGroupManagerStatusStateful(proto.Message): group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful - config even when there is still some preserved state on a - managed instance, for example, if you have deleted all PICs - but not yet applied those deletions. + configuration even when there is still some preserved state + on a managed instance, for example, if you have deleted all + PICs but not yet applied those deletions. This field is a member of `oneof`_ ``_has_stateful_config``. per_instance_configs (google.cloud.compute_v1.types.InstanceGroupManagerStatusStatefulPerInstanceConfigs): - [Output Only] Status of per-instance configs on the + [Output Only] Status of per-instance configurations on the instance. This field is a member of `oneof`_ ``_per_instance_configs``. @@ -33989,9 +34673,10 @@ class InstanceGroupManagerStatusStatefulPerInstanceConfigs(proto.Message): Attributes: all_effective (bool): A bit indicating if all of the group's - per-instance configs (listed in the output of a - listPerInstanceConfigs API call) have status - EFFECTIVE or there are no per-instance-configs. + per-instance configurations (listed in the + output of a listPerInstanceConfigs API call) + have status EFFECTIVE or there are no + per-instance-configs. This field is a member of `oneof`_ ``_all_effective``. """ @@ -34079,16 +34764,22 @@ class InstanceGroupManagerUpdatePolicy(proto.Message): This field is a member of `oneof`_ ``_max_unavailable``. minimal_action (str): Minimal action to be taken on an instance. - You can specify either RESTART to restart - existing instances or REPLACE to delete and - create new instances from the target template. - If you specify a RESTART, the Updater will - attempt to perform that action only. However, if - the Updater determines that the minimal action - you specify is not enough to perform the update, - it might perform a more disruptive action. Check - the MinimalAction enum for the list of possible - values. + Use this option to minimize disruption as much + as possible or to apply a more disruptive action + than is necessary. - To limit disruption as much + as possible, set the minimal action to REFRESH. + If your update requires a more disruptive + action, Compute Engine performs the necessary + action to execute the update. - To apply a more + disruptive action than is strictly necessary, + set the minimal action to RESTART or REPLACE. + For example, Compute Engine does not need to + restart a VM to change its metadata. But if your + application reads instance metadata only when a + VM is restarted, you can set the minimal action + to RESTART in order to pick up metadata changes. + Check the MinimalAction enum for the list of + possible values. This field is a member of `oneof`_ ``_minimal_action``. most_disruptive_allowed_action (str): @@ -34139,15 +34830,20 @@ class InstanceRedistributionType(proto.Enum): UNDEFINED_INSTANCE_REDISTRIBUTION_TYPE = 0 class MinimalAction(proto.Enum): - r"""Minimal action to be taken on an instance. You can specify - either RESTART to restart existing instances or REPLACE to - delete and create new instances from the target template. If you - specify a RESTART, the Updater will attempt to perform that - action only. However, if the Updater determines that the minimal - action you specify is not enough to perform the update, it might - perform a more disruptive action. Additional supported values - which may be not listed in the enum directly due to technical - reasons: NONE + r"""Minimal action to be taken on an instance. Use this option to + minimize disruption as much as possible or to apply a more + disruptive action than is necessary. - To limit disruption as + much as possible, set the minimal action to REFRESH. If your + update requires a more disruptive action, Compute Engine + performs the necessary action to execute the update. - To apply + a more disruptive action than is strictly necessary, set the + minimal action to RESTART or REPLACE. For example, Compute + Engine does not need to restart a VM to change its metadata. But + if your application reads instance metadata only when a VM is + restarted, you can set the minimal action to RESTART in order to + pick up metadata changes. Additional supported values which may + be not listed in the enum directly due to technical reasons: + NONE REFRESH REPLACE RESTART @@ -34582,8 +35278,8 @@ class InstanceGroupManagersPatchPerInstanceConfigsReq(proto.Message): Attributes: per_instance_configs (Sequence[google.cloud.compute_v1.types.PerInstanceConfig]): - The list of per-instance configs to insert or - patch on this managed instance group. + The list of per-instance configurations to + insert or patch on this managed instance group. """ per_instance_configs = proto.RepeatedField( @@ -34701,8 +35397,8 @@ class InstanceGroupManagersUpdatePerInstanceConfigsReq(proto.Message): Attributes: per_instance_configs (Sequence[google.cloud.compute_v1.types.PerInstanceConfig]): - The list of per-instance configs to insert or - patch on this managed instance group. + The list of per-instance configurations to + insert or patch on this managed instance group. """ per_instance_configs = proto.RepeatedField( @@ -38531,13 +39227,16 @@ class ListAcceleratorTypesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -38555,6 +39254,19 @@ class ListAcceleratorTypesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -38639,13 +39351,16 @@ class ListAddressesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -38663,6 +39378,19 @@ class ListAddressesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -38766,13 +39494,16 @@ class ListAutoscalersRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -38790,6 +39521,19 @@ class ListAutoscalersRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -38874,13 +39618,16 @@ class ListAvailableFeaturesSslPoliciesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -38898,6 +39645,19 @@ class ListAvailableFeaturesSslPoliciesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -38976,13 +39736,16 @@ class ListBackendBucketsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -39000,6 +39763,19 @@ class ListBackendBucketsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -39078,13 +39854,16 @@ class ListBackendServicesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -39102,6 +39881,19 @@ class ListBackendServicesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -39180,13 +39972,16 @@ class ListDiskTypesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -39204,6 +39999,19 @@ class ListDiskTypesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -39288,13 +40096,16 @@ class ListDisksRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -39312,6 +40123,19 @@ class ListDisksRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -39396,13 +40220,16 @@ class ListErrorsInstanceGroupManagersRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -39420,6 +40247,19 @@ class ListErrorsInstanceGroupManagersRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. instance_group_manager (str): @@ -39515,13 +40355,16 @@ class ListErrorsRegionInstanceGroupManagersRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -39539,6 +40382,19 @@ class ListErrorsRegionInstanceGroupManagersRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. instance_group_manager (str): @@ -39633,13 +40489,16 @@ class ListExternalVpnGatewaysRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -39657,6 +40516,19 @@ class ListExternalVpnGatewaysRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -39735,13 +40607,16 @@ class ListFirewallPoliciesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -39759,6 +40634,19 @@ class ListFirewallPoliciesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -39840,13 +40728,16 @@ class ListFirewallsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -39864,6 +40755,19 @@ class ListFirewallsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -39942,13 +40846,16 @@ class ListForwardingRulesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -39966,6 +40873,19 @@ class ListForwardingRulesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -40050,13 +40970,16 @@ class ListGlobalAddressesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -40074,6 +40997,19 @@ class ListGlobalAddressesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -40152,13 +41088,16 @@ class ListGlobalForwardingRulesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -40176,6 +41115,19 @@ class ListGlobalForwardingRulesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -40254,13 +41206,16 @@ class ListGlobalNetworkEndpointGroupsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -40278,6 +41233,19 @@ class ListGlobalNetworkEndpointGroupsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -40356,13 +41324,16 @@ class ListGlobalOperationsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -40380,6 +41351,19 @@ class ListGlobalOperationsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -40458,13 +41442,16 @@ class ListGlobalOrganizationOperationsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -40482,6 +41469,19 @@ class ListGlobalOrganizationOperationsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -40563,13 +41563,16 @@ class ListGlobalPublicDelegatedPrefixesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -40587,6 +41590,19 @@ class ListGlobalPublicDelegatedPrefixesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -40665,13 +41681,16 @@ class ListHealthChecksRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -40689,6 +41708,19 @@ class ListHealthChecksRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -40767,13 +41799,16 @@ class ListImagesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -40791,6 +41826,19 @@ class ListImagesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -40869,13 +41917,16 @@ class ListInstanceGroupManagersRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -40893,6 +41944,19 @@ class ListInstanceGroupManagersRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -40978,13 +42042,16 @@ class ListInstanceGroupsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -41002,6 +42069,19 @@ class ListInstanceGroupsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -41087,13 +42167,16 @@ class ListInstanceTemplatesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -41111,6 +42194,19 @@ class ListInstanceTemplatesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -41189,13 +42285,16 @@ class ListInstancesInstanceGroupsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -41213,6 +42312,19 @@ class ListInstancesInstanceGroupsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. instance_group (str): @@ -41312,13 +42424,16 @@ class ListInstancesRegionInstanceGroupsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -41336,6 +42451,19 @@ class ListInstancesRegionInstanceGroupsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. instance_group (str): @@ -41434,13 +42562,16 @@ class ListInstancesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -41458,6 +42589,19 @@ class ListInstancesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -41542,13 +42686,16 @@ class ListInterconnectAttachmentsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -41566,6 +42713,19 @@ class ListInterconnectAttachmentsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -41650,13 +42810,16 @@ class ListInterconnectLocationsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -41674,6 +42837,19 @@ class ListInterconnectLocationsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -41752,13 +42928,16 @@ class ListInterconnectsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -41776,6 +42955,19 @@ class ListInterconnectsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -41854,13 +43046,16 @@ class ListLicensesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -41878,6 +43073,19 @@ class ListLicensesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -41956,13 +43164,16 @@ class ListMachineImagesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -41980,6 +43191,19 @@ class ListMachineImagesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -42058,13 +43282,16 @@ class ListMachineTypesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -42082,6 +43309,19 @@ class ListMachineTypesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -42167,13 +43407,16 @@ class ListManagedInstancesInstanceGroupManagersRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -42191,6 +43434,19 @@ class ListManagedInstancesInstanceGroupManagersRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. instance_group_manager (str): @@ -42283,13 +43539,16 @@ class ListManagedInstancesRegionInstanceGroupManagersRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -42307,6 +43566,19 @@ class ListManagedInstancesRegionInstanceGroupManagersRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. instance_group_manager (str): @@ -42397,13 +43669,16 @@ class ListNetworkEndpointGroupsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -42421,6 +43696,19 @@ class ListNetworkEndpointGroupsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -42508,13 +43796,16 @@ class ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -42532,6 +43823,19 @@ class ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -42620,13 +43924,16 @@ class ListNetworkEndpointsNetworkEndpointGroupsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -42644,6 +43951,19 @@ class ListNetworkEndpointsNetworkEndpointGroupsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -42746,13 +44066,16 @@ class ListNetworkFirewallPoliciesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -42770,6 +44093,19 @@ class ListNetworkFirewallPoliciesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -42848,13 +44184,16 @@ class ListNetworksRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -42872,6 +44211,19 @@ class ListNetworksRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -42950,13 +44302,16 @@ class ListNodeGroupsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -42974,6 +44329,19 @@ class ListNodeGroupsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -43058,13 +44426,16 @@ class ListNodeTemplatesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -43082,6 +44453,19 @@ class ListNodeTemplatesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -43166,13 +44550,16 @@ class ListNodeTypesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -43190,6 +44577,19 @@ class ListNodeTypesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -43274,13 +44674,16 @@ class ListNodesNodeGroupsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -43298,6 +44701,19 @@ class ListNodesNodeGroupsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -43389,13 +44805,16 @@ class ListPacketMirroringsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -43413,6 +44832,19 @@ class ListPacketMirroringsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -43503,13 +44935,16 @@ class ListPeeringRoutesNetworksRequest(proto.Message): This field is a member of `oneof`_ ``_direction``. filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -43527,6 +44962,19 @@ class ListPeeringRoutesNetworksRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -43644,13 +45092,16 @@ class ListPerInstanceConfigsInstanceGroupManagersRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -43668,6 +45119,19 @@ class ListPerInstanceConfigsInstanceGroupManagersRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. instance_group_manager (str): @@ -43762,13 +45226,16 @@ class ListPerInstanceConfigsRegionInstanceGroupManagersRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -43786,6 +45253,19 @@ class ListPerInstanceConfigsRegionInstanceGroupManagersRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. instance_group_manager (str): @@ -43879,13 +45359,16 @@ class ListPreconfiguredExpressionSetsSecurityPoliciesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -43903,6 +45386,19 @@ class ListPreconfiguredExpressionSetsSecurityPoliciesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -43981,13 +45477,16 @@ class ListPublicAdvertisedPrefixesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -44005,6 +45504,19 @@ class ListPublicAdvertisedPrefixesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -44083,13 +45595,16 @@ class ListPublicDelegatedPrefixesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -44107,6 +45622,19 @@ class ListPublicDelegatedPrefixesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -44191,13 +45719,16 @@ class ListReferrersInstancesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -44215,6 +45746,19 @@ class ListReferrersInstancesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. instance (str): @@ -44307,13 +45851,16 @@ class ListRegionAutoscalersRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -44331,6 +45878,19 @@ class ListRegionAutoscalersRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -44415,13 +45975,16 @@ class ListRegionBackendServicesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -44439,6 +46002,19 @@ class ListRegionBackendServicesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -44523,13 +46099,16 @@ class ListRegionCommitmentsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -44547,6 +46126,19 @@ class ListRegionCommitmentsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -44631,13 +46223,16 @@ class ListRegionDiskTypesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -44655,6 +46250,19 @@ class ListRegionDiskTypesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -44739,13 +46347,16 @@ class ListRegionDisksRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -44763,6 +46374,19 @@ class ListRegionDisksRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -44847,13 +46471,16 @@ class ListRegionHealthCheckServicesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -44871,6 +46498,19 @@ class ListRegionHealthCheckServicesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -44955,13 +46595,16 @@ class ListRegionHealthChecksRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -44979,6 +46622,19 @@ class ListRegionHealthChecksRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -45063,13 +46719,16 @@ class ListRegionInstanceGroupManagersRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -45087,6 +46746,19 @@ class ListRegionInstanceGroupManagersRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -45171,13 +46843,16 @@ class ListRegionInstanceGroupsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -45195,6 +46870,19 @@ class ListRegionInstanceGroupsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -45279,13 +46967,16 @@ class ListRegionNetworkEndpointGroupsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -45303,6 +46994,19 @@ class ListRegionNetworkEndpointGroupsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -45389,13 +47093,16 @@ class ListRegionNetworkFirewallPoliciesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -45413,6 +47120,19 @@ class ListRegionNetworkFirewallPoliciesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -45497,13 +47217,16 @@ class ListRegionNotificationEndpointsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -45521,6 +47244,19 @@ class ListRegionNotificationEndpointsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -45605,13 +47341,16 @@ class ListRegionOperationsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -45629,6 +47368,19 @@ class ListRegionOperationsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -45713,13 +47465,16 @@ class ListRegionSecurityPoliciesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -45737,6 +47492,19 @@ class ListRegionSecurityPoliciesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -45821,13 +47589,16 @@ class ListRegionSslCertificatesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -45845,6 +47616,19 @@ class ListRegionSslCertificatesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -45929,13 +47713,16 @@ class ListRegionTargetHttpProxiesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -45953,6 +47740,19 @@ class ListRegionTargetHttpProxiesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -46037,13 +47837,16 @@ class ListRegionTargetHttpsProxiesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -46061,6 +47864,19 @@ class ListRegionTargetHttpsProxiesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -46145,13 +47961,16 @@ class ListRegionUrlMapsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -46169,6 +47988,19 @@ class ListRegionUrlMapsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -46253,13 +48085,16 @@ class ListRegionsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -46277,6 +48112,19 @@ class ListRegionsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -46355,13 +48203,16 @@ class ListReservationsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -46379,6 +48230,19 @@ class ListReservationsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -46463,13 +48327,16 @@ class ListResourcePoliciesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -46487,6 +48354,19 @@ class ListResourcePoliciesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -46571,13 +48451,16 @@ class ListRoutersRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -46595,6 +48478,19 @@ class ListRoutersRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -46679,13 +48575,16 @@ class ListRoutesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -46703,6 +48602,19 @@ class ListRoutesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -46781,13 +48693,16 @@ class ListSecurityPoliciesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -46805,6 +48720,19 @@ class ListSecurityPoliciesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -46883,13 +48811,16 @@ class ListServiceAttachmentsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -46907,6 +48838,19 @@ class ListServiceAttachmentsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -46991,13 +48935,16 @@ class ListSnapshotsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -47015,6 +48962,19 @@ class ListSnapshotsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -47093,13 +49053,16 @@ class ListSslCertificatesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -47117,6 +49080,19 @@ class ListSslCertificatesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -47195,13 +49171,16 @@ class ListSslPoliciesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -47219,6 +49198,19 @@ class ListSslPoliciesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -47297,13 +49289,16 @@ class ListSubnetworksRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -47321,6 +49316,19 @@ class ListSubnetworksRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -47405,13 +49413,16 @@ class ListTargetGrpcProxiesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -47429,6 +49440,19 @@ class ListTargetGrpcProxiesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -47507,13 +49531,16 @@ class ListTargetHttpProxiesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -47531,6 +49558,19 @@ class ListTargetHttpProxiesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -47609,13 +49649,16 @@ class ListTargetHttpsProxiesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -47633,6 +49676,19 @@ class ListTargetHttpsProxiesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -47711,13 +49767,16 @@ class ListTargetInstancesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -47735,6 +49794,19 @@ class ListTargetInstancesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -47819,13 +49891,16 @@ class ListTargetPoolsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -47843,6 +49918,19 @@ class ListTargetPoolsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -47927,13 +50015,16 @@ class ListTargetSslProxiesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -47951,6 +50042,19 @@ class ListTargetSslProxiesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -48029,13 +50133,16 @@ class ListTargetTcpProxiesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -48053,6 +50160,19 @@ class ListTargetTcpProxiesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -48131,13 +50251,16 @@ class ListTargetVpnGatewaysRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -48155,6 +50278,19 @@ class ListTargetVpnGatewaysRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -48239,13 +50375,16 @@ class ListUrlMapsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -48263,6 +50402,19 @@ class ListUrlMapsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -48341,13 +50493,16 @@ class ListUsableSubnetworksRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -48365,6 +50520,19 @@ class ListUsableSubnetworksRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -48443,13 +50611,16 @@ class ListVpnGatewaysRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -48467,6 +50638,19 @@ class ListVpnGatewaysRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -48551,13 +50735,16 @@ class ListVpnTunnelsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -48575,6 +50762,19 @@ class ListVpnTunnelsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -48659,13 +50859,16 @@ class ListXpnHostsProjectsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -48683,6 +50886,19 @@ class ListXpnHostsProjectsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -48768,13 +50984,16 @@ class ListZoneOperationsRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -48792,6 +51011,19 @@ class ListZoneOperationsRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -48876,13 +51108,16 @@ class ListZonesRequest(proto.Message): Attributes: filter (str): A filter expression that filters resources listed in the - response. The expression must specify the field name, an - operator, and the value that you want to use for filtering. - The value must be a string, a number, or a boolean. The - operator must be either ``=``, ``!=``, ``>``, ``<``, ``<=``, - ``>=`` or ``:``. For example, if you are filtering Compute - Engine instances, you can exclude instances named - ``example-instance`` by specifying + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. If you want to use AIP-160, your expression must + specify the field name, an operator, and the value that you + want to use for filtering. The value must be a string, a + number, or a boolean. The operator must be either ``=``, + ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. For example, + if you are filtering Compute Engine instances, you can + exclude instances named ``example-instance`` by specifying ``name != example-instance``. The ``:`` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the ``=`` operator. The ``:*`` @@ -48900,6 +51135,19 @@ class ListZonesRequest(proto.Message): However, you can include ``AND`` and ``OR`` expressions explicitly. For example: ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. This field is a member of `oneof`_ ``_filter``. max_results (int): @@ -49021,14 +51269,32 @@ class LocationPolicy(proto.Message): name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a. + target_shape (str): + Strategy for distributing VMs across zones in + a region. Check the TargetShape enum for the + list of possible values. + + This field is a member of `oneof`_ ``_target_shape``. """ + class TargetShape(proto.Enum): + r"""Strategy for distributing VMs across zones in a region.""" + UNDEFINED_TARGET_SHAPE = 0 + ANY = 64972 + ANY_SINGLE_ZONE = 61100880 + BALANCED = 468409608 + locations = proto.MapField( proto.STRING, proto.MESSAGE, number=413423454, message="LocationPolicyLocation", ) + target_shape = proto.Field( + proto.STRING, + number=338621299, + optional=True, + ) class LocationPolicyLocation(proto.Message): @@ -51028,9 +53294,9 @@ class NetworkEndpointGroup(proto.Message): This field is a member of `oneof`_ ``_network_endpoint_type``. psc_target_service (str): The target service url used to set up private - service connection to a Google API. An example - value is: - "asia-northeast3-cloudkms.googleapis.com". + service connection to a Google API or a PSC + Producer Service Attachment. An example value + is: "asia-northeast3-cloudkms.googleapis.com". This field is a member of `oneof`_ ``_psc_target_service``. region (str): @@ -52035,6 +54301,13 @@ class NetworkPeering(proto.Message): Maximum Transmission Unit in bytes. This field is a member of `oneof`_ ``_peer_mtu``. + stack_type (str): + Which IP version(s) of traffic and routes are allowed to be + imported or exported between peer networks. The default + value is IPV4_ONLY. Check the StackType enum for the list of + possible values. + + This field is a member of `oneof`_ ``_stack_type``. state (str): [Output Only] State for the peering, either ``ACTIVE`` or ``INACTIVE``. The peering is ``ACTIVE`` when there's a @@ -52049,6 +54322,14 @@ class NetworkPeering(proto.Message): This field is a member of `oneof`_ ``_state_details``. """ + class StackType(proto.Enum): + r"""Which IP version(s) of traffic and routes are allowed to be imported + or exported between peer networks. The default value is IPV4_ONLY. + """ + UNDEFINED_STACK_TYPE = 0 + IPV4_IPV6 = 22197249 + IPV4_ONLY = 22373798 + class State(proto.Enum): r"""[Output Only] State for the peering, either ``ACTIVE`` or ``INACTIVE``. The peering is ``ACTIVE`` when there's a matching @@ -52103,6 +54384,11 @@ class State(proto.Enum): number=69584721, optional=True, ) + stack_type = proto.Field( + proto.STRING, + number=425908881, + optional=True, + ) state = proto.Field( proto.STRING, number=109757585, @@ -57230,6 +59516,10 @@ class PatchRuleSecurityPolicyRequest(proto.Message): Name of the security policy to update. security_policy_rule_resource (google.cloud.compute_v1.types.SecurityPolicyRule): The body resource for this request + validate_only (bool): + If true, the request will not be committed. + + This field is a member of `oneof`_ ``_validate_only``. """ priority = proto.Field( @@ -57250,6 +59540,11 @@ class PatchRuleSecurityPolicyRequest(proto.Message): number=402693443, message="SecurityPolicyRule", ) + validate_only = proto.Field( + proto.BOOL, + number=242744629, + optional=True, + ) class PatchSecurityPolicyRequest(proto.Message): @@ -57929,21 +60224,21 @@ class PerInstanceConfig(proto.Message): field can be used in optimistic locking. It is ignored when inserting a per-instance config. An up-to-date fingerprint must be provided in order - to update an existing per-instance config or the - field needs to be unset. + to update an existing per-instance configuration + or the field needs to be unset. This field is a member of `oneof`_ ``_fingerprint``. name (str): - The name of a per-instance config and its - corresponding instance. Serves as a merge key - during UpdatePerInstanceConfigs operations, that - is, if a per-instance config with the same name - exists then it will be updated, otherwise a new - one will be created for the VM instance with the - same name. An attempt to create a per-instance - config for a VM instance that either doesn't - exist or is not part of the group will result in - an error. + The name of a per-instance configuration and + its corresponding instance. Serves as a merge + key during UpdatePerInstanceConfigs operations, + that is, if a per-instance configuration with + the same name exists then it will be updated, + otherwise a new one will be created for the VM + instance with the same name. An attempt to + create a per-instance configconfiguration for a + VM instance that either doesn't exist or is not + part of the group will result in an error. This field is a member of `oneof`_ ``_name``. preserved_state (google.cloud.compute_v1.types.PreservedState): @@ -57954,15 +60249,15 @@ class PerInstanceConfig(proto.Message): This field is a member of `oneof`_ ``_preserved_state``. status (str): The status of applying this per-instance - config on the corresponding managed instance. - Check the Status enum for the list of possible - values. + configuration on the corresponding managed + instance. Check the Status enum for the list of + possible values. This field is a member of `oneof`_ ``_status``. """ class Status(proto.Enum): - r"""The status of applying this per-instance config on the + r"""The status of applying this per-instance configuration on the corresponding managed instance. """ UNDEFINED_STATUS = 0 @@ -59362,6 +61657,7 @@ class Metric(proto.Enum): COMMITTED_N2A_CPUS = 40064304 COMMITTED_N2D_CPUS = 125951757 COMMITTED_N2_CPUS = 322589603 + COMMITTED_NVIDIA_A100_80GB_GPUS = 464326565 COMMITTED_NVIDIA_A100_GPUS = 375799445 COMMITTED_NVIDIA_K80_GPUS = 3857188 COMMITTED_NVIDIA_P100_GPUS = 107528100 @@ -59412,6 +61708,7 @@ class Metric(proto.Enum): NETWORK_FIREWALL_POLICIES = 101117374 NODE_GROUPS = 24624817 NODE_TEMPLATES = 474896668 + NVIDIA_A100_80GB_GPUS = 286389320 NVIDIA_A100_GPUS = 504872978 NVIDIA_K80_GPUS = 163886599 NVIDIA_P100_GPUS = 236601633 @@ -59425,6 +61722,7 @@ class Metric(proto.Enum): PD_EXTREME_TOTAL_PROVISIONED_IOPS = 69593965 PREEMPTIBLE_CPUS = 251184841 PREEMPTIBLE_LOCAL_SSD_GB = 260819336 + PREEMPTIBLE_NVIDIA_A100_80GB_GPUS = 151942410 PREEMPTIBLE_NVIDIA_A100_GPUS = 68832784 PREEMPTIBLE_NVIDIA_K80_GPUS = 374960201 PREEMPTIBLE_NVIDIA_P100_GPUS = 337432351 @@ -60187,8 +62485,8 @@ class RegionInstanceGroupManagerPatchInstanceConfigReq(proto.Message): Attributes: per_instance_configs (Sequence[google.cloud.compute_v1.types.PerInstanceConfig]): - The list of per-instance configs to insert or - patch on this managed instance group. + The list of per-instance configurations to + insert or patch on this managed instance group. """ per_instance_configs = proto.RepeatedField( @@ -60203,8 +62501,8 @@ class RegionInstanceGroupManagerUpdateInstanceConfigReq(proto.Message): Attributes: per_instance_configs (Sequence[google.cloud.compute_v1.types.PerInstanceConfig]): - The list of per-instance configs to insert or - patch on this managed instance group. + The list of per-instance configurations to + insert or patch on this managed instance group. """ per_instance_configs = proto.RepeatedField( @@ -62862,10 +65160,10 @@ class ResourcePolicyGroupPlacementPolicy(proto.Message): Attributes: availability_domain_count (int): - The number of availability domains instances - will be spread across. If two instances are in - different availability domain, they will not be - put in the same low latency network + The number of availability domains to spread + instances across. If two instances are in + different availability domain, they are not in + the same low latency network. This field is a member of `oneof`_ ``_availability_domain_count``. collocation (str): @@ -62875,7 +65173,11 @@ class ResourcePolicyGroupPlacementPolicy(proto.Message): This field is a member of `oneof`_ ``_collocation``. vm_count (int): - Number of vms in this placement group + Number of VMs in this placement group. Google + does not recommend that you use this field + unless you use a compact policy and you want + your policy to work only if it contains this + exact number of VMs. This field is a member of `oneof`_ ``_vm_count``. """ @@ -64733,6 +67035,11 @@ class RouterNat(proto.Message): enable_endpoint_independent_mapping (bool): This field is a member of `oneof`_ ``_enable_endpoint_independent_mapping``. + endpoint_types (Sequence[str]): + List of NAT-ted endpoint types supported by the Nat Gateway. + If the list is empty, then it will be equivalent to include + ENDPOINT_TYPE_VM Check the EndpointTypes enum for the list + of possible values. icmp_idle_timeout_sec (int): Timeout (in seconds) for ICMP connections. Defaults to 30s if not set. @@ -64833,6 +67140,12 @@ class RouterNat(proto.Message): This field is a member of `oneof`_ ``_udp_idle_timeout_sec``. """ + class EndpointTypes(proto.Enum): + r"""""" + UNDEFINED_ENDPOINT_TYPES = 0 + ENDPOINT_TYPE_SWG = 159344456 + ENDPOINT_TYPE_VM = 57095474 + class NatIpAllocateOption(proto.Enum): r"""Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by @@ -64878,6 +67191,10 @@ class SourceSubnetworkIpRangesToNat(proto.Enum): number=259441819, optional=True, ) + endpoint_types = proto.RepeatedField( + proto.STRING, + number=502633807, + ) icmp_idle_timeout_sec = proto.Field( proto.INT32, number=3647562, @@ -66067,10 +68384,9 @@ class Scheduling(proto.Message): instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is - TERMINATE. For more information, see Set VM - availability policies. Check the - OnHostMaintenance enum for the list of possible - values. + TERMINATE. For more information, see Set VM host + maintenance policy. Check the OnHostMaintenance + enum for the list of possible values. This field is a member of `oneof`_ ``_on_host_maintenance``. preemptible (bool): @@ -66100,8 +68416,8 @@ class OnHostMaintenance(proto.Enum): r"""Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is - TERMINATE. For more information, see Set VM availability - policies. + TERMINATE. For more information, see Set VM host maintenance + policy. """ UNDEFINED_ON_HOST_MAINTENANCE = 0 MIGRATE = 165699979 @@ -68099,6 +70415,112 @@ class SetBackupTargetPoolRequest(proto.Message): ) +class SetCertificateMapTargetHttpsProxyRequest(proto.Message): + r"""A request message for TargetHttpsProxies.SetCertificateMap. + See the method description for details. + + Attributes: + project (str): + Project ID for this request. + request_id (str): + An optional request ID to identify requests. + Specify a unique request ID so that if you must + retry your request, the server will know to + ignore the request if it has already been + completed. For example, consider a situation + where you make an initial request and the + request times out. If you make the request again + with the same request ID, the server can check + if original operation with the same request ID + was received, and if so, will ignore the second + request. This prevents clients from accidentally + creating duplicate commitments. The request ID + must be a valid UUID with the exception that + zero UUID is not supported ( + 00000000-0000-0000-0000-000000000000). + + This field is a member of `oneof`_ ``_request_id``. + target_https_proxies_set_certificate_map_request_resource (google.cloud.compute_v1.types.TargetHttpsProxiesSetCertificateMapRequest): + The body resource for this request + target_https_proxy (str): + Name of the TargetHttpsProxy resource whose + CertificateMap is to be set. The name must be + 1-63 characters long, and comply with RFC1035. + """ + + project = proto.Field( + proto.STRING, + number=227560217, + ) + request_id = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + target_https_proxies_set_certificate_map_request_resource = proto.Field( + proto.MESSAGE, + number=467639099, + message="TargetHttpsProxiesSetCertificateMapRequest", + ) + target_https_proxy = proto.Field( + proto.STRING, + number=52336748, + ) + + +class SetCertificateMapTargetSslProxyRequest(proto.Message): + r"""A request message for TargetSslProxies.SetCertificateMap. See + the method description for details. + + Attributes: + project (str): + Project ID for this request. + request_id (str): + An optional request ID to identify requests. + Specify a unique request ID so that if you must + retry your request, the server will know to + ignore the request if it has already been + completed. For example, consider a situation + where you make an initial request and the + request times out. If you make the request again + with the same request ID, the server can check + if original operation with the same request ID + was received, and if so, will ignore the second + request. This prevents clients from accidentally + creating duplicate commitments. The request ID + must be a valid UUID with the exception that + zero UUID is not supported ( + 00000000-0000-0000-0000-000000000000). + + This field is a member of `oneof`_ ``_request_id``. + target_ssl_proxies_set_certificate_map_request_resource (google.cloud.compute_v1.types.TargetSslProxiesSetCertificateMapRequest): + The body resource for this request + target_ssl_proxy (str): + Name of the TargetSslProxy resource whose + CertificateMap is to be set. The name must be + 1-63 characters long, and comply with RFC1035. + """ + + project = proto.Field( + proto.STRING, + number=227560217, + ) + request_id = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + target_ssl_proxies_set_certificate_map_request_resource = proto.Field( + proto.MESSAGE, + number=343984954, + message="TargetSslProxiesSetCertificateMapRequest", + ) + target_ssl_proxy = proto.Field( + proto.STRING, + number=338795853, + ) + + class SetCommonInstanceMetadataProjectRequest(proto.Message): r"""A request message for Projects.SetCommonInstanceMetadata. See the method description for details. @@ -74461,6 +76883,24 @@ class TargetHttpsProxiesScopedList(proto.Message): ) +class TargetHttpsProxiesSetCertificateMapRequest(proto.Message): + r""" + + Attributes: + certificate_map (str): + URL of the Certificate Map to associate with + this TargetHttpsProxy. + + This field is a member of `oneof`_ ``_certificate_map``. + """ + + certificate_map = proto.Field( + proto.STRING, + number=156463796, + optional=True, + ) + + class TargetHttpsProxiesSetQuicOverrideRequest(proto.Message): r""" @@ -74530,6 +76970,14 @@ class TargetHttpsProxy(proto.Message): Note: This field currently has no impact. This field is a member of `oneof`_ ``_authorization_policy``. + certificate_map (str): + URL of a certificate map that identifies a + certificate map associated with the given target + proxy. This field can only be set for global + target proxies. If set, sslCertificates will be + ignored. + + This field is a member of `oneof`_ ``_certificate_map``. creation_timestamp (str): [Output Only] Creation timestamp in RFC3339 text format. @@ -74673,6 +77121,11 @@ class QuicOverride(proto.Enum): number=33945528, optional=True, ) + certificate_map = proto.Field( + proto.STRING, + number=156463796, + optional=True, + ) creation_timestamp = proto.Field( proto.STRING, number=30525366, @@ -75711,6 +78164,24 @@ class TargetSslProxiesSetBackendServiceRequest(proto.Message): ) +class TargetSslProxiesSetCertificateMapRequest(proto.Message): + r""" + + Attributes: + certificate_map (str): + URL of the Certificate Map to associate with + this TargetSslProxy. + + This field is a member of `oneof`_ ``_certificate_map``. + """ + + certificate_map = proto.Field( + proto.STRING, + number=156463796, + optional=True, + ) + + class TargetSslProxiesSetProxyHeaderRequest(proto.Message): r""" @@ -75764,6 +78235,14 @@ class TargetSslProxy(proto.Message): read Using Target Proxies. Attributes: + certificate_map (str): + URL of a certificate map that identifies a + certificate map associated with the given target + proxy. This field can only be set for global + target proxies. If set, sslCertificates will be + ignored. + + This field is a member of `oneof`_ ``_certificate_map``. creation_timestamp (str): [Output Only] Creation timestamp in RFC3339 text format. @@ -75833,6 +78312,11 @@ class ProxyHeader(proto.Enum): NONE = 2402104 PROXY_V1 = 334352940 + certificate_map = proto.Field( + proto.STRING, + number=156463796, + optional=True, + ) creation_timestamp = proto.Field( proto.STRING, number=30525366, @@ -79302,38 +81786,167 @@ class UsableSubnetwork(proto.Message): permission on. Attributes: + external_ipv6_prefix (str): + [Output Only] The external IPv6 address range that is + assigned to this subnetwork. + + This field is a member of `oneof`_ ``_external_ipv6_prefix``. + internal_ipv6_prefix (str): + [Output Only] The internal IPv6 address range that is + assigned to this subnetwork. + + This field is a member of `oneof`_ ``_internal_ipv6_prefix``. ip_cidr_range (str): The range of internal addresses that are owned by this subnetwork. This field is a member of `oneof`_ ``_ip_cidr_range``. + ipv6_access_type (str): + The access type of IPv6 address this subnet holds. It's + immutable and can only be specified during creation or the + first time the subnet is updated into IPV4_IPV6 dual stack. + Check the Ipv6AccessType enum for the list of possible + values. + + This field is a member of `oneof`_ ``_ipv6_access_type``. network (str): Network URL. This field is a member of `oneof`_ ``_network``. + purpose (str): + The purpose of the resource. This field can be either + PRIVATE_RFC_1918 or INTERNAL_HTTPS_LOAD_BALANCER. A + subnetwork with purpose set to INTERNAL_HTTPS_LOAD_BALANCER + is a user-created subnetwork that is reserved for Internal + HTTP(S) Load Balancing. If unspecified, the purpose defaults + to PRIVATE_RFC_1918. The enableFlowLogs field isn't + supported with the purpose field set to + INTERNAL_HTTPS_LOAD_BALANCER. Check the Purpose enum for the + list of possible values. + + This field is a member of `oneof`_ ``_purpose``. + role (str): + The role of subnetwork. Currently, this field is only used + when purpose = INTERNAL_HTTPS_LOAD_BALANCER. The value can + be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that + is currently being used for Internal HTTP(S) Load Balancing. + A BACKUP subnetwork is one that is ready to be promoted to + ACTIVE or is currently draining. This field can be updated + with a patch request. Check the Role enum for the list of + possible values. + + This field is a member of `oneof`_ ``_role``. secondary_ip_ranges (Sequence[google.cloud.compute_v1.types.UsableSubnetworkSecondaryRange]): Secondary IP ranges. + stack_type (str): + The stack type for the subnet. If set to IPV4_ONLY, new VMs + in the subnet are assigned IPv4 addresses only. If set to + IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 + and IPv6 addresses. If not specified, IPV4_ONLY is used. + This field can be both set at resource creation time and + updated using patch. Check the StackType enum for the list + of possible values. + + This field is a member of `oneof`_ ``_stack_type``. subnetwork (str): Subnetwork URL. This field is a member of `oneof`_ ``_subnetwork``. """ + class Ipv6AccessType(proto.Enum): + r"""The access type of IPv6 address this subnet holds. It's immutable + and can only be specified during creation or the first time the + subnet is updated into IPV4_IPV6 dual stack. + """ + UNDEFINED_IPV6_ACCESS_TYPE = 0 + EXTERNAL = 35607499 + INTERNAL = 279295677 + + class Purpose(proto.Enum): + r"""The purpose of the resource. This field can be either + PRIVATE_RFC_1918 or INTERNAL_HTTPS_LOAD_BALANCER. A subnetwork with + purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created + subnetwork that is reserved for Internal HTTP(S) Load Balancing. If + unspecified, the purpose defaults to PRIVATE_RFC_1918. The + enableFlowLogs field isn't supported with the purpose field set to + INTERNAL_HTTPS_LOAD_BALANCER. + """ + UNDEFINED_PURPOSE = 0 + INTERNAL_HTTPS_LOAD_BALANCER = 248748889 + PRIVATE = 403485027 + PRIVATE_RFC_1918 = 254902107 + PRIVATE_SERVICE_CONNECT = 48134724 + REGIONAL_MANAGED_PROXY = 153049966 + + class Role(proto.Enum): + r"""The role of subnetwork. Currently, this field is only used when + purpose = INTERNAL_HTTPS_LOAD_BALANCER. The value can be set to + ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently + being used for Internal HTTP(S) Load Balancing. A BACKUP subnetwork + is one that is ready to be promoted to ACTIVE or is currently + draining. This field can be updated with a patch request. + """ + UNDEFINED_ROLE = 0 + ACTIVE = 314733318 + BACKUP = 341010882 + + class StackType(proto.Enum): + r"""The stack type for the subnet. If set to IPV4_ONLY, new VMs in the + subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new + VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If + not specified, IPV4_ONLY is used. This field can be both set at + resource creation time and updated using patch. + """ + UNDEFINED_STACK_TYPE = 0 + IPV4_IPV6 = 22197249 + IPV4_ONLY = 22373798 + + external_ipv6_prefix = proto.Field( + proto.STRING, + number=139299190, + optional=True, + ) + internal_ipv6_prefix = proto.Field( + proto.STRING, + number=506270056, + optional=True, + ) ip_cidr_range = proto.Field( proto.STRING, number=98117322, optional=True, ) + ipv6_access_type = proto.Field( + proto.STRING, + number=504658653, + optional=True, + ) network = proto.Field( proto.STRING, number=232872494, optional=True, ) + purpose = proto.Field( + proto.STRING, + number=316407070, + optional=True, + ) + role = proto.Field( + proto.STRING, + number=3506294, + optional=True, + ) secondary_ip_ranges = proto.RepeatedField( proto.MESSAGE, number=136658915, message="UsableSubnetworkSecondaryRange", ) + stack_type = proto.Field( + proto.STRING, + number=425908881, + optional=True, + ) subnetwork = proto.Field( proto.STRING, number=307827694, @@ -80945,6 +83558,7 @@ class Code(proto.Enum): MISSING_TYPE_DEPENDENCY = 344505463 NEXT_HOP_ADDRESS_NOT_ASSIGNED = 324964999 NEXT_HOP_CANNOT_IP_FORWARD = 383382887 + NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE = 146748434 NEXT_HOP_INSTANCE_NOT_FOUND = 464250446 NEXT_HOP_INSTANCE_NOT_ON_NETWORK = 243758146 NEXT_HOP_NOT_RUNNING = 417081265 @@ -81016,6 +83630,7 @@ class Code(proto.Enum): MISSING_TYPE_DEPENDENCY = 344505463 NEXT_HOP_ADDRESS_NOT_ASSIGNED = 324964999 NEXT_HOP_CANNOT_IP_FORWARD = 383382887 + NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE = 146748434 NEXT_HOP_INSTANCE_NOT_FOUND = 464250446 NEXT_HOP_INSTANCE_NOT_ON_NETWORK = 243758146 NEXT_HOP_NOT_RUNNING = 417081265 diff --git a/scripts/fixup_compute_v1_keywords.py b/scripts/fixup_compute_v1_keywords.py index 7dbcf114c..57ab3386f 100644 --- a/scripts/fixup_compute_v1_keywords.py +++ b/scripts/fixup_compute_v1_keywords.py @@ -126,6 +126,7 @@ class computeCallTransformer(cst.CSTTransformer): 'send_diagnostic_interrupt': ('instance', 'project', 'zone', ), 'set_backend_service': ('project', 'target_ssl_proxies_set_backend_service_request_resource', 'target_ssl_proxy', 'request_id', ), 'set_backup': ('project', 'region', 'target_pool', 'target_reference_resource', 'failover_ratio', 'request_id', ), + 'set_certificate_map': ('project', 'target_https_proxies_set_certificate_map_request_resource', 'target_https_proxy', 'request_id', ), 'set_common_instance_metadata': ('metadata_resource', 'project', 'request_id', ), 'set_default_network_tier': ('project', 'projects_set_default_network_tier_request_resource', 'request_id', ), 'set_deletion_protection': ('project', 'resource', 'zone', 'deletion_protection', 'request_id', ), diff --git a/setup.py b/setup.py index bd0dc4ade..ea2686179 100644 --- a/setup.py +++ b/setup.py @@ -44,7 +44,7 @@ platforms="Posix; MacOS X; Windows", include_package_data=True, install_requires=( - "google-api-core[grpc] >= 2.7.0, <3.0.0dev", + "google-api-core[grpc] >= 2.8.0, <3.0.0dev", "proto-plus >= 1.19.7, <2.0.0dev", "protobuf >= 3.19.0, <4.0.0dev", "dataclasses >= 0.6; python_version < '3.7'", diff --git a/testing/constraints-3.6.txt b/testing/constraints-3.6.txt deleted file mode 100644 index bacb81cfb..000000000 --- a/testing/constraints-3.6.txt +++ /dev/null @@ -1,11 +0,0 @@ -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file. -# 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==2.7.0 -proto-plus==1.19.7 -dataclasses==0.6.0 -protobuf==3.19.0 diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt index bacb81cfb..adecac80d 100644 --- a/testing/constraints-3.7.txt +++ b/testing/constraints-3.7.txt @@ -5,7 +5,7 @@ # 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==2.7.0 +google-api-core==2.8.0 proto-plus==1.19.7 dataclasses==0.6.0 protobuf==3.19.0 diff --git a/tests/unit/gapic/compute_v1/test_accelerator_types.py b/tests/unit/gapic/compute_v1/test_accelerator_types.py index 0d3a4e1d5..bcea58cd2 100644 --- a/tests/unit/gapic/compute_v1/test_accelerator_types.py +++ b/tests/unit/gapic/compute_v1/test_accelerator_types.py @@ -228,6 +228,7 @@ def test_accelerator_types_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -245,6 +246,7 @@ def test_accelerator_types_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -262,6 +264,7 @@ def test_accelerator_types_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -291,6 +294,25 @@ def test_accelerator_types_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -351,6 +373,7 @@ def test_accelerator_types_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -385,6 +408,7 @@ def test_accelerator_types_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -407,6 +431,7 @@ def test_accelerator_types_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -509,6 +534,7 @@ def test_accelerator_types_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -541,6 +567,7 @@ def test_accelerator_types_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -2001,4 +2028,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_addresses.py b/tests/unit/gapic/compute_v1/test_addresses.py index 4b036c256..bdf9b14a6 100644 --- a/tests/unit/gapic/compute_v1/test_addresses.py +++ b/tests/unit/gapic/compute_v1/test_addresses.py @@ -216,6 +216,7 @@ def test_addresses_client_client_options(client_class, transport_class, transpor quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -233,6 +234,7 @@ def test_addresses_client_client_options(client_class, transport_class, transpor quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -250,6 +252,7 @@ def test_addresses_client_client_options(client_class, transport_class, transpor quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -279,6 +282,25 @@ def test_addresses_client_client_options(client_class, transport_class, transpor quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -327,6 +349,7 @@ def test_addresses_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -361,6 +384,7 @@ def test_addresses_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -383,6 +407,7 @@ def test_addresses_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -483,6 +508,7 @@ def test_addresses_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -510,6 +536,7 @@ def test_addresses_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3267,4 +3294,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_autoscalers.py b/tests/unit/gapic/compute_v1/test_autoscalers.py index cc2518594..aa9a110fd 100644 --- a/tests/unit/gapic/compute_v1/test_autoscalers.py +++ b/tests/unit/gapic/compute_v1/test_autoscalers.py @@ -220,6 +220,7 @@ def test_autoscalers_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -237,6 +238,7 @@ def test_autoscalers_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -254,6 +256,7 @@ def test_autoscalers_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -283,6 +286,25 @@ def test_autoscalers_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -331,6 +353,7 @@ def test_autoscalers_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -365,6 +388,7 @@ def test_autoscalers_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -387,6 +411,7 @@ def test_autoscalers_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -487,6 +512,7 @@ def test_autoscalers_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -514,6 +540,7 @@ def test_autoscalers_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -5024,4 +5051,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_backend_buckets.py b/tests/unit/gapic/compute_v1/test_backend_buckets.py index 1f60a63a8..f616a1db3 100644 --- a/tests/unit/gapic/compute_v1/test_backend_buckets.py +++ b/tests/unit/gapic/compute_v1/test_backend_buckets.py @@ -225,6 +225,7 @@ def test_backend_buckets_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -242,6 +243,7 @@ def test_backend_buckets_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -259,6 +261,7 @@ def test_backend_buckets_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -288,6 +291,25 @@ def test_backend_buckets_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -338,6 +360,7 @@ def test_backend_buckets_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -372,6 +395,7 @@ def test_backend_buckets_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -394,6 +418,7 @@ def test_backend_buckets_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -496,6 +521,7 @@ def test_backend_buckets_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -523,6 +549,7 @@ def test_backend_buckets_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -6470,4 +6497,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_backend_services.py b/tests/unit/gapic/compute_v1/test_backend_services.py index 01551caf6..605443989 100644 --- a/tests/unit/gapic/compute_v1/test_backend_services.py +++ b/tests/unit/gapic/compute_v1/test_backend_services.py @@ -229,6 +229,7 @@ def test_backend_services_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -246,6 +247,7 @@ def test_backend_services_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -263,6 +265,7 @@ def test_backend_services_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -292,6 +295,25 @@ def test_backend_services_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -352,6 +374,7 @@ def test_backend_services_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -386,6 +409,7 @@ def test_backend_services_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -408,6 +432,7 @@ def test_backend_services_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -510,6 +535,7 @@ def test_backend_services_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -537,6 +563,7 @@ def test_backend_services_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -2827,6 +2854,7 @@ def test_get_rest(request_type): region="region_value", security_policy="security_policy_value", self_link="self_link_value", + service_bindings=["service_bindings_value"], session_affinity="session_affinity_value", timeout_sec=1185, ) @@ -2862,6 +2890,7 @@ def test_get_rest(request_type): assert response.region == "region_value" assert response.security_policy == "security_policy_value" assert response.self_link == "self_link_value" + assert response.service_bindings == ["service_bindings_value"] assert response.session_affinity == "session_affinity_value" assert response.timeout_sec == 1185 @@ -3537,6 +3566,7 @@ def test_insert_rest(request_type): ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -3899,6 +3929,7 @@ def test_insert_rest_bad_request( ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -4143,6 +4174,7 @@ def test_insert_unary_rest(request_type): ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -4485,6 +4517,7 @@ def test_insert_unary_rest_bad_request( ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -5066,6 +5099,7 @@ def test_patch_rest(request_type): ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -5433,6 +5467,7 @@ def test_patch_rest_bad_request( ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -5679,6 +5714,7 @@ def test_patch_unary_rest(request_type): ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -6026,6 +6062,7 @@ def test_patch_unary_rest_bad_request( ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -7538,6 +7575,7 @@ def test_update_rest(request_type): ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -7905,6 +7943,7 @@ def test_update_rest_bad_request( ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -8151,6 +8190,7 @@ def test_update_unary_rest(request_type): ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -8498,6 +8538,7 @@ def test_update_unary_rest_bad_request( ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -9068,4 +9109,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_disk_types.py b/tests/unit/gapic/compute_v1/test_disk_types.py index f91324139..59d7e823e 100644 --- a/tests/unit/gapic/compute_v1/test_disk_types.py +++ b/tests/unit/gapic/compute_v1/test_disk_types.py @@ -216,6 +216,7 @@ def test_disk_types_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -233,6 +234,7 @@ def test_disk_types_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -250,6 +252,7 @@ def test_disk_types_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -279,6 +282,25 @@ def test_disk_types_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -327,6 +349,7 @@ def test_disk_types_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -361,6 +384,7 @@ def test_disk_types_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -383,6 +407,7 @@ def test_disk_types_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -483,6 +508,7 @@ def test_disk_types_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -510,6 +536,7 @@ def test_disk_types_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -1949,4 +1976,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_disks.py b/tests/unit/gapic/compute_v1/test_disks.py index fb6f4973d..b12ae7c4c 100644 --- a/tests/unit/gapic/compute_v1/test_disks.py +++ b/tests/unit/gapic/compute_v1/test_disks.py @@ -213,6 +213,7 @@ def test_disks_client_client_options(client_class, transport_class, transport_na quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -230,6 +231,7 @@ def test_disks_client_client_options(client_class, transport_class, transport_na quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -247,6 +249,7 @@ def test_disks_client_client_options(client_class, transport_class, transport_na quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -276,6 +279,25 @@ def test_disks_client_client_options(client_class, transport_class, transport_na quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -324,6 +346,7 @@ def test_disks_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -358,6 +381,7 @@ def test_disks_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -380,6 +404,7 @@ def test_disks_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -480,6 +505,7 @@ def test_disks_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -507,6 +533,7 @@ def test_disks_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -7778,4 +7805,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_external_vpn_gateways.py b/tests/unit/gapic/compute_v1/test_external_vpn_gateways.py index 4039aa417..1a0bf726c 100644 --- a/tests/unit/gapic/compute_v1/test_external_vpn_gateways.py +++ b/tests/unit/gapic/compute_v1/test_external_vpn_gateways.py @@ -236,6 +236,7 @@ def test_external_vpn_gateways_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -253,6 +254,7 @@ def test_external_vpn_gateways_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -270,6 +272,7 @@ def test_external_vpn_gateways_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -299,6 +302,25 @@ def test_external_vpn_gateways_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -359,6 +381,7 @@ def test_external_vpn_gateways_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -393,6 +416,7 @@ def test_external_vpn_gateways_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -415,6 +439,7 @@ def test_external_vpn_gateways_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -521,6 +546,7 @@ def test_external_vpn_gateways_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -553,6 +579,7 @@ def test_external_vpn_gateways_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3812,4 +3839,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_firewall_policies.py b/tests/unit/gapic/compute_v1/test_firewall_policies.py index 0b57707ee..2ef17d0f1 100644 --- a/tests/unit/gapic/compute_v1/test_firewall_policies.py +++ b/tests/unit/gapic/compute_v1/test_firewall_policies.py @@ -230,6 +230,7 @@ def test_firewall_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -247,6 +248,7 @@ def test_firewall_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -264,6 +266,7 @@ def test_firewall_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -293,6 +296,25 @@ def test_firewall_policies_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -353,6 +375,7 @@ def test_firewall_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -387,6 +410,7 @@ def test_firewall_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -409,6 +433,7 @@ def test_firewall_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -511,6 +536,7 @@ def test_firewall_policies_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -543,6 +569,7 @@ def test_firewall_policies_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -10036,4 +10063,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_firewalls.py b/tests/unit/gapic/compute_v1/test_firewalls.py index 42e0125a2..a0e7801bd 100644 --- a/tests/unit/gapic/compute_v1/test_firewalls.py +++ b/tests/unit/gapic/compute_v1/test_firewalls.py @@ -216,6 +216,7 @@ def test_firewalls_client_client_options(client_class, transport_class, transpor quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -233,6 +234,7 @@ def test_firewalls_client_client_options(client_class, transport_class, transpor quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -250,6 +252,7 @@ def test_firewalls_client_client_options(client_class, transport_class, transpor quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -279,6 +282,25 @@ def test_firewalls_client_client_options(client_class, transport_class, transpor quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -327,6 +349,7 @@ def test_firewalls_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -361,6 +384,7 @@ def test_firewalls_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -383,6 +407,7 @@ def test_firewalls_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -483,6 +508,7 @@ def test_firewalls_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -510,6 +536,7 @@ def test_firewalls_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -4497,4 +4524,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_forwarding_rules.py b/tests/unit/gapic/compute_v1/test_forwarding_rules.py index 0bf7b1521..a4325fa2a 100644 --- a/tests/unit/gapic/compute_v1/test_forwarding_rules.py +++ b/tests/unit/gapic/compute_v1/test_forwarding_rules.py @@ -229,6 +229,7 @@ def test_forwarding_rules_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -246,6 +247,7 @@ def test_forwarding_rules_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -263,6 +265,7 @@ def test_forwarding_rules_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -292,6 +295,25 @@ def test_forwarding_rules_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -352,6 +374,7 @@ def test_forwarding_rules_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -386,6 +409,7 @@ def test_forwarding_rules_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -408,6 +432,7 @@ def test_forwarding_rules_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -510,6 +535,7 @@ def test_forwarding_rules_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -537,6 +563,7 @@ def test_forwarding_rules_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -1581,6 +1608,7 @@ def test_get_rest(request_type): name="name_value", network="network_value", network_tier="network_tier_value", + no_automate_dns_zone=True, port_range="port_range_value", ports=["ports_value"], psc_connection_id=1793, @@ -1620,6 +1648,7 @@ def test_get_rest(request_type): assert response.name == "name_value" assert response.network == "network_value" assert response.network_tier == "network_tier_value" + assert response.no_automate_dns_zone is True assert response.port_range == "port_range_value" assert response.ports == ["ports_value"] assert response.psc_connection_id == 1793 @@ -1919,6 +1948,7 @@ def test_insert_rest(request_type): "name": "name_value", "network": "network_value", "network_tier": "network_tier_value", + "no_automate_dns_zone": True, "port_range": "port_range_value", "ports": ["ports_value_1", "ports_value_2"], "psc_connection_id": 1793, @@ -2182,6 +2212,7 @@ def test_insert_rest_bad_request( "name": "name_value", "network": "network_value", "network_tier": "network_tier_value", + "no_automate_dns_zone": True, "port_range": "port_range_value", "ports": ["ports_value_1", "ports_value_2"], "psc_connection_id": 1793, @@ -2324,6 +2355,7 @@ def test_insert_unary_rest(request_type): "name": "name_value", "network": "network_value", "network_tier": "network_tier_value", + "no_automate_dns_zone": True, "port_range": "port_range_value", "ports": ["ports_value_1", "ports_value_2"], "psc_connection_id": 1793, @@ -2567,6 +2599,7 @@ def test_insert_unary_rest_bad_request( "name": "name_value", "network": "network_value", "network_tier": "network_tier_value", + "no_automate_dns_zone": True, "port_range": "port_range_value", "ports": ["ports_value_1", "ports_value_2"], "psc_connection_id": 1793, @@ -3061,6 +3094,7 @@ def test_patch_rest(request_type): "name": "name_value", "network": "network_value", "network_tier": "network_tier_value", + "no_automate_dns_zone": True, "port_range": "port_range_value", "ports": ["ports_value_1", "ports_value_2"], "psc_connection_id": 1793, @@ -3333,6 +3367,7 @@ def test_patch_rest_bad_request( "name": "name_value", "network": "network_value", "network_tier": "network_tier_value", + "no_automate_dns_zone": True, "port_range": "port_range_value", "ports": ["ports_value_1", "ports_value_2"], "psc_connection_id": 1793, @@ -3485,6 +3520,7 @@ def test_patch_unary_rest(request_type): "name": "name_value", "network": "network_value", "network_tier": "network_tier_value", + "no_automate_dns_zone": True, "port_range": "port_range_value", "ports": ["ports_value_1", "ports_value_2"], "psc_connection_id": 1793, @@ -3737,6 +3773,7 @@ def test_patch_unary_rest_bad_request( "name": "name_value", "network": "network_value", "network_tier": "network_tier_value", + "no_automate_dns_zone": True, "port_range": "port_range_value", "ports": ["ports_value_1", "ports_value_2"], "psc_connection_id": 1793, @@ -5623,4 +5660,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_global_addresses.py b/tests/unit/gapic/compute_v1/test_global_addresses.py index 5d599fe8d..99bfed6ad 100644 --- a/tests/unit/gapic/compute_v1/test_global_addresses.py +++ b/tests/unit/gapic/compute_v1/test_global_addresses.py @@ -229,6 +229,7 @@ def test_global_addresses_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -246,6 +247,7 @@ def test_global_addresses_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -263,6 +265,7 @@ def test_global_addresses_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -292,6 +295,25 @@ def test_global_addresses_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -352,6 +374,7 @@ def test_global_addresses_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -386,6 +409,7 @@ def test_global_addresses_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -408,6 +432,7 @@ def test_global_addresses_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -510,6 +535,7 @@ def test_global_addresses_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -537,6 +563,7 @@ def test_global_addresses_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -2898,4 +2925,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_global_forwarding_rules.py b/tests/unit/gapic/compute_v1/test_global_forwarding_rules.py index 28ac4b7ae..9ce893f96 100644 --- a/tests/unit/gapic/compute_v1/test_global_forwarding_rules.py +++ b/tests/unit/gapic/compute_v1/test_global_forwarding_rules.py @@ -236,6 +236,7 @@ def test_global_forwarding_rules_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -253,6 +254,7 @@ def test_global_forwarding_rules_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -270,6 +272,7 @@ def test_global_forwarding_rules_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -299,6 +302,25 @@ def test_global_forwarding_rules_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -359,6 +381,7 @@ def test_global_forwarding_rules_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -393,6 +416,7 @@ def test_global_forwarding_rules_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -415,6 +439,7 @@ def test_global_forwarding_rules_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -521,6 +546,7 @@ def test_global_forwarding_rules_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -553,6 +579,7 @@ def test_global_forwarding_rules_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -1198,6 +1225,7 @@ def test_get_rest(request_type): name="name_value", network="network_value", network_tier="network_tier_value", + no_automate_dns_zone=True, port_range="port_range_value", ports=["ports_value"], psc_connection_id=1793, @@ -1237,6 +1265,7 @@ def test_get_rest(request_type): assert response.name == "name_value" assert response.network == "network_value" assert response.network_tier == "network_tier_value" + assert response.no_automate_dns_zone is True assert response.port_range == "port_range_value" assert response.ports == ["ports_value"] assert response.psc_connection_id == 1793 @@ -1521,6 +1550,7 @@ def test_insert_rest(request_type): "name": "name_value", "network": "network_value", "network_tier": "network_tier_value", + "no_automate_dns_zone": True, "port_range": "port_range_value", "ports": ["ports_value_1", "ports_value_2"], "psc_connection_id": 1793, @@ -1781,6 +1811,7 @@ def test_insert_rest_bad_request( "name": "name_value", "network": "network_value", "network_tier": "network_tier_value", + "no_automate_dns_zone": True, "port_range": "port_range_value", "ports": ["ports_value_1", "ports_value_2"], "psc_connection_id": 1793, @@ -1921,6 +1952,7 @@ def test_insert_unary_rest(request_type): "name": "name_value", "network": "network_value", "network_tier": "network_tier_value", + "no_automate_dns_zone": True, "port_range": "port_range_value", "ports": ["ports_value_1", "ports_value_2"], "psc_connection_id": 1793, @@ -2159,6 +2191,7 @@ def test_insert_unary_rest_bad_request( "name": "name_value", "network": "network_value", "network_tier": "network_tier_value", + "no_automate_dns_zone": True, "port_range": "port_range_value", "ports": ["ports_value_1", "ports_value_2"], "psc_connection_id": 1793, @@ -2638,6 +2671,7 @@ def test_patch_rest(request_type): "name": "name_value", "network": "network_value", "network_tier": "network_tier_value", + "no_automate_dns_zone": True, "port_range": "port_range_value", "ports": ["ports_value_1", "ports_value_2"], "psc_connection_id": 1793, @@ -2903,6 +2937,7 @@ def test_patch_rest_bad_request( "name": "name_value", "network": "network_value", "network_tier": "network_tier_value", + "no_automate_dns_zone": True, "port_range": "port_range_value", "ports": ["ports_value_1", "ports_value_2"], "psc_connection_id": 1793, @@ -3045,6 +3080,7 @@ def test_patch_unary_rest(request_type): "name": "name_value", "network": "network_value", "network_tier": "network_tier_value", + "no_automate_dns_zone": True, "port_range": "port_range_value", "ports": ["ports_value_1", "ports_value_2"], "psc_connection_id": 1793, @@ -3288,6 +3324,7 @@ def test_patch_unary_rest_bad_request( "name": "name_value", "network": "network_value", "network_tier": "network_tier_value", + "no_automate_dns_zone": True, "port_range": "port_range_value", "ports": ["ports_value_1", "ports_value_2"], "psc_connection_id": 1793, @@ -5100,4 +5137,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_global_network_endpoint_groups.py b/tests/unit/gapic/compute_v1/test_global_network_endpoint_groups.py index 2193b61a8..2e247fc0e 100644 --- a/tests/unit/gapic/compute_v1/test_global_network_endpoint_groups.py +++ b/tests/unit/gapic/compute_v1/test_global_network_endpoint_groups.py @@ -242,6 +242,7 @@ def test_global_network_endpoint_groups_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -259,6 +260,7 @@ def test_global_network_endpoint_groups_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -276,6 +278,7 @@ def test_global_network_endpoint_groups_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -305,6 +308,25 @@ def test_global_network_endpoint_groups_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -365,6 +387,7 @@ def test_global_network_endpoint_groups_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -399,6 +422,7 @@ def test_global_network_endpoint_groups_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -421,6 +445,7 @@ def test_global_network_endpoint_groups_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -529,6 +554,7 @@ def test_global_network_endpoint_groups_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -561,6 +587,7 @@ def test_global_network_endpoint_groups_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -4715,4 +4742,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_global_operations.py b/tests/unit/gapic/compute_v1/test_global_operations.py index 59531d701..e1a25429a 100644 --- a/tests/unit/gapic/compute_v1/test_global_operations.py +++ b/tests/unit/gapic/compute_v1/test_global_operations.py @@ -228,6 +228,7 @@ def test_global_operations_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -245,6 +246,7 @@ def test_global_operations_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -262,6 +264,7 @@ def test_global_operations_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -291,6 +294,25 @@ def test_global_operations_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -351,6 +373,7 @@ def test_global_operations_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -385,6 +408,7 @@ def test_global_operations_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -407,6 +431,7 @@ def test_global_operations_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -509,6 +534,7 @@ def test_global_operations_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -541,6 +567,7 @@ def test_global_operations_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -2573,4 +2600,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_global_organization_operations.py b/tests/unit/gapic/compute_v1/test_global_organization_operations.py index a9ed31512..12c1146f5 100644 --- a/tests/unit/gapic/compute_v1/test_global_organization_operations.py +++ b/tests/unit/gapic/compute_v1/test_global_organization_operations.py @@ -240,6 +240,7 @@ def test_global_organization_operations_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -257,6 +258,7 @@ def test_global_organization_operations_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -274,6 +276,7 @@ def test_global_organization_operations_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -303,6 +306,25 @@ def test_global_organization_operations_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -363,6 +385,7 @@ def test_global_organization_operations_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -397,6 +420,7 @@ def test_global_organization_operations_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -419,6 +443,7 @@ def test_global_organization_operations_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -527,6 +552,7 @@ def test_global_organization_operations_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -559,6 +585,7 @@ def test_global_organization_operations_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -1763,4 +1790,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_global_public_delegated_prefixes.py b/tests/unit/gapic/compute_v1/test_global_public_delegated_prefixes.py index 6909faf2b..0b4cbdf93 100644 --- a/tests/unit/gapic/compute_v1/test_global_public_delegated_prefixes.py +++ b/tests/unit/gapic/compute_v1/test_global_public_delegated_prefixes.py @@ -244,6 +244,7 @@ def test_global_public_delegated_prefixes_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -261,6 +262,7 @@ def test_global_public_delegated_prefixes_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -278,6 +280,7 @@ def test_global_public_delegated_prefixes_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -307,6 +310,25 @@ def test_global_public_delegated_prefixes_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -367,6 +389,7 @@ def test_global_public_delegated_prefixes_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -401,6 +424,7 @@ def test_global_public_delegated_prefixes_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -423,6 +447,7 @@ def test_global_public_delegated_prefixes_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -531,6 +556,7 @@ def test_global_public_delegated_prefixes_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -563,6 +589,7 @@ def test_global_public_delegated_prefixes_client_client_options_credentials_file quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3696,4 +3723,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_health_checks.py b/tests/unit/gapic/compute_v1/test_health_checks.py index 6f6944e69..451b2824d 100644 --- a/tests/unit/gapic/compute_v1/test_health_checks.py +++ b/tests/unit/gapic/compute_v1/test_health_checks.py @@ -220,6 +220,7 @@ def test_health_checks_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -237,6 +238,7 @@ def test_health_checks_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -254,6 +256,7 @@ def test_health_checks_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -283,6 +286,25 @@ def test_health_checks_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -331,6 +353,7 @@ def test_health_checks_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -365,6 +388,7 @@ def test_health_checks_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -387,6 +411,7 @@ def test_health_checks_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -487,6 +512,7 @@ def test_health_checks_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -514,6 +540,7 @@ def test_health_checks_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -5146,4 +5173,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_image_family_views.py b/tests/unit/gapic/compute_v1/test_image_family_views.py index 636745567..1ae15bcc9 100644 --- a/tests/unit/gapic/compute_v1/test_image_family_views.py +++ b/tests/unit/gapic/compute_v1/test_image_family_views.py @@ -227,6 +227,7 @@ def test_image_family_views_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -244,6 +245,7 @@ def test_image_family_views_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -261,6 +263,7 @@ def test_image_family_views_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -290,6 +293,25 @@ def test_image_family_views_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -350,6 +372,7 @@ def test_image_family_views_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -384,6 +407,7 @@ def test_image_family_views_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -406,6 +430,7 @@ def test_image_family_views_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -508,6 +533,7 @@ def test_image_family_views_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -540,6 +566,7 @@ def test_image_family_views_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -1254,4 +1281,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_images.py b/tests/unit/gapic/compute_v1/test_images.py index 47e00ccd3..c0269bcd5 100644 --- a/tests/unit/gapic/compute_v1/test_images.py +++ b/tests/unit/gapic/compute_v1/test_images.py @@ -213,6 +213,7 @@ def test_images_client_client_options(client_class, transport_class, transport_n quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -230,6 +231,7 @@ def test_images_client_client_options(client_class, transport_class, transport_n quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -247,6 +249,7 @@ def test_images_client_client_options(client_class, transport_class, transport_n quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -276,6 +279,25 @@ def test_images_client_client_options(client_class, transport_class, transport_n quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -324,6 +346,7 @@ def test_images_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -358,6 +381,7 @@ def test_images_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -380,6 +404,7 @@ def test_images_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -480,6 +505,7 @@ def test_images_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -507,6 +533,7 @@ def test_images_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -6433,4 +6460,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_instance_group_managers.py b/tests/unit/gapic/compute_v1/test_instance_group_managers.py index 4f917fca6..570df2075 100644 --- a/tests/unit/gapic/compute_v1/test_instance_group_managers.py +++ b/tests/unit/gapic/compute_v1/test_instance_group_managers.py @@ -236,6 +236,7 @@ def test_instance_group_managers_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -253,6 +254,7 @@ def test_instance_group_managers_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -270,6 +272,7 @@ def test_instance_group_managers_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -299,6 +302,25 @@ def test_instance_group_managers_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -359,6 +381,7 @@ def test_instance_group_managers_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -393,6 +416,7 @@ def test_instance_group_managers_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -415,6 +439,7 @@ def test_instance_group_managers_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -521,6 +546,7 @@ def test_instance_group_managers_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -553,6 +579,7 @@ def test_instance_group_managers_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -13262,4 +13289,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_instance_groups.py b/tests/unit/gapic/compute_v1/test_instance_groups.py index aac5661f2..2ebd72a6b 100644 --- a/tests/unit/gapic/compute_v1/test_instance_groups.py +++ b/tests/unit/gapic/compute_v1/test_instance_groups.py @@ -225,6 +225,7 @@ def test_instance_groups_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -242,6 +243,7 @@ def test_instance_groups_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -259,6 +261,7 @@ def test_instance_groups_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -288,6 +291,25 @@ def test_instance_groups_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -338,6 +360,7 @@ def test_instance_groups_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -372,6 +395,7 @@ def test_instance_groups_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -394,6 +418,7 @@ def test_instance_groups_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -496,6 +521,7 @@ def test_instance_groups_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -523,6 +549,7 @@ def test_instance_groups_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -5741,4 +5768,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_instance_templates.py b/tests/unit/gapic/compute_v1/test_instance_templates.py index 0c7ec3748..d66d6e6d1 100644 --- a/tests/unit/gapic/compute_v1/test_instance_templates.py +++ b/tests/unit/gapic/compute_v1/test_instance_templates.py @@ -230,6 +230,7 @@ def test_instance_templates_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -247,6 +248,7 @@ def test_instance_templates_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -264,6 +266,7 @@ def test_instance_templates_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -293,6 +296,25 @@ def test_instance_templates_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -353,6 +375,7 @@ def test_instance_templates_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -387,6 +410,7 @@ def test_instance_templates_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -409,6 +433,7 @@ def test_instance_templates_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -511,6 +536,7 @@ def test_instance_templates_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -543,6 +569,7 @@ def test_instance_templates_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -4512,4 +4539,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_instances.py b/tests/unit/gapic/compute_v1/test_instances.py index 17e3587ae..d74a9bf1c 100644 --- a/tests/unit/gapic/compute_v1/test_instances.py +++ b/tests/unit/gapic/compute_v1/test_instances.py @@ -216,6 +216,7 @@ def test_instances_client_client_options(client_class, transport_class, transpor quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -233,6 +234,7 @@ def test_instances_client_client_options(client_class, transport_class, transpor quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -250,6 +252,7 @@ def test_instances_client_client_options(client_class, transport_class, transpor quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -279,6 +282,25 @@ def test_instances_client_client_options(client_class, transport_class, transpor quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -327,6 +349,7 @@ def test_instances_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -361,6 +384,7 @@ def test_instances_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -383,6 +407,7 @@ def test_instances_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -483,6 +508,7 @@ def test_instances_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -510,6 +536,7 @@ def test_instances_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3243,7 +3270,7 @@ def test_bulk_insert_rest(request_type): "items": ["items_value_1", "items_value_2"], }, }, - "location_policy": {"locations": {}}, + "location_policy": {"locations": {}, "target_shape": "target_shape_value"}, "min_count": 972, "name_pattern": "name_pattern_value", "per_instance_properties": {}, @@ -3622,7 +3649,7 @@ def test_bulk_insert_rest_bad_request( "items": ["items_value_1", "items_value_2"], }, }, - "location_policy": {"locations": {}}, + "location_policy": {"locations": {}, "target_shape": "target_shape_value"}, "min_count": 972, "name_pattern": "name_pattern_value", "per_instance_properties": {}, @@ -3880,7 +3907,7 @@ def test_bulk_insert_unary_rest(request_type): "items": ["items_value_1", "items_value_2"], }, }, - "location_policy": {"locations": {}}, + "location_policy": {"locations": {}, "target_shape": "target_shape_value"}, "min_count": 972, "name_pattern": "name_pattern_value", "per_instance_properties": {}, @@ -4237,7 +4264,7 @@ def test_bulk_insert_unary_rest_bad_request( "items": ["items_value_1", "items_value_2"], }, }, - "location_policy": {"locations": {}}, + "location_policy": {"locations": {}, "target_shape": "target_shape_value"}, "min_count": 972, "name_pattern": "name_pattern_value", "per_instance_properties": {}, @@ -28600,4 +28627,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_interconnect_attachments.py b/tests/unit/gapic/compute_v1/test_interconnect_attachments.py index 589f9d0b8..2c89cec43 100644 --- a/tests/unit/gapic/compute_v1/test_interconnect_attachments.py +++ b/tests/unit/gapic/compute_v1/test_interconnect_attachments.py @@ -236,6 +236,7 @@ def test_interconnect_attachments_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -253,6 +254,7 @@ def test_interconnect_attachments_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -270,6 +272,7 @@ def test_interconnect_attachments_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -299,6 +302,25 @@ def test_interconnect_attachments_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -359,6 +381,7 @@ def test_interconnect_attachments_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -393,6 +416,7 @@ def test_interconnect_attachments_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -415,6 +439,7 @@ def test_interconnect_attachments_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -523,6 +548,7 @@ def test_interconnect_attachments_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -555,6 +581,7 @@ def test_interconnect_attachments_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -4423,4 +4450,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_interconnect_locations.py b/tests/unit/gapic/compute_v1/test_interconnect_locations.py index f203dea2e..e437fb416 100644 --- a/tests/unit/gapic/compute_v1/test_interconnect_locations.py +++ b/tests/unit/gapic/compute_v1/test_interconnect_locations.py @@ -234,6 +234,7 @@ def test_interconnect_locations_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -251,6 +252,7 @@ def test_interconnect_locations_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -268,6 +270,7 @@ def test_interconnect_locations_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -297,6 +300,25 @@ def test_interconnect_locations_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -357,6 +379,7 @@ def test_interconnect_locations_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -391,6 +414,7 @@ def test_interconnect_locations_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -413,6 +437,7 @@ def test_interconnect_locations_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -519,6 +544,7 @@ def test_interconnect_locations_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -551,6 +577,7 @@ def test_interconnect_locations_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -1636,4 +1663,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_interconnects.py b/tests/unit/gapic/compute_v1/test_interconnects.py index 2567e7fbc..5c72b6f57 100644 --- a/tests/unit/gapic/compute_v1/test_interconnects.py +++ b/tests/unit/gapic/compute_v1/test_interconnects.py @@ -225,6 +225,7 @@ def test_interconnects_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -242,6 +243,7 @@ def test_interconnects_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -259,6 +261,7 @@ def test_interconnects_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -288,6 +291,25 @@ def test_interconnects_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -338,6 +360,7 @@ def test_interconnects_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -372,6 +395,7 @@ def test_interconnects_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -394,6 +418,7 @@ def test_interconnects_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -496,6 +521,7 @@ def test_interconnects_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -523,6 +549,7 @@ def test_interconnects_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -4094,4 +4121,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_license_codes.py b/tests/unit/gapic/compute_v1/test_license_codes.py index 31768cf5a..678f7f9f7 100644 --- a/tests/unit/gapic/compute_v1/test_license_codes.py +++ b/tests/unit/gapic/compute_v1/test_license_codes.py @@ -217,6 +217,7 @@ def test_license_codes_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -234,6 +235,7 @@ def test_license_codes_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -251,6 +253,7 @@ def test_license_codes_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -280,6 +283,25 @@ def test_license_codes_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -328,6 +350,7 @@ def test_license_codes_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -362,6 +385,7 @@ def test_license_codes_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -384,6 +408,7 @@ def test_license_codes_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -484,6 +509,7 @@ def test_license_codes_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -511,6 +537,7 @@ def test_license_codes_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -1524,4 +1551,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_licenses.py b/tests/unit/gapic/compute_v1/test_licenses.py index 7889d809b..063dfcade 100644 --- a/tests/unit/gapic/compute_v1/test_licenses.py +++ b/tests/unit/gapic/compute_v1/test_licenses.py @@ -216,6 +216,7 @@ def test_licenses_client_client_options(client_class, transport_class, transport quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -233,6 +234,7 @@ def test_licenses_client_client_options(client_class, transport_class, transport quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -250,6 +252,7 @@ def test_licenses_client_client_options(client_class, transport_class, transport quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -279,6 +282,25 @@ def test_licenses_client_client_options(client_class, transport_class, transport quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -327,6 +349,7 @@ def test_licenses_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -361,6 +384,7 @@ def test_licenses_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -383,6 +407,7 @@ def test_licenses_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -483,6 +508,7 @@ def test_licenses_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -510,6 +536,7 @@ def test_licenses_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3855,4 +3882,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_machine_images.py b/tests/unit/gapic/compute_v1/test_machine_images.py index 9cd382876..48a3e4712 100644 --- a/tests/unit/gapic/compute_v1/test_machine_images.py +++ b/tests/unit/gapic/compute_v1/test_machine_images.py @@ -225,6 +225,7 @@ def test_machine_images_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -242,6 +243,7 @@ def test_machine_images_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -259,6 +261,7 @@ def test_machine_images_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -288,6 +291,25 @@ def test_machine_images_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -338,6 +360,7 @@ def test_machine_images_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -372,6 +395,7 @@ def test_machine_images_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -394,6 +418,7 @@ def test_machine_images_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -496,6 +521,7 @@ def test_machine_images_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -523,6 +549,7 @@ def test_machine_images_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -4679,4 +4706,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_machine_types.py b/tests/unit/gapic/compute_v1/test_machine_types.py index 5bf7437e7..73fa5df4e 100644 --- a/tests/unit/gapic/compute_v1/test_machine_types.py +++ b/tests/unit/gapic/compute_v1/test_machine_types.py @@ -218,6 +218,7 @@ def test_machine_types_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -235,6 +236,7 @@ def test_machine_types_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -252,6 +254,7 @@ def test_machine_types_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -281,6 +284,25 @@ def test_machine_types_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -329,6 +351,7 @@ def test_machine_types_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -363,6 +386,7 @@ def test_machine_types_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -385,6 +409,7 @@ def test_machine_types_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -485,6 +510,7 @@ def test_machine_types_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -512,6 +538,7 @@ def test_machine_types_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -1968,4 +1995,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_network_edge_security_services.py b/tests/unit/gapic/compute_v1/test_network_edge_security_services.py index f381c2806..1c6f1db33 100644 --- a/tests/unit/gapic/compute_v1/test_network_edge_security_services.py +++ b/tests/unit/gapic/compute_v1/test_network_edge_security_services.py @@ -242,6 +242,7 @@ def test_network_edge_security_services_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -259,6 +260,7 @@ def test_network_edge_security_services_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -276,6 +278,7 @@ def test_network_edge_security_services_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -305,6 +308,25 @@ def test_network_edge_security_services_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -365,6 +387,7 @@ def test_network_edge_security_services_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -399,6 +422,7 @@ def test_network_edge_security_services_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -421,6 +445,7 @@ def test_network_edge_security_services_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -529,6 +554,7 @@ def test_network_edge_security_services_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -561,6 +587,7 @@ def test_network_edge_security_services_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3791,4 +3818,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_network_endpoint_groups.py b/tests/unit/gapic/compute_v1/test_network_endpoint_groups.py index 60f1b16a5..554023a73 100644 --- a/tests/unit/gapic/compute_v1/test_network_endpoint_groups.py +++ b/tests/unit/gapic/compute_v1/test_network_endpoint_groups.py @@ -236,6 +236,7 @@ def test_network_endpoint_groups_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -253,6 +254,7 @@ def test_network_endpoint_groups_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -270,6 +272,7 @@ def test_network_endpoint_groups_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -299,6 +302,25 @@ def test_network_endpoint_groups_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -359,6 +381,7 @@ def test_network_endpoint_groups_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -393,6 +416,7 @@ def test_network_endpoint_groups_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -415,6 +439,7 @@ def test_network_endpoint_groups_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -521,6 +546,7 @@ def test_network_endpoint_groups_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -553,6 +579,7 @@ def test_network_endpoint_groups_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -5553,4 +5580,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_network_firewall_policies.py b/tests/unit/gapic/compute_v1/test_network_firewall_policies.py index 4a6d4509f..b02e99732 100644 --- a/tests/unit/gapic/compute_v1/test_network_firewall_policies.py +++ b/tests/unit/gapic/compute_v1/test_network_firewall_policies.py @@ -236,6 +236,7 @@ def test_network_firewall_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -253,6 +254,7 @@ def test_network_firewall_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -270,6 +272,7 @@ def test_network_firewall_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -299,6 +302,25 @@ def test_network_firewall_policies_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -359,6 +381,7 @@ def test_network_firewall_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -393,6 +416,7 @@ def test_network_firewall_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -415,6 +439,7 @@ def test_network_firewall_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -523,6 +548,7 @@ def test_network_firewall_policies_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -555,6 +581,7 @@ def test_network_firewall_policies_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -9656,4 +9683,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_networks.py b/tests/unit/gapic/compute_v1/test_networks.py index 312de2213..2c8f93eb5 100644 --- a/tests/unit/gapic/compute_v1/test_networks.py +++ b/tests/unit/gapic/compute_v1/test_networks.py @@ -216,6 +216,7 @@ def test_networks_client_client_options(client_class, transport_class, transport quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -233,6 +234,7 @@ def test_networks_client_client_options(client_class, transport_class, transport quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -250,6 +252,7 @@ def test_networks_client_client_options(client_class, transport_class, transport quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -279,6 +282,25 @@ def test_networks_client_client_options(client_class, transport_class, transport quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -327,6 +349,7 @@ def test_networks_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -361,6 +384,7 @@ def test_networks_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -383,6 +407,7 @@ def test_networks_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -483,6 +508,7 @@ def test_networks_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -510,6 +536,7 @@ def test_networks_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -541,6 +568,7 @@ def test_add_peering_rest(request_type): "name": "name_value", "network": "network_value", "peer_mtu": 865, + "stack_type": "stack_type_value", "state": "state_value", "state_details": "state_details_value", }, @@ -779,6 +807,7 @@ def test_add_peering_rest_bad_request( "name": "name_value", "network": "network_value", "peer_mtu": 865, + "stack_type": "stack_type_value", "state": "state_value", "state_details": "state_details_value", }, @@ -896,6 +925,7 @@ def test_add_peering_unary_rest(request_type): "name": "name_value", "network": "network_value", "peer_mtu": 865, + "stack_type": "stack_type_value", "state": "state_value", "state_details": "state_details_value", }, @@ -1112,6 +1142,7 @@ def test_add_peering_unary_rest_bad_request( "name": "name_value", "network": "network_value", "peer_mtu": 865, + "stack_type": "stack_type_value", "state": "state_value", "state_details": "state_details_value", }, @@ -2406,6 +2437,7 @@ def test_insert_rest(request_type): "name": "name_value", "network": "network_value", "peer_mtu": 865, + "stack_type": "stack_type_value", "state": "state_value", "state_details": "state_details_value", } @@ -2652,6 +2684,7 @@ def test_insert_rest_bad_request( "name": "name_value", "network": "network_value", "peer_mtu": 865, + "stack_type": "stack_type_value", "state": "state_value", "state_details": "state_details_value", } @@ -2777,6 +2810,7 @@ def test_insert_unary_rest(request_type): "name": "name_value", "network": "network_value", "peer_mtu": 865, + "stack_type": "stack_type_value", "state": "state_value", "state_details": "state_details_value", } @@ -3001,6 +3035,7 @@ def test_insert_unary_rest_bad_request( "name": "name_value", "network": "network_value", "peer_mtu": 865, + "stack_type": "stack_type_value", "state": "state_value", "state_details": "state_details_value", } @@ -3814,6 +3849,7 @@ def test_patch_rest(request_type): "name": "name_value", "network": "network_value", "peer_mtu": 865, + "stack_type": "stack_type_value", "state": "state_value", "state_details": "state_details_value", } @@ -4065,6 +4101,7 @@ def test_patch_rest_bad_request( "name": "name_value", "network": "network_value", "peer_mtu": 865, + "stack_type": "stack_type_value", "state": "state_value", "state_details": "state_details_value", } @@ -4193,6 +4230,7 @@ def test_patch_unary_rest(request_type): "name": "name_value", "network": "network_value", "peer_mtu": 865, + "stack_type": "stack_type_value", "state": "state_value", "state_details": "state_details_value", } @@ -4422,6 +4460,7 @@ def test_patch_unary_rest_bad_request( "name": "name_value", "network": "network_value", "peer_mtu": 865, + "stack_type": "stack_type_value", "state": "state_value", "state_details": "state_details_value", } @@ -5757,6 +5796,7 @@ def test_update_peering_rest(request_type): "name": "name_value", "network": "network_value", "peer_mtu": 865, + "stack_type": "stack_type_value", "state": "state_value", "state_details": "state_details_value", } @@ -5992,6 +6032,7 @@ def test_update_peering_rest_bad_request( "name": "name_value", "network": "network_value", "peer_mtu": 865, + "stack_type": "stack_type_value", "state": "state_value", "state_details": "state_details_value", } @@ -6106,6 +6147,7 @@ def test_update_peering_unary_rest(request_type): "name": "name_value", "network": "network_value", "peer_mtu": 865, + "stack_type": "stack_type_value", "state": "state_value", "state_details": "state_details_value", } @@ -6319,6 +6361,7 @@ def test_update_peering_unary_rest_bad_request( "name": "name_value", "network": "network_value", "peer_mtu": 865, + "stack_type": "stack_type_value", "state": "state_value", "state_details": "state_details_value", } @@ -6885,4 +6928,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_node_groups.py b/tests/unit/gapic/compute_v1/test_node_groups.py index eeed571a6..b900ee4c5 100644 --- a/tests/unit/gapic/compute_v1/test_node_groups.py +++ b/tests/unit/gapic/compute_v1/test_node_groups.py @@ -220,6 +220,7 @@ def test_node_groups_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -237,6 +238,7 @@ def test_node_groups_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -254,6 +256,7 @@ def test_node_groups_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -283,6 +286,25 @@ def test_node_groups_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -331,6 +353,7 @@ def test_node_groups_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -365,6 +388,7 @@ def test_node_groups_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -387,6 +411,7 @@ def test_node_groups_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -487,6 +512,7 @@ def test_node_groups_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -514,6 +540,7 @@ def test_node_groups_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -7476,4 +7503,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_node_templates.py b/tests/unit/gapic/compute_v1/test_node_templates.py index 642db9bda..db78e1b45 100644 --- a/tests/unit/gapic/compute_v1/test_node_templates.py +++ b/tests/unit/gapic/compute_v1/test_node_templates.py @@ -225,6 +225,7 @@ def test_node_templates_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -242,6 +243,7 @@ def test_node_templates_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -259,6 +261,7 @@ def test_node_templates_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -288,6 +291,25 @@ def test_node_templates_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -338,6 +360,7 @@ def test_node_templates_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -372,6 +395,7 @@ def test_node_templates_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -394,6 +418,7 @@ def test_node_templates_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -496,6 +521,7 @@ def test_node_templates_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -523,6 +549,7 @@ def test_node_templates_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -4393,4 +4420,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_node_types.py b/tests/unit/gapic/compute_v1/test_node_types.py index 9466b5b52..7c9400b9d 100644 --- a/tests/unit/gapic/compute_v1/test_node_types.py +++ b/tests/unit/gapic/compute_v1/test_node_types.py @@ -216,6 +216,7 @@ def test_node_types_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -233,6 +234,7 @@ def test_node_types_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -250,6 +252,7 @@ def test_node_types_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -279,6 +282,25 @@ def test_node_types_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -327,6 +349,7 @@ def test_node_types_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -361,6 +384,7 @@ def test_node_types_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -383,6 +407,7 @@ def test_node_types_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -483,6 +508,7 @@ def test_node_types_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -510,6 +536,7 @@ def test_node_types_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -1951,4 +1978,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_packet_mirrorings.py b/tests/unit/gapic/compute_v1/test_packet_mirrorings.py index 5a0678cdb..e41e4cc77 100644 --- a/tests/unit/gapic/compute_v1/test_packet_mirrorings.py +++ b/tests/unit/gapic/compute_v1/test_packet_mirrorings.py @@ -230,6 +230,7 @@ def test_packet_mirrorings_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -247,6 +248,7 @@ def test_packet_mirrorings_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -264,6 +266,7 @@ def test_packet_mirrorings_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -293,6 +296,25 @@ def test_packet_mirrorings_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -353,6 +375,7 @@ def test_packet_mirrorings_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -387,6 +410,7 @@ def test_packet_mirrorings_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -409,6 +433,7 @@ def test_packet_mirrorings_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -511,6 +536,7 @@ def test_packet_mirrorings_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -543,6 +569,7 @@ def test_packet_mirrorings_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -4446,4 +4473,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_projects.py b/tests/unit/gapic/compute_v1/test_projects.py index f4c8c567a..6b145c92c 100644 --- a/tests/unit/gapic/compute_v1/test_projects.py +++ b/tests/unit/gapic/compute_v1/test_projects.py @@ -216,6 +216,7 @@ def test_projects_client_client_options(client_class, transport_class, transport quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -233,6 +234,7 @@ def test_projects_client_client_options(client_class, transport_class, transport quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -250,6 +252,7 @@ def test_projects_client_client_options(client_class, transport_class, transport quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -279,6 +282,25 @@ def test_projects_client_client_options(client_class, transport_class, transport quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -327,6 +349,7 @@ def test_projects_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -361,6 +384,7 @@ def test_projects_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -383,6 +407,7 @@ def test_projects_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -483,6 +508,7 @@ def test_projects_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -510,6 +536,7 @@ def test_projects_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -7671,4 +7698,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_public_advertised_prefixes.py b/tests/unit/gapic/compute_v1/test_public_advertised_prefixes.py index 0a97b8888..05d4b59ba 100644 --- a/tests/unit/gapic/compute_v1/test_public_advertised_prefixes.py +++ b/tests/unit/gapic/compute_v1/test_public_advertised_prefixes.py @@ -240,6 +240,7 @@ def test_public_advertised_prefixes_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -257,6 +258,7 @@ def test_public_advertised_prefixes_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -274,6 +276,7 @@ def test_public_advertised_prefixes_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -303,6 +306,25 @@ def test_public_advertised_prefixes_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -363,6 +385,7 @@ def test_public_advertised_prefixes_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -397,6 +420,7 @@ def test_public_advertised_prefixes_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -419,6 +443,7 @@ def test_public_advertised_prefixes_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -527,6 +552,7 @@ def test_public_advertised_prefixes_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -559,6 +585,7 @@ def test_public_advertised_prefixes_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3667,4 +3694,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_public_delegated_prefixes.py b/tests/unit/gapic/compute_v1/test_public_delegated_prefixes.py index e2be99532..6c329551d 100644 --- a/tests/unit/gapic/compute_v1/test_public_delegated_prefixes.py +++ b/tests/unit/gapic/compute_v1/test_public_delegated_prefixes.py @@ -236,6 +236,7 @@ def test_public_delegated_prefixes_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -253,6 +254,7 @@ def test_public_delegated_prefixes_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -270,6 +272,7 @@ def test_public_delegated_prefixes_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -299,6 +302,25 @@ def test_public_delegated_prefixes_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -359,6 +381,7 @@ def test_public_delegated_prefixes_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -393,6 +416,7 @@ def test_public_delegated_prefixes_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -415,6 +439,7 @@ def test_public_delegated_prefixes_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -523,6 +548,7 @@ def test_public_delegated_prefixes_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -555,6 +581,7 @@ def test_public_delegated_prefixes_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -4165,4 +4192,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_autoscalers.py b/tests/unit/gapic/compute_v1/test_region_autoscalers.py index 10d962cc1..1f1feb7cc 100644 --- a/tests/unit/gapic/compute_v1/test_region_autoscalers.py +++ b/tests/unit/gapic/compute_v1/test_region_autoscalers.py @@ -230,6 +230,7 @@ def test_region_autoscalers_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -247,6 +248,7 @@ def test_region_autoscalers_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -264,6 +266,7 @@ def test_region_autoscalers_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -293,6 +296,25 @@ def test_region_autoscalers_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -353,6 +375,7 @@ def test_region_autoscalers_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -387,6 +410,7 @@ def test_region_autoscalers_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -409,6 +433,7 @@ def test_region_autoscalers_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -511,6 +536,7 @@ def test_region_autoscalers_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -543,6 +569,7 @@ def test_region_autoscalers_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -4702,4 +4729,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_backend_services.py b/tests/unit/gapic/compute_v1/test_region_backend_services.py index 0a21cc843..53098713f 100644 --- a/tests/unit/gapic/compute_v1/test_region_backend_services.py +++ b/tests/unit/gapic/compute_v1/test_region_backend_services.py @@ -236,6 +236,7 @@ def test_region_backend_services_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -253,6 +254,7 @@ def test_region_backend_services_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -270,6 +272,7 @@ def test_region_backend_services_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -299,6 +302,25 @@ def test_region_backend_services_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -359,6 +381,7 @@ def test_region_backend_services_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -393,6 +416,7 @@ def test_region_backend_services_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -415,6 +439,7 @@ def test_region_backend_services_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -521,6 +546,7 @@ def test_region_backend_services_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -553,6 +579,7 @@ def test_region_backend_services_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -1244,6 +1271,7 @@ def test_get_rest(request_type): region="region_value", security_policy="security_policy_value", self_link="self_link_value", + service_bindings=["service_bindings_value"], session_affinity="session_affinity_value", timeout_sec=1185, ) @@ -1279,6 +1307,7 @@ def test_get_rest(request_type): assert response.region == "region_value" assert response.security_policy == "security_policy_value" assert response.self_link == "self_link_value" + assert response.service_bindings == ["service_bindings_value"] assert response.session_affinity == "session_affinity_value" assert response.timeout_sec == 1185 @@ -1988,6 +2017,7 @@ def test_insert_rest(request_type): ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -2357,6 +2387,7 @@ def test_insert_rest_bad_request( ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -2603,6 +2634,7 @@ def test_insert_unary_rest(request_type): ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -2950,6 +2982,7 @@ def test_insert_unary_rest_bad_request( ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -3550,6 +3583,7 @@ def test_patch_rest(request_type): ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -3928,6 +3962,7 @@ def test_patch_rest_bad_request( ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -4184,6 +4219,7 @@ def test_patch_unary_rest(request_type): ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -4540,6 +4576,7 @@ def test_patch_unary_rest_bad_request( ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -4796,6 +4833,7 @@ def test_update_rest(request_type): ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -5174,6 +5212,7 @@ def test_update_rest_bad_request( ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -5430,6 +5469,7 @@ def test_update_unary_rest(request_type): ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -5786,6 +5826,7 @@ def test_update_unary_rest_bad_request( ], }, "self_link": "self_link_value", + "service_bindings": ["service_bindings_value_1", "service_bindings_value_2"], "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -6342,4 +6383,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_commitments.py b/tests/unit/gapic/compute_v1/test_region_commitments.py index 902855018..8cb5390a4 100644 --- a/tests/unit/gapic/compute_v1/test_region_commitments.py +++ b/tests/unit/gapic/compute_v1/test_region_commitments.py @@ -230,6 +230,7 @@ def test_region_commitments_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -247,6 +248,7 @@ def test_region_commitments_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -264,6 +266,7 @@ def test_region_commitments_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -293,6 +296,25 @@ def test_region_commitments_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -353,6 +375,7 @@ def test_region_commitments_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -387,6 +410,7 @@ def test_region_commitments_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -409,6 +433,7 @@ def test_region_commitments_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -511,6 +536,7 @@ def test_region_commitments_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -543,6 +569,7 @@ def test_region_commitments_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3791,4 +3818,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_disk_types.py b/tests/unit/gapic/compute_v1/test_region_disk_types.py index f3533a1ec..9fa8e9ce2 100644 --- a/tests/unit/gapic/compute_v1/test_region_disk_types.py +++ b/tests/unit/gapic/compute_v1/test_region_disk_types.py @@ -227,6 +227,7 @@ def test_region_disk_types_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -244,6 +245,7 @@ def test_region_disk_types_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -261,6 +263,7 @@ def test_region_disk_types_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -290,6 +293,25 @@ def test_region_disk_types_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -350,6 +372,7 @@ def test_region_disk_types_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -384,6 +407,7 @@ def test_region_disk_types_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -406,6 +430,7 @@ def test_region_disk_types_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -508,6 +533,7 @@ def test_region_disk_types_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -535,6 +561,7 @@ def test_region_disk_types_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -1626,4 +1653,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_disks.py b/tests/unit/gapic/compute_v1/test_region_disks.py index 337bfcfda..63267b1df 100644 --- a/tests/unit/gapic/compute_v1/test_region_disks.py +++ b/tests/unit/gapic/compute_v1/test_region_disks.py @@ -220,6 +220,7 @@ def test_region_disks_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -237,6 +238,7 @@ def test_region_disks_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -254,6 +256,7 @@ def test_region_disks_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -283,6 +286,25 @@ def test_region_disks_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -331,6 +353,7 @@ def test_region_disks_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -365,6 +388,7 @@ def test_region_disks_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -387,6 +411,7 @@ def test_region_disks_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -487,6 +512,7 @@ def test_region_disks_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -514,6 +540,7 @@ def test_region_disks_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -7471,4 +7498,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_health_check_services.py b/tests/unit/gapic/compute_v1/test_region_health_check_services.py index 66ea3595f..eb2641713 100644 --- a/tests/unit/gapic/compute_v1/test_region_health_check_services.py +++ b/tests/unit/gapic/compute_v1/test_region_health_check_services.py @@ -242,6 +242,7 @@ def test_region_health_check_services_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -259,6 +260,7 @@ def test_region_health_check_services_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -276,6 +278,7 @@ def test_region_health_check_services_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -305,6 +308,25 @@ def test_region_health_check_services_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -365,6 +387,7 @@ def test_region_health_check_services_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -399,6 +422,7 @@ def test_region_health_check_services_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -421,6 +445,7 @@ def test_region_health_check_services_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -529,6 +554,7 @@ def test_region_health_check_services_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -561,6 +587,7 @@ def test_region_health_check_services_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3770,4 +3797,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_health_checks.py b/tests/unit/gapic/compute_v1/test_region_health_checks.py index 4c57d87f3..edbd052f3 100644 --- a/tests/unit/gapic/compute_v1/test_region_health_checks.py +++ b/tests/unit/gapic/compute_v1/test_region_health_checks.py @@ -232,6 +232,7 @@ def test_region_health_checks_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -249,6 +250,7 @@ def test_region_health_checks_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -266,6 +268,7 @@ def test_region_health_checks_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -295,6 +298,25 @@ def test_region_health_checks_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -355,6 +377,7 @@ def test_region_health_checks_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -389,6 +412,7 @@ def test_region_health_checks_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -411,6 +435,7 @@ def test_region_health_checks_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -513,6 +538,7 @@ def test_region_health_checks_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -545,6 +571,7 @@ def test_region_health_checks_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -4982,4 +5009,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_instance_group_managers.py b/tests/unit/gapic/compute_v1/test_region_instance_group_managers.py index 03c8ea6cb..3c1402c95 100644 --- a/tests/unit/gapic/compute_v1/test_region_instance_group_managers.py +++ b/tests/unit/gapic/compute_v1/test_region_instance_group_managers.py @@ -242,6 +242,7 @@ def test_region_instance_group_managers_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -259,6 +260,7 @@ def test_region_instance_group_managers_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -276,6 +278,7 @@ def test_region_instance_group_managers_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -305,6 +308,25 @@ def test_region_instance_group_managers_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -365,6 +387,7 @@ def test_region_instance_group_managers_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -399,6 +422,7 @@ def test_region_instance_group_managers_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -421,6 +445,7 @@ def test_region_instance_group_managers_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -529,6 +554,7 @@ def test_region_instance_group_managers_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -561,6 +587,7 @@ def test_region_instance_group_managers_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -12940,4 +12967,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_instance_groups.py b/tests/unit/gapic/compute_v1/test_region_instance_groups.py index 3cc224492..97c3f0616 100644 --- a/tests/unit/gapic/compute_v1/test_region_instance_groups.py +++ b/tests/unit/gapic/compute_v1/test_region_instance_groups.py @@ -236,6 +236,7 @@ def test_region_instance_groups_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -253,6 +254,7 @@ def test_region_instance_groups_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -270,6 +272,7 @@ def test_region_instance_groups_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -299,6 +302,25 @@ def test_region_instance_groups_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -359,6 +381,7 @@ def test_region_instance_groups_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -393,6 +416,7 @@ def test_region_instance_groups_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -415,6 +439,7 @@ def test_region_instance_groups_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -521,6 +546,7 @@ def test_region_instance_groups_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -553,6 +579,7 @@ def test_region_instance_groups_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -2745,4 +2772,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_instances.py b/tests/unit/gapic/compute_v1/test_region_instances.py index 37a291730..d34c359a7 100644 --- a/tests/unit/gapic/compute_v1/test_region_instances.py +++ b/tests/unit/gapic/compute_v1/test_region_instances.py @@ -228,6 +228,7 @@ def test_region_instances_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -245,6 +246,7 @@ def test_region_instances_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -262,6 +264,7 @@ def test_region_instances_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -291,6 +294,25 @@ def test_region_instances_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -351,6 +373,7 @@ def test_region_instances_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -385,6 +408,7 @@ def test_region_instances_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -407,6 +431,7 @@ def test_region_instances_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -509,6 +534,7 @@ def test_region_instances_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -536,6 +562,7 @@ def test_region_instances_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -707,7 +734,7 @@ def test_bulk_insert_rest(request_type): "items": ["items_value_1", "items_value_2"], }, }, - "location_policy": {"locations": {}}, + "location_policy": {"locations": {}, "target_shape": "target_shape_value"}, "min_count": 972, "name_pattern": "name_pattern_value", "per_instance_properties": {}, @@ -1088,7 +1115,7 @@ def test_bulk_insert_rest_bad_request( "items": ["items_value_1", "items_value_2"], }, }, - "location_policy": {"locations": {}}, + "location_policy": {"locations": {}, "target_shape": "target_shape_value"}, "min_count": 972, "name_pattern": "name_pattern_value", "per_instance_properties": {}, @@ -1346,7 +1373,7 @@ def test_bulk_insert_unary_rest(request_type): "items": ["items_value_1", "items_value_2"], }, }, - "location_policy": {"locations": {}}, + "location_policy": {"locations": {}, "target_shape": "target_shape_value"}, "min_count": 972, "name_pattern": "name_pattern_value", "per_instance_properties": {}, @@ -1705,7 +1732,7 @@ def test_bulk_insert_unary_rest_bad_request( "items": ["items_value_1", "items_value_2"], }, }, - "location_policy": {"locations": {}}, + "location_policy": {"locations": {}, "target_shape": "target_shape_value"}, "min_count": 972, "name_pattern": "name_pattern_value", "per_instance_properties": {}, @@ -2231,4 +2258,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_network_endpoint_groups.py b/tests/unit/gapic/compute_v1/test_region_network_endpoint_groups.py index 500487a54..6d417163c 100644 --- a/tests/unit/gapic/compute_v1/test_region_network_endpoint_groups.py +++ b/tests/unit/gapic/compute_v1/test_region_network_endpoint_groups.py @@ -242,6 +242,7 @@ def test_region_network_endpoint_groups_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -259,6 +260,7 @@ def test_region_network_endpoint_groups_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -276,6 +278,7 @@ def test_region_network_endpoint_groups_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -305,6 +308,25 @@ def test_region_network_endpoint_groups_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -365,6 +387,7 @@ def test_region_network_endpoint_groups_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -399,6 +422,7 @@ def test_region_network_endpoint_groups_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -421,6 +445,7 @@ def test_region_network_endpoint_groups_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -529,6 +554,7 @@ def test_region_network_endpoint_groups_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -561,6 +587,7 @@ def test_region_network_endpoint_groups_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3065,4 +3092,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_network_firewall_policies.py b/tests/unit/gapic/compute_v1/test_region_network_firewall_policies.py index 9a2b85483..152f2059e 100644 --- a/tests/unit/gapic/compute_v1/test_region_network_firewall_policies.py +++ b/tests/unit/gapic/compute_v1/test_region_network_firewall_policies.py @@ -244,6 +244,7 @@ def test_region_network_firewall_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -261,6 +262,7 @@ def test_region_network_firewall_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -278,6 +280,7 @@ def test_region_network_firewall_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -307,6 +310,25 @@ def test_region_network_firewall_policies_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -367,6 +389,7 @@ def test_region_network_firewall_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -401,6 +424,7 @@ def test_region_network_firewall_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -423,6 +447,7 @@ def test_region_network_firewall_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -531,6 +556,7 @@ def test_region_network_firewall_policies_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -563,6 +589,7 @@ def test_region_network_firewall_policies_client_client_options_credentials_file quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -10423,4 +10450,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_notification_endpoints.py b/tests/unit/gapic/compute_v1/test_region_notification_endpoints.py index f31d902a5..0e24c2614 100644 --- a/tests/unit/gapic/compute_v1/test_region_notification_endpoints.py +++ b/tests/unit/gapic/compute_v1/test_region_notification_endpoints.py @@ -242,6 +242,7 @@ def test_region_notification_endpoints_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -259,6 +260,7 @@ def test_region_notification_endpoints_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -276,6 +278,7 @@ def test_region_notification_endpoints_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -305,6 +308,25 @@ def test_region_notification_endpoints_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -365,6 +387,7 @@ def test_region_notification_endpoints_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -399,6 +422,7 @@ def test_region_notification_endpoints_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -421,6 +445,7 @@ def test_region_notification_endpoints_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -529,6 +554,7 @@ def test_region_notification_endpoints_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -561,6 +587,7 @@ def test_region_notification_endpoints_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3003,4 +3030,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_operations.py b/tests/unit/gapic/compute_v1/test_region_operations.py index 56f5e3cab..e40e81f91 100644 --- a/tests/unit/gapic/compute_v1/test_region_operations.py +++ b/tests/unit/gapic/compute_v1/test_region_operations.py @@ -228,6 +228,7 @@ def test_region_operations_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -245,6 +246,7 @@ def test_region_operations_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -262,6 +264,7 @@ def test_region_operations_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -291,6 +294,25 @@ def test_region_operations_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -351,6 +373,7 @@ def test_region_operations_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -385,6 +408,7 @@ def test_region_operations_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -407,6 +431,7 @@ def test_region_operations_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -509,6 +534,7 @@ def test_region_operations_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -541,6 +567,7 @@ def test_region_operations_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -2261,4 +2288,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_security_policies.py b/tests/unit/gapic/compute_v1/test_region_security_policies.py index 23e68d2a2..b6e1afb1e 100644 --- a/tests/unit/gapic/compute_v1/test_region_security_policies.py +++ b/tests/unit/gapic/compute_v1/test_region_security_policies.py @@ -236,6 +236,7 @@ def test_region_security_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -253,6 +254,7 @@ def test_region_security_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -270,6 +272,7 @@ def test_region_security_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -299,6 +302,25 @@ def test_region_security_policies_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -359,6 +381,7 @@ def test_region_security_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -393,6 +416,7 @@ def test_region_security_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -415,6 +439,7 @@ def test_region_security_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -523,6 +548,7 @@ def test_region_security_policies_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -555,6 +581,7 @@ def test_region_security_policies_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -4188,4 +4215,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_ssl_certificates.py b/tests/unit/gapic/compute_v1/test_region_ssl_certificates.py index fa337df0f..b5ddbfe6c 100644 --- a/tests/unit/gapic/compute_v1/test_region_ssl_certificates.py +++ b/tests/unit/gapic/compute_v1/test_region_ssl_certificates.py @@ -236,6 +236,7 @@ def test_region_ssl_certificates_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -253,6 +254,7 @@ def test_region_ssl_certificates_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -270,6 +272,7 @@ def test_region_ssl_certificates_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -299,6 +302,25 @@ def test_region_ssl_certificates_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -359,6 +381,7 @@ def test_region_ssl_certificates_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -393,6 +416,7 @@ def test_region_ssl_certificates_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -415,6 +439,7 @@ def test_region_ssl_certificates_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -521,6 +546,7 @@ def test_region_ssl_certificates_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -553,6 +579,7 @@ def test_region_ssl_certificates_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3032,4 +3059,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_target_http_proxies.py b/tests/unit/gapic/compute_v1/test_region_target_http_proxies.py index 28b580f4c..7d1b34e3f 100644 --- a/tests/unit/gapic/compute_v1/test_region_target_http_proxies.py +++ b/tests/unit/gapic/compute_v1/test_region_target_http_proxies.py @@ -236,6 +236,7 @@ def test_region_target_http_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -253,6 +254,7 @@ def test_region_target_http_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -270,6 +272,7 @@ def test_region_target_http_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -299,6 +302,25 @@ def test_region_target_http_proxies_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -359,6 +381,7 @@ def test_region_target_http_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -393,6 +416,7 @@ def test_region_target_http_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -415,6 +439,7 @@ def test_region_target_http_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -523,6 +548,7 @@ def test_region_target_http_proxies_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -555,6 +581,7 @@ def test_region_target_http_proxies_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3635,4 +3662,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_target_https_proxies.py b/tests/unit/gapic/compute_v1/test_region_target_https_proxies.py index fbc17c3c9..d7908c977 100644 --- a/tests/unit/gapic/compute_v1/test_region_target_https_proxies.py +++ b/tests/unit/gapic/compute_v1/test_region_target_https_proxies.py @@ -240,6 +240,7 @@ def test_region_target_https_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -257,6 +258,7 @@ def test_region_target_https_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -274,6 +276,7 @@ def test_region_target_https_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -303,6 +306,25 @@ def test_region_target_https_proxies_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -363,6 +385,7 @@ def test_region_target_https_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -397,6 +420,7 @@ def test_region_target_https_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -419,6 +443,7 @@ def test_region_target_https_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -527,6 +552,7 @@ def test_region_target_https_proxies_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -559,6 +585,7 @@ def test_region_target_https_proxies_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -1230,6 +1257,7 @@ def test_get_rest(request_type): # Designate an appropriate value for the returned response. return_value = compute.TargetHttpsProxy( authorization_policy="authorization_policy_value", + certificate_map="certificate_map_value", creation_timestamp="creation_timestamp_value", description="description_value", fingerprint="fingerprint_value", @@ -1257,6 +1285,7 @@ def test_get_rest(request_type): # Establish that the response is the type that we expect. assert isinstance(response, compute.TargetHttpsProxy) assert response.authorization_policy == "authorization_policy_value" + assert response.certificate_map == "certificate_map_value" assert response.creation_timestamp == "creation_timestamp_value" assert response.description == "description_value" assert response.fingerprint == "fingerprint_value" @@ -1539,6 +1568,7 @@ def test_insert_rest(request_type): request_init = {"project": "sample1", "region": "sample2"} request_init["target_https_proxy_resource"] = { "authorization_policy": "authorization_policy_value", + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "fingerprint": "fingerprint_value", @@ -1778,6 +1808,7 @@ def test_insert_rest_bad_request( request_init = {"project": "sample1", "region": "sample2"} request_init["target_https_proxy_resource"] = { "authorization_policy": "authorization_policy_value", + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "fingerprint": "fingerprint_value", @@ -1894,6 +1925,7 @@ def test_insert_unary_rest(request_type): request_init = {"project": "sample1", "region": "sample2"} request_init["target_https_proxy_resource"] = { "authorization_policy": "authorization_policy_value", + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "fingerprint": "fingerprint_value", @@ -2111,6 +2143,7 @@ def test_insert_unary_rest_bad_request( request_init = {"project": "sample1", "region": "sample2"} request_init["target_https_proxy_resource"] = { "authorization_policy": "authorization_policy_value", + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "fingerprint": "fingerprint_value", @@ -2581,6 +2614,7 @@ def test_patch_rest(request_type): } request_init["target_https_proxy_resource"] = { "authorization_policy": "authorization_policy_value", + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "fingerprint": "fingerprint_value", @@ -2829,6 +2863,7 @@ def test_patch_rest_bad_request( } request_init["target_https_proxy_resource"] = { "authorization_policy": "authorization_policy_value", + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "fingerprint": "fingerprint_value", @@ -2955,6 +2990,7 @@ def test_patch_unary_rest(request_type): } request_init["target_https_proxy_resource"] = { "authorization_policy": "authorization_policy_value", + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "fingerprint": "fingerprint_value", @@ -3181,6 +3217,7 @@ def test_patch_unary_rest_bad_request( } request_init["target_https_proxy_resource"] = { "authorization_policy": "authorization_policy_value", + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "fingerprint": "fingerprint_value", @@ -5077,4 +5114,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_region_url_maps.py b/tests/unit/gapic/compute_v1/test_region_url_maps.py index 49a75ddda..fd14b5004 100644 --- a/tests/unit/gapic/compute_v1/test_region_url_maps.py +++ b/tests/unit/gapic/compute_v1/test_region_url_maps.py @@ -225,6 +225,7 @@ def test_region_url_maps_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -242,6 +243,7 @@ def test_region_url_maps_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -259,6 +261,7 @@ def test_region_url_maps_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -288,6 +291,25 @@ def test_region_url_maps_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -338,6 +360,7 @@ def test_region_url_maps_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -372,6 +395,7 @@ def test_region_url_maps_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -394,6 +418,7 @@ def test_region_url_maps_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -496,6 +521,7 @@ def test_region_url_maps_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -523,6 +549,7 @@ def test_region_url_maps_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -6813,4 +6840,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_regions.py b/tests/unit/gapic/compute_v1/test_regions.py index e7866aef1..26d9a713b 100644 --- a/tests/unit/gapic/compute_v1/test_regions.py +++ b/tests/unit/gapic/compute_v1/test_regions.py @@ -211,6 +211,7 @@ def test_regions_client_client_options(client_class, transport_class, transport_ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -228,6 +229,7 @@ def test_regions_client_client_options(client_class, transport_class, transport_ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -245,6 +247,7 @@ def test_regions_client_client_options(client_class, transport_class, transport_ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -274,6 +277,25 @@ def test_regions_client_client_options(client_class, transport_class, transport_ quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -322,6 +344,7 @@ def test_regions_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -356,6 +379,7 @@ def test_regions_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -378,6 +402,7 @@ def test_regions_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -478,6 +503,7 @@ def test_regions_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -505,6 +531,7 @@ def test_regions_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -1564,4 +1591,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_reservations.py b/tests/unit/gapic/compute_v1/test_reservations.py index f108c05f5..e841938ab 100644 --- a/tests/unit/gapic/compute_v1/test_reservations.py +++ b/tests/unit/gapic/compute_v1/test_reservations.py @@ -220,6 +220,7 @@ def test_reservations_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -237,6 +238,7 @@ def test_reservations_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -254,6 +256,7 @@ def test_reservations_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -283,6 +286,25 @@ def test_reservations_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -331,6 +353,7 @@ def test_reservations_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -365,6 +388,7 @@ def test_reservations_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -387,6 +411,7 @@ def test_reservations_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -487,6 +512,7 @@ def test_reservations_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -514,6 +540,7 @@ def test_reservations_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -5802,4 +5829,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_resource_policies.py b/tests/unit/gapic/compute_v1/test_resource_policies.py index a8dad3512..c6ccee866 100644 --- a/tests/unit/gapic/compute_v1/test_resource_policies.py +++ b/tests/unit/gapic/compute_v1/test_resource_policies.py @@ -230,6 +230,7 @@ def test_resource_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -247,6 +248,7 @@ def test_resource_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -264,6 +266,7 @@ def test_resource_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -293,6 +296,25 @@ def test_resource_policies_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -353,6 +375,7 @@ def test_resource_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -387,6 +410,7 @@ def test_resource_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -409,6 +433,7 @@ def test_resource_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -511,6 +536,7 @@ def test_resource_policies_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -543,6 +569,7 @@ def test_resource_policies_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -4568,4 +4595,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_routers.py b/tests/unit/gapic/compute_v1/test_routers.py index 4962b23ae..64160ca95 100644 --- a/tests/unit/gapic/compute_v1/test_routers.py +++ b/tests/unit/gapic/compute_v1/test_routers.py @@ -213,6 +213,7 @@ def test_routers_client_client_options(client_class, transport_class, transport_ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -230,6 +231,7 @@ def test_routers_client_client_options(client_class, transport_class, transport_ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -247,6 +249,7 @@ def test_routers_client_client_options(client_class, transport_class, transport_ quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -276,6 +279,25 @@ def test_routers_client_client_options(client_class, transport_class, transport_ quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -324,6 +346,7 @@ def test_routers_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -358,6 +381,7 @@ def test_routers_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -380,6 +404,7 @@ def test_routers_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -480,6 +505,7 @@ def test_routers_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -507,6 +533,7 @@ def test_routers_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -2492,6 +2519,7 @@ def test_insert_rest(request_type): "drain_nat_ips": ["drain_nat_ips_value_1", "drain_nat_ips_value_2"], "enable_dynamic_port_allocation": True, "enable_endpoint_independent_mapping": True, + "endpoint_types": ["endpoint_types_value_1", "endpoint_types_value_2"], "icmp_idle_timeout_sec": 2214, "log_config": {"enable": True, "filter": "filter_value"}, "max_ports_per_vm": 1733, @@ -2822,6 +2850,7 @@ def test_insert_rest_bad_request( "drain_nat_ips": ["drain_nat_ips_value_1", "drain_nat_ips_value_2"], "enable_dynamic_port_allocation": True, "enable_endpoint_independent_mapping": True, + "endpoint_types": ["endpoint_types_value_1", "endpoint_types_value_2"], "icmp_idle_timeout_sec": 2214, "log_config": {"enable": True, "filter": "filter_value"}, "max_ports_per_vm": 1733, @@ -3033,6 +3062,7 @@ def test_insert_unary_rest(request_type): "drain_nat_ips": ["drain_nat_ips_value_1", "drain_nat_ips_value_2"], "enable_dynamic_port_allocation": True, "enable_endpoint_independent_mapping": True, + "endpoint_types": ["endpoint_types_value_1", "endpoint_types_value_2"], "icmp_idle_timeout_sec": 2214, "log_config": {"enable": True, "filter": "filter_value"}, "max_ports_per_vm": 1733, @@ -3341,6 +3371,7 @@ def test_insert_unary_rest_bad_request( "drain_nat_ips": ["drain_nat_ips_value_1", "drain_nat_ips_value_2"], "enable_dynamic_port_allocation": True, "enable_endpoint_independent_mapping": True, + "endpoint_types": ["endpoint_types_value_1", "endpoint_types_value_2"], "icmp_idle_timeout_sec": 2214, "log_config": {"enable": True, "filter": "filter_value"}, "max_ports_per_vm": 1733, @@ -3896,6 +3927,7 @@ def test_patch_rest(request_type): "drain_nat_ips": ["drain_nat_ips_value_1", "drain_nat_ips_value_2"], "enable_dynamic_port_allocation": True, "enable_endpoint_independent_mapping": True, + "endpoint_types": ["endpoint_types_value_1", "endpoint_types_value_2"], "icmp_idle_timeout_sec": 2214, "log_config": {"enable": True, "filter": "filter_value"}, "max_ports_per_vm": 1733, @@ -4231,6 +4263,7 @@ def test_patch_rest_bad_request( "drain_nat_ips": ["drain_nat_ips_value_1", "drain_nat_ips_value_2"], "enable_dynamic_port_allocation": True, "enable_endpoint_independent_mapping": True, + "endpoint_types": ["endpoint_types_value_1", "endpoint_types_value_2"], "icmp_idle_timeout_sec": 2214, "log_config": {"enable": True, "filter": "filter_value"}, "max_ports_per_vm": 1733, @@ -4448,6 +4481,7 @@ def test_patch_unary_rest(request_type): "drain_nat_ips": ["drain_nat_ips_value_1", "drain_nat_ips_value_2"], "enable_dynamic_port_allocation": True, "enable_endpoint_independent_mapping": True, + "endpoint_types": ["endpoint_types_value_1", "endpoint_types_value_2"], "icmp_idle_timeout_sec": 2214, "log_config": {"enable": True, "filter": "filter_value"}, "max_ports_per_vm": 1733, @@ -4761,6 +4795,7 @@ def test_patch_unary_rest_bad_request( "drain_nat_ips": ["drain_nat_ips_value_1", "drain_nat_ips_value_2"], "enable_dynamic_port_allocation": True, "enable_endpoint_independent_mapping": True, + "endpoint_types": ["endpoint_types_value_1", "endpoint_types_value_2"], "icmp_idle_timeout_sec": 2214, "log_config": {"enable": True, "filter": "filter_value"}, "max_ports_per_vm": 1733, @@ -4978,6 +5013,7 @@ def test_preview_rest(request_type): "drain_nat_ips": ["drain_nat_ips_value_1", "drain_nat_ips_value_2"], "enable_dynamic_port_allocation": True, "enable_endpoint_independent_mapping": True, + "endpoint_types": ["endpoint_types_value_1", "endpoint_types_value_2"], "icmp_idle_timeout_sec": 2214, "log_config": {"enable": True, "filter": "filter_value"}, "max_ports_per_vm": 1733, @@ -5268,6 +5304,7 @@ def test_preview_rest_bad_request( "drain_nat_ips": ["drain_nat_ips_value_1", "drain_nat_ips_value_2"], "enable_dynamic_port_allocation": True, "enable_endpoint_independent_mapping": True, + "endpoint_types": ["endpoint_types_value_1", "endpoint_types_value_2"], "icmp_idle_timeout_sec": 2214, "log_config": {"enable": True, "filter": "filter_value"}, "max_ports_per_vm": 1733, @@ -5485,6 +5522,7 @@ def test_update_rest(request_type): "drain_nat_ips": ["drain_nat_ips_value_1", "drain_nat_ips_value_2"], "enable_dynamic_port_allocation": True, "enable_endpoint_independent_mapping": True, + "endpoint_types": ["endpoint_types_value_1", "endpoint_types_value_2"], "icmp_idle_timeout_sec": 2214, "log_config": {"enable": True, "filter": "filter_value"}, "max_ports_per_vm": 1733, @@ -5820,6 +5858,7 @@ def test_update_rest_bad_request( "drain_nat_ips": ["drain_nat_ips_value_1", "drain_nat_ips_value_2"], "enable_dynamic_port_allocation": True, "enable_endpoint_independent_mapping": True, + "endpoint_types": ["endpoint_types_value_1", "endpoint_types_value_2"], "icmp_idle_timeout_sec": 2214, "log_config": {"enable": True, "filter": "filter_value"}, "max_ports_per_vm": 1733, @@ -6037,6 +6076,7 @@ def test_update_unary_rest(request_type): "drain_nat_ips": ["drain_nat_ips_value_1", "drain_nat_ips_value_2"], "enable_dynamic_port_allocation": True, "enable_endpoint_independent_mapping": True, + "endpoint_types": ["endpoint_types_value_1", "endpoint_types_value_2"], "icmp_idle_timeout_sec": 2214, "log_config": {"enable": True, "filter": "filter_value"}, "max_ports_per_vm": 1733, @@ -6350,6 +6390,7 @@ def test_update_unary_rest_bad_request( "drain_nat_ips": ["drain_nat_ips_value_1", "drain_nat_ips_value_2"], "enable_dynamic_port_allocation": True, "enable_endpoint_independent_mapping": True, + "endpoint_types": ["endpoint_types_value_1", "endpoint_types_value_2"], "icmp_idle_timeout_sec": 2214, "log_config": {"enable": True, "filter": "filter_value"}, "max_ports_per_vm": 1733, @@ -6962,4 +7003,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_routes.py b/tests/unit/gapic/compute_v1/test_routes.py index 7d81fca2f..4634a3e44 100644 --- a/tests/unit/gapic/compute_v1/test_routes.py +++ b/tests/unit/gapic/compute_v1/test_routes.py @@ -213,6 +213,7 @@ def test_routes_client_client_options(client_class, transport_class, transport_n quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -230,6 +231,7 @@ def test_routes_client_client_options(client_class, transport_class, transport_n quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -247,6 +249,7 @@ def test_routes_client_client_options(client_class, transport_class, transport_n quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -276,6 +279,25 @@ def test_routes_client_client_options(client_class, transport_class, transport_n quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -324,6 +346,7 @@ def test_routes_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -358,6 +381,7 @@ def test_routes_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -380,6 +404,7 @@ def test_routes_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -480,6 +505,7 @@ def test_routes_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -507,6 +533,7 @@ def test_routes_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -2909,4 +2936,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_security_policies.py b/tests/unit/gapic/compute_v1/test_security_policies.py index 077e2c1c7..90299ace4 100644 --- a/tests/unit/gapic/compute_v1/test_security_policies.py +++ b/tests/unit/gapic/compute_v1/test_security_policies.py @@ -230,6 +230,7 @@ def test_security_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -247,6 +248,7 @@ def test_security_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -264,6 +266,7 @@ def test_security_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -293,6 +296,25 @@ def test_security_policies_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -353,6 +375,7 @@ def test_security_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -387,6 +410,7 @@ def test_security_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -409,6 +433,7 @@ def test_security_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -511,6 +536,7 @@ def test_security_policies_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -543,6 +569,7 @@ def test_security_policies_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -696,6 +723,8 @@ def test_add_rule_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() ).add_rule._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set(("validate_only",)) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone @@ -748,7 +777,7 @@ def test_add_rule_rest_unset_required_fields(): unset_fields = transport.add_rule._get_unset_required_fields({}) assert set(unset_fields) == ( - set(()) + set(("validateOnly",)) & set( ( "project", @@ -1075,6 +1104,8 @@ def test_add_rule_unary_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() ).add_rule._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set(("validate_only",)) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone @@ -1127,7 +1158,7 @@ def test_add_rule_unary_rest_unset_required_fields(): unset_fields = transport.add_rule._get_unset_required_fields({}) assert set(unset_fields) == ( - set(()) + set(("validateOnly",)) & set( ( "project", @@ -3030,7 +3061,12 @@ def test_insert_rest_required_fields(request_type=compute.InsertSecurityPolicyRe credentials=ga_credentials.AnonymousCredentials() ).insert._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. - assert not set(unset_fields) - set(("request_id",)) + assert not set(unset_fields) - set( + ( + "request_id", + "validate_only", + ) + ) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone @@ -3081,7 +3117,12 @@ def test_insert_rest_unset_required_fields(): unset_fields = transport.insert._get_unset_required_fields({}) assert set(unset_fields) == ( - set(("requestId",)) + set( + ( + "requestId", + "validateOnly", + ) + ) & set( ( "project", @@ -3468,7 +3509,12 @@ def test_insert_unary_rest_required_fields( credentials=ga_credentials.AnonymousCredentials() ).insert._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. - assert not set(unset_fields) - set(("request_id",)) + assert not set(unset_fields) - set( + ( + "request_id", + "validate_only", + ) + ) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone @@ -3519,7 +3565,12 @@ def test_insert_unary_rest_unset_required_fields(): unset_fields = transport.insert._get_unset_required_fields({}) assert set(unset_fields) == ( - set(("requestId",)) + set( + ( + "requestId", + "validateOnly", + ) + ) & set( ( "project", @@ -5447,7 +5498,12 @@ def test_patch_rule_rest_required_fields( credentials=ga_credentials.AnonymousCredentials() ).patch_rule._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. - assert not set(unset_fields) - set(("priority",)) + assert not set(unset_fields) - set( + ( + "priority", + "validate_only", + ) + ) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone @@ -5500,7 +5556,12 @@ def test_patch_rule_rest_unset_required_fields(): unset_fields = transport.patch_rule._get_unset_required_fields({}) assert set(unset_fields) == ( - set(("priority",)) + set( + ( + "priority", + "validateOnly", + ) + ) & set( ( "project", @@ -5828,7 +5889,12 @@ def test_patch_rule_unary_rest_required_fields( credentials=ga_credentials.AnonymousCredentials() ).patch_rule._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. - assert not set(unset_fields) - set(("priority",)) + assert not set(unset_fields) - set( + ( + "priority", + "validate_only", + ) + ) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone @@ -5881,7 +5947,12 @@ def test_patch_rule_unary_rest_unset_required_fields(): unset_fields = transport.patch_rule._get_unset_required_fields({}) assert set(unset_fields) == ( - set(("priority",)) + set( + ( + "priority", + "validateOnly", + ) + ) & set( ( "project", @@ -7162,4 +7233,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_service_attachments.py b/tests/unit/gapic/compute_v1/test_service_attachments.py index 1ee68abf7..8437edac4 100644 --- a/tests/unit/gapic/compute_v1/test_service_attachments.py +++ b/tests/unit/gapic/compute_v1/test_service_attachments.py @@ -232,6 +232,7 @@ def test_service_attachments_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -249,6 +250,7 @@ def test_service_attachments_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -266,6 +268,7 @@ def test_service_attachments_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -295,6 +298,25 @@ def test_service_attachments_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -355,6 +377,7 @@ def test_service_attachments_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -389,6 +412,7 @@ def test_service_attachments_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -411,6 +435,7 @@ def test_service_attachments_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -513,6 +538,7 @@ def test_service_attachments_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -545,6 +571,7 @@ def test_service_attachments_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -5273,4 +5300,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_snapshots.py b/tests/unit/gapic/compute_v1/test_snapshots.py index c6aa1e277..45883952b 100644 --- a/tests/unit/gapic/compute_v1/test_snapshots.py +++ b/tests/unit/gapic/compute_v1/test_snapshots.py @@ -216,6 +216,7 @@ def test_snapshots_client_client_options(client_class, transport_class, transpor quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -233,6 +234,7 @@ def test_snapshots_client_client_options(client_class, transport_class, transpor quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -250,6 +252,7 @@ def test_snapshots_client_client_options(client_class, transport_class, transpor quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -279,6 +282,25 @@ def test_snapshots_client_client_options(client_class, transport_class, transpor quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -327,6 +349,7 @@ def test_snapshots_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -361,6 +384,7 @@ def test_snapshots_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -383,6 +407,7 @@ def test_snapshots_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -483,6 +508,7 @@ def test_snapshots_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -510,6 +536,7 @@ def test_snapshots_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -4546,4 +4573,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_ssl_certificates.py b/tests/unit/gapic/compute_v1/test_ssl_certificates.py index ad54e8ced..7bee720ea 100644 --- a/tests/unit/gapic/compute_v1/test_ssl_certificates.py +++ b/tests/unit/gapic/compute_v1/test_ssl_certificates.py @@ -229,6 +229,7 @@ def test_ssl_certificates_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -246,6 +247,7 @@ def test_ssl_certificates_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -263,6 +265,7 @@ def test_ssl_certificates_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -292,6 +295,25 @@ def test_ssl_certificates_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -352,6 +374,7 @@ def test_ssl_certificates_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -386,6 +409,7 @@ def test_ssl_certificates_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -408,6 +432,7 @@ def test_ssl_certificates_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -510,6 +535,7 @@ def test_ssl_certificates_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -537,6 +563,7 @@ def test_ssl_certificates_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3291,4 +3318,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_ssl_policies.py b/tests/unit/gapic/compute_v1/test_ssl_policies.py index 4bde31f9c..4306090c9 100644 --- a/tests/unit/gapic/compute_v1/test_ssl_policies.py +++ b/tests/unit/gapic/compute_v1/test_ssl_policies.py @@ -220,6 +220,7 @@ def test_ssl_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -237,6 +238,7 @@ def test_ssl_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -254,6 +256,7 @@ def test_ssl_policies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -283,6 +286,25 @@ def test_ssl_policies_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -331,6 +353,7 @@ def test_ssl_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -365,6 +388,7 @@ def test_ssl_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -387,6 +411,7 @@ def test_ssl_policies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -487,6 +512,7 @@ def test_ssl_policies_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -514,6 +540,7 @@ def test_ssl_policies_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3864,4 +3891,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_subnetworks.py b/tests/unit/gapic/compute_v1/test_subnetworks.py index c8f895ec3..644a7d35a 100644 --- a/tests/unit/gapic/compute_v1/test_subnetworks.py +++ b/tests/unit/gapic/compute_v1/test_subnetworks.py @@ -220,6 +220,7 @@ def test_subnetworks_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -237,6 +238,7 @@ def test_subnetworks_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -254,6 +256,7 @@ def test_subnetworks_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -283,6 +286,25 @@ def test_subnetworks_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -331,6 +353,7 @@ def test_subnetworks_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -365,6 +388,7 @@ def test_subnetworks_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -387,6 +411,7 @@ def test_subnetworks_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -487,6 +512,7 @@ def test_subnetworks_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -514,6 +540,7 @@ def test_subnetworks_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -6889,4 +6916,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_target_grpc_proxies.py b/tests/unit/gapic/compute_v1/test_target_grpc_proxies.py index 6f0ddff86..9b7b98b6d 100644 --- a/tests/unit/gapic/compute_v1/test_target_grpc_proxies.py +++ b/tests/unit/gapic/compute_v1/test_target_grpc_proxies.py @@ -230,6 +230,7 @@ def test_target_grpc_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -247,6 +248,7 @@ def test_target_grpc_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -264,6 +266,7 @@ def test_target_grpc_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -293,6 +296,25 @@ def test_target_grpc_proxies_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -353,6 +375,7 @@ def test_target_grpc_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -387,6 +410,7 @@ def test_target_grpc_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -409,6 +433,7 @@ def test_target_grpc_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -511,6 +536,7 @@ def test_target_grpc_proxies_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -543,6 +569,7 @@ def test_target_grpc_proxies_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3544,4 +3571,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_target_http_proxies.py b/tests/unit/gapic/compute_v1/test_target_http_proxies.py index 44df0bd23..3f7f03a20 100644 --- a/tests/unit/gapic/compute_v1/test_target_http_proxies.py +++ b/tests/unit/gapic/compute_v1/test_target_http_proxies.py @@ -230,6 +230,7 @@ def test_target_http_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -247,6 +248,7 @@ def test_target_http_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -264,6 +266,7 @@ def test_target_http_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -293,6 +296,25 @@ def test_target_http_proxies_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -353,6 +375,7 @@ def test_target_http_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -387,6 +410,7 @@ def test_target_http_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -409,6 +433,7 @@ def test_target_http_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -511,6 +536,7 @@ def test_target_http_proxies_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -543,6 +569,7 @@ def test_target_http_proxies_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -4527,4 +4554,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_target_https_proxies.py b/tests/unit/gapic/compute_v1/test_target_https_proxies.py index 15fbc8b38..bad576f00 100644 --- a/tests/unit/gapic/compute_v1/test_target_https_proxies.py +++ b/tests/unit/gapic/compute_v1/test_target_https_proxies.py @@ -232,6 +232,7 @@ def test_target_https_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -249,6 +250,7 @@ def test_target_https_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -266,6 +268,7 @@ def test_target_https_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -295,6 +298,25 @@ def test_target_https_proxies_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -355,6 +377,7 @@ def test_target_https_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -389,6 +412,7 @@ def test_target_https_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -411,6 +435,7 @@ def test_target_https_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -513,6 +538,7 @@ def test_target_https_proxies_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -545,6 +571,7 @@ def test_target_https_proxies_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -1534,6 +1561,7 @@ def test_get_rest(request_type): # Designate an appropriate value for the returned response. return_value = compute.TargetHttpsProxy( authorization_policy="authorization_policy_value", + certificate_map="certificate_map_value", creation_timestamp="creation_timestamp_value", description="description_value", fingerprint="fingerprint_value", @@ -1561,6 +1589,7 @@ def test_get_rest(request_type): # Establish that the response is the type that we expect. assert isinstance(response, compute.TargetHttpsProxy) assert response.authorization_policy == "authorization_policy_value" + assert response.certificate_map == "certificate_map_value" assert response.creation_timestamp == "creation_timestamp_value" assert response.description == "description_value" assert response.fingerprint == "fingerprint_value" @@ -1826,6 +1855,7 @@ def test_insert_rest(request_type): request_init = {"project": "sample1"} request_init["target_https_proxy_resource"] = { "authorization_policy": "authorization_policy_value", + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "fingerprint": "fingerprint_value", @@ -2060,6 +2090,7 @@ def test_insert_rest_bad_request( request_init = {"project": "sample1"} request_init["target_https_proxy_resource"] = { "authorization_policy": "authorization_policy_value", + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "fingerprint": "fingerprint_value", @@ -2174,6 +2205,7 @@ def test_insert_unary_rest(request_type): request_init = {"project": "sample1"} request_init["target_https_proxy_resource"] = { "authorization_policy": "authorization_policy_value", + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "fingerprint": "fingerprint_value", @@ -2386,6 +2418,7 @@ def test_insert_unary_rest_bad_request( request_init = {"project": "sample1"} request_init["target_https_proxy_resource"] = { "authorization_policy": "authorization_policy_value", + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "fingerprint": "fingerprint_value", @@ -2837,6 +2870,7 @@ def test_patch_rest(request_type): request_init = {"project": "sample1", "target_https_proxy": "sample2"} request_init["target_https_proxy_resource"] = { "authorization_policy": "authorization_policy_value", + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "fingerprint": "fingerprint_value", @@ -3074,6 +3108,7 @@ def test_patch_rest_bad_request( request_init = {"project": "sample1", "target_https_proxy": "sample2"} request_init["target_https_proxy_resource"] = { "authorization_policy": "authorization_policy_value", + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "fingerprint": "fingerprint_value", @@ -3190,6 +3225,7 @@ def test_patch_unary_rest(request_type): request_init = {"project": "sample1", "target_https_proxy": "sample2"} request_init["target_https_proxy_resource"] = { "authorization_policy": "authorization_policy_value", + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "fingerprint": "fingerprint_value", @@ -3407,6 +3443,7 @@ def test_patch_unary_rest_bad_request( request_init = {"project": "sample1", "target_https_proxy": "sample2"} request_init["target_https_proxy_resource"] = { "authorization_policy": "authorization_policy_value", + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "fingerprint": "fingerprint_value", @@ -3509,11 +3546,11 @@ def test_patch_unary_rest_error(): @pytest.mark.parametrize( "request_type", [ - compute.SetQuicOverrideTargetHttpsProxyRequest, + compute.SetCertificateMapTargetHttpsProxyRequest, dict, ], ) -def test_set_quic_override_rest(request_type): +def test_set_certificate_map_rest(request_type): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", @@ -3521,8 +3558,8 @@ def test_set_quic_override_rest(request_type): # send a request that will satisfy transcoding request_init = {"project": "sample1", "target_https_proxy": "sample2"} - request_init["target_https_proxies_set_quic_override_request_resource"] = { - "quic_override": "quic_override_value" + request_init["target_https_proxies_set_certificate_map_request_resource"] = { + "certificate_map": "certificate_map_value" } request = request_type(request_init) @@ -3560,7 +3597,7 @@ def test_set_quic_override_rest(request_type): json_return_value = compute.Operation.to_json(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_quic_override(request) + response = client.set_certificate_map(request) # Establish that the response is the type that we expect. assert isinstance(response, extended_operation.ExtendedOperation) @@ -3588,8 +3625,8 @@ def test_set_quic_override_rest(request_type): assert response.zone == "zone_value" -def test_set_quic_override_rest_required_fields( - request_type=compute.SetQuicOverrideTargetHttpsProxyRequest, +def test_set_certificate_map_rest_required_fields( + request_type=compute.SetCertificateMapTargetHttpsProxyRequest, ): transport_class = transports.TargetHttpsProxiesRestTransport @@ -3607,7 +3644,7 @@ def test_set_quic_override_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_quic_override._get_unset_required_fields(jsonified_request) + ).set_certificate_map._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present @@ -3617,7 +3654,7 @@ def test_set_quic_override_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_quic_override._get_unset_required_fields(jsonified_request) + ).set_certificate_map._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("request_id",)) jsonified_request.update(unset_fields) @@ -3658,25 +3695,25 @@ def test_set_quic_override_rest_required_fields( response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_quic_override(request) + response = client.set_certificate_map(request) expected_params = [] actual_params = req.call_args.kwargs["params"] assert expected_params == actual_params -def test_set_quic_override_rest_unset_required_fields(): +def test_set_certificate_map_rest_unset_required_fields(): transport = transports.TargetHttpsProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials ) - unset_fields = transport.set_quic_override._get_unset_required_fields({}) + unset_fields = transport.set_certificate_map._get_unset_required_fields({}) assert set(unset_fields) == ( set(("requestId",)) & set( ( "project", - "targetHttpsProxiesSetQuicOverrideRequestResource", + "targetHttpsProxiesSetCertificateMapRequestResource", "targetHttpsProxy", ) ) @@ -3684,7 +3721,7 @@ def test_set_quic_override_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_set_quic_override_rest_interceptors(null_interceptor): +def test_set_certificate_map_rest_interceptors(null_interceptor): transport = transports.TargetHttpsProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=None @@ -3697,9 +3734,9 @@ def test_set_quic_override_rest_interceptors(null_interceptor): ) as req, mock.patch.object( path_template, "transcode" ) as transcode, mock.patch.object( - transports.TargetHttpsProxiesRestInterceptor, "post_set_quic_override" + transports.TargetHttpsProxiesRestInterceptor, "post_set_certificate_map" ) as post, mock.patch.object( - transports.TargetHttpsProxiesRestInterceptor, "pre_set_quic_override" + transports.TargetHttpsProxiesRestInterceptor, "pre_set_certificate_map" ) as pre: pre.assert_not_called() post.assert_not_called() @@ -3716,7 +3753,7 @@ def test_set_quic_override_rest_interceptors(null_interceptor): req.return_value.request = PreparedRequest() req.return_value._content = compute.Operation.to_json(compute.Operation()) - request = compute.SetQuicOverrideTargetHttpsProxyRequest() + request = compute.SetCertificateMapTargetHttpsProxyRequest() metadata = [ ("key", "val"), ("cephalopod", "squid"), @@ -3724,7 +3761,7 @@ def test_set_quic_override_rest_interceptors(null_interceptor): pre.return_value = request, metadata post.return_value = compute.Operation - client.set_quic_override( + client.set_certificate_map( request, metadata=[ ("key", "val"), @@ -3736,8 +3773,9 @@ def test_set_quic_override_rest_interceptors(null_interceptor): post.assert_called_once() -def test_set_quic_override_rest_bad_request( - transport: str = "rest", request_type=compute.SetQuicOverrideTargetHttpsProxyRequest +def test_set_certificate_map_rest_bad_request( + transport: str = "rest", + request_type=compute.SetCertificateMapTargetHttpsProxyRequest, ): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), @@ -3746,8 +3784,8 @@ def test_set_quic_override_rest_bad_request( # send a request that will satisfy transcoding request_init = {"project": "sample1", "target_https_proxy": "sample2"} - request_init["target_https_proxies_set_quic_override_request_resource"] = { - "quic_override": "quic_override_value" + request_init["target_https_proxies_set_certificate_map_request_resource"] = { + "certificate_map": "certificate_map_value" } request = request_type(request_init) @@ -3760,10 +3798,10 @@ def test_set_quic_override_rest_bad_request( response_value.status_code = 400 response_value.request = Request() req.return_value = response_value - client.set_quic_override(request) + client.set_certificate_map(request) -def test_set_quic_override_rest_flattened(): +def test_set_certificate_map_rest_flattened(): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", @@ -3781,8 +3819,8 @@ def test_set_quic_override_rest_flattened(): mock_args = dict( project="project_value", target_https_proxy="target_https_proxy_value", - target_https_proxies_set_quic_override_request_resource=compute.TargetHttpsProxiesSetQuicOverrideRequest( - quic_override="quic_override_value" + target_https_proxies_set_certificate_map_request_resource=compute.TargetHttpsProxiesSetCertificateMapRequest( + certificate_map="certificate_map_value" ), ) mock_args.update(sample_request) @@ -3795,20 +3833,20 @@ def test_set_quic_override_rest_flattened(): response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - client.set_quic_override(**mock_args) + client.set_certificate_map(**mock_args) # Establish that the underlying call was made with the expected # request object values. assert len(req.mock_calls) == 1 _, args, _ = req.mock_calls[0] assert path_template.validate( - "%s/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}/setQuicOverride" + "%s/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}/setCertificateMap" % client.transport._host, args[1], ) -def test_set_quic_override_rest_flattened_error(transport: str = "rest"): +def test_set_certificate_map_rest_flattened_error(transport: str = "rest"): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3817,17 +3855,17 @@ def test_set_quic_override_rest_flattened_error(transport: str = "rest"): # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - client.set_quic_override( - compute.SetQuicOverrideTargetHttpsProxyRequest(), + client.set_certificate_map( + compute.SetCertificateMapTargetHttpsProxyRequest(), project="project_value", target_https_proxy="target_https_proxy_value", - target_https_proxies_set_quic_override_request_resource=compute.TargetHttpsProxiesSetQuicOverrideRequest( - quic_override="quic_override_value" + target_https_proxies_set_certificate_map_request_resource=compute.TargetHttpsProxiesSetCertificateMapRequest( + certificate_map="certificate_map_value" ), ) -def test_set_quic_override_rest_error(): +def test_set_certificate_map_rest_error(): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3836,11 +3874,11 @@ def test_set_quic_override_rest_error(): @pytest.mark.parametrize( "request_type", [ - compute.SetQuicOverrideTargetHttpsProxyRequest, + compute.SetCertificateMapTargetHttpsProxyRequest, dict, ], ) -def test_set_quic_override_unary_rest(request_type): +def test_set_certificate_map_unary_rest(request_type): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", @@ -3848,8 +3886,8 @@ def test_set_quic_override_unary_rest(request_type): # send a request that will satisfy transcoding request_init = {"project": "sample1", "target_https_proxy": "sample2"} - request_init["target_https_proxies_set_quic_override_request_resource"] = { - "quic_override": "quic_override_value" + request_init["target_https_proxies_set_certificate_map_request_resource"] = { + "certificate_map": "certificate_map_value" } request = request_type(request_init) @@ -3887,14 +3925,14 @@ def test_set_quic_override_unary_rest(request_type): json_return_value = compute.Operation.to_json(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_quic_override_unary(request) + response = client.set_certificate_map_unary(request) # Establish that the response is the type that we expect. assert isinstance(response, compute.Operation) -def test_set_quic_override_unary_rest_required_fields( - request_type=compute.SetQuicOverrideTargetHttpsProxyRequest, +def test_set_certificate_map_unary_rest_required_fields( + request_type=compute.SetCertificateMapTargetHttpsProxyRequest, ): transport_class = transports.TargetHttpsProxiesRestTransport @@ -3912,7 +3950,7 @@ def test_set_quic_override_unary_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_quic_override._get_unset_required_fields(jsonified_request) + ).set_certificate_map._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present @@ -3922,7 +3960,7 @@ def test_set_quic_override_unary_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_quic_override._get_unset_required_fields(jsonified_request) + ).set_certificate_map._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("request_id",)) jsonified_request.update(unset_fields) @@ -3963,25 +4001,25 @@ def test_set_quic_override_unary_rest_required_fields( response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_quic_override_unary(request) + response = client.set_certificate_map_unary(request) expected_params = [] actual_params = req.call_args.kwargs["params"] assert expected_params == actual_params -def test_set_quic_override_unary_rest_unset_required_fields(): +def test_set_certificate_map_unary_rest_unset_required_fields(): transport = transports.TargetHttpsProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials ) - unset_fields = transport.set_quic_override._get_unset_required_fields({}) + unset_fields = transport.set_certificate_map._get_unset_required_fields({}) assert set(unset_fields) == ( set(("requestId",)) & set( ( "project", - "targetHttpsProxiesSetQuicOverrideRequestResource", + "targetHttpsProxiesSetCertificateMapRequestResource", "targetHttpsProxy", ) ) @@ -3989,7 +4027,7 @@ def test_set_quic_override_unary_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_set_quic_override_unary_rest_interceptors(null_interceptor): +def test_set_certificate_map_unary_rest_interceptors(null_interceptor): transport = transports.TargetHttpsProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=None @@ -4002,9 +4040,9 @@ def test_set_quic_override_unary_rest_interceptors(null_interceptor): ) as req, mock.patch.object( path_template, "transcode" ) as transcode, mock.patch.object( - transports.TargetHttpsProxiesRestInterceptor, "post_set_quic_override" + transports.TargetHttpsProxiesRestInterceptor, "post_set_certificate_map" ) as post, mock.patch.object( - transports.TargetHttpsProxiesRestInterceptor, "pre_set_quic_override" + transports.TargetHttpsProxiesRestInterceptor, "pre_set_certificate_map" ) as pre: pre.assert_not_called() post.assert_not_called() @@ -4021,7 +4059,7 @@ def test_set_quic_override_unary_rest_interceptors(null_interceptor): req.return_value.request = PreparedRequest() req.return_value._content = compute.Operation.to_json(compute.Operation()) - request = compute.SetQuicOverrideTargetHttpsProxyRequest() + request = compute.SetCertificateMapTargetHttpsProxyRequest() metadata = [ ("key", "val"), ("cephalopod", "squid"), @@ -4029,7 +4067,7 @@ def test_set_quic_override_unary_rest_interceptors(null_interceptor): pre.return_value = request, metadata post.return_value = compute.Operation - client.set_quic_override_unary( + client.set_certificate_map_unary( request, metadata=[ ("key", "val"), @@ -4041,8 +4079,9 @@ def test_set_quic_override_unary_rest_interceptors(null_interceptor): post.assert_called_once() -def test_set_quic_override_unary_rest_bad_request( - transport: str = "rest", request_type=compute.SetQuicOverrideTargetHttpsProxyRequest +def test_set_certificate_map_unary_rest_bad_request( + transport: str = "rest", + request_type=compute.SetCertificateMapTargetHttpsProxyRequest, ): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), @@ -4051,8 +4090,8 @@ def test_set_quic_override_unary_rest_bad_request( # send a request that will satisfy transcoding request_init = {"project": "sample1", "target_https_proxy": "sample2"} - request_init["target_https_proxies_set_quic_override_request_resource"] = { - "quic_override": "quic_override_value" + request_init["target_https_proxies_set_certificate_map_request_resource"] = { + "certificate_map": "certificate_map_value" } request = request_type(request_init) @@ -4065,10 +4104,10 @@ def test_set_quic_override_unary_rest_bad_request( response_value.status_code = 400 response_value.request = Request() req.return_value = response_value - client.set_quic_override_unary(request) + client.set_certificate_map_unary(request) -def test_set_quic_override_unary_rest_flattened(): +def test_set_certificate_map_unary_rest_flattened(): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", @@ -4086,8 +4125,8 @@ def test_set_quic_override_unary_rest_flattened(): mock_args = dict( project="project_value", target_https_proxy="target_https_proxy_value", - target_https_proxies_set_quic_override_request_resource=compute.TargetHttpsProxiesSetQuicOverrideRequest( - quic_override="quic_override_value" + target_https_proxies_set_certificate_map_request_resource=compute.TargetHttpsProxiesSetCertificateMapRequest( + certificate_map="certificate_map_value" ), ) mock_args.update(sample_request) @@ -4100,20 +4139,20 @@ def test_set_quic_override_unary_rest_flattened(): response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - client.set_quic_override_unary(**mock_args) + client.set_certificate_map_unary(**mock_args) # Establish that the underlying call was made with the expected # request object values. assert len(req.mock_calls) == 1 _, args, _ = req.mock_calls[0] assert path_template.validate( - "%s/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}/setQuicOverride" + "%s/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}/setCertificateMap" % client.transport._host, args[1], ) -def test_set_quic_override_unary_rest_flattened_error(transport: str = "rest"): +def test_set_certificate_map_unary_rest_flattened_error(transport: str = "rest"): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4122,17 +4161,17 @@ def test_set_quic_override_unary_rest_flattened_error(transport: str = "rest"): # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - client.set_quic_override_unary( - compute.SetQuicOverrideTargetHttpsProxyRequest(), + client.set_certificate_map_unary( + compute.SetCertificateMapTargetHttpsProxyRequest(), project="project_value", target_https_proxy="target_https_proxy_value", - target_https_proxies_set_quic_override_request_resource=compute.TargetHttpsProxiesSetQuicOverrideRequest( - quic_override="quic_override_value" + target_https_proxies_set_certificate_map_request_resource=compute.TargetHttpsProxiesSetCertificateMapRequest( + certificate_map="certificate_map_value" ), ) -def test_set_quic_override_unary_rest_error(): +def test_set_certificate_map_unary_rest_error(): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4141,11 +4180,11 @@ def test_set_quic_override_unary_rest_error(): @pytest.mark.parametrize( "request_type", [ - compute.SetSslCertificatesTargetHttpsProxyRequest, + compute.SetQuicOverrideTargetHttpsProxyRequest, dict, ], ) -def test_set_ssl_certificates_rest(request_type): +def test_set_quic_override_rest(request_type): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", @@ -4153,8 +4192,8 @@ def test_set_ssl_certificates_rest(request_type): # send a request that will satisfy transcoding request_init = {"project": "sample1", "target_https_proxy": "sample2"} - request_init["target_https_proxies_set_ssl_certificates_request_resource"] = { - "ssl_certificates": ["ssl_certificates_value_1", "ssl_certificates_value_2"] + request_init["target_https_proxies_set_quic_override_request_resource"] = { + "quic_override": "quic_override_value" } request = request_type(request_init) @@ -4192,7 +4231,7 @@ def test_set_ssl_certificates_rest(request_type): json_return_value = compute.Operation.to_json(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_ssl_certificates(request) + response = client.set_quic_override(request) # Establish that the response is the type that we expect. assert isinstance(response, extended_operation.ExtendedOperation) @@ -4220,8 +4259,8 @@ def test_set_ssl_certificates_rest(request_type): assert response.zone == "zone_value" -def test_set_ssl_certificates_rest_required_fields( - request_type=compute.SetSslCertificatesTargetHttpsProxyRequest, +def test_set_quic_override_rest_required_fields( + request_type=compute.SetQuicOverrideTargetHttpsProxyRequest, ): transport_class = transports.TargetHttpsProxiesRestTransport @@ -4239,7 +4278,7 @@ def test_set_ssl_certificates_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_ssl_certificates._get_unset_required_fields(jsonified_request) + ).set_quic_override._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present @@ -4249,7 +4288,7 @@ def test_set_ssl_certificates_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_ssl_certificates._get_unset_required_fields(jsonified_request) + ).set_quic_override._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("request_id",)) jsonified_request.update(unset_fields) @@ -4290,25 +4329,25 @@ def test_set_ssl_certificates_rest_required_fields( response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_ssl_certificates(request) + response = client.set_quic_override(request) expected_params = [] actual_params = req.call_args.kwargs["params"] assert expected_params == actual_params -def test_set_ssl_certificates_rest_unset_required_fields(): +def test_set_quic_override_rest_unset_required_fields(): transport = transports.TargetHttpsProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials ) - unset_fields = transport.set_ssl_certificates._get_unset_required_fields({}) + unset_fields = transport.set_quic_override._get_unset_required_fields({}) assert set(unset_fields) == ( set(("requestId",)) & set( ( "project", - "targetHttpsProxiesSetSslCertificatesRequestResource", + "targetHttpsProxiesSetQuicOverrideRequestResource", "targetHttpsProxy", ) ) @@ -4316,7 +4355,7 @@ def test_set_ssl_certificates_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_set_ssl_certificates_rest_interceptors(null_interceptor): +def test_set_quic_override_rest_interceptors(null_interceptor): transport = transports.TargetHttpsProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=None @@ -4329,9 +4368,9 @@ def test_set_ssl_certificates_rest_interceptors(null_interceptor): ) as req, mock.patch.object( path_template, "transcode" ) as transcode, mock.patch.object( - transports.TargetHttpsProxiesRestInterceptor, "post_set_ssl_certificates" + transports.TargetHttpsProxiesRestInterceptor, "post_set_quic_override" ) as post, mock.patch.object( - transports.TargetHttpsProxiesRestInterceptor, "pre_set_ssl_certificates" + transports.TargetHttpsProxiesRestInterceptor, "pre_set_quic_override" ) as pre: pre.assert_not_called() post.assert_not_called() @@ -4348,7 +4387,7 @@ def test_set_ssl_certificates_rest_interceptors(null_interceptor): req.return_value.request = PreparedRequest() req.return_value._content = compute.Operation.to_json(compute.Operation()) - request = compute.SetSslCertificatesTargetHttpsProxyRequest() + request = compute.SetQuicOverrideTargetHttpsProxyRequest() metadata = [ ("key", "val"), ("cephalopod", "squid"), @@ -4356,7 +4395,7 @@ def test_set_ssl_certificates_rest_interceptors(null_interceptor): pre.return_value = request, metadata post.return_value = compute.Operation - client.set_ssl_certificates( + client.set_quic_override( request, metadata=[ ("key", "val"), @@ -4368,9 +4407,8 @@ def test_set_ssl_certificates_rest_interceptors(null_interceptor): post.assert_called_once() -def test_set_ssl_certificates_rest_bad_request( - transport: str = "rest", - request_type=compute.SetSslCertificatesTargetHttpsProxyRequest, +def test_set_quic_override_rest_bad_request( + transport: str = "rest", request_type=compute.SetQuicOverrideTargetHttpsProxyRequest ): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), @@ -4379,8 +4417,8 @@ def test_set_ssl_certificates_rest_bad_request( # send a request that will satisfy transcoding request_init = {"project": "sample1", "target_https_proxy": "sample2"} - request_init["target_https_proxies_set_ssl_certificates_request_resource"] = { - "ssl_certificates": ["ssl_certificates_value_1", "ssl_certificates_value_2"] + request_init["target_https_proxies_set_quic_override_request_resource"] = { + "quic_override": "quic_override_value" } request = request_type(request_init) @@ -4393,10 +4431,10 @@ def test_set_ssl_certificates_rest_bad_request( response_value.status_code = 400 response_value.request = Request() req.return_value = response_value - client.set_ssl_certificates(request) + client.set_quic_override(request) -def test_set_ssl_certificates_rest_flattened(): +def test_set_quic_override_rest_flattened(): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", @@ -4414,8 +4452,8 @@ def test_set_ssl_certificates_rest_flattened(): mock_args = dict( project="project_value", target_https_proxy="target_https_proxy_value", - target_https_proxies_set_ssl_certificates_request_resource=compute.TargetHttpsProxiesSetSslCertificatesRequest( - ssl_certificates=["ssl_certificates_value"] + target_https_proxies_set_quic_override_request_resource=compute.TargetHttpsProxiesSetQuicOverrideRequest( + quic_override="quic_override_value" ), ) mock_args.update(sample_request) @@ -4428,20 +4466,20 @@ def test_set_ssl_certificates_rest_flattened(): response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - client.set_ssl_certificates(**mock_args) + client.set_quic_override(**mock_args) # Establish that the underlying call was made with the expected # request object values. assert len(req.mock_calls) == 1 _, args, _ = req.mock_calls[0] assert path_template.validate( - "%s/compute/v1/projects/{project}/targetHttpsProxies/{target_https_proxy}/setSslCertificates" + "%s/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}/setQuicOverride" % client.transport._host, args[1], ) -def test_set_ssl_certificates_rest_flattened_error(transport: str = "rest"): +def test_set_quic_override_rest_flattened_error(transport: str = "rest"): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4450,17 +4488,17 @@ def test_set_ssl_certificates_rest_flattened_error(transport: str = "rest"): # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - client.set_ssl_certificates( - compute.SetSslCertificatesTargetHttpsProxyRequest(), + client.set_quic_override( + compute.SetQuicOverrideTargetHttpsProxyRequest(), project="project_value", target_https_proxy="target_https_proxy_value", - target_https_proxies_set_ssl_certificates_request_resource=compute.TargetHttpsProxiesSetSslCertificatesRequest( - ssl_certificates=["ssl_certificates_value"] + target_https_proxies_set_quic_override_request_resource=compute.TargetHttpsProxiesSetQuicOverrideRequest( + quic_override="quic_override_value" ), ) -def test_set_ssl_certificates_rest_error(): +def test_set_quic_override_rest_error(): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4469,11 +4507,11 @@ def test_set_ssl_certificates_rest_error(): @pytest.mark.parametrize( "request_type", [ - compute.SetSslCertificatesTargetHttpsProxyRequest, + compute.SetQuicOverrideTargetHttpsProxyRequest, dict, ], ) -def test_set_ssl_certificates_unary_rest(request_type): +def test_set_quic_override_unary_rest(request_type): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", @@ -4481,8 +4519,8 @@ def test_set_ssl_certificates_unary_rest(request_type): # send a request that will satisfy transcoding request_init = {"project": "sample1", "target_https_proxy": "sample2"} - request_init["target_https_proxies_set_ssl_certificates_request_resource"] = { - "ssl_certificates": ["ssl_certificates_value_1", "ssl_certificates_value_2"] + request_init["target_https_proxies_set_quic_override_request_resource"] = { + "quic_override": "quic_override_value" } request = request_type(request_init) @@ -4520,14 +4558,14 @@ def test_set_ssl_certificates_unary_rest(request_type): json_return_value = compute.Operation.to_json(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_ssl_certificates_unary(request) + response = client.set_quic_override_unary(request) # Establish that the response is the type that we expect. assert isinstance(response, compute.Operation) -def test_set_ssl_certificates_unary_rest_required_fields( - request_type=compute.SetSslCertificatesTargetHttpsProxyRequest, +def test_set_quic_override_unary_rest_required_fields( + request_type=compute.SetQuicOverrideTargetHttpsProxyRequest, ): transport_class = transports.TargetHttpsProxiesRestTransport @@ -4545,7 +4583,7 @@ def test_set_ssl_certificates_unary_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_ssl_certificates._get_unset_required_fields(jsonified_request) + ).set_quic_override._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present @@ -4555,7 +4593,7 @@ def test_set_ssl_certificates_unary_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_ssl_certificates._get_unset_required_fields(jsonified_request) + ).set_quic_override._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("request_id",)) jsonified_request.update(unset_fields) @@ -4596,25 +4634,25 @@ def test_set_ssl_certificates_unary_rest_required_fields( response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_ssl_certificates_unary(request) + response = client.set_quic_override_unary(request) expected_params = [] actual_params = req.call_args.kwargs["params"] assert expected_params == actual_params -def test_set_ssl_certificates_unary_rest_unset_required_fields(): +def test_set_quic_override_unary_rest_unset_required_fields(): transport = transports.TargetHttpsProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials ) - unset_fields = transport.set_ssl_certificates._get_unset_required_fields({}) + unset_fields = transport.set_quic_override._get_unset_required_fields({}) assert set(unset_fields) == ( set(("requestId",)) & set( ( "project", - "targetHttpsProxiesSetSslCertificatesRequestResource", + "targetHttpsProxiesSetQuicOverrideRequestResource", "targetHttpsProxy", ) ) @@ -4622,7 +4660,7 @@ def test_set_ssl_certificates_unary_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_set_ssl_certificates_unary_rest_interceptors(null_interceptor): +def test_set_quic_override_unary_rest_interceptors(null_interceptor): transport = transports.TargetHttpsProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=None @@ -4635,9 +4673,9 @@ def test_set_ssl_certificates_unary_rest_interceptors(null_interceptor): ) as req, mock.patch.object( path_template, "transcode" ) as transcode, mock.patch.object( - transports.TargetHttpsProxiesRestInterceptor, "post_set_ssl_certificates" + transports.TargetHttpsProxiesRestInterceptor, "post_set_quic_override" ) as post, mock.patch.object( - transports.TargetHttpsProxiesRestInterceptor, "pre_set_ssl_certificates" + transports.TargetHttpsProxiesRestInterceptor, "pre_set_quic_override" ) as pre: pre.assert_not_called() post.assert_not_called() @@ -4654,7 +4692,7 @@ def test_set_ssl_certificates_unary_rest_interceptors(null_interceptor): req.return_value.request = PreparedRequest() req.return_value._content = compute.Operation.to_json(compute.Operation()) - request = compute.SetSslCertificatesTargetHttpsProxyRequest() + request = compute.SetQuicOverrideTargetHttpsProxyRequest() metadata = [ ("key", "val"), ("cephalopod", "squid"), @@ -4662,7 +4700,7 @@ def test_set_ssl_certificates_unary_rest_interceptors(null_interceptor): pre.return_value = request, metadata post.return_value = compute.Operation - client.set_ssl_certificates_unary( + client.set_quic_override_unary( request, metadata=[ ("key", "val"), @@ -4674,9 +4712,8 @@ def test_set_ssl_certificates_unary_rest_interceptors(null_interceptor): post.assert_called_once() -def test_set_ssl_certificates_unary_rest_bad_request( - transport: str = "rest", - request_type=compute.SetSslCertificatesTargetHttpsProxyRequest, +def test_set_quic_override_unary_rest_bad_request( + transport: str = "rest", request_type=compute.SetQuicOverrideTargetHttpsProxyRequest ): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), @@ -4685,8 +4722,8 @@ def test_set_ssl_certificates_unary_rest_bad_request( # send a request that will satisfy transcoding request_init = {"project": "sample1", "target_https_proxy": "sample2"} - request_init["target_https_proxies_set_ssl_certificates_request_resource"] = { - "ssl_certificates": ["ssl_certificates_value_1", "ssl_certificates_value_2"] + request_init["target_https_proxies_set_quic_override_request_resource"] = { + "quic_override": "quic_override_value" } request = request_type(request_init) @@ -4699,10 +4736,10 @@ def test_set_ssl_certificates_unary_rest_bad_request( response_value.status_code = 400 response_value.request = Request() req.return_value = response_value - client.set_ssl_certificates_unary(request) + client.set_quic_override_unary(request) -def test_set_ssl_certificates_unary_rest_flattened(): +def test_set_quic_override_unary_rest_flattened(): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", @@ -4720,8 +4757,8 @@ def test_set_ssl_certificates_unary_rest_flattened(): mock_args = dict( project="project_value", target_https_proxy="target_https_proxy_value", - target_https_proxies_set_ssl_certificates_request_resource=compute.TargetHttpsProxiesSetSslCertificatesRequest( - ssl_certificates=["ssl_certificates_value"] + target_https_proxies_set_quic_override_request_resource=compute.TargetHttpsProxiesSetQuicOverrideRequest( + quic_override="quic_override_value" ), ) mock_args.update(sample_request) @@ -4734,20 +4771,20 @@ def test_set_ssl_certificates_unary_rest_flattened(): response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - client.set_ssl_certificates_unary(**mock_args) + client.set_quic_override_unary(**mock_args) # Establish that the underlying call was made with the expected # request object values. assert len(req.mock_calls) == 1 _, args, _ = req.mock_calls[0] assert path_template.validate( - "%s/compute/v1/projects/{project}/targetHttpsProxies/{target_https_proxy}/setSslCertificates" + "%s/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}/setQuicOverride" % client.transport._host, args[1], ) -def test_set_ssl_certificates_unary_rest_flattened_error(transport: str = "rest"): +def test_set_quic_override_unary_rest_flattened_error(transport: str = "rest"): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4756,17 +4793,17 @@ def test_set_ssl_certificates_unary_rest_flattened_error(transport: str = "rest" # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - client.set_ssl_certificates_unary( - compute.SetSslCertificatesTargetHttpsProxyRequest(), + client.set_quic_override_unary( + compute.SetQuicOverrideTargetHttpsProxyRequest(), project="project_value", target_https_proxy="target_https_proxy_value", - target_https_proxies_set_ssl_certificates_request_resource=compute.TargetHttpsProxiesSetSslCertificatesRequest( - ssl_certificates=["ssl_certificates_value"] + target_https_proxies_set_quic_override_request_resource=compute.TargetHttpsProxiesSetQuicOverrideRequest( + quic_override="quic_override_value" ), ) -def test_set_ssl_certificates_unary_rest_error(): +def test_set_quic_override_unary_rest_error(): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4775,11 +4812,11 @@ def test_set_ssl_certificates_unary_rest_error(): @pytest.mark.parametrize( "request_type", [ - compute.SetSslPolicyTargetHttpsProxyRequest, + compute.SetSslCertificatesTargetHttpsProxyRequest, dict, ], ) -def test_set_ssl_policy_rest(request_type): +def test_set_ssl_certificates_rest(request_type): client = TargetHttpsProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", @@ -4787,7 +4824,9 @@ def test_set_ssl_policy_rest(request_type): # send a request that will satisfy transcoding request_init = {"project": "sample1", "target_https_proxy": "sample2"} - request_init["ssl_policy_reference_resource"] = {"ssl_policy": "ssl_policy_value"} + request_init["target_https_proxies_set_ssl_certificates_request_resource"] = { + "ssl_certificates": ["ssl_certificates_value_1", "ssl_certificates_value_2"] + } request = request_type(request_init) # Mock the http request call within the method and fake a response. @@ -4824,7 +4863,7 @@ def test_set_ssl_policy_rest(request_type): json_return_value = compute.Operation.to_json(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_ssl_policy(request) + response = client.set_ssl_certificates(request) # Establish that the response is the type that we expect. assert isinstance(response, extended_operation.ExtendedOperation) @@ -4852,8 +4891,8 @@ def test_set_ssl_policy_rest(request_type): assert response.zone == "zone_value" -def test_set_ssl_policy_rest_required_fields( - request_type=compute.SetSslPolicyTargetHttpsProxyRequest, +def test_set_ssl_certificates_rest_required_fields( + request_type=compute.SetSslCertificatesTargetHttpsProxyRequest, ): transport_class = transports.TargetHttpsProxiesRestTransport @@ -4871,7 +4910,7 @@ def test_set_ssl_policy_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_ssl_policy._get_unset_required_fields(jsonified_request) + ).set_ssl_certificates._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present @@ -4881,7 +4920,7 @@ def test_set_ssl_policy_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_ssl_policy._get_unset_required_fields(jsonified_request) + ).set_ssl_certificates._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("request_id",)) jsonified_request.update(unset_fields) @@ -4922,25 +4961,25 @@ def test_set_ssl_policy_rest_required_fields( response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_ssl_policy(request) + response = client.set_ssl_certificates(request) expected_params = [] actual_params = req.call_args.kwargs["params"] assert expected_params == actual_params -def test_set_ssl_policy_rest_unset_required_fields(): +def test_set_ssl_certificates_rest_unset_required_fields(): transport = transports.TargetHttpsProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials ) - unset_fields = transport.set_ssl_policy._get_unset_required_fields({}) + unset_fields = transport.set_ssl_certificates._get_unset_required_fields({}) assert set(unset_fields) == ( set(("requestId",)) & set( ( "project", - "sslPolicyReferenceResource", + "targetHttpsProxiesSetSslCertificatesRequestResource", "targetHttpsProxy", ) ) @@ -4948,7 +4987,7 @@ def test_set_ssl_policy_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_set_ssl_policy_rest_interceptors(null_interceptor): +def test_set_ssl_certificates_rest_interceptors(null_interceptor): transport = transports.TargetHttpsProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=None @@ -4961,9 +5000,9 @@ def test_set_ssl_policy_rest_interceptors(null_interceptor): ) as req, mock.patch.object( path_template, "transcode" ) as transcode, mock.patch.object( - transports.TargetHttpsProxiesRestInterceptor, "post_set_ssl_policy" + transports.TargetHttpsProxiesRestInterceptor, "post_set_ssl_certificates" ) as post, mock.patch.object( - transports.TargetHttpsProxiesRestInterceptor, "pre_set_ssl_policy" + transports.TargetHttpsProxiesRestInterceptor, "pre_set_ssl_certificates" ) as pre: pre.assert_not_called() post.assert_not_called() @@ -4980,7 +5019,639 @@ def test_set_ssl_policy_rest_interceptors(null_interceptor): req.return_value.request = PreparedRequest() req.return_value._content = compute.Operation.to_json(compute.Operation()) - request = compute.SetSslPolicyTargetHttpsProxyRequest() + request = compute.SetSslCertificatesTargetHttpsProxyRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation + + client.set_ssl_certificates( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_set_ssl_certificates_rest_bad_request( + transport: str = "rest", + request_type=compute.SetSslCertificatesTargetHttpsProxyRequest, +): + client = TargetHttpsProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "target_https_proxy": "sample2"} + request_init["target_https_proxies_set_ssl_certificates_request_resource"] = { + "ssl_certificates": ["ssl_certificates_value_1", "ssl_certificates_value_2"] + } + request = request_type(request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.set_ssl_certificates(request) + + +def test_set_ssl_certificates_rest_flattened(): + client = TargetHttpsProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "target_https_proxy": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + target_https_proxy="target_https_proxy_value", + target_https_proxies_set_ssl_certificates_request_resource=compute.TargetHttpsProxiesSetSslCertificatesRequest( + ssl_certificates=["ssl_certificates_value"] + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + json_return_value = compute.Operation.to_json(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + + client.set_ssl_certificates(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/targetHttpsProxies/{target_https_proxy}/setSslCertificates" + % client.transport._host, + args[1], + ) + + +def test_set_ssl_certificates_rest_flattened_error(transport: str = "rest"): + client = TargetHttpsProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.set_ssl_certificates( + compute.SetSslCertificatesTargetHttpsProxyRequest(), + project="project_value", + target_https_proxy="target_https_proxy_value", + target_https_proxies_set_ssl_certificates_request_resource=compute.TargetHttpsProxiesSetSslCertificatesRequest( + ssl_certificates=["ssl_certificates_value"] + ), + ) + + +def test_set_ssl_certificates_rest_error(): + client = TargetHttpsProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.SetSslCertificatesTargetHttpsProxyRequest, + dict, + ], +) +def test_set_ssl_certificates_unary_rest(request_type): + client = TargetHttpsProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "target_https_proxy": "sample2"} + request_init["target_https_proxies_set_ssl_certificates_request_resource"] = { + "ssl_certificates": ["ssl_certificates_value_1", "ssl_certificates_value_2"] + } + request = request_type(request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation( + client_operation_id="client_operation_id_value", + creation_timestamp="creation_timestamp_value", + description="description_value", + end_time="end_time_value", + http_error_message="http_error_message_value", + http_error_status_code=2374, + id=205, + insert_time="insert_time_value", + kind="kind_value", + name="name_value", + operation_group_id="operation_group_id_value", + operation_type="operation_type_value", + progress=885, + region="region_value", + self_link="self_link_value", + start_time="start_time_value", + status=compute.Operation.Status.DONE, + status_message="status_message_value", + target_id=947, + target_link="target_link_value", + user="user_value", + zone="zone_value", + ) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + json_return_value = compute.Operation.to_json(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + response = client.set_ssl_certificates_unary(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.Operation) + + +def test_set_ssl_certificates_unary_rest_required_fields( + request_type=compute.SetSslCertificatesTargetHttpsProxyRequest, +): + transport_class = transports.TargetHttpsProxiesRestTransport + + request_init = {} + request_init["project"] = "" + request_init["target_https_proxy"] = "" + request = request_type(request_init) + jsonified_request = json.loads( + request_type.to_json( + request, including_default_value_fields=False, use_integers_for_enums=False + ) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).set_ssl_certificates._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["project"] = "project_value" + jsonified_request["targetHttpsProxy"] = "target_https_proxy_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).set_ssl_certificates._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set(("request_id",)) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "targetHttpsProxy" in jsonified_request + assert jsonified_request["targetHttpsProxy"] == "target_https_proxy_value" + + client = TargetHttpsProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": request_init, + } + transcode_result["body"] = {} + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + json_return_value = compute.Operation.to_json(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + + response = client.set_ssl_certificates_unary(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_set_ssl_certificates_unary_rest_unset_required_fields(): + transport = transports.TargetHttpsProxiesRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.set_ssl_certificates._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "project", + "targetHttpsProxiesSetSslCertificatesRequestResource", + "targetHttpsProxy", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_set_ssl_certificates_unary_rest_interceptors(null_interceptor): + transport = transports.TargetHttpsProxiesRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.TargetHttpsProxiesRestInterceptor(), + ) + client = TargetHttpsProxiesClient(transport=transport) + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.TargetHttpsProxiesRestInterceptor, "post_set_ssl_certificates" + ) as post, mock.patch.object( + transports.TargetHttpsProxiesRestInterceptor, "pre_set_ssl_certificates" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": None, + "query_params": {}, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Operation.to_json(compute.Operation()) + + request = compute.SetSslCertificatesTargetHttpsProxyRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation + + client.set_ssl_certificates_unary( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_set_ssl_certificates_unary_rest_bad_request( + transport: str = "rest", + request_type=compute.SetSslCertificatesTargetHttpsProxyRequest, +): + client = TargetHttpsProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "target_https_proxy": "sample2"} + request_init["target_https_proxies_set_ssl_certificates_request_resource"] = { + "ssl_certificates": ["ssl_certificates_value_1", "ssl_certificates_value_2"] + } + request = request_type(request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.set_ssl_certificates_unary(request) + + +def test_set_ssl_certificates_unary_rest_flattened(): + client = TargetHttpsProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "target_https_proxy": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + target_https_proxy="target_https_proxy_value", + target_https_proxies_set_ssl_certificates_request_resource=compute.TargetHttpsProxiesSetSslCertificatesRequest( + ssl_certificates=["ssl_certificates_value"] + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + json_return_value = compute.Operation.to_json(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + + client.set_ssl_certificates_unary(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/targetHttpsProxies/{target_https_proxy}/setSslCertificates" + % client.transport._host, + args[1], + ) + + +def test_set_ssl_certificates_unary_rest_flattened_error(transport: str = "rest"): + client = TargetHttpsProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.set_ssl_certificates_unary( + compute.SetSslCertificatesTargetHttpsProxyRequest(), + project="project_value", + target_https_proxy="target_https_proxy_value", + target_https_proxies_set_ssl_certificates_request_resource=compute.TargetHttpsProxiesSetSslCertificatesRequest( + ssl_certificates=["ssl_certificates_value"] + ), + ) + + +def test_set_ssl_certificates_unary_rest_error(): + client = TargetHttpsProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.SetSslPolicyTargetHttpsProxyRequest, + dict, + ], +) +def test_set_ssl_policy_rest(request_type): + client = TargetHttpsProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "target_https_proxy": "sample2"} + request_init["ssl_policy_reference_resource"] = {"ssl_policy": "ssl_policy_value"} + request = request_type(request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation( + client_operation_id="client_operation_id_value", + creation_timestamp="creation_timestamp_value", + description="description_value", + end_time="end_time_value", + http_error_message="http_error_message_value", + http_error_status_code=2374, + id=205, + insert_time="insert_time_value", + kind="kind_value", + name="name_value", + operation_group_id="operation_group_id_value", + operation_type="operation_type_value", + progress=885, + region="region_value", + self_link="self_link_value", + start_time="start_time_value", + status=compute.Operation.Status.DONE, + status_message="status_message_value", + target_id=947, + target_link="target_link_value", + user="user_value", + zone="zone_value", + ) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + json_return_value = compute.Operation.to_json(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + response = client.set_ssl_policy(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, extended_operation.ExtendedOperation) + assert response.client_operation_id == "client_operation_id_value" + assert response.creation_timestamp == "creation_timestamp_value" + assert response.description == "description_value" + assert response.end_time == "end_time_value" + assert response.http_error_message == "http_error_message_value" + assert response.http_error_status_code == 2374 + assert response.id == 205 + assert response.insert_time == "insert_time_value" + assert response.kind == "kind_value" + assert response.name == "name_value" + assert response.operation_group_id == "operation_group_id_value" + assert response.operation_type == "operation_type_value" + assert response.progress == 885 + assert response.region == "region_value" + assert response.self_link == "self_link_value" + assert response.start_time == "start_time_value" + assert response.status == compute.Operation.Status.DONE + assert response.status_message == "status_message_value" + assert response.target_id == 947 + assert response.target_link == "target_link_value" + assert response.user == "user_value" + assert response.zone == "zone_value" + + +def test_set_ssl_policy_rest_required_fields( + request_type=compute.SetSslPolicyTargetHttpsProxyRequest, +): + transport_class = transports.TargetHttpsProxiesRestTransport + + request_init = {} + request_init["project"] = "" + request_init["target_https_proxy"] = "" + request = request_type(request_init) + jsonified_request = json.loads( + request_type.to_json( + request, including_default_value_fields=False, use_integers_for_enums=False + ) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).set_ssl_policy._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["project"] = "project_value" + jsonified_request["targetHttpsProxy"] = "target_https_proxy_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).set_ssl_policy._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set(("request_id",)) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "targetHttpsProxy" in jsonified_request + assert jsonified_request["targetHttpsProxy"] == "target_https_proxy_value" + + client = TargetHttpsProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": request_init, + } + transcode_result["body"] = {} + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + json_return_value = compute.Operation.to_json(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + + response = client.set_ssl_policy(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_set_ssl_policy_rest_unset_required_fields(): + transport = transports.TargetHttpsProxiesRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.set_ssl_policy._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "project", + "sslPolicyReferenceResource", + "targetHttpsProxy", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_set_ssl_policy_rest_interceptors(null_interceptor): + transport = transports.TargetHttpsProxiesRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.TargetHttpsProxiesRestInterceptor(), + ) + client = TargetHttpsProxiesClient(transport=transport) + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.TargetHttpsProxiesRestInterceptor, "post_set_ssl_policy" + ) as post, mock.patch.object( + transports.TargetHttpsProxiesRestInterceptor, "pre_set_ssl_policy" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": None, + "query_params": {}, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Operation.to_json(compute.Operation()) + + request = compute.SetSslPolicyTargetHttpsProxyRequest() metadata = [ ("key", "val"), ("cephalopod", "squid"), @@ -6128,6 +6799,7 @@ def test_target_https_proxies_base_transport(): "insert", "list", "patch", + "set_certificate_map", "set_quic_override", "set_ssl_certificates", "set_ssl_policy", @@ -6287,6 +6959,9 @@ def test_target_https_proxies_client_transport_session_collision(transport_name) session1 = client1.transport.patch._session session2 = client2.transport.patch._session assert session1 != session2 + session1 = client1.transport.set_certificate_map._session + session2 = client2.transport.set_certificate_map._session + assert session1 != session2 session1 = client1.transport.set_quic_override._session session2 = client2.transport.set_quic_override._session assert session1 != session2 @@ -6486,4 +7161,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_target_instances.py b/tests/unit/gapic/compute_v1/test_target_instances.py index fdc874da0..048f3cdaf 100644 --- a/tests/unit/gapic/compute_v1/test_target_instances.py +++ b/tests/unit/gapic/compute_v1/test_target_instances.py @@ -229,6 +229,7 @@ def test_target_instances_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -246,6 +247,7 @@ def test_target_instances_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -263,6 +265,7 @@ def test_target_instances_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -292,6 +295,25 @@ def test_target_instances_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -352,6 +374,7 @@ def test_target_instances_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -386,6 +409,7 @@ def test_target_instances_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -408,6 +432,7 @@ def test_target_instances_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -510,6 +535,7 @@ def test_target_instances_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -537,6 +563,7 @@ def test_target_instances_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3313,4 +3340,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_target_pools.py b/tests/unit/gapic/compute_v1/test_target_pools.py index 8d5982547..35ad55dee 100644 --- a/tests/unit/gapic/compute_v1/test_target_pools.py +++ b/tests/unit/gapic/compute_v1/test_target_pools.py @@ -220,6 +220,7 @@ def test_target_pools_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -237,6 +238,7 @@ def test_target_pools_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -254,6 +256,7 @@ def test_target_pools_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -283,6 +286,25 @@ def test_target_pools_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -331,6 +353,7 @@ def test_target_pools_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -365,6 +388,7 @@ def test_target_pools_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -387,6 +411,7 @@ def test_target_pools_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -487,6 +512,7 @@ def test_target_pools_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -514,6 +540,7 @@ def test_target_pools_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -6870,4 +6897,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_target_ssl_proxies.py b/tests/unit/gapic/compute_v1/test_target_ssl_proxies.py index 27312b4e1..2d5e6eee8 100644 --- a/tests/unit/gapic/compute_v1/test_target_ssl_proxies.py +++ b/tests/unit/gapic/compute_v1/test_target_ssl_proxies.py @@ -230,6 +230,7 @@ def test_target_ssl_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -247,6 +248,7 @@ def test_target_ssl_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -264,6 +266,7 @@ def test_target_ssl_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -293,6 +296,25 @@ def test_target_ssl_proxies_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -353,6 +375,7 @@ def test_target_ssl_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -387,6 +410,7 @@ def test_target_ssl_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -409,6 +433,7 @@ def test_target_ssl_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -511,6 +536,7 @@ def test_target_ssl_proxies_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -543,6 +569,7 @@ def test_target_ssl_proxies_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -1169,6 +1196,7 @@ def test_get_rest(request_type): with mock.patch.object(type(client.transport._session), "request") as req: # Designate an appropriate value for the returned response. return_value = compute.TargetSslProxy( + certificate_map="certificate_map_value", creation_timestamp="creation_timestamp_value", description="description_value", id=205, @@ -1191,6 +1219,7 @@ def test_get_rest(request_type): # Establish that the response is the type that we expect. assert isinstance(response, compute.TargetSslProxy) + assert response.certificate_map == "certificate_map_value" assert response.creation_timestamp == "creation_timestamp_value" assert response.description == "description_value" assert response.id == 205 @@ -1451,6 +1480,7 @@ def test_insert_rest(request_type): # send a request that will satisfy transcoding request_init = {"project": "sample1"} request_init["target_ssl_proxy_resource"] = { + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "id": 205, @@ -1678,6 +1708,7 @@ def test_insert_rest_bad_request( # send a request that will satisfy transcoding request_init = {"project": "sample1"} request_init["target_ssl_proxy_resource"] = { + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "id": 205, @@ -1721,7 +1752,7 @@ def test_insert_rest_flattened(): mock_args = dict( project="project_value", target_ssl_proxy_resource=compute.TargetSslProxy( - creation_timestamp="creation_timestamp_value" + certificate_map="certificate_map_value" ), ) mock_args.update(sample_request) @@ -1760,7 +1791,7 @@ def test_insert_rest_flattened_error(transport: str = "rest"): compute.InsertTargetSslProxyRequest(), project="project_value", target_ssl_proxy_resource=compute.TargetSslProxy( - creation_timestamp="creation_timestamp_value" + certificate_map="certificate_map_value" ), ) @@ -1787,6 +1818,7 @@ def test_insert_unary_rest(request_type): # send a request that will satisfy transcoding request_init = {"project": "sample1"} request_init["target_ssl_proxy_resource"] = { + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "id": 205, @@ -1994,6 +2026,7 @@ def test_insert_unary_rest_bad_request( # send a request that will satisfy transcoding request_init = {"project": "sample1"} request_init["target_ssl_proxy_resource"] = { + "certificate_map": "certificate_map_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", "id": 205, @@ -2037,7 +2070,7 @@ def test_insert_unary_rest_flattened(): mock_args = dict( project="project_value", target_ssl_proxy_resource=compute.TargetSslProxy( - creation_timestamp="creation_timestamp_value" + certificate_map="certificate_map_value" ), ) mock_args.update(sample_request) @@ -2076,7 +2109,7 @@ def test_insert_unary_rest_flattened_error(transport: str = "rest"): compute.InsertTargetSslProxyRequest(), project="project_value", target_ssl_proxy_resource=compute.TargetSslProxy( - creation_timestamp="creation_timestamp_value" + certificate_map="certificate_map_value" ), ) @@ -3059,11 +3092,11 @@ def test_set_backend_service_unary_rest_error(): @pytest.mark.parametrize( "request_type", [ - compute.SetProxyHeaderTargetSslProxyRequest, + compute.SetCertificateMapTargetSslProxyRequest, dict, ], ) -def test_set_proxy_header_rest(request_type): +def test_set_certificate_map_rest(request_type): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", @@ -3071,8 +3104,8 @@ def test_set_proxy_header_rest(request_type): # send a request that will satisfy transcoding request_init = {"project": "sample1", "target_ssl_proxy": "sample2"} - request_init["target_ssl_proxies_set_proxy_header_request_resource"] = { - "proxy_header": "proxy_header_value" + request_init["target_ssl_proxies_set_certificate_map_request_resource"] = { + "certificate_map": "certificate_map_value" } request = request_type(request_init) @@ -3110,7 +3143,7 @@ def test_set_proxy_header_rest(request_type): json_return_value = compute.Operation.to_json(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_proxy_header(request) + response = client.set_certificate_map(request) # Establish that the response is the type that we expect. assert isinstance(response, extended_operation.ExtendedOperation) @@ -3138,8 +3171,8 @@ def test_set_proxy_header_rest(request_type): assert response.zone == "zone_value" -def test_set_proxy_header_rest_required_fields( - request_type=compute.SetProxyHeaderTargetSslProxyRequest, +def test_set_certificate_map_rest_required_fields( + request_type=compute.SetCertificateMapTargetSslProxyRequest, ): transport_class = transports.TargetSslProxiesRestTransport @@ -3157,7 +3190,7 @@ def test_set_proxy_header_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_proxy_header._get_unset_required_fields(jsonified_request) + ).set_certificate_map._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present @@ -3167,7 +3200,7 @@ def test_set_proxy_header_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_proxy_header._get_unset_required_fields(jsonified_request) + ).set_certificate_map._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("request_id",)) jsonified_request.update(unset_fields) @@ -3208,25 +3241,25 @@ def test_set_proxy_header_rest_required_fields( response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_proxy_header(request) + response = client.set_certificate_map(request) expected_params = [] actual_params = req.call_args.kwargs["params"] assert expected_params == actual_params -def test_set_proxy_header_rest_unset_required_fields(): +def test_set_certificate_map_rest_unset_required_fields(): transport = transports.TargetSslProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials ) - unset_fields = transport.set_proxy_header._get_unset_required_fields({}) + unset_fields = transport.set_certificate_map._get_unset_required_fields({}) assert set(unset_fields) == ( set(("requestId",)) & set( ( "project", - "targetSslProxiesSetProxyHeaderRequestResource", + "targetSslProxiesSetCertificateMapRequestResource", "targetSslProxy", ) ) @@ -3234,7 +3267,7 @@ def test_set_proxy_header_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_set_proxy_header_rest_interceptors(null_interceptor): +def test_set_certificate_map_rest_interceptors(null_interceptor): transport = transports.TargetSslProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=None @@ -3247,9 +3280,9 @@ def test_set_proxy_header_rest_interceptors(null_interceptor): ) as req, mock.patch.object( path_template, "transcode" ) as transcode, mock.patch.object( - transports.TargetSslProxiesRestInterceptor, "post_set_proxy_header" + transports.TargetSslProxiesRestInterceptor, "post_set_certificate_map" ) as post, mock.patch.object( - transports.TargetSslProxiesRestInterceptor, "pre_set_proxy_header" + transports.TargetSslProxiesRestInterceptor, "pre_set_certificate_map" ) as pre: pre.assert_not_called() post.assert_not_called() @@ -3266,7 +3299,7 @@ def test_set_proxy_header_rest_interceptors(null_interceptor): req.return_value.request = PreparedRequest() req.return_value._content = compute.Operation.to_json(compute.Operation()) - request = compute.SetProxyHeaderTargetSslProxyRequest() + request = compute.SetCertificateMapTargetSslProxyRequest() metadata = [ ("key", "val"), ("cephalopod", "squid"), @@ -3274,7 +3307,7 @@ def test_set_proxy_header_rest_interceptors(null_interceptor): pre.return_value = request, metadata post.return_value = compute.Operation - client.set_proxy_header( + client.set_certificate_map( request, metadata=[ ("key", "val"), @@ -3286,8 +3319,8 @@ def test_set_proxy_header_rest_interceptors(null_interceptor): post.assert_called_once() -def test_set_proxy_header_rest_bad_request( - transport: str = "rest", request_type=compute.SetProxyHeaderTargetSslProxyRequest +def test_set_certificate_map_rest_bad_request( + transport: str = "rest", request_type=compute.SetCertificateMapTargetSslProxyRequest ): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), @@ -3296,8 +3329,8 @@ def test_set_proxy_header_rest_bad_request( # send a request that will satisfy transcoding request_init = {"project": "sample1", "target_ssl_proxy": "sample2"} - request_init["target_ssl_proxies_set_proxy_header_request_resource"] = { - "proxy_header": "proxy_header_value" + request_init["target_ssl_proxies_set_certificate_map_request_resource"] = { + "certificate_map": "certificate_map_value" } request = request_type(request_init) @@ -3310,10 +3343,10 @@ def test_set_proxy_header_rest_bad_request( response_value.status_code = 400 response_value.request = Request() req.return_value = response_value - client.set_proxy_header(request) + client.set_certificate_map(request) -def test_set_proxy_header_rest_flattened(): +def test_set_certificate_map_rest_flattened(): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", @@ -3331,8 +3364,8 @@ def test_set_proxy_header_rest_flattened(): mock_args = dict( project="project_value", target_ssl_proxy="target_ssl_proxy_value", - target_ssl_proxies_set_proxy_header_request_resource=compute.TargetSslProxiesSetProxyHeaderRequest( - proxy_header="proxy_header_value" + target_ssl_proxies_set_certificate_map_request_resource=compute.TargetSslProxiesSetCertificateMapRequest( + certificate_map="certificate_map_value" ), ) mock_args.update(sample_request) @@ -3345,20 +3378,20 @@ def test_set_proxy_header_rest_flattened(): response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - client.set_proxy_header(**mock_args) + client.set_certificate_map(**mock_args) # Establish that the underlying call was made with the expected # request object values. assert len(req.mock_calls) == 1 _, args, _ = req.mock_calls[0] assert path_template.validate( - "%s/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setProxyHeader" + "%s/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setCertificateMap" % client.transport._host, args[1], ) -def test_set_proxy_header_rest_flattened_error(transport: str = "rest"): +def test_set_certificate_map_rest_flattened_error(transport: str = "rest"): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3367,17 +3400,17 @@ def test_set_proxy_header_rest_flattened_error(transport: str = "rest"): # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - client.set_proxy_header( - compute.SetProxyHeaderTargetSslProxyRequest(), + client.set_certificate_map( + compute.SetCertificateMapTargetSslProxyRequest(), project="project_value", target_ssl_proxy="target_ssl_proxy_value", - target_ssl_proxies_set_proxy_header_request_resource=compute.TargetSslProxiesSetProxyHeaderRequest( - proxy_header="proxy_header_value" + target_ssl_proxies_set_certificate_map_request_resource=compute.TargetSslProxiesSetCertificateMapRequest( + certificate_map="certificate_map_value" ), ) -def test_set_proxy_header_rest_error(): +def test_set_certificate_map_rest_error(): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3386,11 +3419,11 @@ def test_set_proxy_header_rest_error(): @pytest.mark.parametrize( "request_type", [ - compute.SetProxyHeaderTargetSslProxyRequest, + compute.SetCertificateMapTargetSslProxyRequest, dict, ], ) -def test_set_proxy_header_unary_rest(request_type): +def test_set_certificate_map_unary_rest(request_type): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", @@ -3398,8 +3431,8 @@ def test_set_proxy_header_unary_rest(request_type): # send a request that will satisfy transcoding request_init = {"project": "sample1", "target_ssl_proxy": "sample2"} - request_init["target_ssl_proxies_set_proxy_header_request_resource"] = { - "proxy_header": "proxy_header_value" + request_init["target_ssl_proxies_set_certificate_map_request_resource"] = { + "certificate_map": "certificate_map_value" } request = request_type(request_init) @@ -3437,14 +3470,14 @@ def test_set_proxy_header_unary_rest(request_type): json_return_value = compute.Operation.to_json(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_proxy_header_unary(request) + response = client.set_certificate_map_unary(request) # Establish that the response is the type that we expect. assert isinstance(response, compute.Operation) -def test_set_proxy_header_unary_rest_required_fields( - request_type=compute.SetProxyHeaderTargetSslProxyRequest, +def test_set_certificate_map_unary_rest_required_fields( + request_type=compute.SetCertificateMapTargetSslProxyRequest, ): transport_class = transports.TargetSslProxiesRestTransport @@ -3462,7 +3495,7 @@ def test_set_proxy_header_unary_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_proxy_header._get_unset_required_fields(jsonified_request) + ).set_certificate_map._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present @@ -3472,7 +3505,7 @@ def test_set_proxy_header_unary_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_proxy_header._get_unset_required_fields(jsonified_request) + ).set_certificate_map._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("request_id",)) jsonified_request.update(unset_fields) @@ -3513,25 +3546,25 @@ def test_set_proxy_header_unary_rest_required_fields( response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_proxy_header_unary(request) + response = client.set_certificate_map_unary(request) expected_params = [] actual_params = req.call_args.kwargs["params"] assert expected_params == actual_params -def test_set_proxy_header_unary_rest_unset_required_fields(): +def test_set_certificate_map_unary_rest_unset_required_fields(): transport = transports.TargetSslProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials ) - unset_fields = transport.set_proxy_header._get_unset_required_fields({}) + unset_fields = transport.set_certificate_map._get_unset_required_fields({}) assert set(unset_fields) == ( set(("requestId",)) & set( ( "project", - "targetSslProxiesSetProxyHeaderRequestResource", + "targetSslProxiesSetCertificateMapRequestResource", "targetSslProxy", ) ) @@ -3539,7 +3572,7 @@ def test_set_proxy_header_unary_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_set_proxy_header_unary_rest_interceptors(null_interceptor): +def test_set_certificate_map_unary_rest_interceptors(null_interceptor): transport = transports.TargetSslProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=None @@ -3552,9 +3585,9 @@ def test_set_proxy_header_unary_rest_interceptors(null_interceptor): ) as req, mock.patch.object( path_template, "transcode" ) as transcode, mock.patch.object( - transports.TargetSslProxiesRestInterceptor, "post_set_proxy_header" + transports.TargetSslProxiesRestInterceptor, "post_set_certificate_map" ) as post, mock.patch.object( - transports.TargetSslProxiesRestInterceptor, "pre_set_proxy_header" + transports.TargetSslProxiesRestInterceptor, "pre_set_certificate_map" ) as pre: pre.assert_not_called() post.assert_not_called() @@ -3571,7 +3604,7 @@ def test_set_proxy_header_unary_rest_interceptors(null_interceptor): req.return_value.request = PreparedRequest() req.return_value._content = compute.Operation.to_json(compute.Operation()) - request = compute.SetProxyHeaderTargetSslProxyRequest() + request = compute.SetCertificateMapTargetSslProxyRequest() metadata = [ ("key", "val"), ("cephalopod", "squid"), @@ -3579,7 +3612,7 @@ def test_set_proxy_header_unary_rest_interceptors(null_interceptor): pre.return_value = request, metadata post.return_value = compute.Operation - client.set_proxy_header_unary( + client.set_certificate_map_unary( request, metadata=[ ("key", "val"), @@ -3591,8 +3624,8 @@ def test_set_proxy_header_unary_rest_interceptors(null_interceptor): post.assert_called_once() -def test_set_proxy_header_unary_rest_bad_request( - transport: str = "rest", request_type=compute.SetProxyHeaderTargetSslProxyRequest +def test_set_certificate_map_unary_rest_bad_request( + transport: str = "rest", request_type=compute.SetCertificateMapTargetSslProxyRequest ): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), @@ -3601,8 +3634,8 @@ def test_set_proxy_header_unary_rest_bad_request( # send a request that will satisfy transcoding request_init = {"project": "sample1", "target_ssl_proxy": "sample2"} - request_init["target_ssl_proxies_set_proxy_header_request_resource"] = { - "proxy_header": "proxy_header_value" + request_init["target_ssl_proxies_set_certificate_map_request_resource"] = { + "certificate_map": "certificate_map_value" } request = request_type(request_init) @@ -3615,10 +3648,10 @@ def test_set_proxy_header_unary_rest_bad_request( response_value.status_code = 400 response_value.request = Request() req.return_value = response_value - client.set_proxy_header_unary(request) + client.set_certificate_map_unary(request) -def test_set_proxy_header_unary_rest_flattened(): +def test_set_certificate_map_unary_rest_flattened(): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", @@ -3636,8 +3669,8 @@ def test_set_proxy_header_unary_rest_flattened(): mock_args = dict( project="project_value", target_ssl_proxy="target_ssl_proxy_value", - target_ssl_proxies_set_proxy_header_request_resource=compute.TargetSslProxiesSetProxyHeaderRequest( - proxy_header="proxy_header_value" + target_ssl_proxies_set_certificate_map_request_resource=compute.TargetSslProxiesSetCertificateMapRequest( + certificate_map="certificate_map_value" ), ) mock_args.update(sample_request) @@ -3650,20 +3683,20 @@ def test_set_proxy_header_unary_rest_flattened(): response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - client.set_proxy_header_unary(**mock_args) + client.set_certificate_map_unary(**mock_args) # Establish that the underlying call was made with the expected # request object values. assert len(req.mock_calls) == 1 _, args, _ = req.mock_calls[0] assert path_template.validate( - "%s/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setProxyHeader" + "%s/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setCertificateMap" % client.transport._host, args[1], ) -def test_set_proxy_header_unary_rest_flattened_error(transport: str = "rest"): +def test_set_certificate_map_unary_rest_flattened_error(transport: str = "rest"): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3672,17 +3705,17 @@ def test_set_proxy_header_unary_rest_flattened_error(transport: str = "rest"): # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - client.set_proxy_header_unary( - compute.SetProxyHeaderTargetSslProxyRequest(), + client.set_certificate_map_unary( + compute.SetCertificateMapTargetSslProxyRequest(), project="project_value", target_ssl_proxy="target_ssl_proxy_value", - target_ssl_proxies_set_proxy_header_request_resource=compute.TargetSslProxiesSetProxyHeaderRequest( - proxy_header="proxy_header_value" + target_ssl_proxies_set_certificate_map_request_resource=compute.TargetSslProxiesSetCertificateMapRequest( + certificate_map="certificate_map_value" ), ) -def test_set_proxy_header_unary_rest_error(): +def test_set_certificate_map_unary_rest_error(): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3691,11 +3724,11 @@ def test_set_proxy_header_unary_rest_error(): @pytest.mark.parametrize( "request_type", [ - compute.SetSslCertificatesTargetSslProxyRequest, + compute.SetProxyHeaderTargetSslProxyRequest, dict, ], ) -def test_set_ssl_certificates_rest(request_type): +def test_set_proxy_header_rest(request_type): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", @@ -3703,8 +3736,8 @@ def test_set_ssl_certificates_rest(request_type): # send a request that will satisfy transcoding request_init = {"project": "sample1", "target_ssl_proxy": "sample2"} - request_init["target_ssl_proxies_set_ssl_certificates_request_resource"] = { - "ssl_certificates": ["ssl_certificates_value_1", "ssl_certificates_value_2"] + request_init["target_ssl_proxies_set_proxy_header_request_resource"] = { + "proxy_header": "proxy_header_value" } request = request_type(request_init) @@ -3742,7 +3775,7 @@ def test_set_ssl_certificates_rest(request_type): json_return_value = compute.Operation.to_json(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_ssl_certificates(request) + response = client.set_proxy_header(request) # Establish that the response is the type that we expect. assert isinstance(response, extended_operation.ExtendedOperation) @@ -3770,8 +3803,8 @@ def test_set_ssl_certificates_rest(request_type): assert response.zone == "zone_value" -def test_set_ssl_certificates_rest_required_fields( - request_type=compute.SetSslCertificatesTargetSslProxyRequest, +def test_set_proxy_header_rest_required_fields( + request_type=compute.SetProxyHeaderTargetSslProxyRequest, ): transport_class = transports.TargetSslProxiesRestTransport @@ -3789,7 +3822,7 @@ def test_set_ssl_certificates_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_ssl_certificates._get_unset_required_fields(jsonified_request) + ).set_proxy_header._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present @@ -3799,7 +3832,7 @@ def test_set_ssl_certificates_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_ssl_certificates._get_unset_required_fields(jsonified_request) + ).set_proxy_header._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("request_id",)) jsonified_request.update(unset_fields) @@ -3840,25 +3873,25 @@ def test_set_ssl_certificates_rest_required_fields( response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_ssl_certificates(request) + response = client.set_proxy_header(request) expected_params = [] actual_params = req.call_args.kwargs["params"] assert expected_params == actual_params -def test_set_ssl_certificates_rest_unset_required_fields(): +def test_set_proxy_header_rest_unset_required_fields(): transport = transports.TargetSslProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials ) - unset_fields = transport.set_ssl_certificates._get_unset_required_fields({}) + unset_fields = transport.set_proxy_header._get_unset_required_fields({}) assert set(unset_fields) == ( set(("requestId",)) & set( ( "project", - "targetSslProxiesSetSslCertificatesRequestResource", + "targetSslProxiesSetProxyHeaderRequestResource", "targetSslProxy", ) ) @@ -3866,7 +3899,7 @@ def test_set_ssl_certificates_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_set_ssl_certificates_rest_interceptors(null_interceptor): +def test_set_proxy_header_rest_interceptors(null_interceptor): transport = transports.TargetSslProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=None @@ -3879,9 +3912,9 @@ def test_set_ssl_certificates_rest_interceptors(null_interceptor): ) as req, mock.patch.object( path_template, "transcode" ) as transcode, mock.patch.object( - transports.TargetSslProxiesRestInterceptor, "post_set_ssl_certificates" + transports.TargetSslProxiesRestInterceptor, "post_set_proxy_header" ) as post, mock.patch.object( - transports.TargetSslProxiesRestInterceptor, "pre_set_ssl_certificates" + transports.TargetSslProxiesRestInterceptor, "pre_set_proxy_header" ) as pre: pre.assert_not_called() post.assert_not_called() @@ -3898,7 +3931,7 @@ def test_set_ssl_certificates_rest_interceptors(null_interceptor): req.return_value.request = PreparedRequest() req.return_value._content = compute.Operation.to_json(compute.Operation()) - request = compute.SetSslCertificatesTargetSslProxyRequest() + request = compute.SetProxyHeaderTargetSslProxyRequest() metadata = [ ("key", "val"), ("cephalopod", "squid"), @@ -3906,7 +3939,7 @@ def test_set_ssl_certificates_rest_interceptors(null_interceptor): pre.return_value = request, metadata post.return_value = compute.Operation - client.set_ssl_certificates( + client.set_proxy_header( request, metadata=[ ("key", "val"), @@ -3918,9 +3951,8 @@ def test_set_ssl_certificates_rest_interceptors(null_interceptor): post.assert_called_once() -def test_set_ssl_certificates_rest_bad_request( - transport: str = "rest", - request_type=compute.SetSslCertificatesTargetSslProxyRequest, +def test_set_proxy_header_rest_bad_request( + transport: str = "rest", request_type=compute.SetProxyHeaderTargetSslProxyRequest ): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), @@ -3929,8 +3961,8 @@ def test_set_ssl_certificates_rest_bad_request( # send a request that will satisfy transcoding request_init = {"project": "sample1", "target_ssl_proxy": "sample2"} - request_init["target_ssl_proxies_set_ssl_certificates_request_resource"] = { - "ssl_certificates": ["ssl_certificates_value_1", "ssl_certificates_value_2"] + request_init["target_ssl_proxies_set_proxy_header_request_resource"] = { + "proxy_header": "proxy_header_value" } request = request_type(request_init) @@ -3943,10 +3975,10 @@ def test_set_ssl_certificates_rest_bad_request( response_value.status_code = 400 response_value.request = Request() req.return_value = response_value - client.set_ssl_certificates(request) + client.set_proxy_header(request) -def test_set_ssl_certificates_rest_flattened(): +def test_set_proxy_header_rest_flattened(): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", @@ -3964,8 +3996,8 @@ def test_set_ssl_certificates_rest_flattened(): mock_args = dict( project="project_value", target_ssl_proxy="target_ssl_proxy_value", - target_ssl_proxies_set_ssl_certificates_request_resource=compute.TargetSslProxiesSetSslCertificatesRequest( - ssl_certificates=["ssl_certificates_value"] + target_ssl_proxies_set_proxy_header_request_resource=compute.TargetSslProxiesSetProxyHeaderRequest( + proxy_header="proxy_header_value" ), ) mock_args.update(sample_request) @@ -3978,20 +4010,20 @@ def test_set_ssl_certificates_rest_flattened(): response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - client.set_ssl_certificates(**mock_args) + client.set_proxy_header(**mock_args) # Establish that the underlying call was made with the expected # request object values. assert len(req.mock_calls) == 1 _, args, _ = req.mock_calls[0] assert path_template.validate( - "%s/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setSslCertificates" + "%s/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setProxyHeader" % client.transport._host, args[1], ) -def test_set_ssl_certificates_rest_flattened_error(transport: str = "rest"): +def test_set_proxy_header_rest_flattened_error(transport: str = "rest"): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4000,17 +4032,17 @@ def test_set_ssl_certificates_rest_flattened_error(transport: str = "rest"): # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - client.set_ssl_certificates( - compute.SetSslCertificatesTargetSslProxyRequest(), + client.set_proxy_header( + compute.SetProxyHeaderTargetSslProxyRequest(), project="project_value", target_ssl_proxy="target_ssl_proxy_value", - target_ssl_proxies_set_ssl_certificates_request_resource=compute.TargetSslProxiesSetSslCertificatesRequest( - ssl_certificates=["ssl_certificates_value"] + target_ssl_proxies_set_proxy_header_request_resource=compute.TargetSslProxiesSetProxyHeaderRequest( + proxy_header="proxy_header_value" ), ) -def test_set_ssl_certificates_rest_error(): +def test_set_proxy_header_rest_error(): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4019,11 +4051,11 @@ def test_set_ssl_certificates_rest_error(): @pytest.mark.parametrize( "request_type", [ - compute.SetSslCertificatesTargetSslProxyRequest, + compute.SetProxyHeaderTargetSslProxyRequest, dict, ], ) -def test_set_ssl_certificates_unary_rest(request_type): +def test_set_proxy_header_unary_rest(request_type): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", @@ -4031,8 +4063,8 @@ def test_set_ssl_certificates_unary_rest(request_type): # send a request that will satisfy transcoding request_init = {"project": "sample1", "target_ssl_proxy": "sample2"} - request_init["target_ssl_proxies_set_ssl_certificates_request_resource"] = { - "ssl_certificates": ["ssl_certificates_value_1", "ssl_certificates_value_2"] + request_init["target_ssl_proxies_set_proxy_header_request_resource"] = { + "proxy_header": "proxy_header_value" } request = request_type(request_init) @@ -4070,14 +4102,14 @@ def test_set_ssl_certificates_unary_rest(request_type): json_return_value = compute.Operation.to_json(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_ssl_certificates_unary(request) + response = client.set_proxy_header_unary(request) # Establish that the response is the type that we expect. assert isinstance(response, compute.Operation) -def test_set_ssl_certificates_unary_rest_required_fields( - request_type=compute.SetSslCertificatesTargetSslProxyRequest, +def test_set_proxy_header_unary_rest_required_fields( + request_type=compute.SetProxyHeaderTargetSslProxyRequest, ): transport_class = transports.TargetSslProxiesRestTransport @@ -4095,7 +4127,7 @@ def test_set_ssl_certificates_unary_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_ssl_certificates._get_unset_required_fields(jsonified_request) + ).set_proxy_header._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present @@ -4105,7 +4137,7 @@ def test_set_ssl_certificates_unary_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_ssl_certificates._get_unset_required_fields(jsonified_request) + ).set_proxy_header._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("request_id",)) jsonified_request.update(unset_fields) @@ -4146,25 +4178,25 @@ def test_set_ssl_certificates_unary_rest_required_fields( response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_ssl_certificates_unary(request) + response = client.set_proxy_header_unary(request) expected_params = [] actual_params = req.call_args.kwargs["params"] assert expected_params == actual_params -def test_set_ssl_certificates_unary_rest_unset_required_fields(): +def test_set_proxy_header_unary_rest_unset_required_fields(): transport = transports.TargetSslProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials ) - unset_fields = transport.set_ssl_certificates._get_unset_required_fields({}) + unset_fields = transport.set_proxy_header._get_unset_required_fields({}) assert set(unset_fields) == ( set(("requestId",)) & set( ( "project", - "targetSslProxiesSetSslCertificatesRequestResource", + "targetSslProxiesSetProxyHeaderRequestResource", "targetSslProxy", ) ) @@ -4172,7 +4204,7 @@ def test_set_ssl_certificates_unary_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_set_ssl_certificates_unary_rest_interceptors(null_interceptor): +def test_set_proxy_header_unary_rest_interceptors(null_interceptor): transport = transports.TargetSslProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=None @@ -4185,9 +4217,9 @@ def test_set_ssl_certificates_unary_rest_interceptors(null_interceptor): ) as req, mock.patch.object( path_template, "transcode" ) as transcode, mock.patch.object( - transports.TargetSslProxiesRestInterceptor, "post_set_ssl_certificates" + transports.TargetSslProxiesRestInterceptor, "post_set_proxy_header" ) as post, mock.patch.object( - transports.TargetSslProxiesRestInterceptor, "pre_set_ssl_certificates" + transports.TargetSslProxiesRestInterceptor, "pre_set_proxy_header" ) as pre: pre.assert_not_called() post.assert_not_called() @@ -4204,7 +4236,7 @@ def test_set_ssl_certificates_unary_rest_interceptors(null_interceptor): req.return_value.request = PreparedRequest() req.return_value._content = compute.Operation.to_json(compute.Operation()) - request = compute.SetSslCertificatesTargetSslProxyRequest() + request = compute.SetProxyHeaderTargetSslProxyRequest() metadata = [ ("key", "val"), ("cephalopod", "squid"), @@ -4212,7 +4244,7 @@ def test_set_ssl_certificates_unary_rest_interceptors(null_interceptor): pre.return_value = request, metadata post.return_value = compute.Operation - client.set_ssl_certificates_unary( + client.set_proxy_header_unary( request, metadata=[ ("key", "val"), @@ -4224,9 +4256,8 @@ def test_set_ssl_certificates_unary_rest_interceptors(null_interceptor): post.assert_called_once() -def test_set_ssl_certificates_unary_rest_bad_request( - transport: str = "rest", - request_type=compute.SetSslCertificatesTargetSslProxyRequest, +def test_set_proxy_header_unary_rest_bad_request( + transport: str = "rest", request_type=compute.SetProxyHeaderTargetSslProxyRequest ): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), @@ -4235,8 +4266,8 @@ def test_set_ssl_certificates_unary_rest_bad_request( # send a request that will satisfy transcoding request_init = {"project": "sample1", "target_ssl_proxy": "sample2"} - request_init["target_ssl_proxies_set_ssl_certificates_request_resource"] = { - "ssl_certificates": ["ssl_certificates_value_1", "ssl_certificates_value_2"] + request_init["target_ssl_proxies_set_proxy_header_request_resource"] = { + "proxy_header": "proxy_header_value" } request = request_type(request_init) @@ -4249,10 +4280,10 @@ def test_set_ssl_certificates_unary_rest_bad_request( response_value.status_code = 400 response_value.request = Request() req.return_value = response_value - client.set_ssl_certificates_unary(request) + client.set_proxy_header_unary(request) -def test_set_ssl_certificates_unary_rest_flattened(): +def test_set_proxy_header_unary_rest_flattened(): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", @@ -4270,8 +4301,8 @@ def test_set_ssl_certificates_unary_rest_flattened(): mock_args = dict( project="project_value", target_ssl_proxy="target_ssl_proxy_value", - target_ssl_proxies_set_ssl_certificates_request_resource=compute.TargetSslProxiesSetSslCertificatesRequest( - ssl_certificates=["ssl_certificates_value"] + target_ssl_proxies_set_proxy_header_request_resource=compute.TargetSslProxiesSetProxyHeaderRequest( + proxy_header="proxy_header_value" ), ) mock_args.update(sample_request) @@ -4284,20 +4315,20 @@ def test_set_ssl_certificates_unary_rest_flattened(): response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - client.set_ssl_certificates_unary(**mock_args) + client.set_proxy_header_unary(**mock_args) # Establish that the underlying call was made with the expected # request object values. assert len(req.mock_calls) == 1 _, args, _ = req.mock_calls[0] assert path_template.validate( - "%s/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setSslCertificates" + "%s/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setProxyHeader" % client.transport._host, args[1], ) -def test_set_ssl_certificates_unary_rest_flattened_error(transport: str = "rest"): +def test_set_proxy_header_unary_rest_flattened_error(transport: str = "rest"): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4306,17 +4337,17 @@ def test_set_ssl_certificates_unary_rest_flattened_error(transport: str = "rest" # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - client.set_ssl_certificates_unary( - compute.SetSslCertificatesTargetSslProxyRequest(), + client.set_proxy_header_unary( + compute.SetProxyHeaderTargetSslProxyRequest(), project="project_value", target_ssl_proxy="target_ssl_proxy_value", - target_ssl_proxies_set_ssl_certificates_request_resource=compute.TargetSslProxiesSetSslCertificatesRequest( - ssl_certificates=["ssl_certificates_value"] + target_ssl_proxies_set_proxy_header_request_resource=compute.TargetSslProxiesSetProxyHeaderRequest( + proxy_header="proxy_header_value" ), ) -def test_set_ssl_certificates_unary_rest_error(): +def test_set_proxy_header_unary_rest_error(): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4325,11 +4356,11 @@ def test_set_ssl_certificates_unary_rest_error(): @pytest.mark.parametrize( "request_type", [ - compute.SetSslPolicyTargetSslProxyRequest, + compute.SetSslCertificatesTargetSslProxyRequest, dict, ], ) -def test_set_ssl_policy_rest(request_type): +def test_set_ssl_certificates_rest(request_type): client = TargetSslProxiesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", @@ -4337,7 +4368,9 @@ def test_set_ssl_policy_rest(request_type): # send a request that will satisfy transcoding request_init = {"project": "sample1", "target_ssl_proxy": "sample2"} - request_init["ssl_policy_reference_resource"] = {"ssl_policy": "ssl_policy_value"} + request_init["target_ssl_proxies_set_ssl_certificates_request_resource"] = { + "ssl_certificates": ["ssl_certificates_value_1", "ssl_certificates_value_2"] + } request = request_type(request_init) # Mock the http request call within the method and fake a response. @@ -4374,7 +4407,7 @@ def test_set_ssl_policy_rest(request_type): json_return_value = compute.Operation.to_json(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_ssl_policy(request) + response = client.set_ssl_certificates(request) # Establish that the response is the type that we expect. assert isinstance(response, extended_operation.ExtendedOperation) @@ -4402,8 +4435,8 @@ def test_set_ssl_policy_rest(request_type): assert response.zone == "zone_value" -def test_set_ssl_policy_rest_required_fields( - request_type=compute.SetSslPolicyTargetSslProxyRequest, +def test_set_ssl_certificates_rest_required_fields( + request_type=compute.SetSslCertificatesTargetSslProxyRequest, ): transport_class = transports.TargetSslProxiesRestTransport @@ -4421,7 +4454,7 @@ def test_set_ssl_policy_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_ssl_policy._get_unset_required_fields(jsonified_request) + ).set_ssl_certificates._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present @@ -4431,7 +4464,7 @@ def test_set_ssl_policy_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).set_ssl_policy._get_unset_required_fields(jsonified_request) + ).set_ssl_certificates._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("request_id",)) jsonified_request.update(unset_fields) @@ -4472,25 +4505,25 @@ def test_set_ssl_policy_rest_required_fields( response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value - response = client.set_ssl_policy(request) + response = client.set_ssl_certificates(request) expected_params = [] actual_params = req.call_args.kwargs["params"] assert expected_params == actual_params -def test_set_ssl_policy_rest_unset_required_fields(): +def test_set_ssl_certificates_rest_unset_required_fields(): transport = transports.TargetSslProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials ) - unset_fields = transport.set_ssl_policy._get_unset_required_fields({}) + unset_fields = transport.set_ssl_certificates._get_unset_required_fields({}) assert set(unset_fields) == ( set(("requestId",)) & set( ( "project", - "sslPolicyReferenceResource", + "targetSslProxiesSetSslCertificatesRequestResource", "targetSslProxy", ) ) @@ -4498,7 +4531,7 @@ def test_set_ssl_policy_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_set_ssl_policy_rest_interceptors(null_interceptor): +def test_set_ssl_certificates_rest_interceptors(null_interceptor): transport = transports.TargetSslProxiesRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=None @@ -4511,9 +4544,9 @@ def test_set_ssl_policy_rest_interceptors(null_interceptor): ) as req, mock.patch.object( path_template, "transcode" ) as transcode, mock.patch.object( - transports.TargetSslProxiesRestInterceptor, "post_set_ssl_policy" + transports.TargetSslProxiesRestInterceptor, "post_set_ssl_certificates" ) as post, mock.patch.object( - transports.TargetSslProxiesRestInterceptor, "pre_set_ssl_policy" + transports.TargetSslProxiesRestInterceptor, "pre_set_ssl_certificates" ) as pre: pre.assert_not_called() post.assert_not_called() @@ -4530,7 +4563,7 @@ def test_set_ssl_policy_rest_interceptors(null_interceptor): req.return_value.request = PreparedRequest() req.return_value._content = compute.Operation.to_json(compute.Operation()) - request = compute.SetSslPolicyTargetSslProxyRequest() + request = compute.SetSslCertificatesTargetSslProxyRequest() metadata = [ ("key", "val"), ("cephalopod", "squid"), @@ -4538,7 +4571,639 @@ def test_set_ssl_policy_rest_interceptors(null_interceptor): pre.return_value = request, metadata post.return_value = compute.Operation - client.set_ssl_policy( + client.set_ssl_certificates( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_set_ssl_certificates_rest_bad_request( + transport: str = "rest", + request_type=compute.SetSslCertificatesTargetSslProxyRequest, +): + client = TargetSslProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "target_ssl_proxy": "sample2"} + request_init["target_ssl_proxies_set_ssl_certificates_request_resource"] = { + "ssl_certificates": ["ssl_certificates_value_1", "ssl_certificates_value_2"] + } + request = request_type(request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.set_ssl_certificates(request) + + +def test_set_ssl_certificates_rest_flattened(): + client = TargetSslProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "target_ssl_proxy": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + target_ssl_proxy="target_ssl_proxy_value", + target_ssl_proxies_set_ssl_certificates_request_resource=compute.TargetSslProxiesSetSslCertificatesRequest( + ssl_certificates=["ssl_certificates_value"] + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + json_return_value = compute.Operation.to_json(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + + client.set_ssl_certificates(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setSslCertificates" + % client.transport._host, + args[1], + ) + + +def test_set_ssl_certificates_rest_flattened_error(transport: str = "rest"): + client = TargetSslProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.set_ssl_certificates( + compute.SetSslCertificatesTargetSslProxyRequest(), + project="project_value", + target_ssl_proxy="target_ssl_proxy_value", + target_ssl_proxies_set_ssl_certificates_request_resource=compute.TargetSslProxiesSetSslCertificatesRequest( + ssl_certificates=["ssl_certificates_value"] + ), + ) + + +def test_set_ssl_certificates_rest_error(): + client = TargetSslProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.SetSslCertificatesTargetSslProxyRequest, + dict, + ], +) +def test_set_ssl_certificates_unary_rest(request_type): + client = TargetSslProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "target_ssl_proxy": "sample2"} + request_init["target_ssl_proxies_set_ssl_certificates_request_resource"] = { + "ssl_certificates": ["ssl_certificates_value_1", "ssl_certificates_value_2"] + } + request = request_type(request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation( + client_operation_id="client_operation_id_value", + creation_timestamp="creation_timestamp_value", + description="description_value", + end_time="end_time_value", + http_error_message="http_error_message_value", + http_error_status_code=2374, + id=205, + insert_time="insert_time_value", + kind="kind_value", + name="name_value", + operation_group_id="operation_group_id_value", + operation_type="operation_type_value", + progress=885, + region="region_value", + self_link="self_link_value", + start_time="start_time_value", + status=compute.Operation.Status.DONE, + status_message="status_message_value", + target_id=947, + target_link="target_link_value", + user="user_value", + zone="zone_value", + ) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + json_return_value = compute.Operation.to_json(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + response = client.set_ssl_certificates_unary(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.Operation) + + +def test_set_ssl_certificates_unary_rest_required_fields( + request_type=compute.SetSslCertificatesTargetSslProxyRequest, +): + transport_class = transports.TargetSslProxiesRestTransport + + request_init = {} + request_init["project"] = "" + request_init["target_ssl_proxy"] = "" + request = request_type(request_init) + jsonified_request = json.loads( + request_type.to_json( + request, including_default_value_fields=False, use_integers_for_enums=False + ) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).set_ssl_certificates._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["project"] = "project_value" + jsonified_request["targetSslProxy"] = "target_ssl_proxy_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).set_ssl_certificates._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set(("request_id",)) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "targetSslProxy" in jsonified_request + assert jsonified_request["targetSslProxy"] == "target_ssl_proxy_value" + + client = TargetSslProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": request_init, + } + transcode_result["body"] = {} + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + json_return_value = compute.Operation.to_json(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + + response = client.set_ssl_certificates_unary(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_set_ssl_certificates_unary_rest_unset_required_fields(): + transport = transports.TargetSslProxiesRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.set_ssl_certificates._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "project", + "targetSslProxiesSetSslCertificatesRequestResource", + "targetSslProxy", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_set_ssl_certificates_unary_rest_interceptors(null_interceptor): + transport = transports.TargetSslProxiesRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.TargetSslProxiesRestInterceptor(), + ) + client = TargetSslProxiesClient(transport=transport) + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.TargetSslProxiesRestInterceptor, "post_set_ssl_certificates" + ) as post, mock.patch.object( + transports.TargetSslProxiesRestInterceptor, "pre_set_ssl_certificates" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": None, + "query_params": {}, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Operation.to_json(compute.Operation()) + + request = compute.SetSslCertificatesTargetSslProxyRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation + + client.set_ssl_certificates_unary( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_set_ssl_certificates_unary_rest_bad_request( + transport: str = "rest", + request_type=compute.SetSslCertificatesTargetSslProxyRequest, +): + client = TargetSslProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "target_ssl_proxy": "sample2"} + request_init["target_ssl_proxies_set_ssl_certificates_request_resource"] = { + "ssl_certificates": ["ssl_certificates_value_1", "ssl_certificates_value_2"] + } + request = request_type(request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.set_ssl_certificates_unary(request) + + +def test_set_ssl_certificates_unary_rest_flattened(): + client = TargetSslProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "target_ssl_proxy": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + target_ssl_proxy="target_ssl_proxy_value", + target_ssl_proxies_set_ssl_certificates_request_resource=compute.TargetSslProxiesSetSslCertificatesRequest( + ssl_certificates=["ssl_certificates_value"] + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + json_return_value = compute.Operation.to_json(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + + client.set_ssl_certificates_unary(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setSslCertificates" + % client.transport._host, + args[1], + ) + + +def test_set_ssl_certificates_unary_rest_flattened_error(transport: str = "rest"): + client = TargetSslProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.set_ssl_certificates_unary( + compute.SetSslCertificatesTargetSslProxyRequest(), + project="project_value", + target_ssl_proxy="target_ssl_proxy_value", + target_ssl_proxies_set_ssl_certificates_request_resource=compute.TargetSslProxiesSetSslCertificatesRequest( + ssl_certificates=["ssl_certificates_value"] + ), + ) + + +def test_set_ssl_certificates_unary_rest_error(): + client = TargetSslProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.SetSslPolicyTargetSslProxyRequest, + dict, + ], +) +def test_set_ssl_policy_rest(request_type): + client = TargetSslProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "target_ssl_proxy": "sample2"} + request_init["ssl_policy_reference_resource"] = {"ssl_policy": "ssl_policy_value"} + request = request_type(request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation( + client_operation_id="client_operation_id_value", + creation_timestamp="creation_timestamp_value", + description="description_value", + end_time="end_time_value", + http_error_message="http_error_message_value", + http_error_status_code=2374, + id=205, + insert_time="insert_time_value", + kind="kind_value", + name="name_value", + operation_group_id="operation_group_id_value", + operation_type="operation_type_value", + progress=885, + region="region_value", + self_link="self_link_value", + start_time="start_time_value", + status=compute.Operation.Status.DONE, + status_message="status_message_value", + target_id=947, + target_link="target_link_value", + user="user_value", + zone="zone_value", + ) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + json_return_value = compute.Operation.to_json(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + response = client.set_ssl_policy(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, extended_operation.ExtendedOperation) + assert response.client_operation_id == "client_operation_id_value" + assert response.creation_timestamp == "creation_timestamp_value" + assert response.description == "description_value" + assert response.end_time == "end_time_value" + assert response.http_error_message == "http_error_message_value" + assert response.http_error_status_code == 2374 + assert response.id == 205 + assert response.insert_time == "insert_time_value" + assert response.kind == "kind_value" + assert response.name == "name_value" + assert response.operation_group_id == "operation_group_id_value" + assert response.operation_type == "operation_type_value" + assert response.progress == 885 + assert response.region == "region_value" + assert response.self_link == "self_link_value" + assert response.start_time == "start_time_value" + assert response.status == compute.Operation.Status.DONE + assert response.status_message == "status_message_value" + assert response.target_id == 947 + assert response.target_link == "target_link_value" + assert response.user == "user_value" + assert response.zone == "zone_value" + + +def test_set_ssl_policy_rest_required_fields( + request_type=compute.SetSslPolicyTargetSslProxyRequest, +): + transport_class = transports.TargetSslProxiesRestTransport + + request_init = {} + request_init["project"] = "" + request_init["target_ssl_proxy"] = "" + request = request_type(request_init) + jsonified_request = json.loads( + request_type.to_json( + request, including_default_value_fields=False, use_integers_for_enums=False + ) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).set_ssl_policy._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["project"] = "project_value" + jsonified_request["targetSslProxy"] = "target_ssl_proxy_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).set_ssl_policy._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set(("request_id",)) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "targetSslProxy" in jsonified_request + assert jsonified_request["targetSslProxy"] == "target_ssl_proxy_value" + + client = TargetSslProxiesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": request_init, + } + transcode_result["body"] = {} + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + json_return_value = compute.Operation.to_json(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + + response = client.set_ssl_policy(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_set_ssl_policy_rest_unset_required_fields(): + transport = transports.TargetSslProxiesRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.set_ssl_policy._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "project", + "sslPolicyReferenceResource", + "targetSslProxy", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_set_ssl_policy_rest_interceptors(null_interceptor): + transport = transports.TargetSslProxiesRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.TargetSslProxiesRestInterceptor(), + ) + client = TargetSslProxiesClient(transport=transport) + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.TargetSslProxiesRestInterceptor, "post_set_ssl_policy" + ) as post, mock.patch.object( + transports.TargetSslProxiesRestInterceptor, "pre_set_ssl_policy" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": None, + "query_params": {}, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Operation.to_json(compute.Operation()) + + request = compute.SetSslPolicyTargetSslProxyRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation + + client.set_ssl_policy( request, metadata=[ ("key", "val"), @@ -5061,6 +5726,7 @@ def test_target_ssl_proxies_base_transport(): "insert", "list", "set_backend_service", + "set_certificate_map", "set_proxy_header", "set_ssl_certificates", "set_ssl_policy", @@ -5216,6 +5882,9 @@ def test_target_ssl_proxies_client_transport_session_collision(transport_name): session1 = client1.transport.set_backend_service._session session2 = client2.transport.set_backend_service._session assert session1 != session2 + session1 = client1.transport.set_certificate_map._session + session2 = client2.transport.set_certificate_map._session + assert session1 != session2 session1 = client1.transport.set_proxy_header._session session2 = client2.transport.set_proxy_header._session assert session1 != session2 @@ -5412,4 +6081,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_target_tcp_proxies.py b/tests/unit/gapic/compute_v1/test_target_tcp_proxies.py index 612f25579..76bd43487 100644 --- a/tests/unit/gapic/compute_v1/test_target_tcp_proxies.py +++ b/tests/unit/gapic/compute_v1/test_target_tcp_proxies.py @@ -230,6 +230,7 @@ def test_target_tcp_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -247,6 +248,7 @@ def test_target_tcp_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -264,6 +266,7 @@ def test_target_tcp_proxies_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -293,6 +296,25 @@ def test_target_tcp_proxies_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -353,6 +375,7 @@ def test_target_tcp_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -387,6 +410,7 @@ def test_target_tcp_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -409,6 +433,7 @@ def test_target_tcp_proxies_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -511,6 +536,7 @@ def test_target_tcp_proxies_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -543,6 +569,7 @@ def test_target_tcp_proxies_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -4140,4 +4167,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_target_vpn_gateways.py b/tests/unit/gapic/compute_v1/test_target_vpn_gateways.py index 1b5d2d055..21aaeeb80 100644 --- a/tests/unit/gapic/compute_v1/test_target_vpn_gateways.py +++ b/tests/unit/gapic/compute_v1/test_target_vpn_gateways.py @@ -230,6 +230,7 @@ def test_target_vpn_gateways_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -247,6 +248,7 @@ def test_target_vpn_gateways_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -264,6 +266,7 @@ def test_target_vpn_gateways_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -293,6 +296,25 @@ def test_target_vpn_gateways_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -353,6 +375,7 @@ def test_target_vpn_gateways_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -387,6 +410,7 @@ def test_target_vpn_gateways_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -409,6 +433,7 @@ def test_target_vpn_gateways_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -511,6 +536,7 @@ def test_target_vpn_gateways_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -543,6 +569,7 @@ def test_target_vpn_gateways_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3329,4 +3356,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_url_maps.py b/tests/unit/gapic/compute_v1/test_url_maps.py index 06d0b4ad1..f6137c579 100644 --- a/tests/unit/gapic/compute_v1/test_url_maps.py +++ b/tests/unit/gapic/compute_v1/test_url_maps.py @@ -215,6 +215,7 @@ def test_url_maps_client_client_options(client_class, transport_class, transport quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -232,6 +233,7 @@ def test_url_maps_client_client_options(client_class, transport_class, transport quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -249,6 +251,7 @@ def test_url_maps_client_client_options(client_class, transport_class, transport quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -278,6 +281,25 @@ def test_url_maps_client_client_options(client_class, transport_class, transport quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -326,6 +348,7 @@ def test_url_maps_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -360,6 +383,7 @@ def test_url_maps_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -382,6 +406,7 @@ def test_url_maps_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -482,6 +507,7 @@ def test_url_maps_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -509,6 +535,7 @@ def test_url_maps_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -7649,4 +7676,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_vpn_gateways.py b/tests/unit/gapic/compute_v1/test_vpn_gateways.py index 6b3f1e678..d3b07e7ed 100644 --- a/tests/unit/gapic/compute_v1/test_vpn_gateways.py +++ b/tests/unit/gapic/compute_v1/test_vpn_gateways.py @@ -220,6 +220,7 @@ def test_vpn_gateways_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -237,6 +238,7 @@ def test_vpn_gateways_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -254,6 +256,7 @@ def test_vpn_gateways_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -283,6 +286,25 @@ def test_vpn_gateways_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -331,6 +353,7 @@ def test_vpn_gateways_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -365,6 +388,7 @@ def test_vpn_gateways_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -387,6 +411,7 @@ def test_vpn_gateways_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -487,6 +512,7 @@ def test_vpn_gateways_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -514,6 +540,7 @@ def test_vpn_gateways_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -4539,4 +4566,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_vpn_tunnels.py b/tests/unit/gapic/compute_v1/test_vpn_tunnels.py index 0763f6f83..29a0c724f 100644 --- a/tests/unit/gapic/compute_v1/test_vpn_tunnels.py +++ b/tests/unit/gapic/compute_v1/test_vpn_tunnels.py @@ -220,6 +220,7 @@ def test_vpn_tunnels_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -237,6 +238,7 @@ def test_vpn_tunnels_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -254,6 +256,7 @@ def test_vpn_tunnels_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -283,6 +286,25 @@ def test_vpn_tunnels_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -331,6 +353,7 @@ def test_vpn_tunnels_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -365,6 +388,7 @@ def test_vpn_tunnels_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -387,6 +411,7 @@ def test_vpn_tunnels_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -487,6 +512,7 @@ def test_vpn_tunnels_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -514,6 +540,7 @@ def test_vpn_tunnels_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -3349,4 +3376,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_zone_operations.py b/tests/unit/gapic/compute_v1/test_zone_operations.py index 95167d9f6..fce994c2b 100644 --- a/tests/unit/gapic/compute_v1/test_zone_operations.py +++ b/tests/unit/gapic/compute_v1/test_zone_operations.py @@ -223,6 +223,7 @@ def test_zone_operations_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -240,6 +241,7 @@ def test_zone_operations_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -257,6 +259,7 @@ def test_zone_operations_client_client_options( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -286,6 +289,25 @@ def test_zone_operations_client_client_options( quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -336,6 +358,7 @@ def test_zone_operations_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -370,6 +393,7 @@ def test_zone_operations_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -392,6 +416,7 @@ def test_zone_operations_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -494,6 +519,7 @@ def test_zone_operations_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -521,6 +547,7 @@ def test_zone_operations_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -2241,4 +2268,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) diff --git a/tests/unit/gapic/compute_v1/test_zones.py b/tests/unit/gapic/compute_v1/test_zones.py index 05c18c4e2..60d0949fe 100644 --- a/tests/unit/gapic/compute_v1/test_zones.py +++ b/tests/unit/gapic/compute_v1/test_zones.py @@ -211,6 +211,7 @@ def test_zones_client_client_options(client_class, transport_class, transport_na quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -228,6 +229,7 @@ def test_zones_client_client_options(client_class, transport_class, transport_na quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is @@ -245,6 +247,7 @@ def test_zones_client_client_options(client_class, transport_class, transport_na quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has @@ -274,6 +277,25 @@ def test_zones_client_client_options(client_class, transport_class, transport_na quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + 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=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, + api_audience="https://language.googleapis.com", ) @@ -322,6 +344,7 @@ def test_zones_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case ADC client cert is provided. Whether client cert is used depends on @@ -356,6 +379,7 @@ def test_zones_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) # Check the case client_cert_source and ADC client cert are not provided. @@ -378,6 +402,7 @@ def test_zones_client_mtls_env_auto( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -478,6 +503,7 @@ def test_zones_client_client_options_scopes( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -505,6 +531,7 @@ def test_zones_client_client_options_credentials_file( quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, ) @@ -1561,4 +1588,5 @@ def test_api_key_credentials(client_class, transport_class): quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, always_use_jwt_access=True, + api_audience=None, )