[e3d4e0a] | 1 | <?php
|
---|
| 2 | /*
|
---|
| 3 | * Copyright 2014 Google Inc.
|
---|
| 4 | *
|
---|
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
---|
| 6 | * use this file except in compliance with the License. You may obtain a copy of
|
---|
| 7 | * the License at
|
---|
| 8 | *
|
---|
| 9 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
| 10 | *
|
---|
| 11 | * Unless required by applicable law or agreed to in writing, software
|
---|
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
---|
| 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
---|
| 14 | * License for the specific language governing permissions and limitations under
|
---|
| 15 | * the License.
|
---|
| 16 | */
|
---|
| 17 |
|
---|
| 18 | namespace Google\Service\DiscoveryEngine\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\DiscoveryEngine\GoogleCloudDiscoveryengineV1AnswerQueryRequest;
|
---|
| 21 | use Google\Service\DiscoveryEngine\GoogleCloudDiscoveryengineV1AnswerQueryResponse;
|
---|
| 22 | use Google\Service\DiscoveryEngine\GoogleCloudDiscoveryengineV1RecommendRequest;
|
---|
| 23 | use Google\Service\DiscoveryEngine\GoogleCloudDiscoveryengineV1RecommendResponse;
|
---|
| 24 | use Google\Service\DiscoveryEngine\GoogleCloudDiscoveryengineV1SearchRequest;
|
---|
| 25 | use Google\Service\DiscoveryEngine\GoogleCloudDiscoveryengineV1SearchResponse;
|
---|
| 26 |
|
---|
| 27 | /**
|
---|
| 28 | * The "servingConfigs" collection of methods.
|
---|
| 29 | * Typical usage is:
|
---|
| 30 | * <code>
|
---|
| 31 | * $discoveryengineService = new Google\Service\DiscoveryEngine(...);
|
---|
| 32 | * $servingConfigs = $discoveryengineService->projects_locations_collections_engines_servingConfigs;
|
---|
| 33 | * </code>
|
---|
| 34 | */
|
---|
| 35 | class ProjectsLocationsCollectionsEnginesServingConfigs extends \Google\Service\Resource
|
---|
| 36 | {
|
---|
| 37 | /**
|
---|
| 38 | * Answer query method. (servingConfigs.answer)
|
---|
| 39 | *
|
---|
| 40 | * @param string $servingConfig Required. The resource name of the Search
|
---|
| 41 | * serving config, such as `projects/locations/global/collections/default_collec
|
---|
| 42 | * tion/engines/servingConfigs/default_serving_config`, or `projects/locations/g
|
---|
| 43 | * lobal/collections/default_collection/dataStores/servingConfigs/default_servin
|
---|
| 44 | * g_config`. This field is used to identify the serving configuration name, set
|
---|
| 45 | * of models used to make the search.
|
---|
| 46 | * @param GoogleCloudDiscoveryengineV1AnswerQueryRequest $postBody
|
---|
| 47 | * @param array $optParams Optional parameters.
|
---|
| 48 | * @return GoogleCloudDiscoveryengineV1AnswerQueryResponse
|
---|
| 49 | * @throws \Google\Service\Exception
|
---|
| 50 | */
|
---|
| 51 | public function answer($servingConfig, GoogleCloudDiscoveryengineV1AnswerQueryRequest $postBody, $optParams = [])
|
---|
| 52 | {
|
---|
| 53 | $params = ['servingConfig' => $servingConfig, 'postBody' => $postBody];
|
---|
| 54 | $params = array_merge($params, $optParams);
|
---|
| 55 | return $this->call('answer', [$params], GoogleCloudDiscoveryengineV1AnswerQueryResponse::class);
|
---|
| 56 | }
|
---|
| 57 | /**
|
---|
| 58 | * Makes a recommendation, which requires a contextual user event.
|
---|
| 59 | * (servingConfigs.recommend)
|
---|
| 60 | *
|
---|
| 61 | * @param string $servingConfig Required. Full resource name of a ServingConfig:
|
---|
| 62 | * `projects/locations/global/collections/engines/servingConfigs`, or
|
---|
| 63 | * `projects/locations/global/collections/dataStores/servingConfigs` One default
|
---|
| 64 | * serving config is created along with your recommendation engine creation. The
|
---|
| 65 | * engine ID is used as the ID of the default serving config. For example, for
|
---|
| 66 | * Engine `projects/locations/global/collections/engines/my-engine`, you can use
|
---|
| 67 | * `projects/locations/global/collections/engines/my-engine/servingConfigs/my-
|
---|
| 68 | * engine` for your RecommendationService.Recommend requests.
|
---|
| 69 | * @param GoogleCloudDiscoveryengineV1RecommendRequest $postBody
|
---|
| 70 | * @param array $optParams Optional parameters.
|
---|
| 71 | * @return GoogleCloudDiscoveryengineV1RecommendResponse
|
---|
| 72 | * @throws \Google\Service\Exception
|
---|
| 73 | */
|
---|
| 74 | public function recommend($servingConfig, GoogleCloudDiscoveryengineV1RecommendRequest $postBody, $optParams = [])
|
---|
| 75 | {
|
---|
| 76 | $params = ['servingConfig' => $servingConfig, 'postBody' => $postBody];
|
---|
| 77 | $params = array_merge($params, $optParams);
|
---|
| 78 | return $this->call('recommend', [$params], GoogleCloudDiscoveryengineV1RecommendResponse::class);
|
---|
| 79 | }
|
---|
| 80 | /**
|
---|
| 81 | * Performs a search. (servingConfigs.search)
|
---|
| 82 | *
|
---|
| 83 | * @param string $servingConfig Required. The resource name of the Search
|
---|
| 84 | * serving config, such as `projects/locations/global/collections/default_collec
|
---|
| 85 | * tion/engines/servingConfigs/default_serving_config`, or `projects/locations/g
|
---|
| 86 | * lobal/collections/default_collection/dataStores/default_data_store/servingCon
|
---|
| 87 | * figs/default_serving_config`. This field is used to identify the serving
|
---|
| 88 | * configuration name, set of models used to make the search.
|
---|
| 89 | * @param GoogleCloudDiscoveryengineV1SearchRequest $postBody
|
---|
| 90 | * @param array $optParams Optional parameters.
|
---|
| 91 | * @return GoogleCloudDiscoveryengineV1SearchResponse
|
---|
| 92 | * @throws \Google\Service\Exception
|
---|
| 93 | */
|
---|
| 94 | public function search($servingConfig, GoogleCloudDiscoveryengineV1SearchRequest $postBody, $optParams = [])
|
---|
| 95 | {
|
---|
| 96 | $params = ['servingConfig' => $servingConfig, 'postBody' => $postBody];
|
---|
| 97 | $params = array_merge($params, $optParams);
|
---|
| 98 | return $this->call('search', [$params], GoogleCloudDiscoveryengineV1SearchResponse::class);
|
---|
| 99 | }
|
---|
| 100 | /**
|
---|
| 101 | * Performs a search. Similar to the SearchService.Search method, but a lite
|
---|
| 102 | * version that allows API key for authentication, where OAuth and IAM checks
|
---|
| 103 | * are not required. Only public website search is supported by this method. If
|
---|
| 104 | * data stores and engines not associated with public website search are
|
---|
| 105 | * specified, a `FAILED_PRECONDITION` error is returned. This method can be used
|
---|
| 106 | * for easy onboarding without having to implement an authentication backend.
|
---|
| 107 | * However, it is strongly recommended to use SearchService.Search instead with
|
---|
| 108 | * required OAuth and IAM checks to provide better data security.
|
---|
| 109 | * (servingConfigs.searchLite)
|
---|
| 110 | *
|
---|
| 111 | * @param string $servingConfig Required. The resource name of the Search
|
---|
| 112 | * serving config, such as `projects/locations/global/collections/default_collec
|
---|
| 113 | * tion/engines/servingConfigs/default_serving_config`, or `projects/locations/g
|
---|
| 114 | * lobal/collections/default_collection/dataStores/default_data_store/servingCon
|
---|
| 115 | * figs/default_serving_config`. This field is used to identify the serving
|
---|
| 116 | * configuration name, set of models used to make the search.
|
---|
| 117 | * @param GoogleCloudDiscoveryengineV1SearchRequest $postBody
|
---|
| 118 | * @param array $optParams Optional parameters.
|
---|
| 119 | * @return GoogleCloudDiscoveryengineV1SearchResponse
|
---|
| 120 | * @throws \Google\Service\Exception
|
---|
| 121 | */
|
---|
| 122 | public function searchLite($servingConfig, GoogleCloudDiscoveryengineV1SearchRequest $postBody, $optParams = [])
|
---|
| 123 | {
|
---|
| 124 | $params = ['servingConfig' => $servingConfig, 'postBody' => $postBody];
|
---|
| 125 | $params = array_merge($params, $optParams);
|
---|
| 126 | return $this->call('searchLite', [$params], GoogleCloudDiscoveryengineV1SearchResponse::class);
|
---|
| 127 | }
|
---|
| 128 | }
|
---|
| 129 |
|
---|
| 130 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 131 | class_alias(ProjectsLocationsCollectionsEnginesServingConfigs::class, 'Google_Service_DiscoveryEngine_Resource_ProjectsLocationsCollectionsEnginesServingConfigs');
|
---|