diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/__init__.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/__init__.py index a7f6cb125929..9de9fd4462bc 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/__init__.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/__init__.py @@ -44,12 +44,15 @@ Catalog, CatalogAttribute, CompletionConfig, + MerchantCenterFeedFilter, MerchantCenterLink, MerchantCenterLinkingConfig, ProductLevelConfig, ) from .types.catalog_service import ( AddCatalogAttributeRequest, + BatchRemoveCatalogAttributesRequest, + BatchRemoveCatalogAttributesResponse, GetAttributesConfigRequest, GetCompletionConfigRequest, GetDefaultBranchRequest, @@ -97,6 +100,7 @@ ExportMetadata, ExportProductsResponse, ExportUserEventsResponse, + GcsOutputResult, OutputResult, ) from .types.import_config import ( @@ -113,6 +117,7 @@ ImportUserEventsResponse, ProductInlineSource, ProductInputConfig, + TransformedUserEventsMetadata, UserEventImportSummary, UserEventInlineSource, UserEventInputConfig, @@ -212,6 +217,8 @@ "AttributeConfigLevel", "AttributesConfig", "Audience", + "BatchRemoveCatalogAttributesRequest", + "BatchRemoveCatalogAttributesResponse", "BigQueryOutputResult", "BigQuerySource", "Catalog", @@ -243,6 +250,7 @@ "ExportProductsResponse", "ExportUserEventsResponse", "FulfillmentInfo", + "GcsOutputResult", "GcsSource", "GetAttributesConfigRequest", "GetCompletionConfigRequest", @@ -272,6 +280,7 @@ "ListServingConfigsRequest", "ListServingConfigsResponse", "LocalInventory", + "MerchantCenterFeedFilter", "MerchantCenterLink", "MerchantCenterLinkingConfig", "Model", @@ -323,6 +332,7 @@ "SetInventoryRequest", "SetInventoryResponse", "SolutionType", + "TransformedUserEventsMetadata", "TuneModelMetadata", "TuneModelRequest", "TuneModelResponse", diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/gapic_metadata.json b/packages/google-cloud-retail/google/cloud/retail_v2alpha/gapic_metadata.json index 40b87875859d..9317fa133ad7 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/gapic_metadata.json +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/gapic_metadata.json @@ -15,6 +15,11 @@ "add_catalog_attribute" ] }, + "BatchRemoveCatalogAttributes": { + "methods": [ + "batch_remove_catalog_attributes" + ] + }, "GetAttributesConfig": { "methods": [ "get_attributes_config" @@ -75,6 +80,11 @@ "add_catalog_attribute" ] }, + "BatchRemoveCatalogAttributes": { + "methods": [ + "batch_remove_catalog_attributes" + ] + }, "GetAttributesConfig": { "methods": [ "get_attributes_config" diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/async_client.py index 31f18947a206..374c01ce1458 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/async_client.py @@ -755,7 +755,7 @@ async def sample_get_completion_config(): method. name (:class:`str`): Required. Full CompletionConfig resource name. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1377,6 +1377,95 @@ async def sample_remove_catalog_attribute(): # Done; return the response. return response + async def batch_remove_catalog_attributes( + self, + request: Optional[ + Union[catalog_service.BatchRemoveCatalogAttributesRequest, dict] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> catalog_service.BatchRemoveCatalogAttributesResponse: + r"""Removes all specified + [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s + from the + [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + + .. 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_v2alpha + + async def sample_batch_remove_catalog_attributes(): + # Create a client + client = retail_v2alpha.CatalogServiceAsyncClient() + + # Initialize request argument(s) + request = retail_v2alpha.BatchRemoveCatalogAttributesRequest( + attributes_config="attributes_config_value", + attribute_keys=['attribute_keys_value1', 'attribute_keys_value2'], + ) + + # Make the request + response = await client.batch_remove_catalog_attributes(request=request) + + # Handle the response + print(response) + + Args: + request (Optional[Union[google.cloud.retail_v2alpha.types.BatchRemoveCatalogAttributesRequest, dict]]): + The request object. Request for + [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributes] + method. + 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_v2alpha.types.BatchRemoveCatalogAttributesResponse: + Response of the + [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributes]. + + """ + # Create or coerce a protobuf request object. + request = catalog_service.BatchRemoveCatalogAttributesRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.batch_remove_catalog_attributes, + 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( + (("attributes_config", request.attributes_config),) + ), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + async def replace_catalog_attribute( self, request: Optional[ diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/client.py index 78178bd659c7..8878a730ccdf 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/client.py @@ -1040,7 +1040,7 @@ def sample_get_completion_config(): method. name (str): Required. Full CompletionConfig resource name. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1664,6 +1664,98 @@ def sample_remove_catalog_attribute(): # Done; return the response. return response + def batch_remove_catalog_attributes( + self, + request: Optional[ + Union[catalog_service.BatchRemoveCatalogAttributesRequest, dict] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> catalog_service.BatchRemoveCatalogAttributesResponse: + r"""Removes all specified + [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s + from the + [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + + .. 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_v2alpha + + def sample_batch_remove_catalog_attributes(): + # Create a client + client = retail_v2alpha.CatalogServiceClient() + + # Initialize request argument(s) + request = retail_v2alpha.BatchRemoveCatalogAttributesRequest( + attributes_config="attributes_config_value", + attribute_keys=['attribute_keys_value1', 'attribute_keys_value2'], + ) + + # Make the request + response = client.batch_remove_catalog_attributes(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.retail_v2alpha.types.BatchRemoveCatalogAttributesRequest, dict]): + The request object. Request for + [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributes] + method. + 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_v2alpha.types.BatchRemoveCatalogAttributesResponse: + Response of the + [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributes]. + + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a catalog_service.BatchRemoveCatalogAttributesRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, catalog_service.BatchRemoveCatalogAttributesRequest): + request = catalog_service.BatchRemoveCatalogAttributesRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.batch_remove_catalog_attributes + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + (("attributes_config", request.attributes_config),) + ), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + def replace_catalog_attribute( self, request: Optional[ diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/transports/base.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/transports/base.py index f0da4fa451f5..57a01e2e4d01 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/transports/base.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/transports/base.py @@ -175,6 +175,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.batch_remove_catalog_attributes: gapic_v1.method.wrap_method( + self.batch_remove_catalog_attributes, + default_timeout=None, + client_info=client_info, + ), self.replace_catalog_attribute: gapic_v1.method.wrap_method( self.replace_catalog_attribute, default_timeout=None, @@ -287,6 +292,18 @@ def remove_catalog_attribute( ]: raise NotImplementedError() + @property + def batch_remove_catalog_attributes( + self, + ) -> Callable[ + [catalog_service.BatchRemoveCatalogAttributesRequest], + Union[ + catalog_service.BatchRemoveCatalogAttributesResponse, + Awaitable[catalog_service.BatchRemoveCatalogAttributesResponse], + ], + ]: + raise NotImplementedError() + @property def replace_catalog_attribute( self, diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/transports/grpc.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/transports/grpc.py index 658a74cc7ff9..3b77913fcb04 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/transports/grpc.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/transports/grpc.py @@ -572,6 +572,41 @@ def remove_catalog_attribute( ) return self._stubs["remove_catalog_attribute"] + @property + def batch_remove_catalog_attributes( + self, + ) -> Callable[ + [catalog_service.BatchRemoveCatalogAttributesRequest], + catalog_service.BatchRemoveCatalogAttributesResponse, + ]: + r"""Return a callable for the batch remove catalog + attributes method over gRPC. + + Removes all specified + [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s + from the + [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + + Returns: + Callable[[~.BatchRemoveCatalogAttributesRequest], + ~.BatchRemoveCatalogAttributesResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "batch_remove_catalog_attributes" not in self._stubs: + self._stubs[ + "batch_remove_catalog_attributes" + ] = self.grpc_channel.unary_unary( + "/google.cloud.retail.v2alpha.CatalogService/BatchRemoveCatalogAttributes", + request_serializer=catalog_service.BatchRemoveCatalogAttributesRequest.serialize, + response_deserializer=catalog_service.BatchRemoveCatalogAttributesResponse.deserialize, + ) + return self._stubs["batch_remove_catalog_attributes"] + @property def replace_catalog_attribute( self, diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/transports/grpc_asyncio.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/transports/grpc_asyncio.py index c4b778f98fb9..934a02b3b230 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/catalog_service/transports/grpc_asyncio.py @@ -586,6 +586,41 @@ def remove_catalog_attribute( ) return self._stubs["remove_catalog_attribute"] + @property + def batch_remove_catalog_attributes( + self, + ) -> Callable[ + [catalog_service.BatchRemoveCatalogAttributesRequest], + Awaitable[catalog_service.BatchRemoveCatalogAttributesResponse], + ]: + r"""Return a callable for the batch remove catalog + attributes method over gRPC. + + Removes all specified + [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s + from the + [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + + Returns: + Callable[[~.BatchRemoveCatalogAttributesRequest], + Awaitable[~.BatchRemoveCatalogAttributesResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "batch_remove_catalog_attributes" not in self._stubs: + self._stubs[ + "batch_remove_catalog_attributes" + ] = self.grpc_channel.unary_unary( + "/google.cloud.retail.v2alpha.CatalogService/BatchRemoveCatalogAttributes", + request_serializer=catalog_service.BatchRemoveCatalogAttributesRequest.serialize, + response_deserializer=catalog_service.BatchRemoveCatalogAttributesResponse.deserialize, + ) + return self._stubs["batch_remove_catalog_attributes"] + @property def replace_catalog_attribute( self, diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/async_client.py index d6d739958816..ce3ea1073b12 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/async_client.py @@ -55,8 +55,8 @@ class CompletionServiceAsyncClient: """Auto-completion service for retail. This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. """ _client: CompletionServiceClient @@ -231,8 +231,8 @@ async def complete_query( r"""Completes the specified prefix with keyword suggestions. This feature is only available for users who have Retail - Search enabled. Please enable Retail Search on Cloud - Console before using this feature. + Search enabled. Enable Retail Search on Cloud Console + before using this feature. .. code-block:: python @@ -319,8 +319,8 @@ async def import_completion_data( imported suggestions are indexed successfully and ready for serving. The process takes hours. This feature is only available for users who have Retail - Search enabled. Please enable Retail Search on Cloud - Console before using this feature. + Search enabled. Enable Retail Search on Cloud Console + before using this feature. .. code-block:: python diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/client.py index a457f9a7c51c..5ea941e49492 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/client.py @@ -95,8 +95,8 @@ def get_transport_class( class CompletionServiceClient(metaclass=CompletionServiceClientMeta): """Auto-completion service for retail. This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. """ @staticmethod @@ -458,8 +458,8 @@ def complete_query( r"""Completes the specified prefix with keyword suggestions. This feature is only available for users who have Retail - Search enabled. Please enable Retail Search on Cloud - Console before using this feature. + Search enabled. Enable Retail Search on Cloud Console + before using this feature. .. code-block:: python @@ -547,8 +547,8 @@ def import_completion_data( imported suggestions are indexed successfully and ready for serving. The process takes hours. This feature is only available for users who have Retail - Search enabled. Please enable Retail Search on Cloud - Console before using this feature. + Search enabled. Enable Retail Search on Cloud Console + before using this feature. .. code-block:: python diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/transports/grpc.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/transports/grpc.py index ade982005b5d..8df9bccb2070 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/transports/grpc.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/transports/grpc.py @@ -33,8 +33,8 @@ class CompletionServiceGrpcTransport(CompletionServiceTransport): Auto-completion service for retail. This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -259,8 +259,8 @@ def complete_query( Completes the specified prefix with keyword suggestions. This feature is only available for users who have Retail - Search enabled. Please enable Retail Search on Cloud - Console before using this feature. + Search enabled. Enable Retail Search on Cloud Console + before using this feature. Returns: Callable[[~.CompleteQueryRequest], @@ -295,8 +295,8 @@ def import_completion_data( imported suggestions are indexed successfully and ready for serving. The process takes hours. This feature is only available for users who have Retail - Search enabled. Please enable Retail Search on Cloud - Console before using this feature. + Search enabled. Enable Retail Search on Cloud Console + before using this feature. Returns: Callable[[~.ImportCompletionDataRequest], diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/transports/grpc_asyncio.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/transports/grpc_asyncio.py index 56609a727d5f..5bcef7972c31 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/completion_service/transports/grpc_asyncio.py @@ -34,8 +34,8 @@ class CompletionServiceGrpcAsyncIOTransport(CompletionServiceTransport): Auto-completion service for retail. This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -264,8 +264,8 @@ def complete_query( Completes the specified prefix with keyword suggestions. This feature is only available for users who have Retail - Search enabled. Please enable Retail Search on Cloud - Console before using this feature. + Search enabled. Enable Retail Search on Cloud Console + before using this feature. Returns: Callable[[~.CompleteQueryRequest], @@ -300,8 +300,8 @@ def import_completion_data( imported suggestions are indexed successfully and ready for serving. The process takes hours. This feature is only available for users who have Retail - Search enabled. Please enable Retail Search on Cloud - Console before using this feature. + Search enabled. Enable Retail Search on Cloud Console + before using this feature. Returns: Callable[[~.ImportCompletionDataRequest], diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/control_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/control_service/async_client.py index c3c0e055fc9d..56785ff0eb55 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/control_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/control_service/async_client.py @@ -257,7 +257,6 @@ async def sample_create_control(): control.facet_spec.facet_key.key = "key_value" control.display_name = "display_name_value" control.solution_types = ['SOLUTION_TYPE_SEARCH'] - control.search_solution_use_case = ['SEARCH_SOLUTION_USE_CASE_BROWSE'] request = retail_v2alpha.CreateControlRequest( parent="parent_value", @@ -305,10 +304,10 @@ async def sample_create_control(): Returns: google.cloud.retail_v2alpha.types.Control: - Configures dynamic serving time - metadata that is used to pre and post - process search/recommendation model - results. + Configures dynamic metadata that can be linked to a + [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] + and affect search or recommendation results at + serving time. """ # Create or coerce a protobuf request object. @@ -464,7 +463,7 @@ async def update_control( [Control][google.cloud.retail.v2alpha.Control] cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. - If the [Control][google.cloud.retail.v2alpha.Control] to delete + If the [Control][google.cloud.retail.v2alpha.Control] to update does not exist, a NOT_FOUND error is returned. .. code-block:: python @@ -487,7 +486,6 @@ async def sample_update_control(): control.facet_spec.facet_key.key = "key_value" control.display_name = "display_name_value" control.solution_types = ['SOLUTION_TYPE_SEARCH'] - control.search_solution_use_case = ['SEARCH_SOLUTION_USE_CASE_BROWSE'] request = retail_v2alpha.UpdateControlRequest( control=control, @@ -527,10 +525,10 @@ async def sample_update_control(): Returns: google.cloud.retail_v2alpha.types.Control: - Configures dynamic serving time - metadata that is used to pre and post - process search/recommendation model - results. + Configures dynamic metadata that can be linked to a + [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] + and affect search or recommendation results at + serving time. """ # Create or coerce a protobuf request object. @@ -620,7 +618,7 @@ async def sample_get_control(): request (Optional[Union[google.cloud.retail_v2alpha.types.GetControlRequest, dict]]): The request object. Request for GetControl method. name (:class:`str`): - Required. The resource name of the Control to delete. + Required. The resource name of the Control to get. Format: ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`` @@ -635,10 +633,10 @@ async def sample_get_control(): Returns: google.cloud.retail_v2alpha.types.Control: - Configures dynamic serving time - metadata that is used to pre and post - process search/recommendation model - results. + Configures dynamic metadata that can be linked to a + [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] + and affect search or recommendation results at + serving time. """ # Create or coerce a protobuf request object. @@ -692,7 +690,8 @@ async def list_controls( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListControlsAsyncPager: - r"""Lists all Controls linked to this catalog. + r"""Lists all Controls by their parent + [Catalog][google.cloud.retail.v2alpha.Catalog]. .. code-block:: python diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/control_service/client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/control_service/client.py index 1a273d4c33d5..b22b7c02c95d 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/control_service/client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/control_service/client.py @@ -506,7 +506,6 @@ def sample_create_control(): control.facet_spec.facet_key.key = "key_value" control.display_name = "display_name_value" control.solution_types = ['SOLUTION_TYPE_SEARCH'] - control.search_solution_use_case = ['SEARCH_SOLUTION_USE_CASE_BROWSE'] request = retail_v2alpha.CreateControlRequest( parent="parent_value", @@ -554,10 +553,10 @@ def sample_create_control(): Returns: google.cloud.retail_v2alpha.types.Control: - Configures dynamic serving time - metadata that is used to pre and post - process search/recommendation model - results. + Configures dynamic metadata that can be linked to a + [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] + and affect search or recommendation results at + serving time. """ # Create or coerce a protobuf request object. @@ -713,7 +712,7 @@ def update_control( [Control][google.cloud.retail.v2alpha.Control] cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. - If the [Control][google.cloud.retail.v2alpha.Control] to delete + If the [Control][google.cloud.retail.v2alpha.Control] to update does not exist, a NOT_FOUND error is returned. .. code-block:: python @@ -736,7 +735,6 @@ def sample_update_control(): control.facet_spec.facet_key.key = "key_value" control.display_name = "display_name_value" control.solution_types = ['SOLUTION_TYPE_SEARCH'] - control.search_solution_use_case = ['SEARCH_SOLUTION_USE_CASE_BROWSE'] request = retail_v2alpha.UpdateControlRequest( control=control, @@ -776,10 +774,10 @@ def sample_update_control(): Returns: google.cloud.retail_v2alpha.types.Control: - Configures dynamic serving time - metadata that is used to pre and post - process search/recommendation model - results. + Configures dynamic metadata that can be linked to a + [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] + and affect search or recommendation results at + serving time. """ # Create or coerce a protobuf request object. @@ -869,7 +867,7 @@ def sample_get_control(): request (Union[google.cloud.retail_v2alpha.types.GetControlRequest, dict]): The request object. Request for GetControl method. name (str): - Required. The resource name of the Control to delete. + Required. The resource name of the Control to get. Format: ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`` @@ -884,10 +882,10 @@ def sample_get_control(): Returns: google.cloud.retail_v2alpha.types.Control: - Configures dynamic serving time - metadata that is used to pre and post - process search/recommendation model - results. + Configures dynamic metadata that can be linked to a + [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] + and affect search or recommendation results at + serving time. """ # Create or coerce a protobuf request object. @@ -941,7 +939,8 @@ def list_controls( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListControlsPager: - r"""Lists all Controls linked to this catalog. + r"""Lists all Controls by their parent + [Catalog][google.cloud.retail.v2alpha.Catalog]. .. code-block:: python diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/control_service/transports/grpc.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/control_service/transports/grpc.py index b222ceb64e2f..0a15a25514ef 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/control_service/transports/grpc.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/control_service/transports/grpc.py @@ -299,7 +299,7 @@ def update_control( [Control][google.cloud.retail.v2alpha.Control] cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. - If the [Control][google.cloud.retail.v2alpha.Control] to delete + If the [Control][google.cloud.retail.v2alpha.Control] to update does not exist, a NOT_FOUND error is returned. Returns: @@ -354,7 +354,8 @@ def list_controls( ]: r"""Return a callable for the list controls method over gRPC. - Lists all Controls linked to this catalog. + Lists all Controls by their parent + [Catalog][google.cloud.retail.v2alpha.Catalog]. Returns: Callable[[~.ListControlsRequest], diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/control_service/transports/grpc_asyncio.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/control_service/transports/grpc_asyncio.py index 53325ced9bcb..9c1bc23a29de 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/control_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/control_service/transports/grpc_asyncio.py @@ -306,7 +306,7 @@ def update_control( [Control][google.cloud.retail.v2alpha.Control] cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. - If the [Control][google.cloud.retail.v2alpha.Control] to delete + If the [Control][google.cloud.retail.v2alpha.Control] to update does not exist, a NOT_FOUND error is returned. Returns: @@ -362,7 +362,8 @@ def list_controls( ]: r"""Return a callable for the list controls method over gRPC. - Lists all Controls linked to this catalog. + Lists all Controls by their parent + [Catalog][google.cloud.retail.v2alpha.Catalog]. Returns: Callable[[~.ListControlsRequest], diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/async_client.py index 67b0a66b7ed9..d0247ea70e99 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/async_client.py @@ -61,11 +61,11 @@ class ModelServiceAsyncClient: """Service for performing CRUD operations on models. Recommendation models contain all the metadata necessary to generate a set of - models for the Predict() api. A model is queried indirectly via a - ServingConfig, which associates a model with a given Placement (e.g. - Frequently Bought Together on Home Page). + models for the ``Predict()`` API. A model is queried indirectly via + a ServingConfig, which associates a model with a given Placement + (e.g. Frequently Bought Together on Home Page). - This service allows customers to e.g.: + This service allows you to do the following: - Initiate training of a model. - Pause training of an existing model. @@ -289,13 +289,15 @@ async def sample_create_model(): parent (:class:`str`): Required. The parent resource under which to create the model. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. model (:class:`google.cloud.retail_v2alpha.types.Model`): - Required. The payload of the [Model] to create. + Required. The payload of the + [Model][google.cloud.retail.v2alpha.Model] to create. + This corresponds to the ``model`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -314,7 +316,7 @@ async def sample_create_model(): [Model][google.cloud.retail.v2alpha.Model] can be associated with a [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] - and then queried through the Predict api. + and then queried through the Predict API. """ # Create or coerce a protobuf request object. @@ -412,7 +414,7 @@ async def sample_pause_model(): model. name (:class:`str`): Required. The name of the model to pause. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -430,7 +432,7 @@ async def sample_pause_model(): [Model][google.cloud.retail.v2alpha.Model] can be associated with a [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] - and then queried through the Predict api. + and then queried through the Predict API. """ # Create or coerce a protobuf request object. @@ -518,7 +520,7 @@ async def sample_resume_model(): model. name (:class:`str`): Required. The name of the model to resume. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -536,7 +538,7 @@ async def sample_resume_model(): [Model][google.cloud.retail.v2alpha.Model] can be associated with a [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] - and then queried through the Predict api. + and then queried through the Predict API. """ # Create or coerce a protobuf request object. @@ -619,9 +621,10 @@ async def sample_delete_model(): request (Optional[Union[google.cloud.retail_v2alpha.types.DeleteModelRequest, dict]]): The request object. Request for deleting a model. name (:class:`str`): - Required. The resource name of the [Model] to delete. + Required. The resource name of the + [Model][google.cloud.retail.v2alpha.Model] to delete. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -715,7 +718,7 @@ async def sample_list_models(): associated with a resource. parent (:class:`str`): Required. The parent for which to list models. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -796,8 +799,8 @@ async def update_model( metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_model.Model: r"""Update of model metadata. Only fields that currently can be - updated are: filtering_option, periodic_tuning_state. If other - values are provided, this API method will ignore them. + updated are: ``filtering_option`` and ``periodic_tuning_state``. + If other values are provided, this API method ignores them. .. code-block:: python @@ -838,14 +841,16 @@ async def sample_update_model(): The request object. Request for updating an existing model. model (:class:`google.cloud.retail_v2alpha.types.Model`): - Required. The body of the updated [Model]. + Required. The body of the updated + [Model][google.cloud.retail.v2alpha.Model]. + This corresponds to the ``model`` field on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): Optional. Indicates which fields in the provided 'model' to update. If not - set, will by default update all fields. + set, by default updates all fields. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -863,7 +868,7 @@ async def sample_update_model(): [Model][google.cloud.retail.v2alpha.Model] can be associated with a [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] - and then queried through the Predict api. + and then queried through the Predict API. """ # Create or coerce a protobuf request object. @@ -961,7 +966,7 @@ async def sample_tune_model(): name (:class:`str`): Required. The resource name of the model to tune. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/client.py index 1f160eec073b..0681669d68c3 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/client.py @@ -99,11 +99,11 @@ def get_transport_class( class ModelServiceClient(metaclass=ModelServiceClientMeta): """Service for performing CRUD operations on models. Recommendation models contain all the metadata necessary to generate a set of - models for the Predict() api. A model is queried indirectly via a - ServingConfig, which associates a model with a given Placement (e.g. - Frequently Bought Together on Home Page). + models for the ``Predict()`` API. A model is queried indirectly via + a ServingConfig, which associates a model with a given Placement + (e.g. Frequently Bought Together on Home Page). - This service allows customers to e.g.: + This service allows you to do the following: - Initiate training of a model. - Pause training of an existing model. @@ -540,13 +540,15 @@ def sample_create_model(): parent (str): Required. The parent resource under which to create the model. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. model (google.cloud.retail_v2alpha.types.Model): - Required. The payload of the [Model] to create. + Required. The payload of the + [Model][google.cloud.retail.v2alpha.Model] to create. + This corresponds to the ``model`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -565,7 +567,7 @@ def sample_create_model(): [Model][google.cloud.retail.v2alpha.Model] can be associated with a [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] - and then queried through the Predict api. + and then queried through the Predict API. """ # Create or coerce a protobuf request object. @@ -663,7 +665,7 @@ def sample_pause_model(): model. name (str): Required. The name of the model to pause. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -681,7 +683,7 @@ def sample_pause_model(): [Model][google.cloud.retail.v2alpha.Model] can be associated with a [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] - and then queried through the Predict api. + and then queried through the Predict API. """ # Create or coerce a protobuf request object. @@ -769,7 +771,7 @@ def sample_resume_model(): model. name (str): Required. The name of the model to resume. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -787,7 +789,7 @@ def sample_resume_model(): [Model][google.cloud.retail.v2alpha.Model] can be associated with a [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] - and then queried through the Predict api. + and then queried through the Predict API. """ # Create or coerce a protobuf request object. @@ -870,9 +872,10 @@ def sample_delete_model(): request (Union[google.cloud.retail_v2alpha.types.DeleteModelRequest, dict]): The request object. Request for deleting a model. name (str): - Required. The resource name of the [Model] to delete. + Required. The resource name of the + [Model][google.cloud.retail.v2alpha.Model] to delete. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -966,7 +969,7 @@ def sample_list_models(): associated with a resource. parent (str): Required. The parent for which to list models. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1047,8 +1050,8 @@ def update_model( metadata: Sequence[Tuple[str, str]] = (), ) -> gcr_model.Model: r"""Update of model metadata. Only fields that currently can be - updated are: filtering_option, periodic_tuning_state. If other - values are provided, this API method will ignore them. + updated are: ``filtering_option`` and ``periodic_tuning_state``. + If other values are provided, this API method ignores them. .. code-block:: python @@ -1089,14 +1092,16 @@ def sample_update_model(): The request object. Request for updating an existing model. model (google.cloud.retail_v2alpha.types.Model): - Required. The body of the updated [Model]. + Required. The body of the updated + [Model][google.cloud.retail.v2alpha.Model]. + This corresponds to the ``model`` field on the ``request`` instance; if ``request`` is provided, this should not be set. update_mask (google.protobuf.field_mask_pb2.FieldMask): Optional. Indicates which fields in the provided 'model' to update. If not - set, will by default update all fields. + set, by default updates all fields. This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this @@ -1114,7 +1119,7 @@ def sample_update_model(): [Model][google.cloud.retail.v2alpha.Model] can be associated with a [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] - and then queried through the Predict api. + and then queried through the Predict API. """ # Create or coerce a protobuf request object. @@ -1212,7 +1217,7 @@ def sample_tune_model(): name (str): Required. The resource name of the model to tune. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/transports/grpc.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/transports/grpc.py index 793656097fb2..f59bf671949b 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/transports/grpc.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/transports/grpc.py @@ -36,11 +36,11 @@ class ModelServiceGrpcTransport(ModelServiceTransport): Service for performing CRUD operations on models. Recommendation models contain all the metadata necessary to generate a set of - models for the Predict() api. A model is queried indirectly via a - ServingConfig, which associates a model with a given Placement (e.g. - Frequently Bought Together on Home Page). + models for the ``Predict()`` API. A model is queried indirectly via + a ServingConfig, which associates a model with a given Placement + (e.g. Frequently Bought Together on Home Page). - This service allows customers to e.g.: + This service allows you to do the following: - Initiate training of a model. - Pause training of an existing model. @@ -391,8 +391,8 @@ def update_model( r"""Return a callable for the update model method over gRPC. Update of model metadata. Only fields that currently can be - updated are: filtering_option, periodic_tuning_state. If other - values are provided, this API method will ignore them. + updated are: ``filtering_option`` and ``periodic_tuning_state``. + If other values are provided, this API method ignores them. Returns: Callable[[~.UpdateModelRequest], diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/transports/grpc_asyncio.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/transports/grpc_asyncio.py index d2671f3c81e3..0d940347cee0 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/model_service/transports/grpc_asyncio.py @@ -37,11 +37,11 @@ class ModelServiceGrpcAsyncIOTransport(ModelServiceTransport): Service for performing CRUD operations on models. Recommendation models contain all the metadata necessary to generate a set of - models for the Predict() api. A model is queried indirectly via a - ServingConfig, which associates a model with a given Placement (e.g. - Frequently Bought Together on Home Page). + models for the ``Predict()`` API. A model is queried indirectly via + a ServingConfig, which associates a model with a given Placement + (e.g. Frequently Bought Together on Home Page). - This service allows customers to e.g.: + This service allows you to do the following: - Initiate training of a model. - Pause training of an existing model. @@ -404,8 +404,8 @@ def update_model( r"""Return a callable for the update model method over gRPC. Update of model metadata. Only fields that currently can be - updated are: filtering_option, periodic_tuning_state. If other - values are provided, this API method will ignore them. + updated are: ``filtering_option`` and ``periodic_tuning_state``. + If other values are provided, this API method ignores them. Returns: Callable[[~.UpdateModelRequest], diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/async_client.py index 6241ffbcbee6..8c725313dd19 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/async_client.py @@ -1118,10 +1118,10 @@ async def set_inventory( This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the - update will be enqueued and processed downstream. As a - consequence, when a response is returned, updates are not - immediately manifested in the - [Product][google.cloud.retail.v2alpha.Product] queried by + update is enqueued and processed downstream. As a consequence, + when a response is returned, updates are not immediately + manifested in the [Product][google.cloud.retail.v2alpha.Product] + queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. @@ -1130,10 +1130,10 @@ async def set_inventory( [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct], - the specified inventory field value(s) will overwrite any - existing value(s) while ignoring the last update time for this - field. Furthermore, the last update time for the specified - inventory fields will be overwritten to the time of the + the specified inventory field value(s) overwrite any existing + value(s) while ignoring the last update time for this field. + Furthermore, the last update times for the specified inventory + fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] @@ -1141,12 +1141,12 @@ async def set_inventory( If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product], - then any pre-existing inventory information for this product - will be used. + then any pre-existing inventory information for this product is + used. If no inventory fields are set in [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask], - then any existing inventory information will be preserved. + then any existing inventory information is preserved. Pre-existing inventory information can only be updated with [ProductService.SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory], @@ -1154,9 +1154,20 @@ async def set_inventory( and [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces]. + The returned [Operation][google.longrunning.Operation]s is + obsolete after one day, and the + [GetOperation][google.longrunning.Operations.GetOperation] API + returns ``NOT_FOUND`` afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates are not marked as + [done][google.longrunning.Operation.done] until they are + obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. .. code-block:: python @@ -1375,9 +1386,19 @@ async def add_fulfillment_places( or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. + The returned [Operation][google.longrunning.Operation]s will be + obsolete after 1 day, and + [GetOperation][google.longrunning.Operations.GetOperation] API + will return NOT_FOUND afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates will not be marked as + [done][google.longrunning.Operation.done] until being obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. .. code-block:: python @@ -1520,9 +1541,19 @@ async def remove_fulfillment_places( or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. + The returned [Operation][google.longrunning.Operation]s will be + obsolete after 1 day, and + [GetOperation][google.longrunning.Operations.GetOperation] API + will return NOT_FOUND afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates will not be marked as + [done][google.longrunning.Operation.done] until being obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. .. code-block:: python @@ -1674,9 +1705,19 @@ async def add_local_inventories( [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories. + The returned [Operation][google.longrunning.Operation]s will be + obsolete after 1 day, and + [GetOperation][google.longrunning.Operations.GetOperation] API + will return NOT_FOUND afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates will not be marked as + [done][google.longrunning.Operation.done] until being obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. .. code-block:: python @@ -1825,9 +1866,19 @@ async def remove_local_inventories( [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories. + The returned [Operation][google.longrunning.Operation]s will be + obsolete after 1 day, and + [GetOperation][google.longrunning.Operations.GetOperation] API + will return NOT_FOUND afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates will not be marked as + [done][google.longrunning.Operation.done] until being obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. .. code-block:: python diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/client.py index a8543d2ab016..d400d62f2092 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/client.py @@ -1363,10 +1363,10 @@ def set_inventory( This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the - update will be enqueued and processed downstream. As a - consequence, when a response is returned, updates are not - immediately manifested in the - [Product][google.cloud.retail.v2alpha.Product] queried by + update is enqueued and processed downstream. As a consequence, + when a response is returned, updates are not immediately + manifested in the [Product][google.cloud.retail.v2alpha.Product] + queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. @@ -1375,10 +1375,10 @@ def set_inventory( [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct], - the specified inventory field value(s) will overwrite any - existing value(s) while ignoring the last update time for this - field. Furthermore, the last update time for the specified - inventory fields will be overwritten to the time of the + the specified inventory field value(s) overwrite any existing + value(s) while ignoring the last update time for this field. + Furthermore, the last update times for the specified inventory + fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] @@ -1386,12 +1386,12 @@ def set_inventory( If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product], - then any pre-existing inventory information for this product - will be used. + then any pre-existing inventory information for this product is + used. If no inventory fields are set in [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask], - then any existing inventory information will be preserved. + then any existing inventory information is preserved. Pre-existing inventory information can only be updated with [ProductService.SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory], @@ -1399,9 +1399,20 @@ def set_inventory( and [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces]. + The returned [Operation][google.longrunning.Operation]s is + obsolete after one day, and the + [GetOperation][google.longrunning.Operations.GetOperation] API + returns ``NOT_FOUND`` afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates are not marked as + [done][google.longrunning.Operation.done] until they are + obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. .. code-block:: python @@ -1620,9 +1631,19 @@ def add_fulfillment_places( or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. + The returned [Operation][google.longrunning.Operation]s will be + obsolete after 1 day, and + [GetOperation][google.longrunning.Operations.GetOperation] API + will return NOT_FOUND afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates will not be marked as + [done][google.longrunning.Operation.done] until being obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. .. code-block:: python @@ -1765,9 +1786,19 @@ def remove_fulfillment_places( or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. + The returned [Operation][google.longrunning.Operation]s will be + obsolete after 1 day, and + [GetOperation][google.longrunning.Operations.GetOperation] API + will return NOT_FOUND afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates will not be marked as + [done][google.longrunning.Operation.done] until being obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. .. code-block:: python @@ -1921,9 +1952,19 @@ def add_local_inventories( [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories. + The returned [Operation][google.longrunning.Operation]s will be + obsolete after 1 day, and + [GetOperation][google.longrunning.Operations.GetOperation] API + will return NOT_FOUND afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates will not be marked as + [done][google.longrunning.Operation.done] until being obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. .. code-block:: python @@ -2072,9 +2113,19 @@ def remove_local_inventories( [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories. + The returned [Operation][google.longrunning.Operation]s will be + obsolete after 1 day, and + [GetOperation][google.longrunning.Operations.GetOperation] API + will return NOT_FOUND afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates will not be marked as + [done][google.longrunning.Operation.done] until being obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. .. code-block:: python diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/transports/grpc.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/transports/grpc.py index b36d9915eef0..ab35d28755f2 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/transports/grpc.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/transports/grpc.py @@ -473,10 +473,10 @@ def set_inventory( This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the - update will be enqueued and processed downstream. As a - consequence, when a response is returned, updates are not - immediately manifested in the - [Product][google.cloud.retail.v2alpha.Product] queried by + update is enqueued and processed downstream. As a consequence, + when a response is returned, updates are not immediately + manifested in the [Product][google.cloud.retail.v2alpha.Product] + queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. @@ -485,10 +485,10 @@ def set_inventory( [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct], - the specified inventory field value(s) will overwrite any - existing value(s) while ignoring the last update time for this - field. Furthermore, the last update time for the specified - inventory fields will be overwritten to the time of the + the specified inventory field value(s) overwrite any existing + value(s) while ignoring the last update time for this field. + Furthermore, the last update times for the specified inventory + fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] @@ -496,12 +496,12 @@ def set_inventory( If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product], - then any pre-existing inventory information for this product - will be used. + then any pre-existing inventory information for this product is + used. If no inventory fields are set in [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask], - then any existing inventory information will be preserved. + then any existing inventory information is preserved. Pre-existing inventory information can only be updated with [ProductService.SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory], @@ -509,9 +509,20 @@ def set_inventory( and [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces]. + The returned [Operation][google.longrunning.Operation]s is + obsolete after one day, and the + [GetOperation][google.longrunning.Operations.GetOperation] API + returns ``NOT_FOUND`` afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates are not marked as + [done][google.longrunning.Operation.done] until they are + obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. Returns: Callable[[~.SetInventoryRequest], @@ -553,9 +564,19 @@ def add_fulfillment_places( or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. + The returned [Operation][google.longrunning.Operation]s will be + obsolete after 1 day, and + [GetOperation][google.longrunning.Operations.GetOperation] API + will return NOT_FOUND afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates will not be marked as + [done][google.longrunning.Operation.done] until being obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. Returns: Callable[[~.AddFulfillmentPlacesRequest], @@ -597,9 +618,19 @@ def remove_fulfillment_places( or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. + The returned [Operation][google.longrunning.Operation]s will be + obsolete after 1 day, and + [GetOperation][google.longrunning.Operations.GetOperation] API + will return NOT_FOUND afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates will not be marked as + [done][google.longrunning.Operation.done] until being obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. Returns: Callable[[~.RemoveFulfillmentPlacesRequest], @@ -650,9 +681,19 @@ def add_local_inventories( [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories. + The returned [Operation][google.longrunning.Operation]s will be + obsolete after 1 day, and + [GetOperation][google.longrunning.Operations.GetOperation] API + will return NOT_FOUND afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates will not be marked as + [done][google.longrunning.Operation.done] until being obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. Returns: Callable[[~.AddLocalInventoriesRequest], @@ -700,9 +741,19 @@ def remove_local_inventories( [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories. + The returned [Operation][google.longrunning.Operation]s will be + obsolete after 1 day, and + [GetOperation][google.longrunning.Operations.GetOperation] API + will return NOT_FOUND afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates will not be marked as + [done][google.longrunning.Operation.done] until being obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. Returns: Callable[[~.RemoveLocalInventoriesRequest], diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/transports/grpc_asyncio.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/transports/grpc_asyncio.py index 9991a3c554f0..ef990b00d6b5 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/product_service/transports/grpc_asyncio.py @@ -489,10 +489,10 @@ def set_inventory( This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the - update will be enqueued and processed downstream. As a - consequence, when a response is returned, updates are not - immediately manifested in the - [Product][google.cloud.retail.v2alpha.Product] queried by + update is enqueued and processed downstream. As a consequence, + when a response is returned, updates are not immediately + manifested in the [Product][google.cloud.retail.v2alpha.Product] + queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. @@ -501,10 +501,10 @@ def set_inventory( [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct], - the specified inventory field value(s) will overwrite any - existing value(s) while ignoring the last update time for this - field. Furthermore, the last update time for the specified - inventory fields will be overwritten to the time of the + the specified inventory field value(s) overwrite any existing + value(s) while ignoring the last update time for this field. + Furthermore, the last update times for the specified inventory + fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] @@ -512,12 +512,12 @@ def set_inventory( If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product], - then any pre-existing inventory information for this product - will be used. + then any pre-existing inventory information for this product is + used. If no inventory fields are set in [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask], - then any existing inventory information will be preserved. + then any existing inventory information is preserved. Pre-existing inventory information can only be updated with [ProductService.SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory], @@ -525,9 +525,20 @@ def set_inventory( and [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces]. + The returned [Operation][google.longrunning.Operation]s is + obsolete after one day, and the + [GetOperation][google.longrunning.Operations.GetOperation] API + returns ``NOT_FOUND`` afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates are not marked as + [done][google.longrunning.Operation.done] until they are + obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. Returns: Callable[[~.SetInventoryRequest], @@ -570,9 +581,19 @@ def add_fulfillment_places( or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. + The returned [Operation][google.longrunning.Operation]s will be + obsolete after 1 day, and + [GetOperation][google.longrunning.Operations.GetOperation] API + will return NOT_FOUND afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates will not be marked as + [done][google.longrunning.Operation.done] until being obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. Returns: Callable[[~.AddFulfillmentPlacesRequest], @@ -615,9 +636,19 @@ def remove_fulfillment_places( or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. + The returned [Operation][google.longrunning.Operation]s will be + obsolete after 1 day, and + [GetOperation][google.longrunning.Operations.GetOperation] API + will return NOT_FOUND afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates will not be marked as + [done][google.longrunning.Operation.done] until being obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. Returns: Callable[[~.RemoveFulfillmentPlacesRequest], @@ -669,9 +700,19 @@ def add_local_inventories( [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories. + The returned [Operation][google.longrunning.Operation]s will be + obsolete after 1 day, and + [GetOperation][google.longrunning.Operations.GetOperation] API + will return NOT_FOUND afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates will not be marked as + [done][google.longrunning.Operation.done] until being obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. Returns: Callable[[~.AddLocalInventoriesRequest], @@ -720,9 +761,19 @@ def remove_local_inventories( [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories. + The returned [Operation][google.longrunning.Operation]s will be + obsolete after 1 day, and + [GetOperation][google.longrunning.Operations.GetOperation] API + will return NOT_FOUND afterwards. + + If conflicting updates are issued, the + [Operation][google.longrunning.Operation]s associated with the + stale updates will not be marked as + [done][google.longrunning.Operation.done] until being obsolete. + This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. Returns: Callable[[~.RemoveLocalInventoriesRequest], diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/search_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/search_service/async_client.py index 2592f64182f3..73d4185dfe4a 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/search_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/search_service/async_client.py @@ -53,8 +53,8 @@ class SearchServiceAsyncClient: """Service for search. This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. """ _client: SearchServiceClient @@ -230,8 +230,8 @@ async def search( ) -> pagers.SearchAsyncPager: r"""Performs a search. This feature is only available for users who have Retail - Search enabled. Please enable Retail Search on Cloud - Console before using this feature. + Search enabled. Enable Retail Search on Cloud Console + before using this feature. .. code-block:: python diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/search_service/client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/search_service/client.py index 65e8c78108a1..df6534a57fb0 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/search_service/client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/search_service/client.py @@ -91,8 +91,8 @@ def get_transport_class( class SearchServiceClient(metaclass=SearchServiceClientMeta): """Service for search. This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. """ @staticmethod @@ -481,8 +481,8 @@ def search( ) -> pagers.SearchPager: r"""Performs a search. This feature is only available for users who have Retail - Search enabled. Please enable Retail Search on Cloud - Console before using this feature. + Search enabled. Enable Retail Search on Cloud Console + before using this feature. .. code-block:: python diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/search_service/transports/grpc.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/search_service/transports/grpc.py index a5de8f27ff70..4d05250a8916 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/search_service/transports/grpc.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/search_service/transports/grpc.py @@ -32,8 +32,8 @@ class SearchServiceGrpcTransport(SearchServiceTransport): Service for search. This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -239,8 +239,8 @@ def search( Performs a search. This feature is only available for users who have Retail - Search enabled. Please enable Retail Search on Cloud - Console before using this feature. + Search enabled. Enable Retail Search on Cloud Console + before using this feature. Returns: Callable[[~.SearchRequest], diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/search_service/transports/grpc_asyncio.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/search_service/transports/grpc_asyncio.py index 0c4d01ffeca7..d23a5bdea111 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/search_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/search_service/transports/grpc_asyncio.py @@ -33,8 +33,8 @@ class SearchServiceGrpcAsyncIOTransport(SearchServiceTransport): Service for search. This feature is only available for users who have Retail Search - enabled. Please enable Retail Search on Cloud Console before - using this feature. + enabled. Enable Retail Search on Cloud Console before using this + feature. This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -244,8 +244,8 @@ def search( Performs a search. This feature is only available for users who have Retail - Search enabled. Please enable Retail Search on Cloud - Console before using this feature. + Search enabled. Enable Retail Search on Cloud Console + before using this feature. Returns: Callable[[~.SearchRequest], diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/serving_config_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/serving_config_service/async_client.py index 3c5abdf1676b..9a726f414694 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/serving_config_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/serving_config_service/async_client.py @@ -313,11 +313,10 @@ async def sample_create_serving_config(): Returns: google.cloud.retail_v2alpha.types.ServingConfig: - Configures metadata that is used to generate serving time results (e.g. - search results or recommendation predictions). The - ServingConfig is passed in the search and predict - request and together with the Catalog.default_branch, - generates results. + Configures metadata that is used to + generate serving time results (e.g. + search results or recommendation + predictions). """ # Create or coerce a protobuf request object. @@ -411,7 +410,7 @@ async def sample_delete_serving_config(): name (:class:`str`): Required. The resource name of the ServingConfig to delete. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -536,11 +535,10 @@ async def sample_update_serving_config(): Returns: google.cloud.retail_v2alpha.types.ServingConfig: - Configures metadata that is used to generate serving time results (e.g. - search results or recommendation predictions). The - ServingConfig is passed in the search and predict - request and together with the Catalog.default_branch, - generates results. + Configures metadata that is used to + generate serving time results (e.g. + search results or recommendation + predictions). """ # Create or coerce a protobuf request object. @@ -636,7 +634,7 @@ async def sample_get_serving_config(): name (:class:`str`): Required. The resource name of the ServingConfig to get. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -649,11 +647,10 @@ async def sample_get_serving_config(): Returns: google.cloud.retail_v2alpha.types.ServingConfig: - Configures metadata that is used to generate serving time results (e.g. - search results or recommendation predictions). The - ServingConfig is passed in the search and predict - request and together with the Catalog.default_branch, - generates results. + Configures metadata that is used to + generate serving time results (e.g. + search results or recommendation + predictions). """ # Create or coerce a protobuf request object. @@ -744,7 +741,7 @@ async def sample_list_serving_configs(): method. parent (:class:`str`): Required. The catalog resource name. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -865,7 +862,7 @@ async def sample_add_control(): serving_config (:class:`str`): Required. The source ServingConfig resource name . Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`` This corresponds to the ``serving_config`` field on the ``request`` instance; if ``request`` is provided, this @@ -878,11 +875,10 @@ async def sample_add_control(): Returns: google.cloud.retail_v2alpha.types.ServingConfig: - Configures metadata that is used to generate serving time results (e.g. - search results or recommendation predictions). The - ServingConfig is passed in the search and predict - request and together with the Catalog.default_branch, - generates results. + Configures metadata that is used to + generate serving time results (e.g. + search results or recommendation + predictions). """ # Create or coerce a protobuf request object. @@ -977,7 +973,7 @@ async def sample_remove_control(): serving_config (:class:`str`): Required. The source ServingConfig resource name . Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`` This corresponds to the ``serving_config`` field on the ``request`` instance; if ``request`` is provided, this @@ -990,11 +986,10 @@ async def sample_remove_control(): Returns: google.cloud.retail_v2alpha.types.ServingConfig: - Configures metadata that is used to generate serving time results (e.g. - search results or recommendation predictions). The - ServingConfig is passed in the search and predict - request and together with the Catalog.default_branch, - generates results. + Configures metadata that is used to + generate serving time results (e.g. + search results or recommendation + predictions). """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/serving_config_service/client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/serving_config_service/client.py index 109b2bb12ab3..18f1eae5b111 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/serving_config_service/client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/serving_config_service/client.py @@ -559,11 +559,10 @@ def sample_create_serving_config(): Returns: google.cloud.retail_v2alpha.types.ServingConfig: - Configures metadata that is used to generate serving time results (e.g. - search results or recommendation predictions). The - ServingConfig is passed in the search and predict - request and together with the Catalog.default_branch, - generates results. + Configures metadata that is used to + generate serving time results (e.g. + search results or recommendation + predictions). """ # Create or coerce a protobuf request object. @@ -657,7 +656,7 @@ def sample_delete_serving_config(): name (str): Required. The resource name of the ServingConfig to delete. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -782,11 +781,10 @@ def sample_update_serving_config(): Returns: google.cloud.retail_v2alpha.types.ServingConfig: - Configures metadata that is used to generate serving time results (e.g. - search results or recommendation predictions). The - ServingConfig is passed in the search and predict - request and together with the Catalog.default_branch, - generates results. + Configures metadata that is used to + generate serving time results (e.g. + search results or recommendation + predictions). """ # Create or coerce a protobuf request object. @@ -882,7 +880,7 @@ def sample_get_serving_config(): name (str): Required. The resource name of the ServingConfig to get. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`` This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -895,11 +893,10 @@ def sample_get_serving_config(): Returns: google.cloud.retail_v2alpha.types.ServingConfig: - Configures metadata that is used to generate serving time results (e.g. - search results or recommendation predictions). The - ServingConfig is passed in the search and predict - request and together with the Catalog.default_branch, - generates results. + Configures metadata that is used to + generate serving time results (e.g. + search results or recommendation + predictions). """ # Create or coerce a protobuf request object. @@ -990,7 +987,7 @@ def sample_list_serving_configs(): method. parent (str): Required. The catalog resource name. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`` This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1111,7 +1108,7 @@ def sample_add_control(): serving_config (str): Required. The source ServingConfig resource name . Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`` This corresponds to the ``serving_config`` field on the ``request`` instance; if ``request`` is provided, this @@ -1124,11 +1121,10 @@ def sample_add_control(): Returns: google.cloud.retail_v2alpha.types.ServingConfig: - Configures metadata that is used to generate serving time results (e.g. - search results or recommendation predictions). The - ServingConfig is passed in the search and predict - request and together with the Catalog.default_branch, - generates results. + Configures metadata that is used to + generate serving time results (e.g. + search results or recommendation + predictions). """ # Create or coerce a protobuf request object. @@ -1223,7 +1219,7 @@ def sample_remove_control(): serving_config (str): Required. The source ServingConfig resource name . Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`` This corresponds to the ``serving_config`` field on the ``request`` instance; if ``request`` is provided, this @@ -1236,11 +1232,10 @@ def sample_remove_control(): Returns: google.cloud.retail_v2alpha.types.ServingConfig: - Configures metadata that is used to generate serving time results (e.g. - search results or recommendation predictions). The - ServingConfig is passed in the search and predict - request and together with the Catalog.default_branch, - generates results. + Configures metadata that is used to + generate serving time results (e.g. + search results or recommendation + predictions). """ # Create or coerce a protobuf request object. diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/async_client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/async_client.py index 272662a175da..69046a399edb 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/async_client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/async_client.py @@ -350,6 +350,7 @@ async def sample_collect_user_event(): # Initialize request argument(s) request = retail_v2alpha.CollectUserEventRequest( + prebuilt_rule="prebuilt_rule_value", parent="parent_value", user_event="user_event_value", ) @@ -566,13 +567,13 @@ async def import_user_events( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: - r"""Bulk import of User events. Request processing might - be synchronous. Events that already exist are skipped. - Use this method for backfilling historical user events. - Operation.response is of type ImportResponse. Note that - it is possible for a subset of the items to be - successfully inserted. Operation.metadata is of type - ImportMetadata. + r"""Bulk import of User events. Request processing might be + synchronous. Events that already exist are skipped. Use this + method for backfilling historical user events. + + ``Operation.response`` is of type ``ImportResponse``. Note that + it is possible for a subset of the items to be successfully + inserted. ``Operation.metadata`` is of type ``ImportMetadata``. .. code-block:: python @@ -686,15 +687,15 @@ async def rejoin_user_events( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: - r"""Starts a user event rejoin operation with latest - product catalog. Events will not be annotated with - detailed product information if product is missing from - the catalog at the time the user event is ingested, and - these events are stored as unjoined events with a - limited usage on training and serving. This method can - be used to start a join operation on specified events - with latest version of product catalog. It can also be - used to correct events joined with the wrong product + r"""Starts a user-event rejoin operation with latest + product catalog. Events are not annotated with detailed + product information for products that are missing from + the catalog when the user event is ingested. These + events are stored as unjoined events with limited usage + on training and serving. You can use this method to + start a join operation on specified events with the + latest version of product catalog. You can also use this + method to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete. diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/client.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/client.py index 34fa2b441fb5..24e8fa214991 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/client.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/client.py @@ -602,6 +602,7 @@ def sample_collect_user_event(): # Initialize request argument(s) request = retail_v2alpha.CollectUserEventRequest( + prebuilt_rule="prebuilt_rule_value", parent="parent_value", user_event="user_event_value", ) @@ -810,13 +811,13 @@ def import_user_events( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: - r"""Bulk import of User events. Request processing might - be synchronous. Events that already exist are skipped. - Use this method for backfilling historical user events. - Operation.response is of type ImportResponse. Note that - it is possible for a subset of the items to be - successfully inserted. Operation.metadata is of type - ImportMetadata. + r"""Bulk import of User events. Request processing might be + synchronous. Events that already exist are skipped. Use this + method for backfilling historical user events. + + ``Operation.response`` is of type ``ImportResponse``. Note that + it is possible for a subset of the items to be successfully + inserted. ``Operation.metadata`` is of type ``ImportMetadata``. .. code-block:: python @@ -921,15 +922,15 @@ def rejoin_user_events( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: - r"""Starts a user event rejoin operation with latest - product catalog. Events will not be annotated with - detailed product information if product is missing from - the catalog at the time the user event is ingested, and - these events are stored as unjoined events with a - limited usage on training and serving. This method can - be used to start a join operation on specified events - with latest version of product catalog. It can also be - used to correct events joined with the wrong product + r"""Starts a user-event rejoin operation with latest + product catalog. Events are not annotated with detailed + product information for products that are missing from + the catalog when the user event is ingested. These + events are stored as unjoined events with limited usage + on training and serving. You can use this method to + start a join operation on specified events with the + latest version of product catalog. You can also use this + method to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete. diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/transports/grpc.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/transports/grpc.py index 366bc771de09..3c213898bcf4 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/transports/grpc.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/transports/grpc.py @@ -344,13 +344,13 @@ def import_user_events( ) -> Callable[[import_config.ImportUserEventsRequest], operations_pb2.Operation]: r"""Return a callable for the import user events method over gRPC. - Bulk import of User events. Request processing might - be synchronous. Events that already exist are skipped. - Use this method for backfilling historical user events. - Operation.response is of type ImportResponse. Note that - it is possible for a subset of the items to be - successfully inserted. Operation.metadata is of type - ImportMetadata. + Bulk import of User events. Request processing might be + synchronous. Events that already exist are skipped. Use this + method for backfilling historical user events. + + ``Operation.response`` is of type ``ImportResponse``. Note that + it is possible for a subset of the items to be successfully + inserted. ``Operation.metadata`` is of type ``ImportMetadata``. Returns: Callable[[~.ImportUserEventsRequest], @@ -378,15 +378,15 @@ def rejoin_user_events( ]: r"""Return a callable for the rejoin user events method over gRPC. - Starts a user event rejoin operation with latest - product catalog. Events will not be annotated with - detailed product information if product is missing from - the catalog at the time the user event is ingested, and - these events are stored as unjoined events with a - limited usage on training and serving. This method can - be used to start a join operation on specified events - with latest version of product catalog. It can also be - used to correct events joined with the wrong product + Starts a user-event rejoin operation with latest + product catalog. Events are not annotated with detailed + product information for products that are missing from + the catalog when the user event is ingested. These + events are stored as unjoined events with limited usage + on training and serving. You can use this method to + start a join operation on specified events with the + latest version of product catalog. You can also use this + method to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete. diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/transports/grpc_asyncio.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/transports/grpc_asyncio.py index ae51816699a9..f8cd8bcb81cc 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/services/user_event_service/transports/grpc_asyncio.py @@ -357,13 +357,13 @@ def import_user_events( ]: r"""Return a callable for the import user events method over gRPC. - Bulk import of User events. Request processing might - be synchronous. Events that already exist are skipped. - Use this method for backfilling historical user events. - Operation.response is of type ImportResponse. Note that - it is possible for a subset of the items to be - successfully inserted. Operation.metadata is of type - ImportMetadata. + Bulk import of User events. Request processing might be + synchronous. Events that already exist are skipped. Use this + method for backfilling historical user events. + + ``Operation.response`` is of type ``ImportResponse``. Note that + it is possible for a subset of the items to be successfully + inserted. ``Operation.metadata`` is of type ``ImportMetadata``. Returns: Callable[[~.ImportUserEventsRequest], @@ -392,15 +392,15 @@ def rejoin_user_events( ]: r"""Return a callable for the rejoin user events method over gRPC. - Starts a user event rejoin operation with latest - product catalog. Events will not be annotated with - detailed product information if product is missing from - the catalog at the time the user event is ingested, and - these events are stored as unjoined events with a - limited usage on training and serving. This method can - be used to start a join operation on specified events - with latest version of product catalog. It can also be - used to correct events joined with the wrong product + Starts a user-event rejoin operation with latest + product catalog. Events are not annotated with detailed + product information for products that are missing from + the catalog when the user event is ingested. These + events are stored as unjoined events with limited usage + on training and serving. You can use this method to + start a join operation on specified events with the + latest version of product catalog. You can also use this + method to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete. diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/__init__.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/__init__.py index b3b7f50bac7b..e370016a45de 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/__init__.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/__init__.py @@ -18,12 +18,15 @@ Catalog, CatalogAttribute, CompletionConfig, + MerchantCenterFeedFilter, MerchantCenterLink, MerchantCenterLinkingConfig, ProductLevelConfig, ) from .catalog_service import ( AddCatalogAttributeRequest, + BatchRemoveCatalogAttributesRequest, + BatchRemoveCatalogAttributesResponse, GetAttributesConfigRequest, GetCompletionConfigRequest, GetDefaultBranchRequest, @@ -71,6 +74,7 @@ ExportMetadata, ExportProductsResponse, ExportUserEventsResponse, + GcsOutputResult, OutputResult, ) from .import_config import ( @@ -87,6 +91,7 @@ ImportUserEventsResponse, ProductInlineSource, ProductInputConfig, + TransformedUserEventsMetadata, UserEventImportSummary, UserEventInlineSource, UserEventInputConfig, @@ -165,10 +170,13 @@ "Catalog", "CatalogAttribute", "CompletionConfig", + "MerchantCenterFeedFilter", "MerchantCenterLink", "MerchantCenterLinkingConfig", "ProductLevelConfig", "AddCatalogAttributeRequest", + "BatchRemoveCatalogAttributesRequest", + "BatchRemoveCatalogAttributesResponse", "GetAttributesConfigRequest", "GetCompletionConfigRequest", "GetDefaultBranchRequest", @@ -211,6 +219,7 @@ "ExportMetadata", "ExportProductsResponse", "ExportUserEventsResponse", + "GcsOutputResult", "OutputResult", "BigQuerySource", "CompletionDataInputConfig", @@ -225,6 +234,7 @@ "ImportUserEventsResponse", "ProductInlineSource", "ProductInputConfig", + "TransformedUserEventsMetadata", "UserEventImportSummary", "UserEventInlineSource", "UserEventInputConfig", diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/catalog.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/catalog.py index f763fa487ab7..d53e9e10edc2 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/catalog.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/catalog.py @@ -27,6 +27,7 @@ "AttributesConfig", "CompletionConfig", "MerchantCenterLink", + "MerchantCenterFeedFilter", "MerchantCenterLinkingConfig", "Catalog", }, @@ -136,14 +137,15 @@ class CatalogAttribute(proto.Message): APIs. This field is ``False`` for pre-loaded [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s. - Only pre-loaded - [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s + Only pre-loaded [catalog + attributes][google.cloud.retail.v2alpha.CatalogAttribute] that are neither in use by products nor predefined can be - deleted. - [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s - that are either in use by products or are predefined cannot - be deleted; however, their configuration properties will - reset to default values upon removal request. + deleted. [Catalog + attributes][google.cloud.retail.v2alpha.CatalogAttribute] + that are either in use by products or are predefined + attributes cannot be deleted; however, their configuration + properties will reset to default values upon removal + request. After catalog changes, it takes about 10 minutes for this field to update. @@ -158,6 +160,8 @@ class CatalogAttribute(proto.Message): attribute values are indexed so that it can be filtered, faceted, or boosted in [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. + + Must be specified, otherwise throws INVALID_FORMAT error. dynamic_facetable_option (google.cloud.retail_v2alpha.types.CatalogAttribute.DynamicFacetableOption): If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic facet. Could only be DYNAMIC_FACETABLE_DISABLED @@ -165,6 +169,8 @@ class CatalogAttribute(proto.Message): [CatalogAttribute.indexable_option][google.cloud.retail.v2alpha.CatalogAttribute.indexable_option] is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned. + + Must be specified, otherwise throws INVALID_FORMAT error. searchable_option (google.cloud.retail_v2alpha.types.CatalogAttribute.SearchableOption): When [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level] @@ -177,6 +183,8 @@ class CatalogAttribute(proto.Message): [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search], as there are no text values associated to numerical attributes. + + Must be specified, otherwise throws INVALID_FORMAT error. recommendations_filtering_option (google.cloud.retail_v2alpha.types.RecommendationsFilteringOption): When [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level] @@ -185,6 +193,14 @@ class CatalogAttribute(proto.Message): filterable for recommendations. This option works for categorical features only, does not work for numerical features, inventory filtering. + exact_searchable_option (google.cloud.retail_v2alpha.types.CatalogAttribute.ExactSearchableOption): + If EXACT_SEARCHABLE_ENABLED, attribute values will be exact + searchable. This property only applies to textual custom + attributes and requires indexable set to enabled to enable + exact-searchable. + retrievable_option (google.cloud.retail_v2alpha.types.CatalogAttribute.RetrievableOption): + If RETRIEVABLE_ENABLED, attribute values are retrievable in + the search results. """ class AttributeType(proto.Enum): @@ -213,6 +229,20 @@ class SearchableOption(proto.Enum): SEARCHABLE_ENABLED = 1 SEARCHABLE_DISABLED = 2 + class ExactSearchableOption(proto.Enum): + r"""The status of the exact-searchable option of a catalog + attribute. + """ + EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0 + EXACT_SEARCHABLE_ENABLED = 1 + EXACT_SEARCHABLE_DISABLED = 2 + + class RetrievableOption(proto.Enum): + r"""The status of the retrievable option of a catalog attribute.""" + RETRIEVABLE_OPTION_UNSPECIFIED = 0 + RETRIEVABLE_ENABLED = 1 + RETRIEVABLE_DISABLED = 2 + key: str = proto.Field( proto.STRING, number=1, @@ -248,6 +278,16 @@ class SearchableOption(proto.Enum): enum=common.RecommendationsFilteringOption, ) ) + exact_searchable_option: ExactSearchableOption = proto.Field( + proto.ENUM, + number=11, + enum=ExactSearchableOption, + ) + retrievable_option: RetrievableOption = proto.Field( + proto.ENUM, + number=12, + enum=RetrievableOption, + ) class AttributesConfig(proto.Message): @@ -423,23 +463,23 @@ class MerchantCenterLink(proto.Message): Attributes: merchant_center_account_id (int): Required. The linked `Merchant center account - id `__. + ID `__. The account must be a standalone account or a sub-account of a MCA. branch_id (str): - The branch id (e.g. 0/1/2) within this catalog that products + The branch ID (e.g. 0/1/2) within this catalog that products from merchant_center_account_id are streamed to. When updating this field, an empty value will use the currently configured default branch. However, changing the default branch later on won't change the linked branch here. - A single branch id can only have one linked merchant center - account id. + A single branch ID can only have one linked merchant center + account ID. destinations (MutableSequence[str]): String representing the destination to import for, all if - left empty. List of possible values can be found here. - [https://support.google.com/merchants/answer/7501026] List - of allowed string values: "Shopping_ads", + left empty. List of possible values is given in `Included + destination `__. + List of allowed string values: "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory \_ads", "Free_listings", "Free_local_listings" NOTE: The string values are case sensitive. @@ -462,6 +502,11 @@ class MerchantCenterLink(proto.Message): be performed. Example value: ``en``. + feeds (MutableSequence[google.cloud.retail_v2alpha.types.MerchantCenterFeedFilter]): + Criteria for the Merchant Center feeds to be + ingested via the link. All offers will be + ingested if the list is empty. Otherwise the + offers will be ingested from selected feeds. """ merchant_center_account_id: int = proto.Field( @@ -484,6 +529,32 @@ class MerchantCenterLink(proto.Message): proto.STRING, number=5, ) + feeds: MutableSequence["MerchantCenterFeedFilter"] = proto.RepeatedField( + proto.MESSAGE, + number=6, + message="MerchantCenterFeedFilter", + ) + + +class MerchantCenterFeedFilter(proto.Message): + r"""Merchant Center Feed filter criterion. + + Attributes: + primary_feed_id (int): + Merchant Center primary feed ID. + primary_feed_name (str): + Merchant Center primary feed name. The name + is used for the display purposes only. + """ + + primary_feed_id: int = proto.Field( + proto.INT64, + number=1, + ) + primary_feed_name: str = proto.Field( + proto.STRING, + number=2, + ) class MerchantCenterLinkingConfig(proto.Message): diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/catalog_service.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/catalog_service.py index b661f39e35ca..5a66358ea0b8 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/catalog_service.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/catalog_service.py @@ -36,6 +36,8 @@ "UpdateAttributesConfigRequest", "AddCatalogAttributeRequest", "RemoveCatalogAttributeRequest", + "BatchRemoveCatalogAttributesRequest", + "BatchRemoveCatalogAttributesResponse", "ReplaceCatalogAttributeRequest", }, ) @@ -261,7 +263,7 @@ class GetCompletionConfigRequest(proto.Message): Attributes: name (str): Required. Full CompletionConfig resource name. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`` """ name: str = proto.Field( @@ -413,6 +415,65 @@ class RemoveCatalogAttributeRequest(proto.Message): ) +class BatchRemoveCatalogAttributesRequest(proto.Message): + r"""Request for + [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributes] + method. + + Attributes: + attributes_config (str): + Required. The attributes config resource shared by all + catalog attributes being deleted. Format: + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`` + attribute_keys (MutableSequence[str]): + Required. The attribute name keys of the + [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s + to delete. A maximum of 1000 catalog attributes can be + deleted in a batch. + """ + + attributes_config: str = proto.Field( + proto.STRING, + number=1, + ) + attribute_keys: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=2, + ) + + +class BatchRemoveCatalogAttributesResponse(proto.Message): + r"""Response of the + [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributes]. + + Attributes: + deleted_catalog_attributes (MutableSequence[str]): + Catalog attributes that were deleted. Only pre-loaded + [catalog + attributes][google.cloud.retail.v2alpha.CatalogAttribute] + that are neither [in + use][google.cloud.retail.v2alpha.CatalogAttribute.in_use] by + products nor predefined can be deleted. + reset_catalog_attributes (MutableSequence[str]): + Catalog attributes that were reset. [Catalog + attributes][google.cloud.retail.v2alpha.CatalogAttribute] + that are either [in + use][google.cloud.retail.v2alpha.CatalogAttribute.in_use] by + products or are predefined attributes cannot be deleted; + however, their configuration properties will reset to + default values upon removal request. + """ + + deleted_catalog_attributes: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=1, + ) + reset_catalog_attributes: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=2, + ) + + class ReplaceCatalogAttributeRequest(proto.Message): r"""Request for [CatalogService.ReplaceCatalogAttribute][google.cloud.retail.v2alpha.CatalogService.ReplaceCatalogAttribute] diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/common.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/common.py index beb2db06637a..27429a8d02c5 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/common.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/common.py @@ -100,9 +100,9 @@ class QueryTerm(proto.Message): Value cannot be empty. Value can have at most 3 terms if specified as a partial match. Each space separated string is - considered as one term. Example) "a b c" is 3 - terms and allowed, " a b c d" is 4 terms and not - allowed for partial match. + considered as one term. For example, "a b c" is + 3 terms and allowed, but " a b c d" is 4 terms + and not allowed for a partial match. full_match (bool): Whether this is supposed to be a full or partial match. @@ -155,9 +155,10 @@ class Rule(proto.Message): r"""A rule is a condition-action pair - A condition defines when a rule is to be triggered. - - An action specifies what occurs on that trigger. Currently only - boost rules are supported. Currently only supported by the search - endpoint. + - An action specifies what occurs on that trigger. Currently rules + only work for [controls][google.cloud.retail.v2alpha.Control] + with + [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2alpha.SolutionType.SOLUTION_TYPE_SEARCH]. This message has `oneof`_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. @@ -323,7 +324,7 @@ class RedirectAction(proto.Message): class TwowaySynonymsAction(proto.Message): r"""Creates a set of terms that will be treated as synonyms of each - other. Example: synonyms of "sneakers" and "shoes". + other. Example: synonyms of "sneakers" and "shoes": - "sneakers" will use a synonym of "shoes". - "shoes" will use a synonym of "sneakers". diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/completion_service.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/completion_service.py index e05d2cdfd7dc..57dfe40c1438 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/completion_service.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/completion_service.py @@ -65,8 +65,10 @@ class CompleteQueryRequest(proto.Message): Languages `__. The maximum number of language codes is 3. device_type (str): - The device type context for completion suggestions. It is - useful to apply different suggestions on different device + The device type context for completion suggestions. We + recommend that you leave this field empty. + + It can apply different suggestions on different device types, e.g. ``DESKTOP``, ``MOBILE``. If it is empty, the suggestions are across all device types. @@ -102,6 +104,11 @@ class CompleteQueryRequest(proto.Message): The maximum allowed max suggestions is 20. If it is set higher, it will be capped by 20. + enable_attribute_suggestions (bool): + If true, attribute suggestions are enabled + and provided in response. + This field is only available for "cloud-retail" + dataset. """ catalog: str = proto.Field( @@ -132,6 +139,10 @@ class CompleteQueryRequest(proto.Message): proto.INT32, number=5, ) + enable_attribute_suggestions: bool = proto.Field( + proto.BOOL, + number=9, + ) class CompleteQueryResponse(proto.Message): @@ -171,6 +182,15 @@ class CompleteQueryResponse(proto.Message): Recent searches are deduplicated. More recent searches will be reserved when duplication happens. + attribute_results (MutableMapping[str, google.cloud.retail_v2alpha.types.CompleteQueryResponse.AttributeResult]): + A map of matched attribute suggestions. This field is only + available for "cloud-retail" dataset. + + Current supported keys: + + - ``brands`` + + - ``categories`` """ class CompletionResult(proto.Message): @@ -215,6 +235,19 @@ class RecentSearchResult(proto.Message): number=1, ) + class AttributeResult(proto.Message): + r"""Resource that represents attribute results. + + Attributes: + suggestions (MutableSequence[str]): + The list of suggestions for the attribute. + """ + + suggestions: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=1, + ) + completion_results: MutableSequence[CompletionResult] = proto.RepeatedField( proto.MESSAGE, number=1, @@ -229,6 +262,12 @@ class RecentSearchResult(proto.Message): number=3, message=RecentSearchResult, ) + attribute_results: MutableMapping[str, AttributeResult] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=4, + message=AttributeResult, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/control.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/control.py index 42e345a812fe..b599b2d7bc5f 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/control.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/control.py @@ -28,8 +28,9 @@ class Control(proto.Message): - r"""Configures dynamic serving time metadata that is used to pre - and post process search/recommendation model results. + r"""Configures dynamic metadata that can be linked to a + [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] and + affect search or recommendation results at serving time. This message has `oneof`_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. @@ -40,8 +41,10 @@ class Control(proto.Message): Attributes: facet_spec (google.cloud.retail_v2alpha.types.SearchRequest.FacetSpec): - A facet specification to perform faceted - search. + A facet specification to perform faceted search. + + Note that this field is deprecated and will throw + NOT_IMPLEMENTED if used for creating a control. This field is a member of `oneof`_ ``control``. rule (google.cloud.retail_v2alpha.types.Rule): @@ -62,25 +65,29 @@ class Control(proto.Message): limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is thrown. associated_serving_config_ids (MutableSequence[str]): - Output only. List of serving configuration - ids that that are associated with this control. + Output only. List of [serving + config][google.cloud.retail.v2alpha.ServingConfig] ids that + are associated with this control in the same + [Catalog][google.cloud.retail.v2alpha.Catalog]. + Note the association is managed via the - ServingConfig, this is an output only - denormalizeed view. Assumed to be in the same - catalog. + [ServingConfig][google.cloud.retail.v2alpha.ServingConfig], + this is an output only denormalized view. solution_types (MutableSequence[google.cloud.retail_v2alpha.types.SolutionType]): - Required. Immutable. The solution types that the serving - config is used for. Currently we support setting only one - type of solution at creation time. + Required. Immutable. The solution types that the control is + used for. Currently we support setting only one type of + solution at creation time. Only ``SOLUTION_TYPE_SEARCH`` value is supported at the moment. If no solution type is provided at creation time, - will default to SOLUTION_TYPE_SEARCH. + will default to + [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2alpha.SolutionType.SOLUTION_TYPE_SEARCH]. search_solution_use_case (MutableSequence[google.cloud.retail_v2alpha.types.SearchSolutionUseCase]): - Required. Specifies the use case for the control. Affects - what condition fields can be set. Only settable by search - controls. Will default to SEARCH_SOLUTION_USE_CASE_SEARCH if - not specified. Currently only allow one + Specifies the use case for the control. Affects what + condition fields can be set. Only settable by search + controls. Will default to + [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2alpha.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH] + if not specified. Currently only allow one search_solution_use_case per control. """ diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/control_service.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/control_service.py index a74fa1758929..030f062a4e9d 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/control_service.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/control_service.py @@ -114,8 +114,7 @@ class GetControlRequest(proto.Message): Attributes: name (str): - Required. The resource name of the Control to delete. - Format: + Required. The resource name of the Control to get. Format: ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`` """ diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/export_config.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/export_config.py index 99cf8ce6ac95..8a766e04abc7 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/export_config.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/export_config.py @@ -28,6 +28,7 @@ "ExportUserEventsResponse", "OutputResult", "BigQueryOutputResult", + "GcsOutputResult", }, ) @@ -56,8 +57,8 @@ class ExportErrorsConfig(proto.Message): class ExportMetadata(proto.Message): r"""Metadata related to the progress of the Export operation. - This will be returned by the - google.longrunning.Operation.metadata field. + This is returned by the google.longrunning.Operation.metadata + field. Attributes: create_time (google.protobuf.timestamp_pb2.Timestamp): @@ -148,11 +149,16 @@ class ExportUserEventsResponse(proto.Message): class OutputResult(proto.Message): - r"""Output result. + r"""Output result that stores the information about where the + exported data is stored. Attributes: bigquery_result (MutableSequence[google.cloud.retail_v2alpha.types.BigQueryOutputResult]): - Export result in BigQuery. + The BigQuery location where the result is + stored. + gcs_result (MutableSequence[google.cloud.retail_v2alpha.types.GcsOutputResult]): + The Google Cloud Storage location where the + result is stored. """ bigquery_result: MutableSequence["BigQueryOutputResult"] = proto.RepeatedField( @@ -160,6 +166,11 @@ class OutputResult(proto.Message): number=1, message="BigQueryOutputResult", ) + gcs_result: MutableSequence["GcsOutputResult"] = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="GcsOutputResult", + ) class BigQueryOutputResult(proto.Message): @@ -182,4 +193,18 @@ class BigQueryOutputResult(proto.Message): ) +class GcsOutputResult(proto.Message): + r"""A Gcs output result. + + Attributes: + output_uri (str): + The uri of Gcs output + """ + + output_uri: str = proto.Field( + proto.STRING, + number=1, + ) + + __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/import_config.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/import_config.py index f21dc340535d..b829a71b87bd 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/import_config.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/import_config.py @@ -38,6 +38,7 @@ "UserEventInputConfig", "CompletionDataInputConfig", "ImportMetadata", + "TransformedUserEventsMetadata", "ImportProductsResponse", "ImportUserEventsResponse", "UserEventImportSummary", @@ -48,7 +49,6 @@ class GcsSource(proto.Message): r"""Google Cloud Storage location for input content. - format. Attributes: input_uris (MutableSequence[str]): @@ -84,12 +84,12 @@ class GcsSource(proto.Message): Supported values for control imports: - - 'control' (default): One JSON + - ``control`` (default): One JSON [Control][google.cloud.retail.v2alpha.Control] per line. Supported values for catalog attribute imports: - - 'catalog_attribute' (default): One CSV + - ``catalog_attribute`` (default): One CSV [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] per line. """ @@ -114,9 +114,8 @@ class BigQuerySource(proto.Message): BigQuery time partitioned table's \_PARTITIONDATE in YYYY-MM-DD format. - Only supported when - [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode] - is set to ``FULL``. + Only supported in + [ImportProductsRequest][google.cloud.retail.v2alpha.ImportProductsRequest]. This field is a member of `oneof`_ ``partition``. project_id (str): @@ -157,9 +156,7 @@ class BigQuerySource(proto.Message): line. - ``user_event_ga360``: The schema is available here: https://support.google.com/analytics/answer/3437719. - - ``user_event_ga4``: This feature is in private preview. - Please contact the support team for importing Google - Analytics 4 events. The schema is available here: + - ``user_event_ga4``: The schema is available here: https://support.google.com/analytics/answer/7029846. Supported values for auto-completion imports: @@ -243,7 +240,7 @@ class ImportErrorsConfig(proto.Message): gcs_prefix (str): Google Cloud Storage prefix for import errors. This must be an empty, existing Cloud Storage directory. Import errors - will be written to sharded files in this directory, one per + are written to sharded files in this directory, one per line, as a JSON-encoded ``google.rpc.Status`` message. This field is a member of `oneof`_ ``destination``. @@ -276,36 +273,28 @@ class ImportProductsRequest(proto.Message): The desired location of errors incurred during the Import. update_mask (google.protobuf.field_mask_pb2.FieldMask): - Indicates which fields in the provided - imported 'products' to update. If not set, will - by default update all fields. + Indicates which fields in the provided imported ``products`` + to update. If not set, all fields are updated. reconciliation_mode (google.cloud.retail_v2alpha.types.ImportProductsRequest.ReconciliationMode): The mode of reconciliation between existing products and the products to be imported. Defaults to [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode.INCREMENTAL]. notification_pubsub_topic (str): Full Pub/Sub topic name for receiving notification. If this - field is set, when the import is finished, a notification - will be sent to specified Pub/Sub topic. The message data - will be JSON string of a - [Operation][google.longrunning.Operation]. + field is set, when the import is finished, a notification is + sent to specified Pub/Sub topic. The message data is JSON + string of a [Operation][google.longrunning.Operation]. Format of the Pub/Sub topic is ``projects/{project}/topics/{topic}``. It has to be within the same project as [ImportProductsRequest.parent][google.cloud.retail.v2alpha.ImportProductsRequest.parent]. - Make sure that both - ``cloud-retail-customer-data-access@system.gserviceaccount.com`` - and + Make sure that ``service-@gcp-sa-retail.iam.gserviceaccount.com`` - have the ``pubsub.topics.publish`` IAM permission on the + has the ``pubsub.topics.publish`` IAM permission on the topic. - - Only supported when - [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode] - is set to ``FULL``. skip_default_branch_protection (bool): - If true, will perform the FULL import even if it would + If true, this performs the FULL import even if it would delete a large proportion of the products in the default branch, which could potentially cause outages if you have live predict/search traffic. @@ -408,11 +397,10 @@ class ImportCompletionDataRequest(proto.Message): data. notification_pubsub_topic (str): Pub/Sub topic for receiving notification. If this field is - set, when the import is finished, a notification will be - sent to specified Pub/Sub topic. The message data will be - JSON string of a [Operation][google.longrunning.Operation]. - Format of the Pub/Sub topic is - ``projects/{project}/topics/{topic}``. + set, when the import is finished, a notification is sent to + specified Pub/Sub topic. The message data is JSON string of + a [Operation][google.longrunning.Operation]. Format of the + Pub/Sub topic is ``projects/{project}/topics/{topic}``. """ parent: str = proto.Field( @@ -551,8 +539,8 @@ class CompletionDataInputConfig(proto.Message): class ImportMetadata(proto.Message): r"""Metadata related to the progress of the Import operation. - This will be returned by the - google.longrunning.Operation.metadata field. + This is returned by the google.longrunning.Operation.metadata + field. Attributes: create_time (google.protobuf.timestamp_pb2.Timestamp): @@ -570,11 +558,12 @@ class ImportMetadata(proto.Message): Deprecated. This field is never set. notification_pubsub_topic (str): Pub/Sub topic for receiving notification. If this field is - set, when the import is finished, a notification will be - sent to specified Pub/Sub topic. The message data will be - JSON string of a [Operation][google.longrunning.Operation]. - Format of the Pub/Sub topic is - ``projects/{project}/topics/{topic}``. + set, when the import is finished, a notification is sent to + specified Pub/Sub topic. The message data is JSON string of + a [Operation][google.longrunning.Operation]. Format of the + Pub/Sub topic is ``projects/{project}/topics/{topic}``. + transformed_user_events_metadata (google.cloud.retail_v2alpha.types.TransformedUserEventsMetadata): + Metadata related to transform user events. """ create_time: timestamp_pb2.Timestamp = proto.Field( @@ -603,6 +592,35 @@ class ImportMetadata(proto.Message): proto.STRING, number=6, ) + transformed_user_events_metadata: "TransformedUserEventsMetadata" = proto.Field( + proto.MESSAGE, + number=7, + message="TransformedUserEventsMetadata", + ) + + +class TransformedUserEventsMetadata(proto.Message): + r"""Metadata related to transform user events operation. + + Attributes: + source_events_count (int): + Count of entries in the source user events + BigQuery table. + transformed_events_count (int): + Count of entries in the transformed user + events BigQuery table, which could be different + from the actually imported number of user + events. + """ + + source_events_count: int = proto.Field( + proto.INT64, + number=1, + ) + transformed_events_count: int = proto.Field( + proto.INT64, + number=2, + ) class ImportProductsResponse(proto.Message): diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/model.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/model.py index 0c7c224ff3a9..86fcf3b6018f 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/model.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/model.py @@ -33,7 +33,7 @@ class Model(proto.Message): [Model][google.cloud.retail.v2alpha.Model]. A [Model][google.cloud.retail.v2alpha.Model] can be associated with a [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] and then - queried through the Predict api. + queried through the Predict API. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -47,29 +47,28 @@ class Model(proto.Message): Required. The fully qualified resource name of the model. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`` catalog_id has char limit of 50. recommendation_model_id has char limit of 40. display_name (str): Required. The display name of the model. Should be human readable, used to display - Recommendation Models in the Retail Cloud Cosole - Dashboard. UTF-8 encoded string with limit of - 1024 characters. + Recommendation Models in the Retail Cloud + Console Dashboard. UTF-8 encoded string with + limit of 1024 characters. training_state (google.cloud.retail_v2alpha.types.Model.TrainingState): - Optional. The training state that the model - is in (e.g. TRAINING or PAUSED). - - Since part of the cost of running the service is - frequency of training - this can be used to - determine when to train model in order to - control cost. If not specified: the default - value for CreateModel method is TRAINING. the - default value for UpdateModel method is to keep - the state the same as before. + Optional. The training state that the model is in (e.g. + ``TRAINING`` or ``PAUSED``). + + Since part of the cost of running the service is frequency + of training - this can be used to determine when to train + model in order to control cost. If not specified: the + default value for ``CreateModel`` method is ``TRAINING``. + The default value for ``UpdateModel`` method is to keep the + state the same as before. serving_state (google.cloud.retail_v2alpha.types.Model.ServingState): - Output only. The serving state of the model: ACTIVE, - NOT_ACTIVE. + Output only. The serving state of the model: ``ACTIVE``, + ``NOT_ACTIVE``. create_time (google.protobuf.timestamp_pb2.Timestamp): Output only. Timestamp the Recommendation Model was created at. @@ -83,8 +82,20 @@ class Model(proto.Message): Currently supported values: ``recommended-for-you``, ``others-you-may-like``, ``frequently-bought-together``, - ``page-optimization``, 'similar-items', 'buy-it-again', - ``recently-viewed``\ (readonly value). + ``page-optimization``, ``similar-items``, ``buy-it-again``, + ``on-sale-items``, and ``recently-viewed``\ (readonly + value). + + This field together with + [optimization_objective][google.cloud.retail.v2alpha.Model.optimization_objective] + describe model metadata to use to control model training and + serving. See https://cloud.google.com/retail/docs/models for + more details on what the model metadata control and which + combination of parameters are valid. For invalid + combinations of parameters (e.g. type = + ``frequently-bought-together`` and optimization_objective = + ``ctr``), you receive an error 400 if you try to + create/update a recommendation with this set of knobs. optimization_objective (str): Optional. The optimization objective e.g. ``cvr``. @@ -99,12 +110,23 @@ class Model(proto.Message): ``others-you-may-like`` => ``ctr`` ``frequently-bought-together`` => ``revenue_per_order`` + + This field together with + [optimization_objective][google.cloud.retail.v2alpha.Model.type] + describe model metadata to use to control model training and + serving. See https://cloud.google.com/retail/docs/models for + more details on what the model metadata control and which + combination of parameters are valid. For invalid + combinations of parameters (e.g. type = + ``frequently-bought-together`` and optimization_objective = + ``ctr``), you receive an error 400 if you try to + create/update a recommendation with this set of knobs. periodic_tuning_state (google.cloud.retail_v2alpha.types.Model.PeriodicTuningState): Optional. The state of periodic tuning. The period we use is 3 months - to do a one-off tune earlier - use the TuneModel method. Default value is - PERIODIC_TUNING_ENABLED. + use the ``TuneModel`` method. Default value is + ``PERIODIC_TUNING_ENABLED``. last_tune_time (google.protobuf.timestamp_pb2.Timestamp): Output only. The timestamp when the latest successful tune finished. @@ -116,15 +138,16 @@ class Model(proto.Message): implies no tune is goig on. data_state (google.cloud.retail_v2alpha.types.Model.DataState): Output only. The state of data requirements for this model: - DATA_OK and DATA_ERROR. + ``DATA_OK`` and ``DATA_ERROR``. Recommendation model cannot be trained if the data is in - DATA_ERROR state. Recommendation model can have DATA_ERROR - state even if serving state is ACTIVE: models were trained - successfully before, but cannot be refreshed because model - no longer has sufficient data for training. + ``DATA_ERROR`` state. Recommendation model can have + ``DATA_ERROR`` state even if serving state is ``ACTIVE``: + models were trained successfully before, but cannot be + refreshed because model no longer has sufficient data for + training. filtering_option (google.cloud.retail_v2alpha.types.RecommendationsFilteringOption): - Optional. If RECOMMENDATIONS_FILTERING_ENABLED, + Optional. If ``RECOMMENDATIONS_FILTERING_ENABLED``, recommendation filtering by attributes is enabled for the model. serving_config_lists (MutableSequence[google.cloud.retail_v2alpha.types.Model.ServingConfigList]): @@ -147,12 +170,12 @@ class TrainingState(proto.Enum): TRAINING = 2 class PeriodicTuningState(proto.Enum): - r"""Describes whether periodic tuning is enabled for this model - or not. Periodic tuning is scheduled at most every three months. - You can start a tuning process manually by using the ModelTune - method, which starts a tuning process immediately and resets the - quarterly schedule. Enabling or disabling periodic tuning does - not affect any current tuning processes. + r"""Describes whether periodic tuning is enabled for this model or not. + Periodic tuning is scheduled at most every three months. You can + start a tuning process manually by using the ``TuneModel`` method, + which starts a tuning process immediately and resets the quarterly + schedule. Enabling or disabling periodic tuning does not affect any + current tuning processes. """ PERIODIC_TUNING_STATE_UNSPECIFIED = 0 PERIODIC_TUNING_DISABLED = 1 @@ -171,8 +194,8 @@ class PageOptimizationConfig(proto.Message): r"""The PageOptimizationConfig for model training. This determines how many panels to optimize for, and which serving - configurations to consider for each panel. The purpose of this model - is to optimize which + configs to consider for each panel. The purpose of this model is to + optimize which [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to show on which panels in way that optimizes the visitors shopping journey. @@ -231,9 +254,9 @@ class Candidate(proto.Message): serving_config_id (str): This has to be a valid [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] - identifier. e.g. for a ServingConfig with full name: - ``projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config`` - this would be 'my_candidate_config' + identifier. For example, for a ServingConfig with full name: + ``projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config``, + this would be ``my_candidate_config``. This field is a member of `oneof`_ ``candidate``. """ @@ -255,11 +278,10 @@ class Panel(proto.Message): candidates (MutableSequence[google.cloud.retail_v2alpha.types.Model.PageOptimizationConfig.Candidate]): Required. The candidates to consider on the panel. - Limit = 10. default_candidate (google.cloud.retail_v2alpha.types.Model.PageOptimizationConfig.Candidate): - Required. The default candidate (in case the - model fails at serving time, we can fall back to - the default). + Required. The default candidate. If the model + fails at serving time, we fall back to the + default. """ display_name: str = proto.Field( @@ -297,13 +319,13 @@ class Panel(proto.Message): ) class ServingConfigList(proto.Message): - r"""Represents an ordered combination of valid serving configs, which / - may be used for PAGE_OPTIMIZATION recommendations. + r"""Represents an ordered combination of valid serving configs, which + can be used for ``PAGE_OPTIMIZATION`` recommendations. Attributes: serving_config_ids (MutableSequence[str]): Optional. A set of valid serving configs that may be used - for PAGE_OPTIMIZATION. + for ``PAGE_OPTIMIZATION``. """ serving_config_ids: MutableSequence[str] = proto.RepeatedField( diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/model_service.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/model_service.py index f69347f2e57c..c431c3d5f4c2 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/model_service.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/model_service.py @@ -45,12 +45,14 @@ class CreateModelRequest(proto.Message): parent (str): Required. The parent resource under which to create the model. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`` model (google.cloud.retail_v2alpha.types.Model): - Required. The payload of the [Model] to create. + Required. The payload of the + [Model][google.cloud.retail.v2alpha.Model] to create. dry_run (bool): - Optional. Whether to run a dry_run to validate the request - (without actually creating the model). + Optional. Whether to run a dry run to + validate the request (without actually creating + the model). """ parent: str = proto.Field( @@ -73,11 +75,12 @@ class UpdateModelRequest(proto.Message): Attributes: model (google.cloud.retail_v2alpha.types.Model): - Required. The body of the updated [Model]. + Required. The body of the updated + [Model][google.cloud.retail.v2alpha.Model]. update_mask (google.protobuf.field_mask_pb2.FieldMask): Optional. Indicates which fields in the - provided 'model' to update. If not set, will by - default update all fields. + provided 'model' to update. If not set, by + default updates all fields. """ model: gcr_model.Model = proto.Field( @@ -98,7 +101,7 @@ class PauseModelRequest(proto.Message): Attributes: name (str): Required. The name of the model to pause. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`` """ name: str = proto.Field( @@ -113,7 +116,7 @@ class ResumeModelRequest(proto.Message): Attributes: name (str): Required. The name of the model to resume. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`` """ name: str = proto.Field( @@ -128,7 +131,7 @@ class ListModelsRequest(proto.Message): Attributes: parent (str): Required. The parent for which to list models. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`` page_size (int): Optional. Maximum number of results to return. If unspecified, defaults to 50. Max @@ -158,9 +161,10 @@ class DeleteModelRequest(proto.Message): Attributes: name (str): - Required. The resource name of the [Model] to delete. + Required. The resource name of the + [Model][google.cloud.retail.v2alpha.Model] to delete. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`` """ name: str = proto.Field( @@ -202,7 +206,7 @@ class TuneModelRequest(proto.Message): Attributes: name (str): Required. The resource name of the model to tune. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`` """ name: str = proto.Field( @@ -218,7 +222,7 @@ class CreateModelMetadata(proto.Message): model (str): The resource name of the model that this create applies to. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`` """ model: str = proto.Field( @@ -234,7 +238,7 @@ class TuneModelMetadata(proto.Message): model (str): The resource name of the model that this tune applies to. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`` """ model: str = proto.Field( diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/prediction_service.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/prediction_service.py index 8d07056eca72..f1ff828250cb 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/prediction_service.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/prediction_service.py @@ -43,7 +43,7 @@ class PredictRequest(proto.Message): Recommendations AI serving config or placement. Before you can request predictions from your model, you must create at least one serving config or placement for it. For more - information, see [Managing serving configurations] + information, see [Manage serving configs] (https://cloud.google.com/retail/docs/manage-configs). The full list of available serving configs can be seen at @@ -68,14 +68,13 @@ class PredictRequest(proto.Message): [UserInfo.user_id][google.cloud.retail.v2alpha.UserInfo.user_id] unset. page_size (int): - Maximum number of results to return per page. - Set this property to the number of prediction - results needed. If zero, the service will choose - a reasonable default. The maximum allowed value - is 100. Values above 100 will be coerced to 100. + Maximum number of results to return. Set this + property to the number of prediction results + needed. If zero, the service will choose a + reasonable default. The maximum allowed value is + 100. Values above 100 will be coerced to 100. page_token (str): - This field is not used for now; leave it - unset. + This field is not used; leave it unset. filter (str): Filter for restricting prediction results with a length limit of 5,000 characters. Accepts values for tags and the @@ -104,12 +103,11 @@ class PredictRequest(proto.Message): - filterOutOfStockItems If your filter blocks all prediction results, the API will - return generic (unfiltered) popular products. If you only - want results strictly matching the filters, set - ``strictFiltering`` to True in ``PredictRequest.params`` to - receive empty results instead. Note that the API will never - return items with storageStatus of "EXPIRED" or "DELETED" - regardless of filter choices. + return *no* results. If instead you want empty result sets + to return generic (unfiltered) popular products, set + ``strictFiltering`` to False in ``PredictRequest.params``. + Note that the API will never return items with storageStatus + of "EXPIRED" or "DELETED" regardless of filter choices. If ``filterSyntaxV2`` is set to true under the ``params`` field, then attribute-based expressions are expected instead @@ -137,7 +135,7 @@ class PredictRequest(proto.Message): 'score' corresponding to each returned product will be set in the ``results.metadata`` field in the prediction response. The given 'score' indicates the probability of - an product being clicked/purchased given the user's + a product being clicked/purchased given the user's context and history. - ``strictFiltering``: Boolean. True by default. If set to false, the service will return generic (unfiltered) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/product.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/product.py index 5f14852232e5..728db4b796c2 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/product.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/product.py @@ -46,6 +46,15 @@ class Product(proto.Message): expire_time (google.protobuf.timestamp_pb2.Timestamp): The timestamp when this product becomes unavailable for [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. + Note that this is only applicable to + [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + and + [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], + and ignored for + [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]. + In general, we suggest the users to delete the stale + products explicitly, instead of using this field to + determine staleness. If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not @@ -70,7 +79,16 @@ class Product(proto.Message): This field is a member of `oneof`_ ``expiration``. ttl (google.protobuf.duration_pb2.Duration): - Input only. The TTL (time to live) of the product. + Input only. The TTL (time to live) of the product. Note that + this is only applicable to + [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + and + [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], + and ignored for + [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]. + In general, we suggest the users to delete the stale + products explicitly, instead of using this field to + determine staleness. If it is set, it must be a non-negative value, and [expire_time][google.cloud.retail.v2alpha.Product.expire_time] @@ -150,7 +168,7 @@ class Product(proto.Message): [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] - otherwise and INVALID_ARGUMENT error is thrown. Should not + otherwise an INVALID_ARGUMENT error is thrown. Should not set it for other types. A maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is return. gtin (str): @@ -182,7 +200,7 @@ class Product(proto.Message): To represent full path of category, use '>' sign to separate different hierarchies. If '>' is part of the category name, - please replace it with other character(s). + replace it with other character(s). For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> @@ -318,6 +336,12 @@ class Product(proto.Message): [Product][google.cloud.retail.v2alpha.Product] becomes available for [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. + Note that this is only applicable to + [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + and + [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], + and ignored for + [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]. availability (google.cloud.retail_v2alpha.types.Product.Availability): The online availability of the [Product][google.cloud.retail.v2alpha.Product]. Default to @@ -518,6 +542,9 @@ class Product(proto.Message): Note: Returning more fields in [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] can increase response payload size and serving latency. + + This field is deprecated. Use the retrievable site-wide + control instead. variants (MutableSequence[google.cloud.retail_v2alpha.types.Product]): Output only. Product variants grouped together on primary product which share similar product attributes. It's @@ -530,6 +557,16 @@ class Product(proto.Message): Note: This field is OUTPUT_ONLY for [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]. Do not set this field in API requests. + local_inventories (MutableSequence[google.cloud.retail_v2alpha.types.LocalInventory]): + Output only. A list of local inventories specific to + different places. + + This is only available for users who have Retail Search + enabled, and it can be managed by + [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] + and + [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] + APIs. """ class Type(proto.Enum): @@ -701,6 +738,11 @@ class Availability(proto.Enum): number=31, message="Product", ) + local_inventories: MutableSequence[common.LocalInventory] = proto.RepeatedField( + proto.MESSAGE, + number=35, + message=common.LocalInventory, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/search_service.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/search_service.py index 8e02f92be929..4ec2a1b52a80 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/search_service.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/search_service.py @@ -43,9 +43,8 @@ class SearchRequest(proto.Message): ``projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config`` or the name of the legacy placement resource, such as ``projects/*/locations/global/catalogs/default_catalog/placements/default_search``. - This field is used to identify the serving configuration - name and the set of models that will be used to make the - search. + This field is used to identify the serving config name and + the set of models that will be used to make the search. branch (str): The branch resource name, such as ``projects/*/locations/global/catalogs/default_catalog/branches/0``. @@ -273,7 +272,7 @@ class SearchRequest(proto.Message): To represent full path of category, use '>' sign to separate different hierarchies. If '>' is part of the category name, - please replace it with other character(s). + replace it with other character(s). Category pages include special pages such as sales or promotions. For instance, a special sale page may have the @@ -285,6 +284,15 @@ class SearchRequest(proto.Message): product search and faceted search. personalization_spec (google.cloud.retail_v2alpha.types.SearchRequest.PersonalizationSpec): The specification for personalization. + + Notice that if both + [ServingConfig.personalization_spec][google.cloud.retail.v2alpha.ServingConfig.personalization_spec] + and + [SearchRequest.personalization_spec][google.cloud.retail.v2alpha.SearchRequest.personalization_spec] + are set. + [SearchRequest.personalization_spec][google.cloud.retail.v2alpha.SearchRequest.personalization_spec] + will override + [ServingConfig.personalization_spec][google.cloud.retail.v2alpha.ServingConfig.personalization_spec]. labels (MutableMapping[str, str]): The labels applied to a resource must meet the following requirements: @@ -340,7 +348,7 @@ class FacetSpec(proto.Message): Required. The facet key specification. limit (int): Maximum of facet values that should be returned for this - facet. If unspecified, defaults to 20. The maximum allowed + facet. If unspecified, defaults to 50. The maximum allowed value is 300. Values above 300 will be coerced to 300. If this field is negative, an INVALID_ARGUMENT is returned. @@ -1042,6 +1050,23 @@ class SearchResult(proto.Message): ``{key: "pickupInStore.store1" value { number_value: 10 }}`` means a there are 10 variants in this product are available in the store "store1". + personal_labels (MutableSequence[str]): + Specifies previous events related to this product for this + user based on + [UserEvent][google.cloud.retail.v2alpha.UserEvent] with same + [SearchRequest.visitor_id][google.cloud.retail.v2alpha.SearchRequest.visitor_id] + or + [UserInfo.user_id][google.cloud.retail.v2alpha.UserInfo.user_id]. + + This is set only when + [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.mode] + is + [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.AUTO]. + + Possible values: + + - ``purchased``: Indicates that this product has been + purchased before. """ id: str = proto.Field( @@ -1071,6 +1096,10 @@ class SearchResult(proto.Message): number=5, message=struct_pb2.Value, ) + personal_labels: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=7, + ) class Facet(proto.Message): r"""A facet result. diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/serving_config.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/serving_config.py index 35df9a48215f..4713c8ac528c 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/serving_config.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/serving_config.py @@ -28,10 +28,8 @@ class ServingConfig(proto.Message): - r"""Configures metadata that is used to generate serving time results - (e.g. search results or recommendation predictions). The - ServingConfig is passed in the search and predict request and - together with the Catalog.default_branch, generates results. + r"""Configures metadata that is used to generate serving time + results (e.g. search results or recommendation predictions). Attributes: name (str): @@ -45,8 +43,10 @@ class ServingConfig(proto.Message): limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. model_id (str): - The id of the model to use at serving time. Currently only - RecommendationModels are supported: + The id of the model in the same + [Catalog][google.cloud.retail.v2alpha.Catalog] to use at + serving time. Currently only RecommendationModels are + supported: https://cloud.google.com/retail/recommendations-ai/docs/create-models Can be changed but only to a compatible model (e.g. others-you-may-like CTR to others-you-may-like CVR). @@ -62,13 +62,13 @@ class ServingConfig(proto.Message): items first. This setting could result in a decrease in click-through and conversion rates. Allowed values are: - - 'no-price-reranking' - - 'low-price-raranking' - - 'medium-price-reranking' - - 'high-price-reranking' + - ``no-price-reranking`` + - ``low-price-raranking`` + - ``medium-price-reranking`` + - ``high-price-reranking`` If not specified, we choose default based on model type. - Default value: 'no-price-reranking'. + Default value: ``no-price-reranking``. Can only be set if [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] @@ -193,30 +193,34 @@ class ServingConfig(proto.Message): [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. diversity_level (str): How much diversity to use in recommendation model results - e.g. 'medium-diversity' or 'high-diversity'. Currently + e.g. ``medium-diversity`` or ``high-diversity``. Currently supported values: - - 'no-diversity' - - 'low-diversity' - - 'medium-diversity' - - 'high-diversity' - - 'auto-diversity' + - ``no-diversity`` + - ``low-diversity`` + - ``medium-diversity`` + - ``high-diversity`` + - ``auto-diversity`` If not specified, we choose default based on recommendation - model type. Default value: 'no-diversity'. + model type. Default value: ``no-diversity``. Can only be set if [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] is [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + diversity_type (google.cloud.retail_v2alpha.types.ServingConfig.DiversityType): + What kind of diversity to use - data driven + or rule based. enable_category_filter_level (str): Whether to add additional category filters on the - 'similar-items' model. If not specified, we enable it by + ``similar-items`` model. If not specified, we enable it by default. Allowed values are: - - 'no-category-match': No additional filtering of original - results from the model and the customer's filters. - - 'relaxed-category-match': Only keep results with + - ``no-category-match``: No additional filtering of + original results from the model and the customer's + filters. + - ``relaxed-category-match``: Only keep results with categories that match at least one item categories in the PredictRequests's context item. @@ -228,6 +232,22 @@ class ServingConfig(proto.Message): [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] is [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. + personalization_spec (google.cloud.retail_v2alpha.types.SearchRequest.PersonalizationSpec): + The specification for personalization spec. + + Can only be set if + [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] + is + [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + + Notice that if both + [ServingConfig.personalization_spec][google.cloud.retail.v2alpha.ServingConfig.personalization_spec] + and + [SearchRequest.personalization_spec][google.cloud.retail.v2alpha.SearchRequest.personalization_spec] + are set. + [SearchRequest.personalization_spec][google.cloud.retail.v2alpha.SearchRequest.personalization_spec] + will override + [ServingConfig.personalization_spec][google.cloud.retail.v2alpha.ServingConfig.personalization_spec]. solution_types (MutableSequence[google.cloud.retail_v2alpha.types.SolutionType]): Required. Immutable. Specifies the solution types that a serving config can be associated @@ -235,6 +255,14 @@ class ServingConfig(proto.Message): of solution. """ + class DiversityType(proto.Enum): + r"""What type of diversity - data or rule based. + If none is specified, default to rule based. + """ + DIVERSITY_TYPE_UNSPECIFIED = 0 + RULE_BASED_DIVERSITY = 2 + DATA_DRIVEN_DIVERSITY = 3 + name: str = proto.Field( proto.STRING, number=1, @@ -296,10 +324,22 @@ class ServingConfig(proto.Message): proto.STRING, number=8, ) + diversity_type: DiversityType = proto.Field( + proto.ENUM, + number=20, + enum=DiversityType, + ) enable_category_filter_level: str = proto.Field( proto.STRING, number=16, ) + personalization_spec: search_service.SearchRequest.PersonalizationSpec = ( + proto.Field( + proto.MESSAGE, + number=21, + message=search_service.SearchRequest.PersonalizationSpec, + ) + ) solution_types: MutableSequence[common.SolutionType] = proto.RepeatedField( proto.ENUM, number=19, diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/serving_config_service.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/serving_config_service.py index 2b2786312234..af681538c785 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/serving_config_service.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/serving_config_service.py @@ -103,7 +103,7 @@ class DeleteServingConfigRequest(proto.Message): name (str): Required. The resource name of the ServingConfig to delete. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`` """ name: str = proto.Field( @@ -119,7 +119,7 @@ class GetServingConfigRequest(proto.Message): name (str): Required. The resource name of the ServingConfig to get. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`` """ name: str = proto.Field( @@ -134,7 +134,7 @@ class ListServingConfigsRequest(proto.Message): Attributes: parent (str): Required. The catalog resource name. Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`` page_size (int): Optional. Maximum number of results to return. If unspecified, defaults to 100. If a @@ -194,7 +194,7 @@ class AddControlRequest(proto.Message): Attributes: serving_config (str): Required. The source ServingConfig resource name . Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`` control_id (str): Required. The id of the control to apply. Assumed to be in the same catalog as the serving config - if id is not found @@ -217,7 +217,7 @@ class RemoveControlRequest(proto.Message): Attributes: serving_config (str): Required. The source ServingConfig resource name . Format: - projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + ``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`` control_id (str): Required. The id of the control to apply. Assumed to be in the same catalog as the serving diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/user_event.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/user_event.py index 8c73a7f7da2b..a4dec27c4911 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/user_event.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/user_event.py @@ -247,7 +247,7 @@ class UserEvent(proto.Message): To represent full path of category, use '>' sign to separate different hierarchies. If '>' is part of the category name, - please replace it with other character(s). + replace it with other character(s). Category pages include special pages such as sales or promotions. For instance, a special sale page may have the diff --git a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/user_event_service.py b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/user_event_service.py index ed5b698ad8f0..eab530c59bf6 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/user_event_service.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2alpha/types/user_event_service.py @@ -40,6 +40,13 @@ class WriteUserEventRequest(proto.Message): ``projects/1234/locations/global/catalogs/default_catalog``. user_event (google.cloud.retail_v2alpha.types.UserEvent): Required. User event to write. + write_async (bool): + If set to true, the user event will be + written asynchronously after validation, and the + API will respond without waiting for the write. + Therefore, silent failures can occur even if the + API returns success. In case of silent failures, + error messages can be found in Stackdriver logs. """ parent: str = proto.Field( @@ -51,12 +58,23 @@ class WriteUserEventRequest(proto.Message): number=2, message=gcr_user_event.UserEvent, ) + write_async: bool = proto.Field( + proto.BOOL, + number=3, + ) class CollectUserEventRequest(proto.Message): r"""Request message for CollectUserEvent method. + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: + prebuilt_rule (str): + The prebuilt rule name that can convert a specific type of + raw_json. For example: "default_schema/v1.0". + + This field is a member of `oneof`_ ``conversion_rule``. parent (str): Required. The parent catalog name, such as ``projects/1234/locations/global/catalogs/default_catalog``. @@ -74,8 +92,18 @@ class CollectUserEventRequest(proto.Message): prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes. + raw_json (str): + An arbitrary serialized JSON string that contains necessary + information that can comprise a user event. When this field + is specified, the user_event field will be ignored. Note: + line-delimited JSON is not supported, a single JSON only. """ + prebuilt_rule: str = proto.Field( + proto.STRING, + number=6, + oneof="conversion_rule", + ) parent: str = proto.Field( proto.STRING, number=1, @@ -92,6 +120,10 @@ class CollectUserEventRequest(proto.Message): proto.INT64, number=4, ) + raw_json: str = proto.Field( + proto.STRING, + number=5, + ) class RejoinUserEventsRequest(proto.Message): @@ -105,18 +137,18 @@ class RejoinUserEventsRequest(proto.Message): The type of the user event rejoin to define the scope and range of the user events to be rejoined with the latest product catalog. Defaults to - USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if this field is not + ``USER_EVENT_REJOIN_SCOPE_UNSPECIFIED`` if this field is not set, or set to an invalid integer value. """ class UserEventRejoinScope(proto.Enum): r"""The scope of user events to be rejoined with the latest product catalog. If the rejoining aims at reducing number of unjoined - events, set UserEventRejoinScope to UNJOINED_EVENTS. If the + events, set ``UserEventRejoinScope`` to ``UNJOINED_EVENTS``. If the rejoining aims at correcting product catalog information in joined - events, set UserEventRejoinScope to JOINED_EVENTS. If all events - needs to be rejoined, set UserEventRejoinScope to - USER_EVENT_REJOIN_SCOPE_UNSPECIFIED. + events, set ``UserEventRejoinScope`` to ``JOINED_EVENTS``. If all + events needs to be rejoined, set ``UserEventRejoinScope`` to + ``USER_EVENT_REJOIN_SCOPE_UNSPECIFIED``. """ USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0 JOINED_EVENTS = 1 @@ -134,7 +166,7 @@ class UserEventRejoinScope(proto.Enum): class RejoinUserEventsResponse(proto.Message): - r"""Response message for RejoinUserEvents method. + r"""Response message for ``RejoinUserEvents`` method. Attributes: rejoined_user_events_count (int): @@ -149,7 +181,7 @@ class RejoinUserEventsResponse(proto.Message): class RejoinUserEventsMetadata(proto.Message): - r"""Metadata for RejoinUserEvents method.""" + r"""Metadata for ``RejoinUserEvents`` method.""" __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_catalog_service_batch_remove_catalog_attributes_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_catalog_service_batch_remove_catalog_attributes_async.py new file mode 100644 index 000000000000..088bbf924064 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_catalog_service_batch_remove_catalog_attributes_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchRemoveCatalogAttributes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-retail + + +# [START retail_v2alpha_generated_CatalogService_BatchRemoveCatalogAttributes_async] +# 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_v2alpha + + +async def sample_batch_remove_catalog_attributes(): + # Create a client + client = retail_v2alpha.CatalogServiceAsyncClient() + + # Initialize request argument(s) + request = retail_v2alpha.BatchRemoveCatalogAttributesRequest( + attributes_config="attributes_config_value", + attribute_keys=['attribute_keys_value1', 'attribute_keys_value2'], + ) + + # Make the request + response = await client.batch_remove_catalog_attributes(request=request) + + # Handle the response + print(response) + +# [END retail_v2alpha_generated_CatalogService_BatchRemoveCatalogAttributes_async] diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_catalog_service_batch_remove_catalog_attributes_sync.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_catalog_service_batch_remove_catalog_attributes_sync.py new file mode 100644 index 000000000000..7f1bc93de2d1 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_catalog_service_batch_remove_catalog_attributes_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchRemoveCatalogAttributes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-retail + + +# [START retail_v2alpha_generated_CatalogService_BatchRemoveCatalogAttributes_sync] +# 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_v2alpha + + +def sample_batch_remove_catalog_attributes(): + # Create a client + client = retail_v2alpha.CatalogServiceClient() + + # Initialize request argument(s) + request = retail_v2alpha.BatchRemoveCatalogAttributesRequest( + attributes_config="attributes_config_value", + attribute_keys=['attribute_keys_value1', 'attribute_keys_value2'], + ) + + # Make the request + response = client.batch_remove_catalog_attributes(request=request) + + # Handle the response + print(response) + +# [END retail_v2alpha_generated_CatalogService_BatchRemoveCatalogAttributes_sync] diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_control_service_create_control_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_control_service_create_control_async.py index d73ab06404ec..a332cb86cf44 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_control_service_create_control_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_control_service_create_control_async.py @@ -43,7 +43,6 @@ async def sample_create_control(): control.facet_spec.facet_key.key = "key_value" control.display_name = "display_name_value" control.solution_types = ['SOLUTION_TYPE_SEARCH'] - control.search_solution_use_case = ['SEARCH_SOLUTION_USE_CASE_BROWSE'] request = retail_v2alpha.CreateControlRequest( parent="parent_value", diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_control_service_create_control_sync.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_control_service_create_control_sync.py index 813bbb4002a1..8a3192f6f9d6 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_control_service_create_control_sync.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_control_service_create_control_sync.py @@ -43,7 +43,6 @@ def sample_create_control(): control.facet_spec.facet_key.key = "key_value" control.display_name = "display_name_value" control.solution_types = ['SOLUTION_TYPE_SEARCH'] - control.search_solution_use_case = ['SEARCH_SOLUTION_USE_CASE_BROWSE'] request = retail_v2alpha.CreateControlRequest( parent="parent_value", diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_control_service_update_control_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_control_service_update_control_async.py index e13c6312c9a9..f577cae8cc14 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_control_service_update_control_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_control_service_update_control_async.py @@ -43,7 +43,6 @@ async def sample_update_control(): control.facet_spec.facet_key.key = "key_value" control.display_name = "display_name_value" control.solution_types = ['SOLUTION_TYPE_SEARCH'] - control.search_solution_use_case = ['SEARCH_SOLUTION_USE_CASE_BROWSE'] request = retail_v2alpha.UpdateControlRequest( control=control, diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_control_service_update_control_sync.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_control_service_update_control_sync.py index 7210dc8e6962..966384051375 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_control_service_update_control_sync.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_control_service_update_control_sync.py @@ -43,7 +43,6 @@ def sample_update_control(): control.facet_spec.facet_key.key = "key_value" control.display_name = "display_name_value" control.solution_types = ['SOLUTION_TYPE_SEARCH'] - control.search_solution_use_case = ['SEARCH_SOLUTION_USE_CASE_BROWSE'] request = retail_v2alpha.UpdateControlRequest( control=control, diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_collect_user_event_async.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_collect_user_event_async.py index 8b199d7070bc..62d8379986df 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_collect_user_event_async.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_collect_user_event_async.py @@ -40,6 +40,7 @@ async def sample_collect_user_event(): # Initialize request argument(s) request = retail_v2alpha.CollectUserEventRequest( + prebuilt_rule="prebuilt_rule_value", parent="parent_value", user_event="user_event_value", ) diff --git a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_collect_user_event_sync.py b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_collect_user_event_sync.py index d3c3f5840452..c698d375f3e1 100644 --- a/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_collect_user_event_sync.py +++ b/packages/google-cloud-retail/samples/generated_samples/retail_v2alpha_generated_user_event_service_collect_user_event_sync.py @@ -40,6 +40,7 @@ def sample_collect_user_event(): # Initialize request argument(s) request = retail_v2alpha.CollectUserEventRequest( + prebuilt_rule="prebuilt_rule_value", parent="parent_value", user_event="user_event_value", ) diff --git a/packages/google-cloud-retail/samples/generated_samples/snippet_metadata_google.cloud.retail.v2alpha.json b/packages/google-cloud-retail/samples/generated_samples/snippet_metadata_google.cloud.retail.v2alpha.json index 8640f116c740..a60cdddcb28d 100644 --- a/packages/google-cloud-retail/samples/generated_samples/snippet_metadata_google.cloud.retail.v2alpha.json +++ b/packages/google-cloud-retail/samples/generated_samples/snippet_metadata_google.cloud.retail.v2alpha.json @@ -164,6 +164,159 @@ ], "title": "retail_v2alpha_generated_catalog_service_add_catalog_attribute_sync.py" }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.retail_v2alpha.CatalogServiceAsyncClient", + "shortName": "CatalogServiceAsyncClient" + }, + "fullName": "google.cloud.retail_v2alpha.CatalogServiceAsyncClient.batch_remove_catalog_attributes", + "method": { + "fullName": "google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributes", + "service": { + "fullName": "google.cloud.retail.v2alpha.CatalogService", + "shortName": "CatalogService" + }, + "shortName": "BatchRemoveCatalogAttributes" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.retail_v2alpha.types.BatchRemoveCatalogAttributesRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.retail_v2alpha.types.BatchRemoveCatalogAttributesResponse", + "shortName": "batch_remove_catalog_attributes" + }, + "description": "Sample for BatchRemoveCatalogAttributes", + "file": "retail_v2alpha_generated_catalog_service_batch_remove_catalog_attributes_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "retail_v2alpha_generated_CatalogService_BatchRemoveCatalogAttributes_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "retail_v2alpha_generated_catalog_service_batch_remove_catalog_attributes_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.retail_v2alpha.CatalogServiceClient", + "shortName": "CatalogServiceClient" + }, + "fullName": "google.cloud.retail_v2alpha.CatalogServiceClient.batch_remove_catalog_attributes", + "method": { + "fullName": "google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributes", + "service": { + "fullName": "google.cloud.retail.v2alpha.CatalogService", + "shortName": "CatalogService" + }, + "shortName": "BatchRemoveCatalogAttributes" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.retail_v2alpha.types.BatchRemoveCatalogAttributesRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.retail_v2alpha.types.BatchRemoveCatalogAttributesResponse", + "shortName": "batch_remove_catalog_attributes" + }, + "description": "Sample for BatchRemoveCatalogAttributes", + "file": "retail_v2alpha_generated_catalog_service_batch_remove_catalog_attributes_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "retail_v2alpha_generated_CatalogService_BatchRemoveCatalogAttributes_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "retail_v2alpha_generated_catalog_service_batch_remove_catalog_attributes_sync.py" + }, { "canonical": true, "clientMethod": { @@ -2139,12 +2292,12 @@ "regionTag": "retail_v2alpha_generated_ControlService_CreateControl_async", "segments": [ { - "end": 59, + "end": 58, "start": 27, "type": "FULL" }, { - "end": 59, + "end": 58, "start": 27, "type": "SHORT" }, @@ -2154,18 +2307,18 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 53, + "end": 52, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 56, - "start": 54, + "end": 55, + "start": 53, "type": "REQUEST_EXECUTION" }, { - "end": 60, - "start": 57, + "end": 59, + "start": 56, "type": "RESPONSE_HANDLING" } ], @@ -2227,12 +2380,12 @@ "regionTag": "retail_v2alpha_generated_ControlService_CreateControl_sync", "segments": [ { - "end": 59, + "end": 58, "start": 27, "type": "FULL" }, { - "end": 59, + "end": 58, "start": 27, "type": "SHORT" }, @@ -2242,18 +2395,18 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 53, + "end": 52, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 56, - "start": 54, + "end": 55, + "start": 53, "type": "REQUEST_EXECUTION" }, { - "end": 60, - "start": 57, + "end": 59, + "start": 56, "type": "RESPONSE_HANDLING" } ], @@ -2789,12 +2942,12 @@ "regionTag": "retail_v2alpha_generated_ControlService_UpdateControl_async", "segments": [ { - "end": 57, + "end": 56, "start": 27, "type": "FULL" }, { - "end": 57, + "end": 56, "start": 27, "type": "SHORT" }, @@ -2804,18 +2957,18 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 51, + "end": 50, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 54, - "start": 52, + "end": 53, + "start": 51, "type": "REQUEST_EXECUTION" }, { - "end": 58, - "start": 55, + "end": 57, + "start": 54, "type": "RESPONSE_HANDLING" } ], @@ -2873,12 +3026,12 @@ "regionTag": "retail_v2alpha_generated_ControlService_UpdateControl_sync", "segments": [ { - "end": 57, + "end": 56, "start": 27, "type": "FULL" }, { - "end": 57, + "end": 56, "start": 27, "type": "SHORT" }, @@ -2888,18 +3041,18 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 51, + "end": 50, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 54, - "start": 52, + "end": 53, + "start": 51, "type": "REQUEST_EXECUTION" }, { - "end": 58, - "start": 55, + "end": 57, + "start": 54, "type": "RESPONSE_HANDLING" } ], @@ -7480,12 +7633,12 @@ "regionTag": "retail_v2alpha_generated_UserEventService_CollectUserEvent_async", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -7495,18 +7648,18 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], @@ -7556,12 +7709,12 @@ "regionTag": "retail_v2alpha_generated_UserEventService_CollectUserEvent_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -7571,18 +7724,18 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], diff --git a/packages/google-cloud-retail/scripts/fixup_retail_v2alpha_keywords.py b/packages/google-cloud-retail/scripts/fixup_retail_v2alpha_keywords.py index a35c88aabe69..6290e25eaaea 100644 --- a/packages/google-cloud-retail/scripts/fixup_retail_v2alpha_keywords.py +++ b/packages/google-cloud-retail/scripts/fixup_retail_v2alpha_keywords.py @@ -43,8 +43,9 @@ class retailCallTransformer(cst.CSTTransformer): 'add_control': ('serving_config', 'control_id', ), 'add_fulfillment_places': ('product', 'type_', 'place_ids', 'add_time', 'allow_missing', ), 'add_local_inventories': ('product', 'local_inventories', 'add_mask', 'add_time', 'allow_missing', ), - 'collect_user_event': ('parent', 'user_event', 'uri', 'ets', ), - 'complete_query': ('catalog', 'query', 'visitor_id', 'language_codes', 'device_type', 'dataset', 'max_suggestions', ), + 'batch_remove_catalog_attributes': ('attributes_config', 'attribute_keys', ), + 'collect_user_event': ('parent', 'user_event', 'prebuilt_rule', 'uri', 'ets', 'raw_json', ), + 'complete_query': ('catalog', 'query', 'visitor_id', 'language_codes', 'device_type', 'dataset', 'max_suggestions', 'enable_attribute_suggestions', ), 'create_control': ('parent', 'control', 'control_id', ), 'create_model': ('parent', 'model', 'dry_run', ), 'create_product': ('parent', 'product', 'product_id', ), @@ -89,7 +90,7 @@ class retailCallTransformer(cst.CSTTransformer): 'update_model': ('model', 'update_mask', ), 'update_product': ('product', 'update_mask', 'allow_missing', ), 'update_serving_config': ('serving_config', 'update_mask', ), - 'write_user_event': ('parent', 'user_event', ), + 'write_user_event': ('parent', 'user_event', 'write_async', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_catalog_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_catalog_service.py index 3ca7b82dfcd5..f547b32e299a 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_catalog_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_catalog_service.py @@ -3295,6 +3295,171 @@ async def test_remove_catalog_attribute_field_headers_async(): ) in kw["metadata"] +@pytest.mark.parametrize( + "request_type", + [ + catalog_service.BatchRemoveCatalogAttributesRequest, + dict, + ], +) +def test_batch_remove_catalog_attributes(request_type, transport: str = "grpc"): + client = CatalogServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.batch_remove_catalog_attributes), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = catalog_service.BatchRemoveCatalogAttributesResponse( + deleted_catalog_attributes=["deleted_catalog_attributes_value"], + reset_catalog_attributes=["reset_catalog_attributes_value"], + ) + response = client.batch_remove_catalog_attributes(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == catalog_service.BatchRemoveCatalogAttributesRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, catalog_service.BatchRemoveCatalogAttributesResponse) + assert response.deleted_catalog_attributes == ["deleted_catalog_attributes_value"] + assert response.reset_catalog_attributes == ["reset_catalog_attributes_value"] + + +def test_batch_remove_catalog_attributes_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = CatalogServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.batch_remove_catalog_attributes), "__call__" + ) as call: + client.batch_remove_catalog_attributes() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == catalog_service.BatchRemoveCatalogAttributesRequest() + + +@pytest.mark.asyncio +async def test_batch_remove_catalog_attributes_async( + transport: str = "grpc_asyncio", + request_type=catalog_service.BatchRemoveCatalogAttributesRequest, +): + client = CatalogServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.batch_remove_catalog_attributes), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + catalog_service.BatchRemoveCatalogAttributesResponse( + deleted_catalog_attributes=["deleted_catalog_attributes_value"], + reset_catalog_attributes=["reset_catalog_attributes_value"], + ) + ) + response = await client.batch_remove_catalog_attributes(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == catalog_service.BatchRemoveCatalogAttributesRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, catalog_service.BatchRemoveCatalogAttributesResponse) + assert response.deleted_catalog_attributes == ["deleted_catalog_attributes_value"] + assert response.reset_catalog_attributes == ["reset_catalog_attributes_value"] + + +@pytest.mark.asyncio +async def test_batch_remove_catalog_attributes_async_from_dict(): + await test_batch_remove_catalog_attributes_async(request_type=dict) + + +def test_batch_remove_catalog_attributes_field_headers(): + client = CatalogServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = catalog_service.BatchRemoveCatalogAttributesRequest() + + request.attributes_config = "attributes_config_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.batch_remove_catalog_attributes), "__call__" + ) as call: + call.return_value = catalog_service.BatchRemoveCatalogAttributesResponse() + client.batch_remove_catalog_attributes(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "attributes_config=attributes_config_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_batch_remove_catalog_attributes_field_headers_async(): + client = CatalogServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = catalog_service.BatchRemoveCatalogAttributesRequest() + + request.attributes_config = "attributes_config_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.batch_remove_catalog_attributes), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + catalog_service.BatchRemoveCatalogAttributesResponse() + ) + await client.batch_remove_catalog_attributes(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "attributes_config=attributes_config_value", + ) in kw["metadata"] + + @pytest.mark.parametrize( "request_type", [ @@ -3613,6 +3778,7 @@ def test_catalog_service_base_transport(): "update_attributes_config", "add_catalog_attribute", "remove_catalog_attribute", + "batch_remove_catalog_attributes", "replace_catalog_attribute", ) for method in methods: diff --git a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_serving_config_service.py b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_serving_config_service.py index 53519b2b7824..3feb315e249f 100644 --- a/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_serving_config_service.py +++ b/packages/google-cloud-retail/tests/unit/gapic/retail_v2alpha/test_serving_config_service.py @@ -744,6 +744,7 @@ def test_create_serving_config(request_type, transport: str = "grpc"): replacement_control_ids=["replacement_control_ids_value"], ignore_control_ids=["ignore_control_ids_value"], diversity_level="diversity_level_value", + diversity_type=gcr_serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY, enable_category_filter_level="enable_category_filter_level_value", solution_types=[common.SolutionType.SOLUTION_TYPE_RECOMMENDATION], ) @@ -772,6 +773,10 @@ def test_create_serving_config(request_type, transport: str = "grpc"): assert response.replacement_control_ids == ["replacement_control_ids_value"] assert response.ignore_control_ids == ["ignore_control_ids_value"] assert response.diversity_level == "diversity_level_value" + assert ( + response.diversity_type + == gcr_serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY + ) assert response.enable_category_filter_level == "enable_category_filter_level_value" assert response.solution_types == [common.SolutionType.SOLUTION_TYPE_RECOMMENDATION] @@ -829,6 +834,7 @@ async def test_create_serving_config_async( replacement_control_ids=["replacement_control_ids_value"], ignore_control_ids=["ignore_control_ids_value"], diversity_level="diversity_level_value", + diversity_type=gcr_serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY, enable_category_filter_level="enable_category_filter_level_value", solution_types=[common.SolutionType.SOLUTION_TYPE_RECOMMENDATION], ) @@ -858,6 +864,10 @@ async def test_create_serving_config_async( assert response.replacement_control_ids == ["replacement_control_ids_value"] assert response.ignore_control_ids == ["ignore_control_ids_value"] assert response.diversity_level == "diversity_level_value" + assert ( + response.diversity_type + == gcr_serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY + ) assert response.enable_category_filter_level == "enable_category_filter_level_value" assert response.solution_types == [common.SolutionType.SOLUTION_TYPE_RECOMMENDATION] @@ -1310,6 +1320,7 @@ def test_update_serving_config(request_type, transport: str = "grpc"): replacement_control_ids=["replacement_control_ids_value"], ignore_control_ids=["ignore_control_ids_value"], diversity_level="diversity_level_value", + diversity_type=gcr_serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY, enable_category_filter_level="enable_category_filter_level_value", solution_types=[common.SolutionType.SOLUTION_TYPE_RECOMMENDATION], ) @@ -1338,6 +1349,10 @@ def test_update_serving_config(request_type, transport: str = "grpc"): assert response.replacement_control_ids == ["replacement_control_ids_value"] assert response.ignore_control_ids == ["ignore_control_ids_value"] assert response.diversity_level == "diversity_level_value" + assert ( + response.diversity_type + == gcr_serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY + ) assert response.enable_category_filter_level == "enable_category_filter_level_value" assert response.solution_types == [common.SolutionType.SOLUTION_TYPE_RECOMMENDATION] @@ -1395,6 +1410,7 @@ async def test_update_serving_config_async( replacement_control_ids=["replacement_control_ids_value"], ignore_control_ids=["ignore_control_ids_value"], diversity_level="diversity_level_value", + diversity_type=gcr_serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY, enable_category_filter_level="enable_category_filter_level_value", solution_types=[common.SolutionType.SOLUTION_TYPE_RECOMMENDATION], ) @@ -1424,6 +1440,10 @@ async def test_update_serving_config_async( assert response.replacement_control_ids == ["replacement_control_ids_value"] assert response.ignore_control_ids == ["ignore_control_ids_value"] assert response.diversity_level == "diversity_level_value" + assert ( + response.diversity_type + == gcr_serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY + ) assert response.enable_category_filter_level == "enable_category_filter_level_value" assert response.solution_types == [common.SolutionType.SOLUTION_TYPE_RECOMMENDATION] @@ -1631,6 +1651,7 @@ def test_get_serving_config(request_type, transport: str = "grpc"): replacement_control_ids=["replacement_control_ids_value"], ignore_control_ids=["ignore_control_ids_value"], diversity_level="diversity_level_value", + diversity_type=serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY, enable_category_filter_level="enable_category_filter_level_value", solution_types=[common.SolutionType.SOLUTION_TYPE_RECOMMENDATION], ) @@ -1659,6 +1680,10 @@ def test_get_serving_config(request_type, transport: str = "grpc"): assert response.replacement_control_ids == ["replacement_control_ids_value"] assert response.ignore_control_ids == ["ignore_control_ids_value"] assert response.diversity_level == "diversity_level_value" + assert ( + response.diversity_type + == serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY + ) assert response.enable_category_filter_level == "enable_category_filter_level_value" assert response.solution_types == [common.SolutionType.SOLUTION_TYPE_RECOMMENDATION] @@ -1716,6 +1741,7 @@ async def test_get_serving_config_async( replacement_control_ids=["replacement_control_ids_value"], ignore_control_ids=["ignore_control_ids_value"], diversity_level="diversity_level_value", + diversity_type=serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY, enable_category_filter_level="enable_category_filter_level_value", solution_types=[common.SolutionType.SOLUTION_TYPE_RECOMMENDATION], ) @@ -1745,6 +1771,10 @@ async def test_get_serving_config_async( assert response.replacement_control_ids == ["replacement_control_ids_value"] assert response.ignore_control_ids == ["ignore_control_ids_value"] assert response.diversity_level == "diversity_level_value" + assert ( + response.diversity_type + == serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY + ) assert response.enable_category_filter_level == "enable_category_filter_level_value" assert response.solution_types == [common.SolutionType.SOLUTION_TYPE_RECOMMENDATION] @@ -2383,6 +2413,7 @@ def test_add_control(request_type, transport: str = "grpc"): replacement_control_ids=["replacement_control_ids_value"], ignore_control_ids=["ignore_control_ids_value"], diversity_level="diversity_level_value", + diversity_type=gcr_serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY, enable_category_filter_level="enable_category_filter_level_value", solution_types=[common.SolutionType.SOLUTION_TYPE_RECOMMENDATION], ) @@ -2411,6 +2442,10 @@ def test_add_control(request_type, transport: str = "grpc"): assert response.replacement_control_ids == ["replacement_control_ids_value"] assert response.ignore_control_ids == ["ignore_control_ids_value"] assert response.diversity_level == "diversity_level_value" + assert ( + response.diversity_type + == gcr_serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY + ) assert response.enable_category_filter_level == "enable_category_filter_level_value" assert response.solution_types == [common.SolutionType.SOLUTION_TYPE_RECOMMENDATION] @@ -2464,6 +2499,7 @@ async def test_add_control_async( replacement_control_ids=["replacement_control_ids_value"], ignore_control_ids=["ignore_control_ids_value"], diversity_level="diversity_level_value", + diversity_type=gcr_serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY, enable_category_filter_level="enable_category_filter_level_value", solution_types=[common.SolutionType.SOLUTION_TYPE_RECOMMENDATION], ) @@ -2493,6 +2529,10 @@ async def test_add_control_async( assert response.replacement_control_ids == ["replacement_control_ids_value"] assert response.ignore_control_ids == ["ignore_control_ids_value"] assert response.diversity_level == "diversity_level_value" + assert ( + response.diversity_type + == gcr_serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY + ) assert response.enable_category_filter_level == "enable_category_filter_level_value" assert response.solution_types == [common.SolutionType.SOLUTION_TYPE_RECOMMENDATION] @@ -2680,6 +2720,7 @@ def test_remove_control(request_type, transport: str = "grpc"): replacement_control_ids=["replacement_control_ids_value"], ignore_control_ids=["ignore_control_ids_value"], diversity_level="diversity_level_value", + diversity_type=gcr_serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY, enable_category_filter_level="enable_category_filter_level_value", solution_types=[common.SolutionType.SOLUTION_TYPE_RECOMMENDATION], ) @@ -2708,6 +2749,10 @@ def test_remove_control(request_type, transport: str = "grpc"): assert response.replacement_control_ids == ["replacement_control_ids_value"] assert response.ignore_control_ids == ["ignore_control_ids_value"] assert response.diversity_level == "diversity_level_value" + assert ( + response.diversity_type + == gcr_serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY + ) assert response.enable_category_filter_level == "enable_category_filter_level_value" assert response.solution_types == [common.SolutionType.SOLUTION_TYPE_RECOMMENDATION] @@ -2761,6 +2806,7 @@ async def test_remove_control_async( replacement_control_ids=["replacement_control_ids_value"], ignore_control_ids=["ignore_control_ids_value"], diversity_level="diversity_level_value", + diversity_type=gcr_serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY, enable_category_filter_level="enable_category_filter_level_value", solution_types=[common.SolutionType.SOLUTION_TYPE_RECOMMENDATION], ) @@ -2790,6 +2836,10 @@ async def test_remove_control_async( assert response.replacement_control_ids == ["replacement_control_ids_value"] assert response.ignore_control_ids == ["ignore_control_ids_value"] assert response.diversity_level == "diversity_level_value" + assert ( + response.diversity_type + == gcr_serving_config.ServingConfig.DiversityType.RULE_BASED_DIVERSITY + ) assert response.enable_category_filter_level == "enable_category_filter_level_value" assert response.solution_types == [common.SolutionType.SOLUTION_TYPE_RECOMMENDATION]