[e3d4e0a] | 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\GoogleCloudIntegrationsV1alphaDownloadTemplateResponse;
|
---|
| 21 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaImportTemplateRequest;
|
---|
| 22 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaImportTemplateResponse;
|
---|
| 23 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaListTemplatesResponse;
|
---|
| 24 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaSearchTemplatesResponse;
|
---|
| 25 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaShareTemplateRequest;
|
---|
| 26 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaTemplate;
|
---|
| 27 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaUnshareTemplateRequest;
|
---|
| 28 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaUploadTemplateRequest;
|
---|
| 29 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaUploadTemplateResponse;
|
---|
| 30 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaUseTemplateRequest;
|
---|
| 31 | use Google\Service\Integrations\GoogleCloudIntegrationsV1alphaUseTemplateResponse;
|
---|
| 32 | use Google\Service\Integrations\GoogleProtobufEmpty;
|
---|
| 33 |
|
---|
| 34 | /**
|
---|
| 35 | * The "templates" collection of methods.
|
---|
| 36 | * Typical usage is:
|
---|
| 37 | * <code>
|
---|
| 38 | * $integrationsService = new Google\Service\Integrations(...);
|
---|
| 39 | * $templates = $integrationsService->projects_locations_templates;
|
---|
| 40 | * </code>
|
---|
| 41 | */
|
---|
| 42 | class ProjectsLocationsTemplates extends \Google\Service\Resource
|
---|
| 43 | {
|
---|
| 44 | /**
|
---|
| 45 | * Creates a new template (templates.create)
|
---|
| 46 | *
|
---|
| 47 | * @param string $parent Required. "projects/{project}/locations/{location}"
|
---|
| 48 | * format.
|
---|
| 49 | * @param GoogleCloudIntegrationsV1alphaTemplate $postBody
|
---|
| 50 | * @param array $optParams Optional parameters.
|
---|
| 51 | * @return GoogleCloudIntegrationsV1alphaTemplate
|
---|
| 52 | * @throws \Google\Service\Exception
|
---|
| 53 | */
|
---|
| 54 | public function create($parent, GoogleCloudIntegrationsV1alphaTemplate $postBody, $optParams = [])
|
---|
| 55 | {
|
---|
| 56 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 57 | $params = array_merge($params, $optParams);
|
---|
| 58 | return $this->call('create', [$params], GoogleCloudIntegrationsV1alphaTemplate::class);
|
---|
| 59 | }
|
---|
| 60 | /**
|
---|
| 61 | * Deletes a template (templates.delete)
|
---|
| 62 | *
|
---|
| 63 | * @param string $name Required. The name that is associated with the Template.
|
---|
| 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 template. Retrieves the `Template` and returns the response as a
|
---|
| 76 | * string. (templates.download)
|
---|
| 77 | *
|
---|
| 78 | * @param string $name Required. The template to download. Format:
|
---|
| 79 | * projects/{project}/locations/{location}/template/{template_id}
|
---|
| 80 | * @param array $optParams Optional parameters.
|
---|
| 81 | *
|
---|
| 82 | * @opt_param string fileFormat Required. File format for download request.
|
---|
| 83 | * @return GoogleCloudIntegrationsV1alphaDownloadTemplateResponse
|
---|
| 84 | * @throws \Google\Service\Exception
|
---|
| 85 | */
|
---|
| 86 | public function download($name, $optParams = [])
|
---|
| 87 | {
|
---|
| 88 | $params = ['name' => $name];
|
---|
| 89 | $params = array_merge($params, $optParams);
|
---|
| 90 | return $this->call('download', [$params], GoogleCloudIntegrationsV1alphaDownloadTemplateResponse::class);
|
---|
| 91 | }
|
---|
| 92 | /**
|
---|
| 93 | * Get a template in the specified project. (templates.get)
|
---|
| 94 | *
|
---|
| 95 | * @param string $name Required. The template to retrieve. Format:
|
---|
| 96 | * projects/{project}/locations/{location}/templates/{template}
|
---|
| 97 | * @param array $optParams Optional parameters.
|
---|
| 98 | * @return GoogleCloudIntegrationsV1alphaTemplate
|
---|
| 99 | * @throws \Google\Service\Exception
|
---|
| 100 | */
|
---|
| 101 | public function get($name, $optParams = [])
|
---|
| 102 | {
|
---|
| 103 | $params = ['name' => $name];
|
---|
| 104 | $params = array_merge($params, $optParams);
|
---|
| 105 | return $this->call('get', [$params], GoogleCloudIntegrationsV1alphaTemplate::class);
|
---|
| 106 | }
|
---|
| 107 | /**
|
---|
| 108 | * Import the template to an existing integration. This api would keep track of
|
---|
| 109 | * usage_count and last_used_time. PERMISSION_DENIED would be thrown if template
|
---|
| 110 | * is not accessible by client. (templates.import)
|
---|
| 111 | *
|
---|
| 112 | * @param string $name Required. The name that is associated with the Template.
|
---|
| 113 | * @param GoogleCloudIntegrationsV1alphaImportTemplateRequest $postBody
|
---|
| 114 | * @param array $optParams Optional parameters.
|
---|
| 115 | * @return GoogleCloudIntegrationsV1alphaImportTemplateResponse
|
---|
| 116 | * @throws \Google\Service\Exception
|
---|
| 117 | */
|
---|
| 118 | public function import($name, GoogleCloudIntegrationsV1alphaImportTemplateRequest $postBody, $optParams = [])
|
---|
| 119 | {
|
---|
| 120 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 121 | $params = array_merge($params, $optParams);
|
---|
| 122 | return $this->call('import', [$params], GoogleCloudIntegrationsV1alphaImportTemplateResponse::class);
|
---|
| 123 | }
|
---|
| 124 | /**
|
---|
| 125 | * Lists all templates matching the filter.
|
---|
| 126 | * (templates.listProjectsLocationsTemplates)
|
---|
| 127 | *
|
---|
| 128 | * @param string $parent Required. The client, which owns this collection of
|
---|
| 129 | * Templates.
|
---|
| 130 | * @param array $optParams Optional parameters.
|
---|
| 131 | *
|
---|
| 132 | * @opt_param string filter Optional. Standard filter field to filter templates.
|
---|
| 133 | * client_id filter won't be supported and will restrict to templates belonging
|
---|
| 134 | * to the current client only. Return all templates of the current client if the
|
---|
| 135 | * filter is empty. Also supports operators like AND, OR, NOT For example,
|
---|
| 136 | * "status=\"ACTIVE\"
|
---|
| 137 | * @opt_param string orderBy Optional. The results would be returned in the
|
---|
| 138 | * order you specified here.
|
---|
| 139 | * @opt_param int pageSize Optional. The size of the response entries. If
|
---|
| 140 | * unspecified, defaults to 100. The maximum value is 1000; values above 1000
|
---|
| 141 | * will be coerced to 1000.
|
---|
| 142 | * @opt_param string pageToken Optional. The token returned in the previous
|
---|
| 143 | * response.
|
---|
| 144 | * @opt_param string readMask Optional. The mask which specifies fields that
|
---|
| 145 | * need to be returned in the template's response.
|
---|
| 146 | * @return GoogleCloudIntegrationsV1alphaListTemplatesResponse
|
---|
| 147 | * @throws \Google\Service\Exception
|
---|
| 148 | */
|
---|
| 149 | public function listProjectsLocationsTemplates($parent, $optParams = [])
|
---|
| 150 | {
|
---|
| 151 | $params = ['parent' => $parent];
|
---|
| 152 | $params = array_merge($params, $optParams);
|
---|
| 153 | return $this->call('list', [$params], GoogleCloudIntegrationsV1alphaListTemplatesResponse::class);
|
---|
| 154 | }
|
---|
| 155 | /**
|
---|
| 156 | * Updates the template by given id. (templates.patch)
|
---|
| 157 | *
|
---|
| 158 | * @param string $name Identifier. Resource name of the template.
|
---|
| 159 | * @param GoogleCloudIntegrationsV1alphaTemplate $postBody
|
---|
| 160 | * @param array $optParams Optional parameters.
|
---|
| 161 | *
|
---|
| 162 | * @opt_param string updateMask Required. Field mask specifying the fields in
|
---|
| 163 | * the above template that have been modified and must be updated.
|
---|
| 164 | * @return GoogleCloudIntegrationsV1alphaTemplate
|
---|
| 165 | * @throws \Google\Service\Exception
|
---|
| 166 | */
|
---|
| 167 | public function patch($name, GoogleCloudIntegrationsV1alphaTemplate $postBody, $optParams = [])
|
---|
| 168 | {
|
---|
| 169 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 170 | $params = array_merge($params, $optParams);
|
---|
| 171 | return $this->call('patch', [$params], GoogleCloudIntegrationsV1alphaTemplate::class);
|
---|
| 172 | }
|
---|
| 173 | /**
|
---|
| 174 | * Search templates based on user query and filters. This api would query the
|
---|
| 175 | * templates and return a list of templates based on the user filter.
|
---|
| 176 | * (templates.search)
|
---|
| 177 | *
|
---|
| 178 | * @param string $parent Required. The client, which owns this collection of
|
---|
| 179 | * Templates.
|
---|
| 180 | * @param array $optParams Optional parameters.
|
---|
| 181 | *
|
---|
| 182 | * @opt_param string filter Optional. Standard filter field to filter templates.
|
---|
| 183 | * client_id filter won't be supported and will restrict to templates belonging
|
---|
| 184 | * to the current client only. Return all templates of the current client if the
|
---|
| 185 | * filter is empty. Also supports operators like AND, OR, NOT For example,
|
---|
| 186 | * "status=\"ACTIVE\"
|
---|
| 187 | * @opt_param string orderBy Optional. The results would be returned in the
|
---|
| 188 | * order you specified here.
|
---|
| 189 | * @opt_param int pageSize Optional. The size of the response entries. If
|
---|
| 190 | * unspecified, defaults to 100. The maximum value is 1000; values above 1000
|
---|
| 191 | * will be coerced to 1000.
|
---|
| 192 | * @opt_param string pageToken Optional. The token returned in the previous
|
---|
| 193 | * response.
|
---|
| 194 | * @opt_param string readMask Optional. The mask which specifies fields that
|
---|
| 195 | * need to be returned in the template's response.
|
---|
| 196 | * @return GoogleCloudIntegrationsV1alphaSearchTemplatesResponse
|
---|
| 197 | * @throws \Google\Service\Exception
|
---|
| 198 | */
|
---|
| 199 | public function search($parent, $optParams = [])
|
---|
| 200 | {
|
---|
| 201 | $params = ['parent' => $parent];
|
---|
| 202 | $params = array_merge($params, $optParams);
|
---|
| 203 | return $this->call('search', [$params], GoogleCloudIntegrationsV1alphaSearchTemplatesResponse::class);
|
---|
| 204 | }
|
---|
| 205 | /**
|
---|
| 206 | * Share a template with other clients. Only the template owner can share the
|
---|
| 207 | * templates with other projects. PERMISSION_DENIED would be thrown if the
|
---|
| 208 | * request is not from the owner. (templates.share)
|
---|
| 209 | *
|
---|
| 210 | * @param string $name Required. The name that is associated with the Template.
|
---|
| 211 | * @param GoogleCloudIntegrationsV1alphaShareTemplateRequest $postBody
|
---|
| 212 | * @param array $optParams Optional parameters.
|
---|
| 213 | * @return GoogleProtobufEmpty
|
---|
| 214 | * @throws \Google\Service\Exception
|
---|
| 215 | */
|
---|
| 216 | public function share($name, GoogleCloudIntegrationsV1alphaShareTemplateRequest $postBody, $optParams = [])
|
---|
| 217 | {
|
---|
| 218 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 219 | $params = array_merge($params, $optParams);
|
---|
| 220 | return $this->call('share', [$params], GoogleProtobufEmpty::class);
|
---|
| 221 | }
|
---|
| 222 | /**
|
---|
| 223 | * Unshare a template from given clients. Owner of the template can unshare
|
---|
| 224 | * template with clients. Shared client can only unshare the template from
|
---|
| 225 | * itself. PERMISSION_DENIED would be thrown if request is not from owner or for
|
---|
| 226 | * unsharing itself. (templates.unshare)
|
---|
| 227 | *
|
---|
| 228 | * @param string $name Required. The name that is associated with the Template.
|
---|
| 229 | * @param GoogleCloudIntegrationsV1alphaUnshareTemplateRequest $postBody
|
---|
| 230 | * @param array $optParams Optional parameters.
|
---|
| 231 | * @return GoogleProtobufEmpty
|
---|
| 232 | * @throws \Google\Service\Exception
|
---|
| 233 | */
|
---|
| 234 | public function unshare($name, GoogleCloudIntegrationsV1alphaUnshareTemplateRequest $postBody, $optParams = [])
|
---|
| 235 | {
|
---|
| 236 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 237 | $params = array_merge($params, $optParams);
|
---|
| 238 | return $this->call('unshare', [$params], GoogleProtobufEmpty::class);
|
---|
| 239 | }
|
---|
| 240 | /**
|
---|
| 241 | * Uploads a template. The content can be a previously downloaded template.
|
---|
| 242 | * Performs the same function as CreateTemplate, but accepts input in a string
|
---|
| 243 | * format, which holds the complete representation of the Template content.
|
---|
| 244 | * (templates.upload)
|
---|
| 245 | *
|
---|
| 246 | * @param string $parent Required. The template to upload. Format:
|
---|
| 247 | * projects/{project}/locations/{location}
|
---|
| 248 | * @param GoogleCloudIntegrationsV1alphaUploadTemplateRequest $postBody
|
---|
| 249 | * @param array $optParams Optional parameters.
|
---|
| 250 | * @return GoogleCloudIntegrationsV1alphaUploadTemplateResponse
|
---|
| 251 | * @throws \Google\Service\Exception
|
---|
| 252 | */
|
---|
| 253 | public function upload($parent, GoogleCloudIntegrationsV1alphaUploadTemplateRequest $postBody, $optParams = [])
|
---|
| 254 | {
|
---|
| 255 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 256 | $params = array_merge($params, $optParams);
|
---|
| 257 | return $this->call('upload', [$params], GoogleCloudIntegrationsV1alphaUploadTemplateResponse::class);
|
---|
| 258 | }
|
---|
| 259 | /**
|
---|
| 260 | * Use the template to create integration. This api would keep track of
|
---|
| 261 | * usage_count and last_used_time. PERMISSION_DENIED would be thrown if template
|
---|
| 262 | * is not accessible by client. (templates.useProjectsLocationsTemplates)
|
---|
| 263 | *
|
---|
| 264 | * @param string $name Required. The name that is associated with the Template.
|
---|
| 265 | * @param GoogleCloudIntegrationsV1alphaUseTemplateRequest $postBody
|
---|
| 266 | * @param array $optParams Optional parameters.
|
---|
| 267 | * @return GoogleCloudIntegrationsV1alphaUseTemplateResponse
|
---|
| 268 | * @throws \Google\Service\Exception
|
---|
| 269 | */
|
---|
| 270 | public function useProjectsLocationsTemplates($name, GoogleCloudIntegrationsV1alphaUseTemplateRequest $postBody, $optParams = [])
|
---|
| 271 | {
|
---|
| 272 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 273 | $params = array_merge($params, $optParams);
|
---|
| 274 | return $this->call('use', [$params], GoogleCloudIntegrationsV1alphaUseTemplateResponse::class);
|
---|
| 275 | }
|
---|
| 276 | }
|
---|
| 277 |
|
---|
| 278 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 279 | class_alias(ProjectsLocationsTemplates::class, 'Google_Service_Integrations_Resource_ProjectsLocationsTemplates');
|
---|