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\Dialogflow\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3DeployFlowRequest;
|
---|
21 | use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3Environment;
|
---|
22 | use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3ListEnvironmentsResponse;
|
---|
23 | use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3LookupEnvironmentHistoryResponse;
|
---|
24 | use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3RunContinuousTestRequest;
|
---|
25 | use Google\Service\Dialogflow\GoogleLongrunningOperation;
|
---|
26 | use Google\Service\Dialogflow\GoogleProtobufEmpty;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "environments" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $dialogflowService = new Google\Service\Dialogflow(...);
|
---|
33 | * $environments = $dialogflowService->projects_locations_agents_environments;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class ProjectsLocationsAgentsEnvironments extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Creates an Environment in the specified Agent. This method is a [long-running
|
---|
40 | * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-
|
---|
41 | * operation). The returned `Operation` type has the following method-specific
|
---|
42 | * fields: - `metadata`: An empty [Struct
|
---|
43 | * message](https://developers.google.com/protocol-
|
---|
44 | * buffers/docs/reference/google.protobuf#struct) - `response`: Environment
|
---|
45 | * (environments.create)
|
---|
46 | *
|
---|
47 | * @param string $parent Required. The Agent to create an Environment for.
|
---|
48 | * Format: `projects//locations//agents/`.
|
---|
49 | * @param GoogleCloudDialogflowCxV3Environment $postBody
|
---|
50 | * @param array $optParams Optional parameters.
|
---|
51 | * @return GoogleLongrunningOperation
|
---|
52 | * @throws \Google\Service\Exception
|
---|
53 | */
|
---|
54 | public function create($parent, GoogleCloudDialogflowCxV3Environment $postBody, $optParams = [])
|
---|
55 | {
|
---|
56 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
57 | $params = array_merge($params, $optParams);
|
---|
58 | return $this->call('create', [$params], GoogleLongrunningOperation::class);
|
---|
59 | }
|
---|
60 | /**
|
---|
61 | * Deletes the specified Environment. (environments.delete)
|
---|
62 | *
|
---|
63 | * @param string $name Required. The name of the Environment to delete. Format:
|
---|
64 | * `projects//locations//agents//environments/`.
|
---|
65 | * @param array $optParams Optional parameters.
|
---|
66 | * @return GoogleProtobufEmpty
|
---|
67 | * @throws \Google\Service\Exception
|
---|
68 | */
|
---|
69 | public function delete($name, $optParams = [])
|
---|
70 | {
|
---|
71 | $params = ['name' => $name];
|
---|
72 | $params = array_merge($params, $optParams);
|
---|
73 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
74 | }
|
---|
75 | /**
|
---|
76 | * Deploys a flow to the specified Environment. This method is a [long-running
|
---|
77 | * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-
|
---|
78 | * operation). The returned `Operation` type has the following method-specific
|
---|
79 | * fields: - `metadata`: DeployFlowMetadata - `response`: DeployFlowResponse
|
---|
80 | * (environments.deployFlow)
|
---|
81 | *
|
---|
82 | * @param string $environment Required. The environment to deploy the flow to.
|
---|
83 | * Format: `projects//locations//agents//environments/`.
|
---|
84 | * @param GoogleCloudDialogflowCxV3DeployFlowRequest $postBody
|
---|
85 | * @param array $optParams Optional parameters.
|
---|
86 | * @return GoogleLongrunningOperation
|
---|
87 | * @throws \Google\Service\Exception
|
---|
88 | */
|
---|
89 | public function deployFlow($environment, GoogleCloudDialogflowCxV3DeployFlowRequest $postBody, $optParams = [])
|
---|
90 | {
|
---|
91 | $params = ['environment' => $environment, 'postBody' => $postBody];
|
---|
92 | $params = array_merge($params, $optParams);
|
---|
93 | return $this->call('deployFlow', [$params], GoogleLongrunningOperation::class);
|
---|
94 | }
|
---|
95 | /**
|
---|
96 | * Retrieves the specified Environment. (environments.get)
|
---|
97 | *
|
---|
98 | * @param string $name Required. The name of the Environment. Format:
|
---|
99 | * `projects//locations//agents//environments/`.
|
---|
100 | * @param array $optParams Optional parameters.
|
---|
101 | * @return GoogleCloudDialogflowCxV3Environment
|
---|
102 | * @throws \Google\Service\Exception
|
---|
103 | */
|
---|
104 | public function get($name, $optParams = [])
|
---|
105 | {
|
---|
106 | $params = ['name' => $name];
|
---|
107 | $params = array_merge($params, $optParams);
|
---|
108 | return $this->call('get', [$params], GoogleCloudDialogflowCxV3Environment::class);
|
---|
109 | }
|
---|
110 | /**
|
---|
111 | * Returns the list of all environments in the specified Agent.
|
---|
112 | * (environments.listProjectsLocationsAgentsEnvironments)
|
---|
113 | *
|
---|
114 | * @param string $parent Required. The Agent to list all environments for.
|
---|
115 | * Format: `projects//locations//agents/`.
|
---|
116 | * @param array $optParams Optional parameters.
|
---|
117 | *
|
---|
118 | * @opt_param int pageSize The maximum number of items to return in a single
|
---|
119 | * page. By default 20 and at most 100.
|
---|
120 | * @opt_param string pageToken The next_page_token value returned from a
|
---|
121 | * previous list request.
|
---|
122 | * @return GoogleCloudDialogflowCxV3ListEnvironmentsResponse
|
---|
123 | * @throws \Google\Service\Exception
|
---|
124 | */
|
---|
125 | public function listProjectsLocationsAgentsEnvironments($parent, $optParams = [])
|
---|
126 | {
|
---|
127 | $params = ['parent' => $parent];
|
---|
128 | $params = array_merge($params, $optParams);
|
---|
129 | return $this->call('list', [$params], GoogleCloudDialogflowCxV3ListEnvironmentsResponse::class);
|
---|
130 | }
|
---|
131 | /**
|
---|
132 | * Looks up the history of the specified Environment.
|
---|
133 | * (environments.lookupEnvironmentHistory)
|
---|
134 | *
|
---|
135 | * @param string $name Required. Resource name of the environment to look up the
|
---|
136 | * history for. Format: `projects//locations//agents//environments/`.
|
---|
137 | * @param array $optParams Optional parameters.
|
---|
138 | *
|
---|
139 | * @opt_param int pageSize The maximum number of items to return in a single
|
---|
140 | * page. By default 100 and at most 1000.
|
---|
141 | * @opt_param string pageToken The next_page_token value returned from a
|
---|
142 | * previous list request.
|
---|
143 | * @return GoogleCloudDialogflowCxV3LookupEnvironmentHistoryResponse
|
---|
144 | * @throws \Google\Service\Exception
|
---|
145 | */
|
---|
146 | public function lookupEnvironmentHistory($name, $optParams = [])
|
---|
147 | {
|
---|
148 | $params = ['name' => $name];
|
---|
149 | $params = array_merge($params, $optParams);
|
---|
150 | return $this->call('lookupEnvironmentHistory', [$params], GoogleCloudDialogflowCxV3LookupEnvironmentHistoryResponse::class);
|
---|
151 | }
|
---|
152 | /**
|
---|
153 | * Updates the specified Environment. This method is a [long-running
|
---|
154 | * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-
|
---|
155 | * operation). The returned `Operation` type has the following method-specific
|
---|
156 | * fields: - `metadata`: An empty [Struct
|
---|
157 | * message](https://developers.google.com/protocol-
|
---|
158 | * buffers/docs/reference/google.protobuf#struct) - `response`: Environment
|
---|
159 | * (environments.patch)
|
---|
160 | *
|
---|
161 | * @param string $name The name of the environment. Format:
|
---|
162 | * `projects//locations//agents//environments/`.
|
---|
163 | * @param GoogleCloudDialogflowCxV3Environment $postBody
|
---|
164 | * @param array $optParams Optional parameters.
|
---|
165 | *
|
---|
166 | * @opt_param string updateMask Required. The mask to control which fields get
|
---|
167 | * updated.
|
---|
168 | * @return GoogleLongrunningOperation
|
---|
169 | * @throws \Google\Service\Exception
|
---|
170 | */
|
---|
171 | public function patch($name, GoogleCloudDialogflowCxV3Environment $postBody, $optParams = [])
|
---|
172 | {
|
---|
173 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
174 | $params = array_merge($params, $optParams);
|
---|
175 | return $this->call('patch', [$params], GoogleLongrunningOperation::class);
|
---|
176 | }
|
---|
177 | /**
|
---|
178 | * Kicks off a continuous test under the specified Environment. This method is a
|
---|
179 | * [long-running
|
---|
180 | * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-
|
---|
181 | * operation). The returned `Operation` type has the following method-specific
|
---|
182 | * fields: - `metadata`: RunContinuousTestMetadata - `response`:
|
---|
183 | * RunContinuousTestResponse (environments.runContinuousTest)
|
---|
184 | *
|
---|
185 | * @param string $environment Required. Format:
|
---|
186 | * `projects//locations//agents//environments/`.
|
---|
187 | * @param GoogleCloudDialogflowCxV3RunContinuousTestRequest $postBody
|
---|
188 | * @param array $optParams Optional parameters.
|
---|
189 | * @return GoogleLongrunningOperation
|
---|
190 | * @throws \Google\Service\Exception
|
---|
191 | */
|
---|
192 | public function runContinuousTest($environment, GoogleCloudDialogflowCxV3RunContinuousTestRequest $postBody, $optParams = [])
|
---|
193 | {
|
---|
194 | $params = ['environment' => $environment, 'postBody' => $postBody];
|
---|
195 | $params = array_merge($params, $optParams);
|
---|
196 | return $this->call('runContinuousTest', [$params], GoogleLongrunningOperation::class);
|
---|
197 | }
|
---|
198 | }
|
---|
199 |
|
---|
200 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
201 | class_alias(ProjectsLocationsAgentsEnvironments::class, 'Google_Service_Dialogflow_Resource_ProjectsLocationsAgentsEnvironments');
|
---|