Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

Commit

Permalink
feat: add audience parameter (#291)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 456827138

Source-Link: googleapis/googleapis@23f1a15

Source-Link: googleapis/googleapis-gen@4075a85
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDA3NWE4NTE0ZjY3NjY5MWVjMTU2Njg4YTViYmYxODNhYTk4OTNjZSJ9

feat: Update Compute Engine API to revision 20220526 (#722)
Source-Link: googleapis/googleapis@950dd73

Source-Link: googleapis/googleapis-gen@57ace17
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTdhY2UxNzhjODU0M2M0NDYyNzgyMzA0NTkxNzgyMGQ2N2I0OTBjMSJ9

fix(deps): require google-api-core 2.8.0
  • Loading branch information
gcf-owl-bot[bot] committed Jul 15, 2022
1 parent 5b82f47 commit 058eb3a
Show file tree
Hide file tree
Showing 349 changed files with 9,937 additions and 1,897 deletions.
14 changes: 14 additions & 0 deletions google/cloud/compute/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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,
)
Expand All @@ -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,
Expand Down Expand Up @@ -2926,6 +2936,8 @@
"SetBackendServiceTargetSslProxyRequest",
"SetBackendServiceTargetTcpProxyRequest",
"SetBackupTargetPoolRequest",
"SetCertificateMapTargetHttpsProxyRequest",
"SetCertificateMapTargetSslProxyRequest",
"SetCommonInstanceMetadataProjectRequest",
"SetDefaultNetworkTierProjectRequest",
"SetDeletionProtectionInstanceRequest",
Expand Down Expand Up @@ -3039,6 +3051,7 @@
"TargetHttpProxyAggregatedList",
"TargetHttpProxyList",
"TargetHttpsProxiesScopedList",
"TargetHttpsProxiesSetCertificateMapRequest",
"TargetHttpsProxiesSetQuicOverrideRequest",
"TargetHttpsProxiesSetSslCertificatesRequest",
"TargetHttpsProxy",
Expand All @@ -3059,6 +3072,7 @@
"TargetPoolsScopedList",
"TargetReference",
"TargetSslProxiesSetBackendServiceRequest",
"TargetSslProxiesSetCertificateMapRequest",
"TargetSslProxiesSetProxyHeaderRequest",
"TargetSslProxiesSetSslCertificatesRequest",
"TargetSslProxy",
Expand Down
8 changes: 8 additions & 0 deletions google/cloud/compute_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -2444,6 +2448,8 @@
"SetBackendServiceTargetSslProxyRequest",
"SetBackendServiceTargetTcpProxyRequest",
"SetBackupTargetPoolRequest",
"SetCertificateMapTargetHttpsProxyRequest",
"SetCertificateMapTargetSslProxyRequest",
"SetCommonInstanceMetadataProjectRequest",
"SetDefaultNetworkTierProjectRequest",
"SetDeletionProtectionInstanceRequest",
Expand Down Expand Up @@ -2564,6 +2570,7 @@
"TargetHttpProxyList",
"TargetHttpsProxiesClient",
"TargetHttpsProxiesScopedList",
"TargetHttpsProxiesSetCertificateMapRequest",
"TargetHttpsProxiesSetQuicOverrideRequest",
"TargetHttpsProxiesSetSslCertificatesRequest",
"TargetHttpsProxy",
Expand All @@ -2587,6 +2594,7 @@
"TargetReference",
"TargetSslProxiesClient",
"TargetSslProxiesSetBackendServiceRequest",
"TargetSslProxiesSetCertificateMapRequest",
"TargetSslProxiesSetProxyHeaderRequest",
"TargetSslProxiesSetSslCertificatesRequest",
"TargetSslProxy",
Expand Down
10 changes: 10 additions & 0 deletions google/cloud/compute_v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3561,6 +3561,11 @@
"patch"
]
},
"SetCertificateMap": {
"methods": [
"set_certificate_map"
]
},
"SetQuicOverride": {
"methods": [
"set_quic_override"
Expand Down Expand Up @@ -3713,6 +3718,11 @@
"set_backend_service"
]
},
"SetCertificateMap": {
"methods": [
"set_certificate_map"
]
},
"SetProxyHeader": {
"methods": [
"set_proxy_header"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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 (
Expand All @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions google/cloud/compute_v1/services/addresses/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
16 changes: 11 additions & 5 deletions google/cloud/compute_v1/services/addresses/transports/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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 (
Expand All @@ -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 = {
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/compute_v1/services/addresses/transports/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions google/cloud/compute_v1/services/autoscalers/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
16 changes: 11 additions & 5 deletions google/cloud/compute_v1/services/autoscalers/transports/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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 (
Expand All @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions google/cloud/compute_v1/services/backend_buckets/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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 (
Expand All @@ -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 = {
Expand Down
Loading

0 comments on commit 058eb3a

Please sign in to comment.