Skip to content

Commit

Permalink
fix: [google-cloud-discoveryengine] fix the location type annotation (#…
Browse files Browse the repository at this point in the history
…13149)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 684571179

Source-Link:
googleapis/googleapis@fbdc238

Source-Link:
googleapis/googleapis-gen@3a2cdcf
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpc2NvdmVyeWVuZ2luZS8uT3dsQm90LnlhbWwiLCJoIjoiM2EyY2RjZmI4MGMyZDBmNWVjMGNjNjYzYzJiYWIwYTk0ODYyMjlkMCJ9

BEGIN_NESTED_COMMIT
fix!: [google-cloud-discoveryengine] fix the location type annotation
PiperOrigin-RevId: 684535402

Source-Link:
googleapis/googleapis@d544df7

Source-Link:
googleapis/googleapis-gen@8bdbcef
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpc2NvdmVyeWVuZ2luZS8uT3dsQm90LnlhbWwiLCJoIjoiOGJkYmNlZjg1MTA3M2Y0OWNmOTZlNDU4NjRjNGVhZGIzN2NkN2Q2OSJ9
END_NESTED_COMMIT

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Oct 11, 2024
1 parent 1b73fa1 commit a341b84
Show file tree
Hide file tree
Showing 456 changed files with 138,845 additions and 100,731 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.12.3" # {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.12.3" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -818,11 +818,7 @@ async def list_operations(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.list_operations,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)
rpc = self.transport._wrapped_methods[self._client._transport.list_operations]

# Certain fields should be provided within the metadata header;
# add these here.
Expand Down Expand Up @@ -875,11 +871,7 @@ async def get_operation(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.get_operation,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)
rpc = self.transport._wrapped_methods[self._client._transport.get_operation]

# Certain fields should be provided within the metadata header;
# add these here.
Expand Down Expand Up @@ -935,11 +927,7 @@ async def cancel_operation(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.cancel_operation,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)
rpc = self.transport._wrapped_methods[self._client._transport.cancel_operation]

# Certain fields should be provided within the metadata header;
# add these here.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1253,11 +1253,7 @@ def list_operations(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method.wrap_method(
self._transport.list_operations,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)
rpc = self._transport._wrapped_methods[self._transport.list_operations]

# Certain fields should be provided within the metadata header;
# add these here.
Expand Down Expand Up @@ -1310,11 +1306,7 @@ def get_operation(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method.wrap_method(
self._transport.get_operation,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)
rpc = self._transport._wrapped_methods[self._transport.get_operation]

# Certain fields should be provided within the metadata header;
# add these here.
Expand Down Expand Up @@ -1370,11 +1362,7 @@ def cancel_operation(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method.wrap_method(
self._transport.cancel_operation,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)
rpc = self._transport._wrapped_methods[self._transport.cancel_operation]

# Certain fields should be provided within the metadata header;
# add these here.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

transport inheritance structure
_______________________________

`CompletionServiceTransport` is the ABC for all transports.
- public child `CompletionServiceGrpcTransport` for sync gRPC transport (defined in `grpc.py`).
- public child `CompletionServiceGrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`).
- private child `_BaseCompletionServiceRestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`).
- public child `CompletionServiceRestTransport` 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 @@ -159,6 +159,21 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=None,
client_info=client_info,
),
self.cancel_operation: gapic_v1.method.wrap_method(
self.cancel_operation,
default_timeout=None,
client_info=client_info,
),
self.get_operation: gapic_v1.method.wrap_method(
self.get_operation,
default_timeout=None,
client_info=client_info,
),
self.list_operations: gapic_v1.method.wrap_method(
self.list_operations,
default_timeout=None,
client_info=client_info,
),
}

def close(self):
Expand Down
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 @@ -233,6 +234,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 @@ -426,36 +430,60 @@ def purge_completion_suggestions(
def _prep_wrapped_messages(self, client_info):
"""Precompute the wrapped methods, overriding the base class method to use async wrappers."""
self._wrapped_methods = {
self.complete_query: gapic_v1.method_async.wrap_method(
self.complete_query: self._wrap_method(
self.complete_query,
default_timeout=None,
client_info=client_info,
),
self.import_suggestion_deny_list_entries: gapic_v1.method_async.wrap_method(
self.import_suggestion_deny_list_entries: self._wrap_method(
self.import_suggestion_deny_list_entries,
default_timeout=None,
client_info=client_info,
),
self.purge_suggestion_deny_list_entries: gapic_v1.method_async.wrap_method(
self.purge_suggestion_deny_list_entries: self._wrap_method(
self.purge_suggestion_deny_list_entries,
default_timeout=None,
client_info=client_info,
),
self.import_completion_suggestions: gapic_v1.method_async.wrap_method(
self.import_completion_suggestions: self._wrap_method(
self.import_completion_suggestions,
default_timeout=None,
client_info=client_info,
),
self.purge_completion_suggestions: gapic_v1.method_async.wrap_method(
self.purge_completion_suggestions: self._wrap_method(
self.purge_completion_suggestions,
default_timeout=None,
client_info=client_info,
),
self.cancel_operation: self._wrap_method(
self.cancel_operation,
default_timeout=None,
client_info=client_info,
),
self.get_operation: self._wrap_method(
self.get_operation,
default_timeout=None,
client_info=client_info,
),
self.list_operations: self._wrap_method(
self.list_operations,
default_timeout=None,
client_info=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"

@property
def cancel_operation(
self,
Expand Down
Loading

0 comments on commit a341b84

Please sign in to comment.