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

Commit 058eb3a

Browse files
feat: add audience parameter (#291)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 456827138 Source-Link: googleapis/googleapis@23f1a15 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4075a8514f676691ec156688a5bbf183aa9893ce Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDA3NWE4NTE0ZjY3NjY5MWVjMTU2Njg4YTViYmYxODNhYTk4OTNjZSJ9 feat: Update Compute Engine API to revision 20220526 (#722) Source-Link: googleapis/googleapis@950dd73 Source-Link: https://github.com/googleapis/googleapis-gen/commit/57ace178c8543c44627823045917820d67b490c1 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTdhY2UxNzhjODU0M2M0NDYyNzgyMzA0NTkxNzgyMGQ2N2I0OTBjMSJ9 fix(deps): require google-api-core 2.8.0
1 parent 5b82f47 commit 058eb3a

File tree

349 files changed

+9937
-1897
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

349 files changed

+9937
-1897
lines changed

google/cloud/compute/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,6 +1510,10 @@
15101510
from google.cloud.compute_v1.types.compute import SetBackendServiceTargetSslProxyRequest
15111511
from google.cloud.compute_v1.types.compute import SetBackendServiceTargetTcpProxyRequest
15121512
from google.cloud.compute_v1.types.compute import SetBackupTargetPoolRequest
1513+
from google.cloud.compute_v1.types.compute import (
1514+
SetCertificateMapTargetHttpsProxyRequest,
1515+
)
1516+
from google.cloud.compute_v1.types.compute import SetCertificateMapTargetSslProxyRequest
15131517
from google.cloud.compute_v1.types.compute import (
15141518
SetCommonInstanceMetadataProjectRequest,
15151519
)
@@ -1661,6 +1665,9 @@
16611665
from google.cloud.compute_v1.types.compute import TargetHttpProxyAggregatedList
16621666
from google.cloud.compute_v1.types.compute import TargetHttpProxyList
16631667
from google.cloud.compute_v1.types.compute import TargetHttpsProxiesScopedList
1668+
from google.cloud.compute_v1.types.compute import (
1669+
TargetHttpsProxiesSetCertificateMapRequest,
1670+
)
16641671
from google.cloud.compute_v1.types.compute import (
16651672
TargetHttpsProxiesSetQuicOverrideRequest,
16661673
)
@@ -1687,6 +1694,9 @@
16871694
from google.cloud.compute_v1.types.compute import (
16881695
TargetSslProxiesSetBackendServiceRequest,
16891696
)
1697+
from google.cloud.compute_v1.types.compute import (
1698+
TargetSslProxiesSetCertificateMapRequest,
1699+
)
16901700
from google.cloud.compute_v1.types.compute import TargetSslProxiesSetProxyHeaderRequest
16911701
from google.cloud.compute_v1.types.compute import (
16921702
TargetSslProxiesSetSslCertificatesRequest,
@@ -2926,6 +2936,8 @@
29262936
"SetBackendServiceTargetSslProxyRequest",
29272937
"SetBackendServiceTargetTcpProxyRequest",
29282938
"SetBackupTargetPoolRequest",
2939+
"SetCertificateMapTargetHttpsProxyRequest",
2940+
"SetCertificateMapTargetSslProxyRequest",
29292941
"SetCommonInstanceMetadataProjectRequest",
29302942
"SetDefaultNetworkTierProjectRequest",
29312943
"SetDeletionProtectionInstanceRequest",
@@ -3039,6 +3051,7 @@
30393051
"TargetHttpProxyAggregatedList",
30403052
"TargetHttpProxyList",
30413053
"TargetHttpsProxiesScopedList",
3054+
"TargetHttpsProxiesSetCertificateMapRequest",
30423055
"TargetHttpsProxiesSetQuicOverrideRequest",
30433056
"TargetHttpsProxiesSetSslCertificatesRequest",
30443057
"TargetHttpsProxy",
@@ -3059,6 +3072,7 @@
30593072
"TargetPoolsScopedList",
30603073
"TargetReference",
30613074
"TargetSslProxiesSetBackendServiceRequest",
3075+
"TargetSslProxiesSetCertificateMapRequest",
30623076
"TargetSslProxiesSetProxyHeaderRequest",
30633077
"TargetSslProxiesSetSslCertificatesRequest",
30643078
"TargetSslProxy",

google/cloud/compute_v1/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,8 @@
11201120
from .types.compute import SetBackendServiceTargetSslProxyRequest
11211121
from .types.compute import SetBackendServiceTargetTcpProxyRequest
11221122
from .types.compute import SetBackupTargetPoolRequest
1123+
from .types.compute import SetCertificateMapTargetHttpsProxyRequest
1124+
from .types.compute import SetCertificateMapTargetSslProxyRequest
11231125
from .types.compute import SetCommonInstanceMetadataProjectRequest
11241126
from .types.compute import SetDefaultNetworkTierProjectRequest
11251127
from .types.compute import SetDeletionProtectionInstanceRequest
@@ -1233,6 +1235,7 @@
12331235
from .types.compute import TargetHttpProxyAggregatedList
12341236
from .types.compute import TargetHttpProxyList
12351237
from .types.compute import TargetHttpsProxiesScopedList
1238+
from .types.compute import TargetHttpsProxiesSetCertificateMapRequest
12361239
from .types.compute import TargetHttpsProxiesSetQuicOverrideRequest
12371240
from .types.compute import TargetHttpsProxiesSetSslCertificatesRequest
12381241
from .types.compute import TargetHttpsProxy
@@ -1253,6 +1256,7 @@
12531256
from .types.compute import TargetPoolsScopedList
12541257
from .types.compute import TargetReference
12551258
from .types.compute import TargetSslProxiesSetBackendServiceRequest
1259+
from .types.compute import TargetSslProxiesSetCertificateMapRequest
12561260
from .types.compute import TargetSslProxiesSetProxyHeaderRequest
12571261
from .types.compute import TargetSslProxiesSetSslCertificatesRequest
12581262
from .types.compute import TargetSslProxy
@@ -2444,6 +2448,8 @@
24442448
"SetBackendServiceTargetSslProxyRequest",
24452449
"SetBackendServiceTargetTcpProxyRequest",
24462450
"SetBackupTargetPoolRequest",
2451+
"SetCertificateMapTargetHttpsProxyRequest",
2452+
"SetCertificateMapTargetSslProxyRequest",
24472453
"SetCommonInstanceMetadataProjectRequest",
24482454
"SetDefaultNetworkTierProjectRequest",
24492455
"SetDeletionProtectionInstanceRequest",
@@ -2564,6 +2570,7 @@
25642570
"TargetHttpProxyList",
25652571
"TargetHttpsProxiesClient",
25662572
"TargetHttpsProxiesScopedList",
2573+
"TargetHttpsProxiesSetCertificateMapRequest",
25672574
"TargetHttpsProxiesSetQuicOverrideRequest",
25682575
"TargetHttpsProxiesSetSslCertificatesRequest",
25692576
"TargetHttpsProxy",
@@ -2587,6 +2594,7 @@
25872594
"TargetReference",
25882595
"TargetSslProxiesClient",
25892596
"TargetSslProxiesSetBackendServiceRequest",
2597+
"TargetSslProxiesSetCertificateMapRequest",
25902598
"TargetSslProxiesSetProxyHeaderRequest",
25912599
"TargetSslProxiesSetSslCertificatesRequest",
25922600
"TargetSslProxy",

google/cloud/compute_v1/gapic_metadata.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3561,6 +3561,11 @@
35613561
"patch"
35623562
]
35633563
},
3564+
"SetCertificateMap": {
3565+
"methods": [
3566+
"set_certificate_map"
3567+
]
3568+
},
35643569
"SetQuicOverride": {
35653570
"methods": [
35663571
"set_quic_override"
@@ -3713,6 +3718,11 @@
37133718
"set_backend_service"
37143719
]
37153720
},
3721+
"SetCertificateMap": {
3722+
"methods": [
3723+
"set_certificate_map"
3724+
]
3725+
},
37163726
"SetProxyHeader": {
37173727
"methods": [
37183728
"set_proxy_header"

google/cloud/compute_v1/services/accelerator_types/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ def __init__(
402402
quota_project_id=client_options.quota_project_id,
403403
client_info=client_info,
404404
always_use_jwt_access=True,
405+
api_audience=client_options.api_audience,
405406
)
406407

407408
def aggregated_list(

google/cloud/compute_v1/services/accelerator_types/transports/base.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def __init__(
5858
quota_project_id: Optional[str] = None,
5959
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
6060
always_use_jwt_access: Optional[bool] = False,
61+
api_audience: Optional[str] = None,
6162
**kwargs,
6263
) -> None:
6364
"""Instantiate the transport.
@@ -85,11 +86,6 @@ def __init__(
8586
be used for service account credentials.
8687
"""
8788

88-
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
89-
if ":" not in host:
90-
host += ":443"
91-
self._host = host
92-
9389
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
9490

9591
# Save the scopes.
@@ -110,6 +106,11 @@ def __init__(
110106
credentials, _ = google.auth.default(
111107
**scopes_kwargs, quota_project_id=quota_project_id
112108
)
109+
# Don't apply audience if the credentials file passed from user.
110+
if hasattr(credentials, "with_gdch_audience"):
111+
credentials = credentials.with_gdch_audience(
112+
api_audience if api_audience else host
113+
)
113114

114115
# If the credentials are service account credentials, then always try to use self signed JWT.
115116
if (
@@ -122,6 +123,11 @@ def __init__(
122123
# Save the credentials.
123124
self._credentials = credentials
124125

126+
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
127+
if ":" not in host:
128+
host += ":443"
129+
self._host = host
130+
125131
def _prep_wrapped_messages(self, client_info):
126132
# Precompute the wrapped methods.
127133
self._wrapped_methods = {

google/cloud/compute_v1/services/accelerator_types/transports/rest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ def __init__(
198198
always_use_jwt_access: Optional[bool] = False,
199199
url_scheme: str = "https",
200200
interceptor: Optional[AcceleratorTypesRestInterceptor] = None,
201+
api_audience: Optional[str] = None,
201202
) -> None:
202203
"""Instantiate the transport.
203204
@@ -250,6 +251,7 @@ def __init__(
250251
credentials=credentials,
251252
client_info=client_info,
252253
always_use_jwt_access=always_use_jwt_access,
254+
api_audience=api_audience,
253255
)
254256
self._session = AuthorizedSession(
255257
self._credentials, default_host=self.DEFAULT_HOST

google/cloud/compute_v1/services/addresses/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ def __init__(
401401
quota_project_id=client_options.quota_project_id,
402402
client_info=client_info,
403403
always_use_jwt_access=True,
404+
api_audience=client_options.api_audience,
404405
)
405406

406407
def aggregated_list(

google/cloud/compute_v1/services/addresses/transports/base.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def __init__(
5858
quota_project_id: Optional[str] = None,
5959
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
6060
always_use_jwt_access: Optional[bool] = False,
61+
api_audience: Optional[str] = None,
6162
**kwargs,
6263
) -> None:
6364
"""Instantiate the transport.
@@ -86,11 +87,6 @@ def __init__(
8687
"""
8788
self._extended_operations_services: Dict[str, Any] = {}
8889

89-
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
90-
if ":" not in host:
91-
host += ":443"
92-
self._host = host
93-
9490
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
9591

9692
# Save the scopes.
@@ -111,6 +107,11 @@ def __init__(
111107
credentials, _ = google.auth.default(
112108
**scopes_kwargs, quota_project_id=quota_project_id
113109
)
110+
# Don't apply audience if the credentials file passed from user.
111+
if hasattr(credentials, "with_gdch_audience"):
112+
credentials = credentials.with_gdch_audience(
113+
api_audience if api_audience else host
114+
)
114115

115116
# If the credentials are service account credentials, then always try to use self signed JWT.
116117
if (
@@ -123,6 +124,11 @@ def __init__(
123124
# Save the credentials.
124125
self._credentials = credentials
125126

127+
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
128+
if ":" not in host:
129+
host += ":443"
130+
self._host = host
131+
126132
def _prep_wrapped_messages(self, client_info):
127133
# Precompute the wrapped methods.
128134
self._wrapped_methods = {

google/cloud/compute_v1/services/addresses/transports/rest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ def __init__(
238238
always_use_jwt_access: Optional[bool] = False,
239239
url_scheme: str = "https",
240240
interceptor: Optional[AddressesRestInterceptor] = None,
241+
api_audience: Optional[str] = None,
241242
) -> None:
242243
"""Instantiate the transport.
243244
@@ -290,6 +291,7 @@ def __init__(
290291
credentials=credentials,
291292
client_info=client_info,
292293
always_use_jwt_access=always_use_jwt_access,
294+
api_audience=api_audience,
293295
)
294296
self._session = AuthorizedSession(
295297
self._credentials, default_host=self.DEFAULT_HOST

google/cloud/compute_v1/services/autoscalers/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ def __init__(
401401
quota_project_id=client_options.quota_project_id,
402402
client_info=client_info,
403403
always_use_jwt_access=True,
404+
api_audience=client_options.api_audience,
404405
)
405406

406407
def aggregated_list(

0 commit comments

Comments
 (0)