Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Commit

Permalink
馃 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed Apr 7, 2023
1 parent fcb4dbb commit 687dc76
Show file tree
Hide file tree
Showing 763 changed files with 1,552 additions and 309,111 deletions.
5 changes: 4 additions & 1 deletion google/cloud/retail_v2beta/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
CreateModelMetadata,
CreateModelRequest,
DeleteModelRequest,
GetModelRequest,
ListModelsRequest,
ListModelsResponse,
PauseModelRequest,
Expand Down Expand Up @@ -166,7 +167,7 @@
PurgeUserEventsRequest,
PurgeUserEventsResponse,
)
from .types.search_service import SearchRequest, SearchResponse
from .types.search_service import ExperimentInfo, SearchRequest, SearchResponse
from .types.serving_config import ServingConfig
from .types.serving_config_service import (
AddControlRequest,
Expand Down Expand Up @@ -241,6 +242,7 @@
"DeleteModelRequest",
"DeleteProductRequest",
"DeleteServingConfigRequest",
"ExperimentInfo",
"ExportErrorsConfig",
"ExportMetadata",
"ExportProductsResponse",
Expand All @@ -253,6 +255,7 @@
"GetControlRequest",
"GetDefaultBranchRequest",
"GetDefaultBranchResponse",
"GetModelRequest",
"GetProductRequest",
"GetServingConfigRequest",
"Image",
Expand Down
15 changes: 15 additions & 0 deletions google/cloud/retail_v2beta/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,11 @@
"delete_model"
]
},
"GetModel": {
"methods": [
"get_model"
]
},
"ListModels": {
"methods": [
"list_models"
Expand Down Expand Up @@ -402,6 +407,11 @@
"delete_model"
]
},
"GetModel": {
"methods": [
"get_model"
]
},
"ListModels": {
"methods": [
"list_models"
Expand Down Expand Up @@ -442,6 +452,11 @@
"delete_model"
]
},
"GetModel": {
"methods": [
"get_model"
]
},
"ListModels": {
"methods": [
"list_models"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@


class CompletionServiceAsyncClient:
"""Auto-completion service for retail.
"""Autocomplete service for retail.
This feature is only available for users who have Retail Search
enabled. Enable Retail Search on Cloud Console before using this
feature.
Expand Down Expand Up @@ -265,7 +265,7 @@ async def sample_complete_query():
Args:
request (Optional[Union[google.cloud.retail_v2beta.types.CompleteQueryRequest, dict]]):
The request object. Auto-complete parameters.
The request object. Autocomplete parameters.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand All @@ -274,7 +274,7 @@ async def sample_complete_query():
Returns:
google.cloud.retail_v2beta.types.CompleteQueryResponse:
Response of the auto-complete query.
Response of the autocomplete query.
"""
# Create or coerce a protobuf request object.
request = completion_service.CompleteQueryRequest(request)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def get_transport_class(


class CompletionServiceClient(metaclass=CompletionServiceClientMeta):
"""Auto-completion service for retail.
"""Autocomplete service for retail.
This feature is only available for users who have Retail Search
enabled. Enable Retail Search on Cloud Console before using this
feature.
Expand Down Expand Up @@ -494,7 +494,7 @@ def sample_complete_query():
Args:
request (Union[google.cloud.retail_v2beta.types.CompleteQueryRequest, dict]):
The request object. Auto-complete parameters.
The request object. Autocomplete parameters.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand All @@ -503,7 +503,7 @@ def sample_complete_query():
Returns:
google.cloud.retail_v2beta.types.CompleteQueryResponse:
Response of the auto-complete query.
Response of the autocomplete query.
"""
# Create or coerce a protobuf request object.
# Minor optimization to avoid making a copy if the user passes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
class CompletionServiceGrpcTransport(CompletionServiceTransport):
"""gRPC backend transport for CompletionService.
Auto-completion service for retail.
Autocomplete service for retail.
This feature is only available for users who have Retail Search
enabled. Enable Retail Search on Cloud Console before using this
feature.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
class CompletionServiceGrpcAsyncIOTransport(CompletionServiceTransport):
"""gRPC AsyncIO backend transport for CompletionService.
Auto-completion service for retail.
Autocomplete service for retail.
This feature is only available for users who have Retail Search
enabled. Enable Retail Search on Cloud Console before using this
feature.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class CompletionServiceRestStub:
class CompletionServiceRestTransport(CompletionServiceTransport):
"""REST backend transport for CompletionService.
Auto-completion service for retail.
Autocomplete service for retail.
This feature is only available for users who have Retail Search
enabled. Enable Retail Search on Cloud Console before using this
feature.
Expand Down Expand Up @@ -376,7 +376,7 @@ def __call__(
Args:
request (~.completion_service.CompleteQueryRequest):
The request object. Auto-complete parameters.
The request object. Autocomplete parameters.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand All @@ -385,7 +385,7 @@ def __call__(
Returns:
~.completion_service.CompleteQueryResponse:
Response of the auto-complete query.
Response of the autocomplete query.
"""

http_options: List[Dict[str, str]] = [
Expand Down
107 changes: 107 additions & 0 deletions google/cloud/retail_v2beta/services/model_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,113 @@ async def sample_create_model():
# Done; return the response.
return response

async def get_model(
self,
request: Optional[Union[model_service.GetModelRequest, dict]] = None,
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> model.Model:
r"""Gets a model.
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import retail_v2beta
async def sample_get_model():
# Create a client
client = retail_v2beta.ModelServiceAsyncClient()
# Initialize request argument(s)
request = retail_v2beta.GetModelRequest(
name="name_value",
)
# Make the request
response = await client.get_model(request=request)
# Handle the response
print(response)
Args:
request (Optional[Union[google.cloud.retail_v2beta.types.GetModelRequest, dict]]):
The request object. Request for getting a model.
name (:class:`str`):
Required. The resource name of the
[Model][google.cloud.retail.v2beta.Model] to get.
Format:
``projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}``
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
Returns:
google.cloud.retail_v2beta.types.Model:
Metadata that describes the training and serving parameters of a
[Model][google.cloud.retail.v2beta.Model]. A
[Model][google.cloud.retail.v2beta.Model] can be
associated with a
[ServingConfig][google.cloud.retail.v2beta.ServingConfig]
and then queried through the Predict API.
"""
# Create or coerce a protobuf request object.
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([name])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

request = model_service.GetModelRequest(request)

# If we have keyword arguments corresponding to fields on the
# request, apply these.
if name is not None:
request.name = name

# 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_model,
default_timeout=None,
client_info=DEFAULT_CLIENT_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),)),
)

# Send the request.
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response

async def pause_model(
self,
request: Optional[Union[model_service.PauseModelRequest, dict]] = None,
Expand Down
107 changes: 107 additions & 0 deletions google/cloud/retail_v2beta/services/model_service/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,113 @@ def sample_create_model():
# Done; return the response.
return response

def get_model(
self,
request: Optional[Union[model_service.GetModelRequest, dict]] = None,
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> model.Model:
r"""Gets a model.
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import retail_v2beta
def sample_get_model():
# Create a client
client = retail_v2beta.ModelServiceClient()
# Initialize request argument(s)
request = retail_v2beta.GetModelRequest(
name="name_value",
)
# Make the request
response = client.get_model(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.retail_v2beta.types.GetModelRequest, dict]):
The request object. Request for getting a model.
name (str):
Required. The resource name of the
[Model][google.cloud.retail.v2beta.Model] to get.
Format:
``projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}``
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
Returns:
google.cloud.retail_v2beta.types.Model:
Metadata that describes the training and serving parameters of a
[Model][google.cloud.retail.v2beta.Model]. A
[Model][google.cloud.retail.v2beta.Model] can be
associated with a
[ServingConfig][google.cloud.retail.v2beta.ServingConfig]
and then queried through the Predict API.
"""
# Create or coerce a protobuf request object.
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([name])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

# Minor optimization to avoid making a copy if the user passes
# in a model_service.GetModelRequest.
# There's no risk of modifying the input as we've already verified
# there are no flattened fields.
if not isinstance(request, model_service.GetModelRequest):
request = model_service.GetModelRequest(request)
# If we have keyword arguments corresponding to fields on the
# request, apply these.
if name is not None:
request.name = name

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.get_model]

# 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),)),
)

# Send the request.
response = rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response

def pause_model(
self,
request: Optional[Union[model_service.PauseModelRequest, dict]] = None,
Expand Down

0 comments on commit 687dc76

Please sign in to comment.