source: vendor/google/apiclient-services/src/Dialogflow/Resource/ProjectsLocationsAgentsIntents.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 12 days ago

Upload project files

  • Property mode set to 100644
File size: 9.0 KB
Line 
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\GoogleCloudDialogflowCxV3ExportIntentsRequest;
21use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3ImportIntentsRequest;
22use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3Intent;
23use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3ListIntentsResponse;
24use Google\Service\Dialogflow\GoogleLongrunningOperation;
25use Google\Service\Dialogflow\GoogleProtobufEmpty;
26
27/**
28 * The "intents" collection of methods.
29 * Typical usage is:
30 * <code>
31 * $dialogflowService = new Google\Service\Dialogflow(...);
32 * $intents = $dialogflowService->projects_locations_agents_intents;
33 * </code>
34 */
35class ProjectsLocationsAgentsIntents extends \Google\Service\Resource
36{
37 /**
38 * Creates an intent in the specified agent. Note: You should always train a
39 * flow prior to sending it queries. See the [training
40 * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
41 * (intents.create)
42 *
43 * @param string $parent Required. The agent to create an intent for. Format:
44 * `projects//locations//agents/`.
45 * @param GoogleCloudDialogflowCxV3Intent $postBody
46 * @param array $optParams Optional parameters.
47 *
48 * @opt_param string languageCode The language of the following fields in
49 * `intent`: * `Intent.training_phrases.parts.text` If not specified, the
50 * agent's default language is used. [Many
51 * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
52 * are supported. Note: languages must be enabled in the agent before they can
53 * be used.
54 * @return GoogleCloudDialogflowCxV3Intent
55 * @throws \Google\Service\Exception
56 */
57 public function create($parent, GoogleCloudDialogflowCxV3Intent $postBody, $optParams = [])
58 {
59 $params = ['parent' => $parent, 'postBody' => $postBody];
60 $params = array_merge($params, $optParams);
61 return $this->call('create', [$params], GoogleCloudDialogflowCxV3Intent::class);
62 }
63 /**
64 * Deletes the specified intent. Note: You should always train a flow prior to
65 * sending it queries. See the [training
66 * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
67 * (intents.delete)
68 *
69 * @param string $name Required. The name of the intent to delete. Format:
70 * `projects//locations//agents//intents/`.
71 * @param array $optParams Optional parameters.
72 * @return GoogleProtobufEmpty
73 * @throws \Google\Service\Exception
74 */
75 public function delete($name, $optParams = [])
76 {
77 $params = ['name' => $name];
78 $params = array_merge($params, $optParams);
79 return $this->call('delete', [$params], GoogleProtobufEmpty::class);
80 }
81 /**
82 * Exports the selected intents. This method is a [long-running
83 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-
84 * operation). The returned `Operation` type has the following method-specific
85 * fields: - `metadata`: ExportIntentsMetadata - `response`:
86 * ExportIntentsResponse (intents.export)
87 *
88 * @param string $parent Required. The name of the parent agent to export
89 * intents. Format: `projects//locations//agents/`.
90 * @param GoogleCloudDialogflowCxV3ExportIntentsRequest $postBody
91 * @param array $optParams Optional parameters.
92 * @return GoogleLongrunningOperation
93 * @throws \Google\Service\Exception
94 */
95 public function export($parent, GoogleCloudDialogflowCxV3ExportIntentsRequest $postBody, $optParams = [])
96 {
97 $params = ['parent' => $parent, 'postBody' => $postBody];
98 $params = array_merge($params, $optParams);
99 return $this->call('export', [$params], GoogleLongrunningOperation::class);
100 }
101 /**
102 * Retrieves the specified intent. (intents.get)
103 *
104 * @param string $name Required. The name of the intent. Format:
105 * `projects//locations//agents//intents/`.
106 * @param array $optParams Optional parameters.
107 *
108 * @opt_param string languageCode The language to retrieve the intent for. The
109 * following fields are language dependent: *
110 * `Intent.training_phrases.parts.text` If not specified, the agent's default
111 * language is used. [Many
112 * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
113 * are supported. Note: languages must be enabled in the agent before they can
114 * be used.
115 * @return GoogleCloudDialogflowCxV3Intent
116 * @throws \Google\Service\Exception
117 */
118 public function get($name, $optParams = [])
119 {
120 $params = ['name' => $name];
121 $params = array_merge($params, $optParams);
122 return $this->call('get', [$params], GoogleCloudDialogflowCxV3Intent::class);
123 }
124 /**
125 * Imports the specified intents into the agent. This method is a [long-running
126 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-
127 * operation). The returned `Operation` type has the following method-specific
128 * fields: - `metadata`: ImportIntentsMetadata - `response`:
129 * ImportIntentsResponse (intents.import)
130 *
131 * @param string $parent Required. The agent to import the intents into. Format:
132 * `projects//locations//agents/`.
133 * @param GoogleCloudDialogflowCxV3ImportIntentsRequest $postBody
134 * @param array $optParams Optional parameters.
135 * @return GoogleLongrunningOperation
136 * @throws \Google\Service\Exception
137 */
138 public function import($parent, GoogleCloudDialogflowCxV3ImportIntentsRequest $postBody, $optParams = [])
139 {
140 $params = ['parent' => $parent, 'postBody' => $postBody];
141 $params = array_merge($params, $optParams);
142 return $this->call('import', [$params], GoogleLongrunningOperation::class);
143 }
144 /**
145 * Returns the list of all intents in the specified agent.
146 * (intents.listProjectsLocationsAgentsIntents)
147 *
148 * @param string $parent Required. The agent to list all intents for. Format:
149 * `projects//locations//agents/`.
150 * @param array $optParams Optional parameters.
151 *
152 * @opt_param string intentView The resource view to apply to the returned
153 * intent.
154 * @opt_param string languageCode The language to list intents for. The
155 * following fields are language dependent: *
156 * `Intent.training_phrases.parts.text` If not specified, the agent's default
157 * language is used. [Many
158 * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
159 * are supported. Note: languages must be enabled in the agent before they can
160 * be used.
161 * @opt_param int pageSize The maximum number of items to return in a single
162 * page. By default 100 and at most 1000.
163 * @opt_param string pageToken The next_page_token value returned from a
164 * previous list request.
165 * @return GoogleCloudDialogflowCxV3ListIntentsResponse
166 * @throws \Google\Service\Exception
167 */
168 public function listProjectsLocationsAgentsIntents($parent, $optParams = [])
169 {
170 $params = ['parent' => $parent];
171 $params = array_merge($params, $optParams);
172 return $this->call('list', [$params], GoogleCloudDialogflowCxV3ListIntentsResponse::class);
173 }
174 /**
175 * Updates the specified intent. Note: You should always train a flow prior to
176 * sending it queries. See the [training
177 * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
178 * (intents.patch)
179 *
180 * @param string $name The unique identifier of the intent. Required for the
181 * Intents.UpdateIntent method. Intents.CreateIntent populates the name
182 * automatically. Format: `projects//locations//agents//intents/`.
183 * @param GoogleCloudDialogflowCxV3Intent $postBody
184 * @param array $optParams Optional parameters.
185 *
186 * @opt_param string languageCode The language of the following fields in
187 * `intent`: * `Intent.training_phrases.parts.text` If not specified, the
188 * agent's default language is used. [Many
189 * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
190 * are supported. Note: languages must be enabled in the agent before they can
191 * be used.
192 * @opt_param string updateMask The mask to control which fields get updated. If
193 * the mask is not present, all fields will be updated.
194 * @return GoogleCloudDialogflowCxV3Intent
195 * @throws \Google\Service\Exception
196 */
197 public function patch($name, GoogleCloudDialogflowCxV3Intent $postBody, $optParams = [])
198 {
199 $params = ['name' => $name, 'postBody' => $postBody];
200 $params = array_merge($params, $optParams);
201 return $this->call('patch', [$params], GoogleCloudDialogflowCxV3Intent::class);
202 }
203}
204
205// Adding a class alias for backwards compatibility with the previous class name.
206class_alias(ProjectsLocationsAgentsIntents::class, 'Google_Service_Dialogflow_Resource_ProjectsLocationsAgentsIntents');
Note: See TracBrowser for help on using the repository browser.