Skip to content

Commit ed8918f

Browse files
chore: [Many APIs] Update gapic-generator-python to v1.17.1 (#12637)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 629071173 Source-Link: googleapis/googleapis@4afa392 Source-Link: googleapis/googleapis-gen@16dbbb4 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJ1aWxkLy5Pd2xCb3QueWFtbCIsImgiOiIxNmRiYmI0ZDA0NTdkYjVlNjFhYzlmOTliMGQ1MmE0NjE1NDQ1NWFjIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNlcnRpZmljYXRlLW1hbmFnZXIvLk93bEJvdC55YW1sIiwiaCI6IjE2ZGJiYjRkMDQ1N2RiNWU2MWFjOWY5OWIwZDUyYTQ2MTU0NDU1YWMifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNoYW5uZWwvLk93bEJvdC55YW1sIiwiaCI6IjE2ZGJiYjRkMDQ1N2RiNWU2MWFjOWY5OWIwZDUyYTQ2MTU0NDU1YWMifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNsb3VkY29udHJvbHNwYXJ0bmVyLy5Pd2xCb3QueWFtbCIsImgiOiIxNmRiYmI0ZDA0NTdkYjVlNjFhYzlmOTliMGQ1MmE0NjE1NDQ1NWFjIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNsb3VkcXVvdGFzLy5Pd2xCb3QueWFtbCIsImgiOiIxNmRiYmI0ZDA0NTdkYjVlNjFhYzlmOTliMGQ1MmE0NjE1NDQ1NWFjIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbW1lcmNlLWNvbnN1bWVyLXByb2N1cmVtZW50Ly5Pd2xCb3QueWFtbCIsImgiOiIxNmRiYmI0ZDA0NTdkYjVlNjFhYzlmOTliMGQ1MmE0NjE1NDQ1NW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NDYxNTQ0NTVhYyJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent f515bc6 commit ed8918f

225 files changed

Lines changed: 73088 additions & 9642 deletions

File tree

Some content is hidden

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

packages/google-cloud-build/google/cloud/devtools/cloudbuild_v1/services/cloud_build/async_client.py

Lines changed: 169 additions & 216 deletions
Large diffs are not rendered by default.

packages/google-cloud-build/google/cloud/devtools/cloudbuild_v1/services/cloud_build/client.py

Lines changed: 88 additions & 112 deletions
Large diffs are not rendered by default.

packages/google-cloud-build/google/cloud/devtools/cloudbuild_v1/services/cloud_build/transports/grpc.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def __init__(
5858
credentials: Optional[ga_credentials.Credentials] = None,
5959
credentials_file: Optional[str] = None,
6060
scopes: Optional[Sequence[str]] = None,
61-
channel: Optional[grpc.Channel] = None,
61+
channel: Optional[Union[grpc.Channel, Callable[..., grpc.Channel]]] = None,
6262
api_mtls_endpoint: Optional[str] = None,
6363
client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
6464
ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
@@ -78,14 +78,17 @@ def __init__(
7878
credentials identify the application to the service; if none
7979
are specified, the client will attempt to ascertain the
8080
credentials from the environment.
81-
This argument is ignored if ``channel`` is provided.
81+
This argument is ignored if a ``channel`` instance is provided.
8282
credentials_file (Optional[str]): A file with credentials that can
8383
be loaded with :func:`google.auth.load_credentials_from_file`.
84-
This argument is ignored if ``channel`` is provided.
84+
This argument is ignored if a ``channel`` instance is provided.
8585
scopes (Optional(Sequence[str])): A list of scopes. This argument is
86-
ignored if ``channel`` is provided.
87-
channel (Optional[grpc.Channel]): A ``Channel`` instance through
88-
which to make calls.
86+
ignored if a ``channel`` instance is provided.
87+
channel (Optional[Union[grpc.Channel, Callable[..., grpc.Channel]]]):
88+
A ``Channel`` instance through which to make calls, or a Callable
89+
that constructs and returns one. If set to None, ``self.create_channel``
90+
is used to create the channel. If a Callable is given, it will be called
91+
with the same arguments as used in ``self.create_channel``.
8992
api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
9093
If provided, it overrides the ``host`` argument and tries to create
9194
a mutual TLS channel with client SSL credentials from
@@ -95,11 +98,11 @@ def __init__(
9598
private key bytes, both in PEM format. It is ignored if
9699
``api_mtls_endpoint`` is None.
97100
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
98-
for the grpc channel. It is ignored if ``channel`` is provided.
101+
for the grpc channel. It is ignored if a ``channel`` instance is provided.
99102
client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
100103
A callback to provide client certificate bytes and private key bytes,
101104
both in PEM format. It is used to configure a mutual TLS channel. It is
102-
ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
105+
ignored if a ``channel`` instance or ``ssl_channel_credentials`` is provided.
103106
quota_project_id (Optional[str]): An optional project to use for billing
104107
and quota.
105108
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
@@ -126,7 +129,7 @@ def __init__(
126129
if client_cert_source:
127130
warnings.warn("client_cert_source is deprecated", DeprecationWarning)
128131

129-
if channel:
132+
if isinstance(channel, grpc.Channel):
130133
# Ignore credentials if a channel was passed.
131134
credentials = False
132135
# If a channel was explicitly provided, set it.
@@ -167,7 +170,9 @@ def __init__(
167170
)
168171

169172
if not self._grpc_channel:
170-
self._grpc_channel = type(self).create_channel(
173+
# initialize with the provided callable or the default channel
174+
channel_init = channel or type(self).create_channel
175+
self._grpc_channel = channel_init(
171176
self._host,
172177
# use the credentials which are saved
173178
credentials=self._credentials,

packages/google-cloud-build/google/cloud/devtools/cloudbuild_v1/services/cloud_build/transports/grpc_asyncio.py

Lines changed: 181 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
1717
import warnings
1818

19+
from google.api_core import exceptions as core_exceptions
1920
from google.api_core import gapic_v1, grpc_helpers_async, operations_v1
21+
from google.api_core import retry_async as retries
2022
from google.auth import credentials as ga_credentials # type: ignore
2123
from google.auth.transport.grpc import SslCredentials # type: ignore
2224
from google.longrunning import operations_pb2 # type: ignore
@@ -73,7 +75,6 @@ def create_channel(
7375
the credentials from the environment.
7476
credentials_file (Optional[str]): A file with credentials that can
7577
be loaded with :func:`google.auth.load_credentials_from_file`.
76-
This argument is ignored if ``channel`` is provided.
7778
scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
7879
service. These are only used when credentials are not specified and
7980
are passed to :func:`google.auth.default`.
@@ -103,7 +104,7 @@ def __init__(
103104
credentials: Optional[ga_credentials.Credentials] = None,
104105
credentials_file: Optional[str] = None,
105106
scopes: Optional[Sequence[str]] = None,
106-
channel: Optional[aio.Channel] = None,
107+
channel: Optional[Union[aio.Channel, Callable[..., aio.Channel]]] = None,
107108
api_mtls_endpoint: Optional[str] = None,
108109
client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
109110
ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
@@ -123,15 +124,18 @@ def __init__(
123124
credentials identify the application to the service; if none
124125
are specified, the client will attempt to ascertain the
125126
credentials from the environment.
126-
This argument is ignored if ``channel`` is provided.
127+
This argument is ignored if a ``channel`` instance is provided.
127128
credentials_file (Optional[str]): A file with credentials that can
128129
be loaded with :func:`google.auth.load_credentials_from_file`.
129-
This argument is ignored if ``channel`` is provided.
130+
This argument is ignored if a ``channel`` instance is provided.
130131
scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
131132
service. These are only used when credentials are not specified and
132133
are passed to :func:`google.auth.default`.
133-
channel (Optional[aio.Channel]): A ``Channel`` instance through
134-
which to make calls.
134+
channel (Optional[Union[aio.Channel, Callable[..., aio.Channel]]]):
135+
A ``Channel`` instance through which to make calls, or a Callable
136+
that constructs and returns one. If set to None, ``self.create_channel``
137+
is used to create the channel. If a Callable is given, it will be called
138+
with the same arguments as used in ``self.create_channel``.
135139
api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
136140
If provided, it overrides the ``host`` argument and tries to create
137141
a mutual TLS channel with client SSL credentials from
@@ -141,11 +145,11 @@ def __init__(
141145
private key bytes, both in PEM format. It is ignored if
142146
``api_mtls_endpoint`` is None.
143147
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
144-
for the grpc channel. It is ignored if ``channel`` is provided.
148+
for the grpc channel. It is ignored if a ``channel`` instance is provided.
145149
client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
146150
A callback to provide client certificate bytes and private key bytes,
147151
both in PEM format. It is used to configure a mutual TLS channel. It is
148-
ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
152+
ignored if a ``channel`` instance or ``ssl_channel_credentials`` is provided.
149153
quota_project_id (Optional[str]): An optional project to use for billing
150154
and quota.
151155
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
@@ -172,7 +176,7 @@ def __init__(
172176
if client_cert_source:
173177
warnings.warn("client_cert_source is deprecated", DeprecationWarning)
174178

175-
if channel:
179+
if isinstance(channel, aio.Channel):
176180
# Ignore credentials if a channel was passed.
177181
credentials = False
178182
# If a channel was explicitly provided, set it.
@@ -212,7 +216,9 @@ def __init__(
212216
)
213217

214218
if not self._grpc_channel:
215-
self._grpc_channel = type(self).create_channel(
219+
# initialize with the provided callable or the default channel
220+
channel_init = channel or type(self).create_channel
221+
self._grpc_channel = channel_init(
216222
self._host,
217223
# use the credentials which are saved
218224
credentials=self._credentials,
@@ -814,6 +820,171 @@ def list_worker_pools(
814820
)
815821
return self._stubs["list_worker_pools"]
816822

823+
def _prep_wrapped_messages(self, client_info):
824+
"""Precompute the wrapped methods, overriding the base class method to use async wrappers."""
825+
self._wrapped_methods = {
826+
self.create_build: gapic_v1.method_async.wrap_method(
827+
self.create_build,
828+
default_timeout=600.0,
829+
client_info=client_info,
830+
),
831+
self.get_build: gapic_v1.method_async.wrap_method(
832+
self.get_build,
833+
default_retry=retries.AsyncRetry(
834+
initial=0.1,
835+
maximum=60.0,
836+
multiplier=1.3,
837+
predicate=retries.if_exception_type(
838+
core_exceptions.DeadlineExceeded,
839+
core_exceptions.ServiceUnavailable,
840+
),
841+
deadline=600.0,
842+
),
843+
default_timeout=600.0,
844+
client_info=client_info,
845+
),
846+
self.list_builds: gapic_v1.method_async.wrap_method(
847+
self.list_builds,
848+
default_retry=retries.AsyncRetry(
849+
initial=0.1,
850+
maximum=60.0,
851+
multiplier=1.3,
852+
predicate=retries.if_exception_type(
853+
core_exceptions.DeadlineExceeded,
854+
core_exceptions.ServiceUnavailable,
855+
),
856+
deadline=600.0,
857+
),
858+
default_timeout=600.0,
859+
client_info=client_info,
860+
),
861+
self.cancel_build: gapic_v1.method_async.wrap_method(
862+
self.cancel_build,
863+
default_timeout=600.0,
864+
client_info=client_info,
865+
),
866+
self.retry_build: gapic_v1.method_async.wrap_method(
867+
self.retry_build,
868+
default_timeout=600.0,
869+
client_info=client_info,
870+
),
871+
self.approve_build: gapic_v1.method_async.wrap_method(
872+
self.approve_build,
873+
default_timeout=None,
874+
client_info=client_info,
875+
),
876+
self.create_build_trigger: gapic_v1.method_async.wrap_method(
877+
self.create_build_trigger,
878+
default_timeout=600.0,
879+
client_info=client_info,
880+
),
881+
self.get_build_trigger: gapic_v1.method_async.wrap_method(
882+
self.get_build_trigger,
883+
default_retry=retries.AsyncRetry(
884+
initial=0.1,
885+
maximum=60.0,
886+
multiplier=1.3,
887+
predicate=retries.if_exception_type(
888+
core_exceptions.DeadlineExceeded,
889+
core_exceptions.ServiceUnavailable,
890+
),
891+
deadline=600.0,
892+
),
893+
default_timeout=600.0,
894+
client_info=client_info,
895+
),
896+
self.list_build_triggers: gapic_v1.method_async.wrap_method(
897+
self.list_build_triggers,
898+
default_retry=retries.AsyncRetry(
899+
initial=0.1,
900+
maximum=60.0,
901+
multiplier=1.3,
902+
predicate=retries.if_exception_type(
903+
core_exceptions.DeadlineExceeded,
904+
core_exceptions.ServiceUnavailable,
905+
),
906+
deadline=600.0,
907+
),
908+
default_timeout=600.0,
909+
client_info=client_info,
910+
),
911+
self.delete_build_trigger: gapic_v1.method_async.wrap_method(
912+
self.delete_build_trigger,
913+
default_retry=retries.AsyncRetry(
914+
initial=0.1,
915+
maximum=60.0,
916+
multiplier=1.3,
917+
predicate=retries.if_exception_type(
918+
core_exceptions.DeadlineExceeded,
919+
core_exceptions.ServiceUnavailable,
920+
),
921+
deadline=600.0,
922+
),
923+
default_timeout=600.0,
924+
client_info=client_info,
925+
),
926+
self.update_build_trigger: gapic_v1.method_async.wrap_method(
927+
self.update_build_trigger,
928+
default_timeout=600.0,
929+
client_info=client_info,
930+
),
931+
self.run_build_trigger: gapic_v1.method_async.wrap_method(
932+
self.run_build_trigger,
933+
default_timeout=600.0,
934+
client_info=client_info,
935+
),
936+
self.receive_trigger_webhook: gapic_v1.method_async.wrap_method(
937+
self.receive_trigger_webhook,
938+
default_timeout=None,
939+
client_info=client_info,
940+
),
941+
self.create_worker_pool: gapic_v1.method_async.wrap_method(
942+
self.create_worker_pool,
943+
default_timeout=600.0,
944+
client_info=client_info,
945+
),
946+
self.get_worker_pool: gapic_v1.method_async.wrap_method(
947+
self.get_worker_pool,
948+
default_retry=retries.AsyncRetry(
949+
initial=0.1,
950+
maximum=60.0,
951+
multiplier=1.3,
952+
predicate=retries.if_exception_type(
953+
core_exceptions.DeadlineExceeded,
954+
core_exceptions.ServiceUnavailable,
955+
),
956+
deadline=600.0,
957+
),
958+
default_timeout=600.0,
959+
client_info=client_info,
960+
),
961+
self.delete_worker_pool: gapic_v1.method_async.wrap_method(
962+
self.delete_worker_pool,
963+
default_timeout=600.0,
964+
client_info=client_info,
965+
),
966+
self.update_worker_pool: gapic_v1.method_async.wrap_method(
967+
self.update_worker_pool,
968+
default_timeout=600.0,
969+
client_info=client_info,
970+
),
971+
self.list_worker_pools: gapic_v1.method_async.wrap_method(
972+
self.list_worker_pools,
973+
default_retry=retries.AsyncRetry(
974+
initial=0.1,
975+
maximum=60.0,
976+
multiplier=1.3,
977+
predicate=retries.if_exception_type(
978+
core_exceptions.DeadlineExceeded,
979+
core_exceptions.ServiceUnavailable,
980+
),
981+
deadline=600.0,
982+
),
983+
default_timeout=600.0,
984+
client_info=client_info,
985+
),
986+
}
987+
817988
def close(self):
818989
return self.grpc_channel.close()
819990

0 commit comments

Comments
 (0)