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
18namespace Google\Service\Dialogflow\Resource;
19
20use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3ListSessionEntityTypesResponse;
21use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3SessionEntityType;
22use Google\Service\Dialogflow\GoogleProtobufEmpty;
23
24/**
25 * The "entityTypes" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $dialogflowService = new Google\Service\Dialogflow(...);
29 *   $entityTypes = $dialogflowService->entityTypes;
30 *  </code>
31 */
32class ProjectsLocationsAgentsEnvironmentsSessionsEntityTypes extends \Google\Service\Resource
33{
34  /**
35   * Creates a session entity type. (entityTypes.create)
36   *
37   * @param string $parent Required. The session to create a session entity type
38   * for. Format: `projects//locations//agents//sessions/` or
39   * `projects//locations//agents//environments//sessions/`. If `Environment ID`
40   * is not specified, we assume default 'draft' environment.
41   * @param GoogleCloudDialogflowCxV3SessionEntityType $postBody
42   * @param array $optParams Optional parameters.
43   * @return GoogleCloudDialogflowCxV3SessionEntityType
44   */
45  public function create($parent, GoogleCloudDialogflowCxV3SessionEntityType $postBody, $optParams = [])
46  {
47    $params = ['parent' => $parent, 'postBody' => $postBody];
48    $params = array_merge($params, $optParams);
49    return $this->call('create', [$params], GoogleCloudDialogflowCxV3SessionEntityType::class);
50  }
51  /**
52   * Deletes the specified session entity type. (entityTypes.delete)
53   *
54   * @param string $name Required. The name of the session entity type to delete.
55   * Format: `projects//locations//agents//sessions//entityTypes/` or
56   * `projects//locations//agents//environments//sessions//entityTypes/`. If
57   * `Environment ID` is not specified, we assume default 'draft' environment.
58   * @param array $optParams Optional parameters.
59   * @return GoogleProtobufEmpty
60   */
61  public function delete($name, $optParams = [])
62  {
63    $params = ['name' => $name];
64    $params = array_merge($params, $optParams);
65    return $this->call('delete', [$params], GoogleProtobufEmpty::class);
66  }
67  /**
68   * Retrieves the specified session entity type. (entityTypes.get)
69   *
70   * @param string $name Required. The name of the session entity type. Format:
71   * `projects//locations//agents//sessions//entityTypes/` or
72   * `projects//locations//agents//environments//sessions//entityTypes/`. If
73   * `Environment ID` is not specified, we assume default 'draft' environment.
74   * @param array $optParams Optional parameters.
75   * @return GoogleCloudDialogflowCxV3SessionEntityType
76   */
77  public function get($name, $optParams = [])
78  {
79    $params = ['name' => $name];
80    $params = array_merge($params, $optParams);
81    return $this->call('get', [$params], GoogleCloudDialogflowCxV3SessionEntityType::class);
82  }
83  /**
84   * Returns the list of all session entity types in the specified session.
85   * (entityTypes.listProjectsLocationsAgentsEnvironmentsSessionsEntityTypes)
86   *
87   * @param string $parent Required. The session to list all session entity types
88   * from. Format: `projects//locations//agents//sessions/` or
89   * `projects//locations//agents//environments//sessions/`. If `Environment ID`
90   * is not specified, we assume default 'draft' environment.
91   * @param array $optParams Optional parameters.
92   *
93   * @opt_param int pageSize The maximum number of items to return in a single
94   * page. By default 100 and at most 1000.
95   * @opt_param string pageToken The next_page_token value returned from a
96   * previous list request.
97   * @return GoogleCloudDialogflowCxV3ListSessionEntityTypesResponse
98   */
99  public function listProjectsLocationsAgentsEnvironmentsSessionsEntityTypes($parent, $optParams = [])
100  {
101    $params = ['parent' => $parent];
102    $params = array_merge($params, $optParams);
103    return $this->call('list', [$params], GoogleCloudDialogflowCxV3ListSessionEntityTypesResponse::class);
104  }
105  /**
106   * Updates the specified session entity type. (entityTypes.patch)
107   *
108   * @param string $name Required. The unique identifier of the session entity
109   * type. Format: `projects//locations//agents//sessions//entityTypes/` or
110   * `projects//locations//agents//environments//sessions//entityTypes/`. If
111   * `Environment ID` is not specified, we assume default 'draft' environment.
112   * @param GoogleCloudDialogflowCxV3SessionEntityType $postBody
113   * @param array $optParams Optional parameters.
114   *
115   * @opt_param string updateMask The mask to control which fields get updated.
116   * @return GoogleCloudDialogflowCxV3SessionEntityType
117   */
118  public function patch($name, GoogleCloudDialogflowCxV3SessionEntityType $postBody, $optParams = [])
119  {
120    $params = ['name' => $name, 'postBody' => $postBody];
121    $params = array_merge($params, $optParams);
122    return $this->call('patch', [$params], GoogleCloudDialogflowCxV3SessionEntityType::class);
123  }
124}
125
126// Adding a class alias for backwards compatibility with the previous class name.
127class_alias(ProjectsLocationsAgentsEnvironmentsSessionsEntityTypes::class, 'Google_Service_Dialogflow_Resource_ProjectsLocationsAgentsEnvironmentsSessionsEntityTypes');
128