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\Integrations\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaDownloadTestCaseResponse;
|
---|
21 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaExecuteTestCaseRequest;
|
---|
22 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaExecuteTestCaseResponse;
|
---|
23 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaListTestCaseExecutionsResponse;
|
---|
24 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaListTestCasesResponse;
|
---|
25 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaTakeoverTestCaseEditLockRequest;
|
---|
26 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaTestCase;
|
---|
27 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaUploadTestCaseRequest;
|
---|
28 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaUploadTestCaseResponse;
|
---|
29 | use Google\Service\Integrations\GoogleProtobufEmpty;
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * The "testCases" collection of methods.
|
---|
33 | * Typical usage is:
|
---|
34 | * <code>
|
---|
35 | * $integrationsService = new Google\Service\Integrations(...);
|
---|
36 | * $testCases = $integrationsService->projects_locations_integrations_versions_testCases;
|
---|
37 | * </code>
|
---|
38 | */
|
---|
39 | class ProjectsLocationsIntegrationsVersionsTestCases extends \Google\Service\Resource
|
---|
40 | {
|
---|
41 | /**
|
---|
42 | * Creates a new test case (testCases.create)
|
---|
43 | *
|
---|
44 | * @param string $parent Required. The parent resource where this test case will
|
---|
45 | * be created. Format: projects/{project}/locations/{location}/integrations/{int
|
---|
46 | * egration}/versions/{integration_version}
|
---|
47 | * @param GoogleCloudIntegrationsV1alphaTestCase $postBody
|
---|
48 | * @param array $optParams Optional parameters.
|
---|
49 | *
|
---|
50 | * @opt_param string testCaseId Required. Required
|
---|
51 | * @return GoogleCloudIntegrationsV1alphaTestCase
|
---|
52 | * @throws \Google\Service\Exception
|
---|
53 | */
|
---|
54 | public function create($parent, GoogleCloudIntegrationsV1alphaTestCase $postBody, $optParams = [])
|
---|
55 | {
|
---|
56 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
57 | $params = array_merge($params, $optParams);
|
---|
58 | return $this->call('create', [$params], GoogleCloudIntegrationsV1alphaTestCase::class);
|
---|
59 | }
|
---|
60 | /**
|
---|
61 | * Deletes a test case (testCases.delete)
|
---|
62 | *
|
---|
63 | * @param string $name Required. ID for the test case to be deleted
|
---|
64 | * @param array $optParams Optional parameters.
|
---|
65 | * @return GoogleProtobufEmpty
|
---|
66 | * @throws \Google\Service\Exception
|
---|
67 | */
|
---|
68 | public function delete($name, $optParams = [])
|
---|
69 | {
|
---|
70 | $params = ['name' => $name];
|
---|
71 | $params = array_merge($params, $optParams);
|
---|
72 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
73 | }
|
---|
74 | /**
|
---|
75 | * Downloads a test case. Retrieves the `TestCase` for a given `test_case_id`
|
---|
76 | * and returns the response as a string. (testCases.download)
|
---|
77 | *
|
---|
78 | * @param string $name Required. The test case to download. Format: projects/{pr
|
---|
79 | * oject}/locations/{location}/integrations/{integration}/versions/{integration_
|
---|
80 | * version}/testCases/{test_case_id}
|
---|
81 | * @param array $optParams Optional parameters.
|
---|
82 | *
|
---|
83 | * @opt_param string fileFormat File format for download request.
|
---|
84 | * @return GoogleCloudIntegrationsV1alphaDownloadTestCaseResponse
|
---|
85 | * @throws \Google\Service\Exception
|
---|
86 | */
|
---|
87 | public function download($name, $optParams = [])
|
---|
88 | {
|
---|
89 | $params = ['name' => $name];
|
---|
90 | $params = array_merge($params, $optParams);
|
---|
91 | return $this->call('download', [$params], GoogleCloudIntegrationsV1alphaDownloadTestCaseResponse::class);
|
---|
92 | }
|
---|
93 | /**
|
---|
94 | * Executes functional test (testCases.executeTest)
|
---|
95 | *
|
---|
96 | * @param string $testCaseName Required. Test case resource name
|
---|
97 | * @param GoogleCloudIntegrationsV1alphaExecuteTestCaseRequest $postBody
|
---|
98 | * @param array $optParams Optional parameters.
|
---|
99 | * @return GoogleCloudIntegrationsV1alphaExecuteTestCaseResponse
|
---|
100 | * @throws \Google\Service\Exception
|
---|
101 | */
|
---|
102 | public function executeTest($testCaseName, GoogleCloudIntegrationsV1alphaExecuteTestCaseRequest $postBody, $optParams = [])
|
---|
103 | {
|
---|
104 | $params = ['testCaseName' => $testCaseName, 'postBody' => $postBody];
|
---|
105 | $params = array_merge($params, $optParams);
|
---|
106 | return $this->call('executeTest', [$params], GoogleCloudIntegrationsV1alphaExecuteTestCaseResponse::class);
|
---|
107 | }
|
---|
108 | /**
|
---|
109 | * Get a test case (testCases.get)
|
---|
110 | *
|
---|
111 | * @param string $name Required. The ID of the test case to retrieve
|
---|
112 | * @param array $optParams Optional parameters.
|
---|
113 | * @return GoogleCloudIntegrationsV1alphaTestCase
|
---|
114 | * @throws \Google\Service\Exception
|
---|
115 | */
|
---|
116 | public function get($name, $optParams = [])
|
---|
117 | {
|
---|
118 | $params = ['name' => $name];
|
---|
119 | $params = array_merge($params, $optParams);
|
---|
120 | return $this->call('get', [$params], GoogleCloudIntegrationsV1alphaTestCase::class);
|
---|
121 | }
|
---|
122 | /**
|
---|
123 | * Lists all the test cases that satisfy the filters.
|
---|
124 | * (testCases.listProjectsLocationsIntegrationsVersionsTestCases)
|
---|
125 | *
|
---|
126 | * @param string $parent Required. The parent resource where this TestCase was
|
---|
127 | * created.
|
---|
128 | * @param array $optParams Optional parameters.
|
---|
129 | *
|
---|
130 | * @opt_param string filter Optional. Standard filter field. Filtering as
|
---|
131 | * supported in https://developers.google.com/authorized-
|
---|
132 | * buyers/apis/guides/list-filters.
|
---|
133 | * @opt_param string orderBy Optional. The results would be returned in order
|
---|
134 | * specified here. Currently supported sort keys are: Descending sort order for
|
---|
135 | * "last_modified_time", "created_time". Ascending sort order for "name".
|
---|
136 | * @opt_param int pageSize Optional. The maximum number of test cases to return.
|
---|
137 | * The service may return fewer than this value. If unspecified, at most 100
|
---|
138 | * test cases will be returned.
|
---|
139 | * @opt_param string pageToken Optional. A page token, received from a previous
|
---|
140 | * `ListTestCases` call. Provide this to retrieve the subsequent page. When
|
---|
141 | * paginating, all other parameters provided to `ListTestCases` must match the
|
---|
142 | * call that provided the page token.
|
---|
143 | * @opt_param string readMask Optional. The mask which specifies fields that
|
---|
144 | * need to be returned in the TestCases's response.
|
---|
145 | * @return GoogleCloudIntegrationsV1alphaListTestCasesResponse
|
---|
146 | * @throws \Google\Service\Exception
|
---|
147 | */
|
---|
148 | public function listProjectsLocationsIntegrationsVersionsTestCases($parent, $optParams = [])
|
---|
149 | {
|
---|
150 | $params = ['parent' => $parent];
|
---|
151 | $params = array_merge($params, $optParams);
|
---|
152 | return $this->call('list', [$params], GoogleCloudIntegrationsV1alphaListTestCasesResponse::class);
|
---|
153 | }
|
---|
154 | /**
|
---|
155 | * Lists the results of all functional test executions. The response includes
|
---|
156 | * the same information as the [execution
|
---|
157 | * log](https://cloud.google.com/application-integration/docs/viewing-logs) in
|
---|
158 | * the Integration UI. (testCases.listExecutions)
|
---|
159 | *
|
---|
160 | * @param string $parent Required. The parent resource name of the test case
|
---|
161 | * execution.
|
---|
162 | * @param array $optParams Optional parameters.
|
---|
163 | *
|
---|
164 | * @opt_param string filter Optional. Standard filter field, we support
|
---|
165 | * filtering on following fields: test_case_id: the ID of the test case.
|
---|
166 | * CreateTimestamp: the execution created time. event_execution_state: the state
|
---|
167 | * of the executions. execution_id: the id of the execution. trigger_id: the id
|
---|
168 | * of the trigger. parameter_type: the type of the parameters involved in the
|
---|
169 | * execution. All fields support for EQUALS, in additional: CreateTimestamp
|
---|
170 | * support for LESS_THAN, GREATER_THAN ParameterType support for HAS For
|
---|
171 | * example: "parameter_type" HAS \"string\" Also supports operators like AND,
|
---|
172 | * OR, NOT For example, trigger_id=\"id1\" AND test_case_id=\"testCaseId\"
|
---|
173 | * @opt_param string orderBy Optional. The results would be returned in order
|
---|
174 | * you specified here. Currently supporting "last_modified_time" and
|
---|
175 | * "create_time".
|
---|
176 | * @opt_param int pageSize Optional. The size of entries in the response.
|
---|
177 | * @opt_param string pageToken Optional. The token returned in the previous
|
---|
178 | * response.
|
---|
179 | * @opt_param string readMask Optional. View mask for the response data. If set,
|
---|
180 | * only the field specified will be returned as part of the result. If not set,
|
---|
181 | * all fields in event execution info will be filled and returned.
|
---|
182 | * @opt_param bool truncateParams Optional. If true, the service will truncate
|
---|
183 | * the params to only keep the first 1000 characters of string params and empty
|
---|
184 | * the executions in order to make response smaller. Only works for UI and when
|
---|
185 | * the params fields are not filtered out.
|
---|
186 | * @return GoogleCloudIntegrationsV1alphaListTestCaseExecutionsResponse
|
---|
187 | * @throws \Google\Service\Exception
|
---|
188 | */
|
---|
189 | public function listExecutions($parent, $optParams = [])
|
---|
190 | {
|
---|
191 | $params = ['parent' => $parent];
|
---|
192 | $params = array_merge($params, $optParams);
|
---|
193 | return $this->call('listExecutions', [$params], GoogleCloudIntegrationsV1alphaListTestCaseExecutionsResponse::class);
|
---|
194 | }
|
---|
195 | /**
|
---|
196 | * Updates a test case (testCases.patch)
|
---|
197 | *
|
---|
198 | * @param string $name Output only. Auto-generated primary key.
|
---|
199 | * @param GoogleCloudIntegrationsV1alphaTestCase $postBody
|
---|
200 | * @param array $optParams Optional parameters.
|
---|
201 | *
|
---|
202 | * @opt_param string updateMask Optional. Field mask specifying the fields in
|
---|
203 | * the above integration that have been modified and need to be updated.
|
---|
204 | * @return GoogleCloudIntegrationsV1alphaTestCase
|
---|
205 | * @throws \Google\Service\Exception
|
---|
206 | */
|
---|
207 | public function patch($name, GoogleCloudIntegrationsV1alphaTestCase $postBody, $optParams = [])
|
---|
208 | {
|
---|
209 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
210 | $params = array_merge($params, $optParams);
|
---|
211 | return $this->call('patch', [$params], GoogleCloudIntegrationsV1alphaTestCase::class);
|
---|
212 | }
|
---|
213 | /**
|
---|
214 | * Clear the lock fields and assign them to current user
|
---|
215 | * (testCases.takeoverEditLock)
|
---|
216 | *
|
---|
217 | * @param string $name Required. The ID of test case to takeover edit lock.
|
---|
218 | * Format: projects/{project}/locations/{location}/integrations/{integration}/ve
|
---|
219 | * rsions/{integration_version}/testCases/{test_case_id}
|
---|
220 | * @param GoogleCloudIntegrationsV1alphaTakeoverTestCaseEditLockRequest $postBody
|
---|
221 | * @param array $optParams Optional parameters.
|
---|
222 | * @return GoogleCloudIntegrationsV1alphaTestCase
|
---|
223 | * @throws \Google\Service\Exception
|
---|
224 | */
|
---|
225 | public function takeoverEditLock($name, GoogleCloudIntegrationsV1alphaTakeoverTestCaseEditLockRequest $postBody, $optParams = [])
|
---|
226 | {
|
---|
227 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
228 | $params = array_merge($params, $optParams);
|
---|
229 | return $this->call('takeoverEditLock', [$params], GoogleCloudIntegrationsV1alphaTestCase::class);
|
---|
230 | }
|
---|
231 | /**
|
---|
232 | * Uploads a test case. The content can be a previously downloaded test case.
|
---|
233 | * Performs the same function as CreateTestCase, but accepts input in a string
|
---|
234 | * format, which holds the complete representation of the TestCase content.
|
---|
235 | * (testCases.upload)
|
---|
236 | *
|
---|
237 | * @param string $parent Required. The test case to upload. Format: projects/{pr
|
---|
238 | * oject}/locations/{location}/integrations/{integration}/versions/{integration_
|
---|
239 | * version}
|
---|
240 | * @param GoogleCloudIntegrationsV1alphaUploadTestCaseRequest $postBody
|
---|
241 | * @param array $optParams Optional parameters.
|
---|
242 | * @return GoogleCloudIntegrationsV1alphaUploadTestCaseResponse
|
---|
243 | * @throws \Google\Service\Exception
|
---|
244 | */
|
---|
245 | public function upload($parent, GoogleCloudIntegrationsV1alphaUploadTestCaseRequest $postBody, $optParams = [])
|
---|
246 | {
|
---|
247 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
248 | $params = array_merge($params, $optParams);
|
---|
249 | return $this->call('upload', [$params], GoogleCloudIntegrationsV1alphaUploadTestCaseResponse::class);
|
---|
250 | }
|
---|
251 | }
|
---|
252 |
|
---|
253 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
254 | class_alias(ProjectsLocationsIntegrationsVersionsTestCases::class, 'Google_Service_Integrations_Resource_ProjectsLocationsIntegrationsVersionsTestCases');
|
---|