[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\GoogleCloudDiscoveryengineV1ListSessionsResponse;
|
---|
| 21 | use Google\Service\DiscoveryEngine\GoogleCloudDiscoveryengineV1Session;
|
---|
| 22 | use Google\Service\DiscoveryEngine\GoogleProtobufEmpty;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "sessions" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $discoveryengineService = new Google\Service\DiscoveryEngine(...);
|
---|
| 29 | * $sessions = $discoveryengineService->projects_locations_collections_dataStores_sessions;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class ProjectsLocationsCollectionsDataStoresSessions extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Creates a Session. If the Session to create already exists, an ALREADY_EXISTS
|
---|
| 36 | * error is returned. (sessions.create)
|
---|
| 37 | *
|
---|
| 38 | * @param string $parent Required. Full resource name of parent data store.
|
---|
| 39 | * Format: `projects/{project}/locations/{location}/collections/{collection}/dat
|
---|
| 40 | * aStores/{data_store_id}`
|
---|
| 41 | * @param GoogleCloudDiscoveryengineV1Session $postBody
|
---|
| 42 | * @param array $optParams Optional parameters.
|
---|
| 43 | * @return GoogleCloudDiscoveryengineV1Session
|
---|
| 44 | * @throws \Google\Service\Exception
|
---|
| 45 | */
|
---|
| 46 | public function create($parent, GoogleCloudDiscoveryengineV1Session $postBody, $optParams = [])
|
---|
| 47 | {
|
---|
| 48 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 49 | $params = array_merge($params, $optParams);
|
---|
| 50 | return $this->call('create', [$params], GoogleCloudDiscoveryengineV1Session::class);
|
---|
| 51 | }
|
---|
| 52 | /**
|
---|
| 53 | * Deletes a Session. If the Session to delete does not exist, a NOT_FOUND error
|
---|
| 54 | * is returned. (sessions.delete)
|
---|
| 55 | *
|
---|
| 56 | * @param string $name Required. The resource name of the Session to delete.
|
---|
| 57 | * Format: `projects/{project}/locations/{location}/collections/{collection}/dat
|
---|
| 58 | * aStores/{data_store_id}/sessions/{session_id}`
|
---|
| 59 | * @param array $optParams Optional parameters.
|
---|
| 60 | * @return GoogleProtobufEmpty
|
---|
| 61 | * @throws \Google\Service\Exception
|
---|
| 62 | */
|
---|
| 63 | public function delete($name, $optParams = [])
|
---|
| 64 | {
|
---|
| 65 | $params = ['name' => $name];
|
---|
| 66 | $params = array_merge($params, $optParams);
|
---|
| 67 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
| 68 | }
|
---|
| 69 | /**
|
---|
| 70 | * Gets a Session. (sessions.get)
|
---|
| 71 | *
|
---|
| 72 | * @param string $name Required. The resource name of the Session to get.
|
---|
| 73 | * Format: `projects/{project}/locations/{location}/collections/{collection}/dat
|
---|
| 74 | * aStores/{data_store_id}/sessions/{session_id}`
|
---|
| 75 | * @param array $optParams Optional parameters.
|
---|
| 76 | * @return GoogleCloudDiscoveryengineV1Session
|
---|
| 77 | * @throws \Google\Service\Exception
|
---|
| 78 | */
|
---|
| 79 | public function get($name, $optParams = [])
|
---|
| 80 | {
|
---|
| 81 | $params = ['name' => $name];
|
---|
| 82 | $params = array_merge($params, $optParams);
|
---|
| 83 | return $this->call('get', [$params], GoogleCloudDiscoveryengineV1Session::class);
|
---|
| 84 | }
|
---|
| 85 | /**
|
---|
| 86 | * Lists all Sessions by their parent DataStore.
|
---|
| 87 | * (sessions.listProjectsLocationsCollectionsDataStoresSessions)
|
---|
| 88 | *
|
---|
| 89 | * @param string $parent Required. The data store resource name. Format: `projec
|
---|
| 90 | * ts/{project}/locations/{location}/collections/{collection}/dataStores/{data_s
|
---|
| 91 | * tore_id}`
|
---|
| 92 | * @param array $optParams Optional parameters.
|
---|
| 93 | *
|
---|
| 94 | * @opt_param string filter A filter to apply on the list results. The supported
|
---|
| 95 | * features are: user_pseudo_id, state. Example: "user_pseudo_id = some_id"
|
---|
| 96 | * @opt_param string orderBy A comma-separated list of fields to order by,
|
---|
| 97 | * sorted in ascending order. Use "desc" after a field name for descending.
|
---|
| 98 | * Supported fields: * `update_time` * `create_time` * `session_name` Example:
|
---|
| 99 | * "update_time desc" "create_time"
|
---|
| 100 | * @opt_param int pageSize Maximum number of results to return. If unspecified,
|
---|
| 101 | * defaults to 50. Max allowed value is 1000.
|
---|
| 102 | * @opt_param string pageToken A page token, received from a previous
|
---|
| 103 | * `ListSessions` call. Provide this to retrieve the subsequent page.
|
---|
| 104 | * @return GoogleCloudDiscoveryengineV1ListSessionsResponse
|
---|
| 105 | * @throws \Google\Service\Exception
|
---|
| 106 | */
|
---|
| 107 | public function listProjectsLocationsCollectionsDataStoresSessions($parent, $optParams = [])
|
---|
| 108 | {
|
---|
| 109 | $params = ['parent' => $parent];
|
---|
| 110 | $params = array_merge($params, $optParams);
|
---|
| 111 | return $this->call('list', [$params], GoogleCloudDiscoveryengineV1ListSessionsResponse::class);
|
---|
| 112 | }
|
---|
| 113 | /**
|
---|
| 114 | * Updates a Session. Session action type cannot be changed. If the Session to
|
---|
| 115 | * update does not exist, a NOT_FOUND error is returned. (sessions.patch)
|
---|
| 116 | *
|
---|
| 117 | * @param string $name Immutable. Fully qualified name `projects/{project}/locat
|
---|
| 118 | * ions/global/collections/{collection}/engines/{engine}/sessions`
|
---|
| 119 | * @param GoogleCloudDiscoveryengineV1Session $postBody
|
---|
| 120 | * @param array $optParams Optional parameters.
|
---|
| 121 | *
|
---|
| 122 | * @opt_param string updateMask Indicates which fields in the provided Session
|
---|
| 123 | * to update. The following are NOT supported: * Session.name If not set or
|
---|
| 124 | * empty, all supported fields are updated.
|
---|
| 125 | * @return GoogleCloudDiscoveryengineV1Session
|
---|
| 126 | * @throws \Google\Service\Exception
|
---|
| 127 | */
|
---|
| 128 | public function patch($name, GoogleCloudDiscoveryengineV1Session $postBody, $optParams = [])
|
---|
| 129 | {
|
---|
| 130 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 131 | $params = array_merge($params, $optParams);
|
---|
| 132 | return $this->call('patch', [$params], GoogleCloudDiscoveryengineV1Session::class);
|
---|
| 133 | }
|
---|
| 134 | }
|
---|
| 135 |
|
---|
| 136 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 137 | class_alias(ProjectsLocationsCollectionsDataStoresSessions::class, 'Google_Service_DiscoveryEngine_Resource_ProjectsLocationsCollectionsDataStoresSessions');
|
---|