Skip to content

Commit

Permalink
chore: [Many APIs] Update gapic-generator-python to v1.19.1 (#13159)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 684571179

Source-Link:
googleapis/googleapis@fbdc238

Source-Link:
googleapis/googleapis-gen@3a2cdcf
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtZmxlZXRlbmdpbmUtZGVsaXZlcnkvLk93bEJvdC55YW1sIiwiaCI6IjNhMmNkY2ZiODBjMmQwZjVlYzBjYzY2M2MyYmFiMGE5NDg2MjI5ZDAifQ==
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtZmxlZXRlbmdpbmUvLk93bEJvdC55YW1sIiwiaCI6IjNhMmNkY2ZiODBjMmQwZjVlYzBjYzY2M2MyYmFiMGE5NDg2MjI5ZDAifQ==
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtbWFwc3BsYXRmb3JtZGF0YXNldHMvLk93bEJvdC55YW1sIiwiaCI6IjNhMmNkY2ZiODBjMmQwZjVlYzBjYzY2M2MyYmFiMGE5NDg2MjI5ZDAifQ==
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtcGxhY2VzLy5Pd2xCb3QueWFtbCIsImgiOiIzYTJjZGNmYjgwYzJkMGY1ZWMwY2M2NjNjMmJhYjBhOTQ4NjIyOWQwIn0=
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtcm91dGVvcHRpbWl6YXRpb24vLk93bEJvdC55YW1sIiwiaCI6IjNhMmNkY2ZiODBjMmQwZjVlYzBjYzY2M2MyYmFiMGE5NDg2MjI5ZDAifQ==
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtcm91dGluZy8uT3dsQm90LnlhbWwiLCJoIjoiM2EyY2RjZmI4MGMyZDBmNWVjMGNjNjYzYzJiYWIwYTk0ODYyMjlkMCJ9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VjMGNjNjYzYzJiYWIwYTk0ODYyMjlkMCJ9

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <[email protected]>
  • Loading branch information
3 people authored Oct 13, 2024
1 parent 43ef51c commit c2f1711
Show file tree
Hide file tree
Showing 263 changed files with 61,578 additions and 43,425 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.2.4" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.2.4" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,17 @@ async def sample_create_delivery_vehicle():
self._client._transport.create_delivery_vehicle
]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
)
header_params = {}

routing_param_regex = re.compile("^(?P<provider_id>providers/[^/]+)$")
regex_match = routing_param_regex.match(request.parent)
if regex_match and regex_match.group("provider_id"):
header_params["provider_id"] = regex_match.group("provider_id")

if header_params:
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(header_params),
)

# Validate the universe domain.
self._client._validate_universe_domain()
Expand Down Expand Up @@ -529,11 +535,17 @@ async def sample_get_delivery_vehicle():
self._client._transport.get_delivery_vehicle
]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)
header_params = {}

routing_param_regex = re.compile("^(?P<provider_id>providers/[^/]+)$")
regex_match = routing_param_regex.match(request.name)
if regex_match and regex_match.group("provider_id"):
header_params["provider_id"] = regex_match.group("provider_id")

if header_params:
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(header_params),
)

# Validate the universe domain.
self._client._validate_universe_domain()
Expand Down Expand Up @@ -668,13 +680,17 @@ async def sample_update_delivery_vehicle():
self._client._transport.update_delivery_vehicle
]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("delivery_vehicle.name", request.delivery_vehicle.name),)
),
)
header_params = {}

routing_param_regex = re.compile("^(?P<provider_id>providers/[^/]+)$")
regex_match = routing_param_regex.match(request.delivery_vehicle.name)
if regex_match and regex_match.group("provider_id"):
header_params["provider_id"] = regex_match.group("provider_id")

if header_params:
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(header_params),
)

# Validate the universe domain.
self._client._validate_universe_domain()
Expand Down Expand Up @@ -758,11 +774,17 @@ async def sample_batch_create_tasks():
self._client._transport.batch_create_tasks
]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
)
header_params = {}

routing_param_regex = re.compile("^(?P<provider_id>providers/[^/]+)$")
regex_match = routing_param_regex.match(request.parent)
if regex_match and regex_match.group("provider_id"):
header_params["provider_id"] = regex_match.group("provider_id")

if header_params:
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(header_params),
)

# Validate the universe domain.
self._client._validate_universe_domain()
Expand Down Expand Up @@ -928,11 +950,17 @@ async def sample_create_task():
self._client._transport.create_task
]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
)
header_params = {}

routing_param_regex = re.compile("^(?P<provider_id>providers/[^/]+)$")
regex_match = routing_param_regex.match(request.parent)
if regex_match and regex_match.group("provider_id"):
header_params["provider_id"] = regex_match.group("provider_id")

if header_params:
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(header_params),
)

# Validate the universe domain.
self._client._validate_universe_domain()
Expand Down Expand Up @@ -1047,11 +1075,17 @@ async def sample_get_task():
# and friendly error handling.
rpc = self._client._transport._wrapped_methods[self._client._transport.get_task]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)
header_params = {}

routing_param_regex = re.compile("^(?P<provider_id>providers/[^/]+)$")
regex_match = routing_param_regex.match(request.name)
if regex_match and regex_match.group("provider_id"):
header_params["provider_id"] = regex_match.group("provider_id")

if header_params:
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(header_params),
)

# Validate the universe domain.
self._client._validate_universe_domain()
Expand Down Expand Up @@ -1201,13 +1235,17 @@ async def sample_update_task():
self._client._transport.update_task
]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("task.name", request.task.name),)
),
)
header_params = {}

routing_param_regex = re.compile("^(?P<provider_id>providers/[^/]+)$")
regex_match = routing_param_regex.match(request.task.name)
if regex_match and regex_match.group("provider_id"):
header_params["provider_id"] = regex_match.group("provider_id")

if header_params:
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(header_params),
)

# Validate the universe domain.
self._client._validate_universe_domain()
Expand Down Expand Up @@ -1314,11 +1352,17 @@ async def sample_list_tasks():
self._client._transport.list_tasks
]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
)
header_params = {}

routing_param_regex = re.compile("^(?P<provider_id>providers/[^/]+)$")
regex_match = routing_param_regex.match(request.parent)
if regex_match and regex_match.group("provider_id"):
header_params["provider_id"] = regex_match.group("provider_id")

if header_params:
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(header_params),
)

# Validate the universe domain.
self._client._validate_universe_domain()
Expand Down Expand Up @@ -1437,11 +1481,17 @@ async def sample_get_task_tracking_info():
self._client._transport.get_task_tracking_info
]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)
header_params = {}

routing_param_regex = re.compile("^(?P<provider_id>providers/[^/]+)$")
regex_match = routing_param_regex.match(request.name)
if regex_match and regex_match.group("provider_id"):
header_params["provider_id"] = regex_match.group("provider_id")

if header_params:
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(header_params),
)

# Validate the universe domain.
self._client._validate_universe_domain()
Expand Down Expand Up @@ -1548,11 +1598,17 @@ async def sample_list_delivery_vehicles():
self._client._transport.list_delivery_vehicles
]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
)
header_params = {}

routing_param_regex = re.compile("^(?P<provider_id>providers/[^/]+)$")
regex_match = routing_param_regex.match(request.parent)
if regex_match and regex_match.group("provider_id"):
header_params["provider_id"] = regex_match.group("provider_id")

if header_params:
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(header_params),
)

# Validate the universe domain.
self._client._validate_universe_domain()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

transport inheritance structure
_______________________________

`DeliveryServiceTransport` is the ABC for all transports.
- public child `DeliveryServiceGrpcTransport` for sync gRPC transport (defined in `grpc.py`).
- public child `DeliveryServiceGrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`).
- private child `_BaseDeliveryServiceRestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`).
- public child `DeliveryServiceRestTransport` for sync REST transport with inner classes `METHOD` derived from the parent's corresponding `_BaseMETHOD` classes (defined in `rest.py`).
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
import inspect
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
import warnings

Expand Down Expand Up @@ -231,6 +232,9 @@ def __init__(
)

# Wrap messages. This must be done after self._grpc_channel exists
self._wrap_with_kind = (
"kind" in inspect.signature(gapic_v1.method_async.wrap_method).parameters
)
self._prep_wrapped_messages(client_info)

@property
Expand Down Expand Up @@ -535,7 +539,7 @@ def list_delivery_vehicles(
def _prep_wrapped_messages(self, client_info):
"""Precompute the wrapped methods, overriding the base class method to use async wrappers."""
self._wrapped_methods = {
self.create_delivery_vehicle: gapic_v1.method_async.wrap_method(
self.create_delivery_vehicle: self._wrap_method(
self.create_delivery_vehicle,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -549,7 +553,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.get_delivery_vehicle: gapic_v1.method_async.wrap_method(
self.get_delivery_vehicle: self._wrap_method(
self.get_delivery_vehicle,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -563,7 +567,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.update_delivery_vehicle: gapic_v1.method_async.wrap_method(
self.update_delivery_vehicle: self._wrap_method(
self.update_delivery_vehicle,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -577,7 +581,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.batch_create_tasks: gapic_v1.method_async.wrap_method(
self.batch_create_tasks: self._wrap_method(
self.batch_create_tasks,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -591,7 +595,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.create_task: gapic_v1.method_async.wrap_method(
self.create_task: self._wrap_method(
self.create_task,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -605,7 +609,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.get_task: gapic_v1.method_async.wrap_method(
self.get_task: self._wrap_method(
self.get_task,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -619,7 +623,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.update_task: gapic_v1.method_async.wrap_method(
self.update_task: self._wrap_method(
self.update_task,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -633,7 +637,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.list_tasks: gapic_v1.method_async.wrap_method(
self.list_tasks: self._wrap_method(
self.list_tasks,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -647,7 +651,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.get_task_tracking_info: gapic_v1.method_async.wrap_method(
self.get_task_tracking_info: self._wrap_method(
self.get_task_tracking_info,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -661,7 +665,7 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.list_delivery_vehicles: gapic_v1.method_async.wrap_method(
self.list_delivery_vehicles: self._wrap_method(
self.list_delivery_vehicles,
default_retry=retries.AsyncRetry(
initial=1.0,
Expand All @@ -677,8 +681,17 @@ def _prep_wrapped_messages(self, client_info):
),
}

def _wrap_method(self, func, *args, **kwargs):
if self._wrap_with_kind: # pragma: NO COVER
kwargs["kind"] = self.kind
return gapic_v1.method_async.wrap_method(func, *args, **kwargs)

def close(self):
return self.grpc_channel.close()

@property
def kind(self) -> str:
return "grpc_asyncio"


__all__ = ("DeliveryServiceGrpcAsyncIOTransport",)
Loading

0 comments on commit c2f1711

Please sign in to comment.