[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\Script\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Script\Deployment;
|
---|
| 21 | use Google\Service\Script\DeploymentConfig;
|
---|
| 22 | use Google\Service\Script\ListDeploymentsResponse;
|
---|
| 23 | use Google\Service\Script\ScriptEmpty;
|
---|
| 24 | use Google\Service\Script\UpdateDeploymentRequest;
|
---|
| 25 |
|
---|
| 26 | /**
|
---|
| 27 | * The "deployments" collection of methods.
|
---|
| 28 | * Typical usage is:
|
---|
| 29 | * <code>
|
---|
| 30 | * $scriptService = new Google\Service\Script(...);
|
---|
| 31 | * $deployments = $scriptService->projects_deployments;
|
---|
| 32 | * </code>
|
---|
| 33 | */
|
---|
| 34 | class ProjectsDeployments extends \Google\Service\Resource
|
---|
| 35 | {
|
---|
| 36 | /**
|
---|
| 37 | * Creates a deployment of an Apps Script project. (deployments.create)
|
---|
| 38 | *
|
---|
| 39 | * @param string $scriptId The script project's Drive ID.
|
---|
| 40 | * @param DeploymentConfig $postBody
|
---|
| 41 | * @param array $optParams Optional parameters.
|
---|
| 42 | * @return Deployment
|
---|
| 43 | * @throws \Google\Service\Exception
|
---|
| 44 | */
|
---|
| 45 | public function create($scriptId, DeploymentConfig $postBody, $optParams = [])
|
---|
| 46 | {
|
---|
| 47 | $params = ['scriptId' => $scriptId, 'postBody' => $postBody];
|
---|
| 48 | $params = array_merge($params, $optParams);
|
---|
| 49 | return $this->call('create', [$params], Deployment::class);
|
---|
| 50 | }
|
---|
| 51 | /**
|
---|
| 52 | * Deletes a deployment of an Apps Script project. (deployments.delete)
|
---|
| 53 | *
|
---|
| 54 | * @param string $scriptId The script project's Drive ID.
|
---|
| 55 | * @param string $deploymentId The deployment ID to be undeployed.
|
---|
| 56 | * @param array $optParams Optional parameters.
|
---|
| 57 | * @return ScriptEmpty
|
---|
| 58 | * @throws \Google\Service\Exception
|
---|
| 59 | */
|
---|
| 60 | public function delete($scriptId, $deploymentId, $optParams = [])
|
---|
| 61 | {
|
---|
| 62 | $params = ['scriptId' => $scriptId, 'deploymentId' => $deploymentId];
|
---|
| 63 | $params = array_merge($params, $optParams);
|
---|
| 64 | return $this->call('delete', [$params], ScriptEmpty::class);
|
---|
| 65 | }
|
---|
| 66 | /**
|
---|
| 67 | * Gets a deployment of an Apps Script project. (deployments.get)
|
---|
| 68 | *
|
---|
| 69 | * @param string $scriptId The script project's Drive ID.
|
---|
| 70 | * @param string $deploymentId The deployment ID.
|
---|
| 71 | * @param array $optParams Optional parameters.
|
---|
| 72 | * @return Deployment
|
---|
| 73 | * @throws \Google\Service\Exception
|
---|
| 74 | */
|
---|
| 75 | public function get($scriptId, $deploymentId, $optParams = [])
|
---|
| 76 | {
|
---|
| 77 | $params = ['scriptId' => $scriptId, 'deploymentId' => $deploymentId];
|
---|
| 78 | $params = array_merge($params, $optParams);
|
---|
| 79 | return $this->call('get', [$params], Deployment::class);
|
---|
| 80 | }
|
---|
| 81 | /**
|
---|
| 82 | * Lists the deployments of an Apps Script project.
|
---|
| 83 | * (deployments.listProjectsDeployments)
|
---|
| 84 | *
|
---|
| 85 | * @param string $scriptId The script project's Drive ID.
|
---|
| 86 | * @param array $optParams Optional parameters.
|
---|
| 87 | *
|
---|
| 88 | * @opt_param int pageSize The maximum number of deployments on each returned
|
---|
| 89 | * page. Defaults to 50.
|
---|
| 90 | * @opt_param string pageToken The token for continuing a previous list request
|
---|
| 91 | * on the next page. This should be set to the value of `nextPageToken` from a
|
---|
| 92 | * previous response.
|
---|
| 93 | * @return ListDeploymentsResponse
|
---|
| 94 | * @throws \Google\Service\Exception
|
---|
| 95 | */
|
---|
| 96 | public function listProjectsDeployments($scriptId, $optParams = [])
|
---|
| 97 | {
|
---|
| 98 | $params = ['scriptId' => $scriptId];
|
---|
| 99 | $params = array_merge($params, $optParams);
|
---|
| 100 | return $this->call('list', [$params], ListDeploymentsResponse::class);
|
---|
| 101 | }
|
---|
| 102 | /**
|
---|
| 103 | * Updates a deployment of an Apps Script project. (deployments.update)
|
---|
| 104 | *
|
---|
| 105 | * @param string $scriptId The script project's Drive ID.
|
---|
| 106 | * @param string $deploymentId The deployment ID for this deployment.
|
---|
| 107 | * @param UpdateDeploymentRequest $postBody
|
---|
| 108 | * @param array $optParams Optional parameters.
|
---|
| 109 | * @return Deployment
|
---|
| 110 | * @throws \Google\Service\Exception
|
---|
| 111 | */
|
---|
| 112 | public function update($scriptId, $deploymentId, UpdateDeploymentRequest $postBody, $optParams = [])
|
---|
| 113 | {
|
---|
| 114 | $params = ['scriptId' => $scriptId, 'deploymentId' => $deploymentId, 'postBody' => $postBody];
|
---|
| 115 | $params = array_merge($params, $optParams);
|
---|
| 116 | return $this->call('update', [$params], Deployment::class);
|
---|
| 117 | }
|
---|
| 118 | }
|
---|
| 119 |
|
---|
| 120 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 121 | class_alias(ProjectsDeployments::class, 'Google_Service_Script_Resource_ProjectsDeployments');
|
---|