[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\OSConfig\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\OSConfig\ListPatchDeploymentsResponse;
|
---|
| 21 | use Google\Service\OSConfig\OsconfigEmpty;
|
---|
| 22 | use Google\Service\OSConfig\PatchDeployment;
|
---|
| 23 | use Google\Service\OSConfig\PausePatchDeploymentRequest;
|
---|
| 24 | use Google\Service\OSConfig\ResumePatchDeploymentRequest;
|
---|
| 25 |
|
---|
| 26 | /**
|
---|
| 27 | * The "patchDeployments" collection of methods.
|
---|
| 28 | * Typical usage is:
|
---|
| 29 | * <code>
|
---|
| 30 | * $osconfigService = new Google\Service\OSConfig(...);
|
---|
| 31 | * $patchDeployments = $osconfigService->projects_patchDeployments;
|
---|
| 32 | * </code>
|
---|
| 33 | */
|
---|
| 34 | class ProjectsPatchDeployments extends \Google\Service\Resource
|
---|
| 35 | {
|
---|
| 36 | /**
|
---|
| 37 | * Create an OS Config patch deployment. (patchDeployments.create)
|
---|
| 38 | *
|
---|
| 39 | * @param string $parent Required. The project to apply this patch deployment to
|
---|
| 40 | * in the form `projects`.
|
---|
| 41 | * @param PatchDeployment $postBody
|
---|
| 42 | * @param array $optParams Optional parameters.
|
---|
| 43 | *
|
---|
| 44 | * @opt_param string patchDeploymentId Required. A name for the patch deployment
|
---|
| 45 | * in the project. When creating a name the following rules apply: * Must
|
---|
| 46 | * contain only lowercase letters, numbers, and hyphens. * Must start with a
|
---|
| 47 | * letter. * Must be between 1-63 characters. * Must end with a number or a
|
---|
| 48 | * letter. * Must be unique within the project.
|
---|
| 49 | * @return PatchDeployment
|
---|
| 50 | * @throws \Google\Service\Exception
|
---|
| 51 | */
|
---|
| 52 | public function create($parent, PatchDeployment $postBody, $optParams = [])
|
---|
| 53 | {
|
---|
| 54 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 55 | $params = array_merge($params, $optParams);
|
---|
| 56 | return $this->call('create', [$params], PatchDeployment::class);
|
---|
| 57 | }
|
---|
| 58 | /**
|
---|
| 59 | * Delete an OS Config patch deployment. (patchDeployments.delete)
|
---|
| 60 | *
|
---|
| 61 | * @param string $name Required. The resource name of the patch deployment in
|
---|
| 62 | * the form `projects/patchDeployments`.
|
---|
| 63 | * @param array $optParams Optional parameters.
|
---|
| 64 | * @return OsconfigEmpty
|
---|
| 65 | * @throws \Google\Service\Exception
|
---|
| 66 | */
|
---|
| 67 | public function delete($name, $optParams = [])
|
---|
| 68 | {
|
---|
| 69 | $params = ['name' => $name];
|
---|
| 70 | $params = array_merge($params, $optParams);
|
---|
| 71 | return $this->call('delete', [$params], OsconfigEmpty::class);
|
---|
| 72 | }
|
---|
| 73 | /**
|
---|
| 74 | * Get an OS Config patch deployment. (patchDeployments.get)
|
---|
| 75 | *
|
---|
| 76 | * @param string $name Required. The resource name of the patch deployment in
|
---|
| 77 | * the form `projects/patchDeployments`.
|
---|
| 78 | * @param array $optParams Optional parameters.
|
---|
| 79 | * @return PatchDeployment
|
---|
| 80 | * @throws \Google\Service\Exception
|
---|
| 81 | */
|
---|
| 82 | public function get($name, $optParams = [])
|
---|
| 83 | {
|
---|
| 84 | $params = ['name' => $name];
|
---|
| 85 | $params = array_merge($params, $optParams);
|
---|
| 86 | return $this->call('get', [$params], PatchDeployment::class);
|
---|
| 87 | }
|
---|
| 88 | /**
|
---|
| 89 | * Get a page of OS Config patch deployments.
|
---|
| 90 | * (patchDeployments.listProjectsPatchDeployments)
|
---|
| 91 | *
|
---|
| 92 | * @param string $parent Required. The resource name of the parent in the form
|
---|
| 93 | * `projects`.
|
---|
| 94 | * @param array $optParams Optional parameters.
|
---|
| 95 | *
|
---|
| 96 | * @opt_param int pageSize Optional. The maximum number of patch deployments to
|
---|
| 97 | * return. Default is 100.
|
---|
| 98 | * @opt_param string pageToken Optional. A pagination token returned from a
|
---|
| 99 | * previous call to ListPatchDeployments that indicates where this listing
|
---|
| 100 | * should continue from.
|
---|
| 101 | * @return ListPatchDeploymentsResponse
|
---|
| 102 | * @throws \Google\Service\Exception
|
---|
| 103 | */
|
---|
| 104 | public function listProjectsPatchDeployments($parent, $optParams = [])
|
---|
| 105 | {
|
---|
| 106 | $params = ['parent' => $parent];
|
---|
| 107 | $params = array_merge($params, $optParams);
|
---|
| 108 | return $this->call('list', [$params], ListPatchDeploymentsResponse::class);
|
---|
| 109 | }
|
---|
| 110 | /**
|
---|
| 111 | * Update an OS Config patch deployment. (patchDeployments.patch)
|
---|
| 112 | *
|
---|
| 113 | * @param string $name Unique name for the patch deployment resource in a
|
---|
| 114 | * project. The patch deployment name is in the form:
|
---|
| 115 | * `projects/{project_id}/patchDeployments/{patch_deployment_id}`. This field is
|
---|
| 116 | * ignored when you create a new patch deployment.
|
---|
| 117 | * @param PatchDeployment $postBody
|
---|
| 118 | * @param array $optParams Optional parameters.
|
---|
| 119 | *
|
---|
| 120 | * @opt_param string updateMask Optional. Field mask that controls which fields
|
---|
| 121 | * of the patch deployment should be updated.
|
---|
| 122 | * @return PatchDeployment
|
---|
| 123 | * @throws \Google\Service\Exception
|
---|
| 124 | */
|
---|
| 125 | public function patch($name, PatchDeployment $postBody, $optParams = [])
|
---|
| 126 | {
|
---|
| 127 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 128 | $params = array_merge($params, $optParams);
|
---|
| 129 | return $this->call('patch', [$params], PatchDeployment::class);
|
---|
| 130 | }
|
---|
| 131 | /**
|
---|
| 132 | * Change state of patch deployment to "PAUSED". Patch deployment in paused
|
---|
| 133 | * state doesn't generate patch jobs. (patchDeployments.pause)
|
---|
| 134 | *
|
---|
| 135 | * @param string $name Required. The resource name of the patch deployment in
|
---|
| 136 | * the form `projects/patchDeployments`.
|
---|
| 137 | * @param PausePatchDeploymentRequest $postBody
|
---|
| 138 | * @param array $optParams Optional parameters.
|
---|
| 139 | * @return PatchDeployment
|
---|
| 140 | * @throws \Google\Service\Exception
|
---|
| 141 | */
|
---|
| 142 | public function pause($name, PausePatchDeploymentRequest $postBody, $optParams = [])
|
---|
| 143 | {
|
---|
| 144 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 145 | $params = array_merge($params, $optParams);
|
---|
| 146 | return $this->call('pause', [$params], PatchDeployment::class);
|
---|
| 147 | }
|
---|
| 148 | /**
|
---|
| 149 | * Change state of patch deployment back to "ACTIVE". Patch deployment in active
|
---|
| 150 | * state continues to generate patch jobs. (patchDeployments.resume)
|
---|
| 151 | *
|
---|
| 152 | * @param string $name Required. The resource name of the patch deployment in
|
---|
| 153 | * the form `projects/patchDeployments`.
|
---|
| 154 | * @param ResumePatchDeploymentRequest $postBody
|
---|
| 155 | * @param array $optParams Optional parameters.
|
---|
| 156 | * @return PatchDeployment
|
---|
| 157 | * @throws \Google\Service\Exception
|
---|
| 158 | */
|
---|
| 159 | public function resume($name, ResumePatchDeploymentRequest $postBody, $optParams = [])
|
---|
| 160 | {
|
---|
| 161 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 162 | $params = array_merge($params, $optParams);
|
---|
| 163 | return $this->call('resume', [$params], PatchDeployment::class);
|
---|
| 164 | }
|
---|
| 165 | }
|
---|
| 166 |
|
---|
| 167 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 168 | class_alias(ProjectsPatchDeployments::class, 'Google_Service_OSConfig_Resource_ProjectsPatchDeployments');
|
---|