Skip to content

Commit af4544f

Browse files
chore: [Many APIs] Update gapic-generator-python to v1.19.1 (googleapis#13157)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 684571179 Source-Link: googleapis/googleapis@fbdc238 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3a2cdcfb80c2d0f5ec0cc663c2bab0a9486229d0 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNjaGVkdWxlci8uT3dsQm90LnlhbWwiLCJoIjoiM2EyY2RjZmI4MGMyZDBmNWVjMGNjNjYzYzJiYWIwYTk0ODYyMjlkMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3JldC1tYW5hZ2VyLy5Pd2xCb3QueWFtbCIsImgiOiIzYTJjZGNmYjgwYzJkMGY1ZWMwY2M2NjNjMmJhYjBhOTQ4NjIyOWQwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyZXNvdXJjZW1hbmFnZXIvLk93bEJvdC55YW1sIiwiaCI6IjNhMmNkY2ZiODBjMmQwZjVlYzBjYzY2M2MyYmFiMGE5NDg2MjI5ZDAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyaXR5Y2VudGVyLy5Pd2xCb3QueWFtbCIsImgiOiIzYTJjZGNmYjgwYzJkMGY1ZWMwY2M2NjNjMmJhYjBhOTQ4NjIyOWQwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyaXR5Y2VudGVybWFuYWdlbWVudC8uT3dsQm90LnlhbWwiLCJoIjoiM2EyY2RjZmI4MGMyZDBmNWVjMGNjNjYzYzJiYWIwYTk0ODYyMjlkMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlcnZpY2UtY29udHJvbC8uT3dsQm90LnlhbWwiLCJoIjoiM2EyY2RjZmI4MGMyZ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MjlkMCJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 46c3e97 commit af4544f

File tree

379 files changed

+223582
-166148
lines changed

Some content is hidden

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

379 files changed

+223582
-166148
lines changed

packages/google-cloud-scheduler/google/cloud/scheduler_v1/services/cloud_scheduler/async_client.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,11 +1216,7 @@ async def get_location(
12161216

12171217
# Wrap the RPC method; this adds retry and timeout information,
12181218
# and friendly error handling.
1219-
rpc = gapic_v1.method_async.wrap_method(
1220-
self._client._transport.get_location,
1221-
default_timeout=None,
1222-
client_info=DEFAULT_CLIENT_INFO,
1223-
)
1219+
rpc = self.transport._wrapped_methods[self._client._transport.get_location]
12241220

12251221
# Certain fields should be provided within the metadata header;
12261222
# add these here.
@@ -1273,11 +1269,7 @@ async def list_locations(
12731269

12741270
# Wrap the RPC method; this adds retry and timeout information,
12751271
# and friendly error handling.
1276-
rpc = gapic_v1.method_async.wrap_method(
1277-
self._client._transport.list_locations,
1278-
default_timeout=None,
1279-
client_info=DEFAULT_CLIENT_INFO,
1280-
)
1272+
rpc = self.transport._wrapped_methods[self._client._transport.list_locations]
12811273

12821274
# Certain fields should be provided within the metadata header;
12831275
# add these here.

packages/google-cloud-scheduler/google/cloud/scheduler_v1/services/cloud_scheduler/client.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,11 +1647,7 @@ def get_location(
16471647

16481648
# Wrap the RPC method; this adds retry and timeout information,
16491649
# and friendly error handling.
1650-
rpc = gapic_v1.method.wrap_method(
1651-
self._transport.get_location,
1652-
default_timeout=None,
1653-
client_info=DEFAULT_CLIENT_INFO,
1654-
)
1650+
rpc = self._transport._wrapped_methods[self._transport.get_location]
16551651

16561652
# Certain fields should be provided within the metadata header;
16571653
# add these here.
@@ -1704,11 +1700,7 @@ def list_locations(
17041700

17051701
# Wrap the RPC method; this adds retry and timeout information,
17061702
# and friendly error handling.
1707-
rpc = gapic_v1.method.wrap_method(
1708-
self._transport.list_locations,
1709-
default_timeout=None,
1710-
client_info=DEFAULT_CLIENT_INFO,
1711-
)
1703+
rpc = self._transport._wrapped_methods[self._transport.list_locations]
17121704

17131705
# Certain fields should be provided within the metadata header;
17141706
# add these here.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
transport inheritance structure
3+
_______________________________
4+
5+
`CloudSchedulerTransport` is the ABC for all transports.
6+
- public child `CloudSchedulerGrpcTransport` for sync gRPC transport (defined in `grpc.py`).
7+
- public child `CloudSchedulerGrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`).
8+
- private child `_BaseCloudSchedulerRestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`).
9+
- public child `CloudSchedulerRestTransport` for sync REST transport with inner classes `METHOD` derived from the parent's corresponding `_BaseMETHOD` classes (defined in `rest.py`).

packages/google-cloud-scheduler/google/cloud/scheduler_v1/services/cloud_scheduler/transports/base.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,16 @@ def _prep_wrapped_messages(self, client_info):
202202
default_timeout=600.0,
203203
client_info=client_info,
204204
),
205+
self.get_location: gapic_v1.method.wrap_method(
206+
self.get_location,
207+
default_timeout=None,
208+
client_info=client_info,
209+
),
210+
self.list_locations: gapic_v1.method.wrap_method(
211+
self.list_locations,
212+
default_timeout=None,
213+
client_info=client_info,
214+
),
205215
}
206216

207217
def close(self):

packages/google-cloud-scheduler/google/cloud/scheduler_v1/services/cloud_scheduler/transports/grpc_asyncio.py

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
import inspect
1617
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
1718
import warnings
1819

@@ -231,6 +232,9 @@ def __init__(
231232
)
232233

233234
# Wrap messages. This must be done after self._grpc_channel exists
235+
self._wrap_with_kind = (
236+
"kind" in inspect.signature(gapic_v1.method_async.wrap_method).parameters
237+
)
234238
self._prep_wrapped_messages(client_info)
235239

236240
@property
@@ -487,7 +491,7 @@ def run_job(self) -> Callable[[cloudscheduler.RunJobRequest], Awaitable[job.Job]
487491
def _prep_wrapped_messages(self, client_info):
488492
"""Precompute the wrapped methods, overriding the base class method to use async wrappers."""
489493
self._wrapped_methods = {
490-
self.list_jobs: gapic_v1.method_async.wrap_method(
494+
self.list_jobs: self._wrap_method(
491495
self.list_jobs,
492496
default_retry=retries.AsyncRetry(
493497
initial=0.1,
@@ -502,7 +506,7 @@ def _prep_wrapped_messages(self, client_info):
502506
default_timeout=600.0,
503507
client_info=client_info,
504508
),
505-
self.get_job: gapic_v1.method_async.wrap_method(
509+
self.get_job: self._wrap_method(
506510
self.get_job,
507511
default_retry=retries.AsyncRetry(
508512
initial=0.1,
@@ -517,17 +521,17 @@ def _prep_wrapped_messages(self, client_info):
517521
default_timeout=600.0,
518522
client_info=client_info,
519523
),
520-
self.create_job: gapic_v1.method_async.wrap_method(
524+
self.create_job: self._wrap_method(
521525
self.create_job,
522526
default_timeout=600.0,
523527
client_info=client_info,
524528
),
525-
self.update_job: gapic_v1.method_async.wrap_method(
529+
self.update_job: self._wrap_method(
526530
self.update_job,
527531
default_timeout=600.0,
528532
client_info=client_info,
529533
),
530-
self.delete_job: gapic_v1.method_async.wrap_method(
534+
self.delete_job: self._wrap_method(
531535
self.delete_job,
532536
default_retry=retries.AsyncRetry(
533537
initial=0.1,
@@ -542,26 +546,45 @@ def _prep_wrapped_messages(self, client_info):
542546
default_timeout=600.0,
543547
client_info=client_info,
544548
),
545-
self.pause_job: gapic_v1.method_async.wrap_method(
549+
self.pause_job: self._wrap_method(
546550
self.pause_job,
547551
default_timeout=600.0,
548552
client_info=client_info,
549553
),
550-
self.resume_job: gapic_v1.method_async.wrap_method(
554+
self.resume_job: self._wrap_method(
551555
self.resume_job,
552556
default_timeout=600.0,
553557
client_info=client_info,
554558
),
555-
self.run_job: gapic_v1.method_async.wrap_method(
559+
self.run_job: self._wrap_method(
556560
self.run_job,
557561
default_timeout=600.0,
558562
client_info=client_info,
559563
),
564+
self.get_location: self._wrap_method(
565+
self.get_location,
566+
default_timeout=None,
567+
client_info=client_info,
568+
),
569+
self.list_locations: self._wrap_method(
570+
self.list_locations,
571+
default_timeout=None,
572+
client_info=client_info,
573+
),
560574
}
561575

576+
def _wrap_method(self, func, *args, **kwargs):
577+
if self._wrap_with_kind: # pragma: NO COVER
578+
kwargs["kind"] = self.kind
579+
return gapic_v1.method_async.wrap_method(func, *args, **kwargs)
580+
562581
def close(self):
563582
return self.grpc_channel.close()
564583

584+
@property
585+
def kind(self) -> str:
586+
return "grpc_asyncio"
587+
565588
@property
566589
def list_locations(
567590
self,

0 commit comments

Comments
 (0)