Skip to content

Commit 068548b

Browse files
feat: Update Compute Engine API to revision 20221101 (#751) (#367)
* feat: Update Compute Engine API to revision 20221101 (#751) Source-Link: googleapis/googleapis@b0432a1 Source-Link: googleapis/googleapis-gen@18b7021 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMThiNzAyMTQ4N2M0YTFlOTQyN2I2MWIxZjIxODVhMzJjNzMzYzM0MCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 6fcf667 commit 068548b

File tree

10 files changed

+1038
-82
lines changed

10 files changed

+1038
-82
lines changed

packages/google-cloud-compute/google/cloud/compute/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@
276276
AggregatedListTargetHttpsProxiesRequest,
277277
AggregatedListTargetInstancesRequest,
278278
AggregatedListTargetPoolsRequest,
279+
AggregatedListTargetTcpProxiesRequest,
279280
AggregatedListTargetVpnGatewaysRequest,
280281
AggregatedListUrlMapsRequest,
281282
AggregatedListVpnGatewaysRequest,
@@ -1401,9 +1402,11 @@
14011402
TargetSslProxiesSetSslCertificatesRequest,
14021403
TargetSslProxy,
14031404
TargetSslProxyList,
1405+
TargetTcpProxiesScopedList,
14041406
TargetTcpProxiesSetBackendServiceRequest,
14051407
TargetTcpProxiesSetProxyHeaderRequest,
14061408
TargetTcpProxy,
1409+
TargetTcpProxyAggregatedList,
14071410
TargetTcpProxyList,
14081411
TargetVpnGateway,
14091412
TargetVpnGatewayAggregatedList,
@@ -1662,6 +1665,7 @@
16621665
"AggregatedListTargetHttpsProxiesRequest",
16631666
"AggregatedListTargetInstancesRequest",
16641667
"AggregatedListTargetPoolsRequest",
1668+
"AggregatedListTargetTcpProxiesRequest",
16651669
"AggregatedListTargetVpnGatewaysRequest",
16661670
"AggregatedListUrlMapsRequest",
16671671
"AggregatedListVpnGatewaysRequest",
@@ -2787,9 +2791,11 @@
27872791
"TargetSslProxiesSetSslCertificatesRequest",
27882792
"TargetSslProxy",
27892793
"TargetSslProxyList",
2794+
"TargetTcpProxiesScopedList",
27902795
"TargetTcpProxiesSetBackendServiceRequest",
27912796
"TargetTcpProxiesSetProxyHeaderRequest",
27922797
"TargetTcpProxy",
2798+
"TargetTcpProxyAggregatedList",
27932799
"TargetTcpProxyList",
27942800
"TargetVpnGateway",
27952801
"TargetVpnGatewayAggregatedList",

packages/google-cloud-compute/google/cloud/compute_v1/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@
176176
AggregatedListTargetHttpsProxiesRequest,
177177
AggregatedListTargetInstancesRequest,
178178
AggregatedListTargetPoolsRequest,
179+
AggregatedListTargetTcpProxiesRequest,
179180
AggregatedListTargetVpnGatewaysRequest,
180181
AggregatedListUrlMapsRequest,
181182
AggregatedListVpnGatewaysRequest,
@@ -1301,9 +1302,11 @@
13011302
TargetSslProxiesSetSslCertificatesRequest,
13021303
TargetSslProxy,
13031304
TargetSslProxyList,
1305+
TargetTcpProxiesScopedList,
13041306
TargetTcpProxiesSetBackendServiceRequest,
13051307
TargetTcpProxiesSetProxyHeaderRequest,
13061308
TargetTcpProxy,
1309+
TargetTcpProxyAggregatedList,
13071310
TargetTcpProxyList,
13081311
TargetVpnGateway,
13091312
TargetVpnGatewayAggregatedList,
@@ -1477,6 +1480,7 @@
14771480
"AggregatedListTargetHttpsProxiesRequest",
14781481
"AggregatedListTargetInstancesRequest",
14791482
"AggregatedListTargetPoolsRequest",
1483+
"AggregatedListTargetTcpProxiesRequest",
14801484
"AggregatedListTargetVpnGatewaysRequest",
14811485
"AggregatedListUrlMapsRequest",
14821486
"AggregatedListVpnGatewaysRequest",
@@ -2682,9 +2686,11 @@
26822686
"TargetSslProxy",
26832687
"TargetSslProxyList",
26842688
"TargetTcpProxiesClient",
2689+
"TargetTcpProxiesScopedList",
26852690
"TargetTcpProxiesSetBackendServiceRequest",
26862691
"TargetTcpProxiesSetProxyHeaderRequest",
26872692
"TargetTcpProxy",
2693+
"TargetTcpProxyAggregatedList",
26882694
"TargetTcpProxyList",
26892695
"TargetVpnGateway",
26902696
"TargetVpnGatewayAggregatedList",

packages/google-cloud-compute/google/cloud/compute_v1/gapic_metadata.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3865,6 +3865,11 @@
38653865
"rest": {
38663866
"libraryClient": "TargetTcpProxiesClient",
38673867
"rpcs": {
3868+
"AggregatedList": {
3869+
"methods": [
3870+
"aggregated_list"
3871+
]
3872+
},
38683873
"Delete": {
38693874
"methods": [
38703875
"delete"

packages/google-cloud-compute/google/cloud/compute_v1/services/target_tcp_proxies/client.py

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,96 @@ def __init__(
422422
api_audience=client_options.api_audience,
423423
)
424424

425+
def aggregated_list(
426+
self,
427+
request: Optional[
428+
Union[compute.AggregatedListTargetTcpProxiesRequest, dict]
429+
] = None,
430+
*,
431+
project: Optional[str] = None,
432+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
433+
timeout: Optional[float] = None,
434+
metadata: Sequence[Tuple[str, str]] = (),
435+
) -> pagers.AggregatedListPager:
436+
r"""Retrieves the list of all TargetTcpProxy resources,
437+
regional and global, available to the specified project.
438+
439+
Args:
440+
request (Union[google.cloud.compute_v1.types.AggregatedListTargetTcpProxiesRequest, dict]):
441+
The request object. A request message for
442+
TargetTcpProxies.AggregatedList. See the method
443+
description for details.
444+
project (str):
445+
Name of the project scoping this
446+
request.
447+
448+
This corresponds to the ``project`` field
449+
on the ``request`` instance; if ``request`` is provided, this
450+
should not be set.
451+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
452+
should be retried.
453+
timeout (float): The timeout for this request.
454+
metadata (Sequence[Tuple[str, str]]): Strings which should be
455+
sent along with the request as metadata.
456+
457+
Returns:
458+
google.cloud.compute_v1.services.target_tcp_proxies.pagers.AggregatedListPager:
459+
Iterating over this object will yield
460+
results and resolve additional pages
461+
automatically.
462+
463+
"""
464+
# Create or coerce a protobuf request object.
465+
# Quick check: If we got a request object, we should *not* have
466+
# gotten any keyword arguments that map to the request.
467+
has_flattened_params = any([project])
468+
if request is not None and has_flattened_params:
469+
raise ValueError(
470+
"If the `request` argument is set, then none of "
471+
"the individual field arguments should be set."
472+
)
473+
474+
# Minor optimization to avoid making a copy if the user passes
475+
# in a compute.AggregatedListTargetTcpProxiesRequest.
476+
# There's no risk of modifying the input as we've already verified
477+
# there are no flattened fields.
478+
if not isinstance(request, compute.AggregatedListTargetTcpProxiesRequest):
479+
request = compute.AggregatedListTargetTcpProxiesRequest(request)
480+
# If we have keyword arguments corresponding to fields on the
481+
# request, apply these.
482+
if project is not None:
483+
request.project = project
484+
485+
# Wrap the RPC method; this adds retry and timeout information,
486+
# and friendly error handling.
487+
rpc = self._transport._wrapped_methods[self._transport.aggregated_list]
488+
489+
# Certain fields should be provided within the metadata header;
490+
# add these here.
491+
metadata = tuple(metadata) + (
492+
gapic_v1.routing_header.to_grpc_metadata((("project", request.project),)),
493+
)
494+
495+
# Send the request.
496+
response = rpc(
497+
request,
498+
retry=retry,
499+
timeout=timeout,
500+
metadata=metadata,
501+
)
502+
503+
# This method is paged; wrap the response in a pager, which provides
504+
# an `__iter__` convenience method.
505+
response = pagers.AggregatedListPager(
506+
method=rpc,
507+
request=request,
508+
response=response,
509+
metadata=metadata,
510+
)
511+
512+
# Done; return the response.
513+
return response
514+
425515
def delete_unary(
426516
self,
427517
request: Optional[Union[compute.DeleteTargetTcpProxyRequest, dict]] = None,

packages/google-cloud-compute/google/cloud/compute_v1/services/target_tcp_proxies/pagers.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,71 @@
2727
from google.cloud.compute_v1.types import compute
2828

2929

30+
class AggregatedListPager:
31+
"""A pager for iterating through ``aggregated_list`` requests.
32+
33+
This class thinly wraps an initial
34+
:class:`google.cloud.compute_v1.types.TargetTcpProxyAggregatedList` object, and
35+
provides an ``__iter__`` method to iterate through its
36+
``items`` field.
37+
38+
If there are more pages, the ``__iter__`` method will make additional
39+
``AggregatedList`` requests and continue to iterate
40+
through the ``items`` field on the
41+
corresponding responses.
42+
43+
All the usual :class:`google.cloud.compute_v1.types.TargetTcpProxyAggregatedList`
44+
attributes are available on the pager. If multiple requests are made, only
45+
the most recent response is retained, and thus used for attribute lookup.
46+
"""
47+
48+
def __init__(
49+
self,
50+
method: Callable[..., compute.TargetTcpProxyAggregatedList],
51+
request: compute.AggregatedListTargetTcpProxiesRequest,
52+
response: compute.TargetTcpProxyAggregatedList,
53+
*,
54+
metadata: Sequence[Tuple[str, str]] = ()
55+
):
56+
"""Instantiate the pager.
57+
58+
Args:
59+
method (Callable): The method that was originally called, and
60+
which instantiated this pager.
61+
request (google.cloud.compute_v1.types.AggregatedListTargetTcpProxiesRequest):
62+
The initial request object.
63+
response (google.cloud.compute_v1.types.TargetTcpProxyAggregatedList):
64+
The initial response object.
65+
metadata (Sequence[Tuple[str, str]]): Strings which should be
66+
sent along with the request as metadata.
67+
"""
68+
self._method = method
69+
self._request = compute.AggregatedListTargetTcpProxiesRequest(request)
70+
self._response = response
71+
self._metadata = metadata
72+
73+
def __getattr__(self, name: str) -> Any:
74+
return getattr(self._response, name)
75+
76+
@property
77+
def pages(self) -> Iterator[compute.TargetTcpProxyAggregatedList]:
78+
yield self._response
79+
while self._response.next_page_token:
80+
self._request.page_token = self._response.next_page_token
81+
self._response = self._method(self._request, metadata=self._metadata)
82+
yield self._response
83+
84+
def __iter__(self) -> Iterator[Tuple[str, compute.TargetTcpProxiesScopedList]]:
85+
for page in self.pages:
86+
yield from page.items.items()
87+
88+
def get(self, key: str) -> Optional[compute.TargetTcpProxiesScopedList]:
89+
return self._response.items.get(key)
90+
91+
def __repr__(self) -> str:
92+
return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
93+
94+
3095
class ListPager:
3196
"""A pager for iterating through ``list`` requests.
3297

packages/google-cloud-compute/google/cloud/compute_v1/services/target_tcp_proxies/transports/base.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ def __init__(
132132
def _prep_wrapped_messages(self, client_info):
133133
# Precompute the wrapped methods.
134134
self._wrapped_methods = {
135+
self.aggregated_list: gapic_v1.method.wrap_method(
136+
self.aggregated_list,
137+
default_timeout=None,
138+
client_info=client_info,
139+
),
135140
self.delete: gapic_v1.method.wrap_method(
136141
self.delete,
137142
default_timeout=None,
@@ -173,6 +178,18 @@ def close(self):
173178
"""
174179
raise NotImplementedError()
175180

181+
@property
182+
def aggregated_list(
183+
self,
184+
) -> Callable[
185+
[compute.AggregatedListTargetTcpProxiesRequest],
186+
Union[
187+
compute.TargetTcpProxyAggregatedList,
188+
Awaitable[compute.TargetTcpProxyAggregatedList],
189+
],
190+
]:
191+
raise NotImplementedError()
192+
176193
@property
177194
def delete(
178195
self,

0 commit comments

Comments
 (0)