class ProjectsLocationsCatalogsServingConfigs extends Resource (View source)

The "servingConfigs" collection of methods.

Typical usage is:

 $retailService = new Google\Service\CloudRetail(...);
 $servingConfigs = $retailService->projects_locations_catalogs_servingConfigs;

Methods

addControl(string $servingConfig, GoogleCloudRetailV2AddControlRequest $postBody, array $optParams = [])

Enables a Control on the specified ServingConfig. The control is added in the last position of the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum number of control allowed for that type of control.

create(string $parent, GoogleCloudRetailV2ServingConfig $postBody, array $optParams = [])

Creates a ServingConfig. A maximum of 100 ServingConfigs are allowed in a Catalog, otherwise a FAILED_PRECONDITION error is returned.

delete(string $name, array $optParams = [])

Deletes a ServingConfig. Returns a NotFound error if the ServingConfig does not exist. (servingConfigs.delete)

get(string $name, array $optParams = [])

Gets a ServingConfig. Returns a NotFound error if the ServingConfig does not exist. (servingConfigs.get)

listProjectsLocationsCatalogsServingConfigs(string $parent, array $optParams = [])

Lists all ServingConfigs linked to this catalog.

patch(string $name, GoogleCloudRetailV2ServingConfig $postBody, array $optParams = [])

Updates a ServingConfig. (servingConfigs.patch)

predict(string $placement, GoogleCloudRetailV2PredictRequest $postBody, array $optParams = [])

Makes a recommendation prediction. (servingConfigs.predict)

removeControl(string $servingConfig, GoogleCloudRetailV2RemoveControlRequest $postBody, array $optParams = [])

Disables a Control on the specified ServingConfig. The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig. (servingConfigs.removeControl)

search(string $placement, GoogleCloudRetailV2SearchRequest $postBody, array $optParams = [])

Performs a search. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature. (servingConfigs.search)

Details

GoogleCloudRetailV2ServingConfig addControl(string $servingConfig, GoogleCloudRetailV2AddControlRequest $postBody, array $optParams = [])

Enables a Control on the specified ServingConfig. The control is added in the last position of the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum number of control allowed for that type of control.

(servingConfigs.addControl)

Parameters

string $servingConfig

Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalo g_id}/servingConfigs/{serving_config_id}

GoogleCloudRetailV2AddControlRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleCloudRetailV2ServingConfig

Exceptions

Exception

GoogleCloudRetailV2ServingConfig create(string $parent, GoogleCloudRetailV2ServingConfig $postBody, array $optParams = [])

Creates a ServingConfig. A maximum of 100 ServingConfigs are allowed in a Catalog, otherwise a FAILED_PRECONDITION error is returned.

(servingConfigs.create)

Parameters

string $parent

Required. Full resource name of parent. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

GoogleCloudRetailV2ServingConfig $postBody
array $optParams

Optional parameters.

Return Value

GoogleCloudRetailV2ServingConfig

Exceptions

Exception

GoogleProtobufEmpty delete(string $name, array $optParams = [])

Deletes a ServingConfig. Returns a NotFound error if the ServingConfig does not exist. (servingConfigs.delete)

Parameters

string $name

Required. The resource name of the ServingConfig to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{ catalog_id}/servingConfigs/{serving_config_id}

array $optParams

Optional parameters.

Return Value

GoogleProtobufEmpty

Exceptions

Exception

GoogleCloudRetailV2ServingConfig get(string $name, array $optParams = [])

Gets a ServingConfig. Returns a NotFound error if the ServingConfig does not exist. (servingConfigs.get)

Parameters

string $name

Required. The resource name of the ServingConfig to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_ id}/servingConfigs/{serving_config_id}

array $optParams

Optional parameters.

Return Value

GoogleCloudRetailV2ServingConfig

Exceptions

Exception

GoogleCloudRetailV2ListServingConfigsResponse listProjectsLocationsCatalogsServingConfigs(string $parent, array $optParams = [])

Lists all ServingConfigs linked to this catalog.

(servingConfigs.listProjectsLocationsCatalogsServingConfigs)

Parameters

string $parent

Required. The catalog resource name. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

array $optParams

Optional parameters.

Return Value

GoogleCloudRetailV2ListServingConfigsResponse

Exceptions

Exception

GoogleCloudRetailV2ServingConfig patch(string $name, GoogleCloudRetailV2ServingConfig $postBody, array $optParams = [])

Updates a ServingConfig. (servingConfigs.patch)

Parameters

string $name

Immutable. Fully qualified name projects/locations/global/catalogs/servingConfig

GoogleCloudRetailV2ServingConfig $postBody
array $optParams

Optional parameters.

Return Value

GoogleCloudRetailV2ServingConfig

Exceptions

Exception

GoogleCloudRetailV2PredictResponse predict(string $placement, GoogleCloudRetailV2PredictRequest $postBody, array $optParams = [])

Makes a recommendation prediction. (servingConfigs.predict)

Parameters

string $placement

Required. Full resource name of the format: {placem ent=projects/locations/global/catalogs/default_catalog/servingConfigs} or {placement=projects/locations/global/catalogs/default_catalog/placements}. We recommend using the servingConfigs resource. placements is a legacy resource. The ID of the 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 [Manage serving configs] (https://cloud.google.com/retail/docs/manage-configs). The full list of available serving configs can be seen at https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs

GoogleCloudRetailV2PredictRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleCloudRetailV2PredictResponse

Exceptions

Exception

GoogleCloudRetailV2ServingConfig removeControl(string $servingConfig, GoogleCloudRetailV2RemoveControlRequest $postBody, array $optParams = [])

Disables a Control on the specified ServingConfig. The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig. (servingConfigs.removeControl)

Parameters

string $servingConfig

Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalo g_id}/servingConfigs/{serving_config_id}

GoogleCloudRetailV2RemoveControlRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleCloudRetailV2ServingConfig

Exceptions

Exception

Performs a search. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature. (servingConfigs.search)

Parameters

string $placement

Required. The resource name of the Retail Search serving config, such as projects/locations/global/catalogs/default_catalog/s ervingConfigs/default_serving_config or the name of the legacy placement resource, such as projects/locations/global/catalogs/default_catalog/placeme nts/default_search. This field is used to identify the serving config name and the set of models that are used to make the search.

GoogleCloudRetailV2SearchRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleCloudRetailV2SearchResponse

Exceptions

Exception