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\GoogleCloudIntegrationsV1alphaDownloadIntegrationVersionResponse;
|
---|
21 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaDownloadJsonPackageResponse;
|
---|
22 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaIntegrationVersion;
|
---|
23 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaListIntegrationVersionsResponse;
|
---|
24 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaPublishIntegrationVersionRequest;
|
---|
25 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaPublishIntegrationVersionResponse;
|
---|
26 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaUnpublishIntegrationVersionRequest;
|
---|
27 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaUploadIntegrationVersionRequest;
|
---|
28 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaUploadIntegrationVersionResponse;
|
---|
29 | use Google\Service\Integrations\GoogleProtobufEmpty;
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * The "versions" collection of methods.
|
---|
33 | * Typical usage is:
|
---|
34 | * <code>
|
---|
35 | * $integrationsService = new Google\Service\Integrations(...);
|
---|
36 | * $versions = $integrationsService->projects_locations_integrations_versions;
|
---|
37 | * </code>
|
---|
38 | */
|
---|
39 | class ProjectsLocationsIntegrationsVersions extends \Google\Service\Resource
|
---|
40 | {
|
---|
41 | /**
|
---|
42 | * Create a integration with a draft version in the specified project.
|
---|
43 | * (versions.create)
|
---|
44 | *
|
---|
45 | * @param string $parent Required. The parent resource where this version will
|
---|
46 | * be created. Format:
|
---|
47 | * projects/{project}/locations/{location}/integrations/{integration}
|
---|
48 | * @param GoogleCloudIntegrationsV1alphaIntegrationVersion $postBody
|
---|
49 | * @param array $optParams Optional parameters.
|
---|
50 | *
|
---|
51 | * @opt_param bool createSampleIntegrations Optional. Optional. Indicates if
|
---|
52 | * sample workflow should be created.
|
---|
53 | * @opt_param bool newIntegration Set this flag to true, if draft version is to
|
---|
54 | * be created for a brand new integration. False, if the request is for an
|
---|
55 | * existing integration. For backward compatibility reasons, even if this flag
|
---|
56 | * is set to `false` and no existing integration is found, a new draft
|
---|
57 | * integration will still be created.
|
---|
58 | * @return GoogleCloudIntegrationsV1alphaIntegrationVersion
|
---|
59 | * @throws \Google\Service\Exception
|
---|
60 | */
|
---|
61 | public function create($parent, GoogleCloudIntegrationsV1alphaIntegrationVersion $postBody, $optParams = [])
|
---|
62 | {
|
---|
63 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
64 | $params = array_merge($params, $optParams);
|
---|
65 | return $this->call('create', [$params], GoogleCloudIntegrationsV1alphaIntegrationVersion::class);
|
---|
66 | }
|
---|
67 | /**
|
---|
68 | * Soft-deletes the integration. Changes the status of the integration to
|
---|
69 | * ARCHIVED. If the integration being ARCHIVED is tagged as "HEAD", the tag is
|
---|
70 | * removed from this snapshot and set to the previous non-ARCHIVED snapshot. The
|
---|
71 | * PUBLISH_REQUESTED, DUE_FOR_DELETION tags are removed too. This RPC throws an
|
---|
72 | * exception if the version being deleted is DRAFT, and if the `locked_by` user
|
---|
73 | * is not the same as the user performing the Delete. Audit fields updated
|
---|
74 | * include last_modified_timestamp, last_modified_by. Any existing lock is
|
---|
75 | * released when Deleting a integration. Currently, there is no undelete
|
---|
76 | * mechanism. (versions.delete)
|
---|
77 | *
|
---|
78 | * @param string $name Required. The version to delete. Format: projects/{projec
|
---|
79 | * t}/locations/{location}/integrations/{integration}/versions/{version}
|
---|
80 | * @param array $optParams Optional parameters.
|
---|
81 | * @return GoogleProtobufEmpty
|
---|
82 | * @throws \Google\Service\Exception
|
---|
83 | */
|
---|
84 | public function delete($name, $optParams = [])
|
---|
85 | {
|
---|
86 | $params = ['name' => $name];
|
---|
87 | $params = array_merge($params, $optParams);
|
---|
88 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
89 | }
|
---|
90 | /**
|
---|
91 | * Downloads an integration. Retrieves the `IntegrationVersion` for a given
|
---|
92 | * `integration_id` and returns the response as a string. (versions.download)
|
---|
93 | *
|
---|
94 | * @param string $name Required. The version to download. Format: projects/{proj
|
---|
95 | * ect}/locations/{location}/integrations/{integration}/versions/{version}
|
---|
96 | * @param array $optParams Optional parameters.
|
---|
97 | *
|
---|
98 | * @opt_param string fileFormat File format for download request.
|
---|
99 | * @opt_param string files Optional. Integration related file to download like
|
---|
100 | * Integration Json, Config variable, testcase etc.
|
---|
101 | * @return GoogleCloudIntegrationsV1alphaDownloadIntegrationVersionResponse
|
---|
102 | * @throws \Google\Service\Exception
|
---|
103 | */
|
---|
104 | public function download($name, $optParams = [])
|
---|
105 | {
|
---|
106 | $params = ['name' => $name];
|
---|
107 | $params = array_merge($params, $optParams);
|
---|
108 | return $this->call('download', [$params], GoogleCloudIntegrationsV1alphaDownloadIntegrationVersionResponse::class);
|
---|
109 | }
|
---|
110 | /**
|
---|
111 | * Downloads an Integration version package like IntegrationVersion,Integration
|
---|
112 | * Config etc. Retrieves the IntegrationVersion package for a given
|
---|
113 | * `integration_id` and returns the response as a JSON.
|
---|
114 | * (versions.downloadJsonPackage)
|
---|
115 | *
|
---|
116 | * @param string $name Required. Integration version name Format: projects/{proj
|
---|
117 | * ect}/locations/{location}/integrations/{integration}/versions/{version}
|
---|
118 | * @param array $optParams Optional parameters.
|
---|
119 | *
|
---|
120 | * @opt_param string files Optional. Integration related file to download like
|
---|
121 | * Integration Version, Config variable, testcase etc.
|
---|
122 | * @return GoogleCloudIntegrationsV1alphaDownloadJsonPackageResponse
|
---|
123 | * @throws \Google\Service\Exception
|
---|
124 | */
|
---|
125 | public function downloadJsonPackage($name, $optParams = [])
|
---|
126 | {
|
---|
127 | $params = ['name' => $name];
|
---|
128 | $params = array_merge($params, $optParams);
|
---|
129 | return $this->call('downloadJsonPackage', [$params], GoogleCloudIntegrationsV1alphaDownloadJsonPackageResponse::class);
|
---|
130 | }
|
---|
131 | /**
|
---|
132 | * Get a integration in the specified project. (versions.get)
|
---|
133 | *
|
---|
134 | * @param string $name Required. The version to retrieve. Format: projects/{proj
|
---|
135 | * ect}/locations/{location}/integrations/{integration}/versions/{version}
|
---|
136 | * @param array $optParams Optional parameters.
|
---|
137 | * @return GoogleCloudIntegrationsV1alphaIntegrationVersion
|
---|
138 | * @throws \Google\Service\Exception
|
---|
139 | */
|
---|
140 | public function get($name, $optParams = [])
|
---|
141 | {
|
---|
142 | $params = ['name' => $name];
|
---|
143 | $params = array_merge($params, $optParams);
|
---|
144 | return $this->call('get', [$params], GoogleCloudIntegrationsV1alphaIntegrationVersion::class);
|
---|
145 | }
|
---|
146 | /**
|
---|
147 | * Returns the list of all integration versions in the specified project.
|
---|
148 | * (versions.listProjectsLocationsIntegrationsVersions)
|
---|
149 | *
|
---|
150 | * @param string $parent Required. The parent resource where this version will
|
---|
151 | * be created. Format:
|
---|
152 | * projects/{project}/locations/{location}/integrations/{integration}
|
---|
153 | * Specifically, when parent equals: 1. projects//locations//integrations/,
|
---|
154 | * Meaning: "List versions (with filter) for a particular integration". 2.
|
---|
155 | * projects//locations//integrations/- Meaning: "List versions (with filter) for
|
---|
156 | * a client within a particular region".
|
---|
157 | * @param array $optParams Optional parameters.
|
---|
158 | *
|
---|
159 | * @opt_param string fieldMask The field mask which specifies the particular
|
---|
160 | * data to be returned.
|
---|
161 | * @opt_param string filter Filter on fields of IntegrationVersion. Fields can
|
---|
162 | * be compared with literal values by use of ":" (containment), "=" (equality),
|
---|
163 | * ">" (greater), "<" (less than), >=" (greater than or equal to), "<=" (less
|
---|
164 | * than or equal to), and "!=" (inequality) operators. Negation, conjunction,
|
---|
165 | * and disjunction are written using NOT, AND, and OR keywords. For example,
|
---|
166 | * organization_id=\"1\" AND state=ACTIVE AND description:"test". Filtering
|
---|
167 | * cannot be performed on repeated fields like `task_config`.
|
---|
168 | * @opt_param string orderBy The results would be returned in order you
|
---|
169 | * specified here. Currently supported sort keys are: Descending sort order for
|
---|
170 | * "last\_modified\_time", "created\_time", and "snapshot\_number". Ascending
|
---|
171 | * sort order for `name`.
|
---|
172 | * @opt_param int pageSize The maximum number of versions to return. The service
|
---|
173 | * may return fewer than this value. If unspecified, at most 50 versions will be
|
---|
174 | * returned. The maximum value is 1000; values above 1000 will be coerced to
|
---|
175 | * 1000.
|
---|
176 | * @opt_param string pageToken A page token, received from a previous
|
---|
177 | * `ListIntegrationVersions` call. Provide this to retrieve the subsequent page.
|
---|
178 | * When paginating, all other parameters provided to `ListIntegrationVersions`
|
---|
179 | * must match the call that provided the page token.
|
---|
180 | * @return GoogleCloudIntegrationsV1alphaListIntegrationVersionsResponse
|
---|
181 | * @throws \Google\Service\Exception
|
---|
182 | */
|
---|
183 | public function listProjectsLocationsIntegrationsVersions($parent, $optParams = [])
|
---|
184 | {
|
---|
185 | $params = ['parent' => $parent];
|
---|
186 | $params = array_merge($params, $optParams);
|
---|
187 | return $this->call('list', [$params], GoogleCloudIntegrationsV1alphaListIntegrationVersionsResponse::class);
|
---|
188 | }
|
---|
189 | /**
|
---|
190 | * Update a integration with a draft version in the specified project.
|
---|
191 | * (versions.patch)
|
---|
192 | *
|
---|
193 | * @param string $name Output only. Auto-generated primary key.
|
---|
194 | * @param GoogleCloudIntegrationsV1alphaIntegrationVersion $postBody
|
---|
195 | * @param array $optParams Optional parameters.
|
---|
196 | *
|
---|
197 | * @opt_param string updateMask Field mask specifying the fields in the above
|
---|
198 | * integration that have been modified and need to be updated.
|
---|
199 | * @return GoogleCloudIntegrationsV1alphaIntegrationVersion
|
---|
200 | * @throws \Google\Service\Exception
|
---|
201 | */
|
---|
202 | public function patch($name, GoogleCloudIntegrationsV1alphaIntegrationVersion $postBody, $optParams = [])
|
---|
203 | {
|
---|
204 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
205 | $params = array_merge($params, $optParams);
|
---|
206 | return $this->call('patch', [$params], GoogleCloudIntegrationsV1alphaIntegrationVersion::class);
|
---|
207 | }
|
---|
208 | /**
|
---|
209 | * This RPC throws an exception if the integration is in ARCHIVED or ACTIVE
|
---|
210 | * state. This RPC throws an exception if the version being published is DRAFT,
|
---|
211 | * and if the `locked_by` user is not the same as the user performing the
|
---|
212 | * Publish. Audit fields updated include last_published_timestamp,
|
---|
213 | * last_published_by, last_modified_timestamp, last_modified_by. Any existing
|
---|
214 | * lock is on this integration is released. (versions.publish)
|
---|
215 | *
|
---|
216 | * @param string $name Required. The version to publish. Format: projects/{proje
|
---|
217 | * ct}/locations/{location}/integrations/{integration}/versions/{version}
|
---|
218 | * @param GoogleCloudIntegrationsV1alphaPublishIntegrationVersionRequest $postBody
|
---|
219 | * @param array $optParams Optional parameters.
|
---|
220 | * @return GoogleCloudIntegrationsV1alphaPublishIntegrationVersionResponse
|
---|
221 | * @throws \Google\Service\Exception
|
---|
222 | */
|
---|
223 | public function publish($name, GoogleCloudIntegrationsV1alphaPublishIntegrationVersionRequest $postBody, $optParams = [])
|
---|
224 | {
|
---|
225 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
226 | $params = array_merge($params, $optParams);
|
---|
227 | return $this->call('publish', [$params], GoogleCloudIntegrationsV1alphaPublishIntegrationVersionResponse::class);
|
---|
228 | }
|
---|
229 | /**
|
---|
230 | * Sets the status of the ACTIVE integration to SNAPSHOT with a new tag
|
---|
231 | * "PREVIOUSLY_PUBLISHED" after validating it. The "HEAD" and
|
---|
232 | * "PUBLISH_REQUESTED" tags do not change. This RPC throws an exception if the
|
---|
233 | * version being snapshot is not ACTIVE. Audit fields added include action,
|
---|
234 | * action_by, action_timestamp. (versions.unpublish)
|
---|
235 | *
|
---|
236 | * @param string $name Required. The version to deactivate. Format: projects/{pr
|
---|
237 | * oject}/locations/{location}/integrations/{integration}/versions/{version}
|
---|
238 | * @param GoogleCloudIntegrationsV1alphaUnpublishIntegrationVersionRequest $postBody
|
---|
239 | * @param array $optParams Optional parameters.
|
---|
240 | * @return GoogleProtobufEmpty
|
---|
241 | * @throws \Google\Service\Exception
|
---|
242 | */
|
---|
243 | public function unpublish($name, GoogleCloudIntegrationsV1alphaUnpublishIntegrationVersionRequest $postBody, $optParams = [])
|
---|
244 | {
|
---|
245 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
246 | $params = array_merge($params, $optParams);
|
---|
247 | return $this->call('unpublish', [$params], GoogleProtobufEmpty::class);
|
---|
248 | }
|
---|
249 | /**
|
---|
250 | * Uploads an integration. The content can be a previously downloaded
|
---|
251 | * integration. Performs the same function as CreateDraftIntegrationVersion, but
|
---|
252 | * accepts input in a string format, which holds the complete representation of
|
---|
253 | * the IntegrationVersion content. (versions.upload)
|
---|
254 | *
|
---|
255 | * @param string $parent Required. The version to upload. Format:
|
---|
256 | * projects/{project}/locations/{location}/integrations/{integration}
|
---|
257 | * @param GoogleCloudIntegrationsV1alphaUploadIntegrationVersionRequest $postBody
|
---|
258 | * @param array $optParams Optional parameters.
|
---|
259 | * @return GoogleCloudIntegrationsV1alphaUploadIntegrationVersionResponse
|
---|
260 | * @throws \Google\Service\Exception
|
---|
261 | */
|
---|
262 | public function upload($parent, GoogleCloudIntegrationsV1alphaUploadIntegrationVersionRequest $postBody, $optParams = [])
|
---|
263 | {
|
---|
264 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
265 | $params = array_merge($params, $optParams);
|
---|
266 | return $this->call('upload', [$params], GoogleCloudIntegrationsV1alphaUploadIntegrationVersionResponse::class);
|
---|
267 | }
|
---|
268 | }
|
---|
269 |
|
---|
270 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
271 | class_alias(ProjectsLocationsIntegrationsVersions::class, 'Google_Service_Integrations_Resource_ProjectsLocationsIntegrationsVersions');
|
---|