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\BackupforGKE\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\BackupforGKE\Backup;
|
---|
21 | use Google\Service\BackupforGKE\GetBackupIndexDownloadUrlResponse;
|
---|
22 | use Google\Service\BackupforGKE\GoogleLongrunningOperation;
|
---|
23 | use Google\Service\BackupforGKE\ListBackupsResponse;
|
---|
24 | use Google\Service\BackupforGKE\Policy;
|
---|
25 | use Google\Service\BackupforGKE\SetIamPolicyRequest;
|
---|
26 | use Google\Service\BackupforGKE\TestIamPermissionsRequest;
|
---|
27 | use Google\Service\BackupforGKE\TestIamPermissionsResponse;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * The "backups" collection of methods.
|
---|
31 | * Typical usage is:
|
---|
32 | * <code>
|
---|
33 | * $gkebackupService = new Google\Service\BackupforGKE(...);
|
---|
34 | * $backups = $gkebackupService->projects_locations_backupPlans_backups;
|
---|
35 | * </code>
|
---|
36 | */
|
---|
37 | class ProjectsLocationsBackupPlansBackups extends \Google\Service\Resource
|
---|
38 | {
|
---|
39 | /**
|
---|
40 | * Creates a Backup for the given BackupPlan. (backups.create)
|
---|
41 | *
|
---|
42 | * @param string $parent Required. The BackupPlan within which to create the
|
---|
43 | * Backup. Format: `projects/locations/backupPlans`
|
---|
44 | * @param Backup $postBody
|
---|
45 | * @param array $optParams Optional parameters.
|
---|
46 | *
|
---|
47 | * @opt_param string backupId Optional. The client-provided short name for the
|
---|
48 | * Backup resource. This name must: - be between 1 and 63 characters long
|
---|
49 | * (inclusive) - consist of only lower-case ASCII letters, numbers, and dashes -
|
---|
50 | * start with a lower-case letter - end with a lower-case letter or number - be
|
---|
51 | * unique within the set of Backups in this BackupPlan
|
---|
52 | * @return GoogleLongrunningOperation
|
---|
53 | * @throws \Google\Service\Exception
|
---|
54 | */
|
---|
55 | public function create($parent, Backup $postBody, $optParams = [])
|
---|
56 | {
|
---|
57 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
58 | $params = array_merge($params, $optParams);
|
---|
59 | return $this->call('create', [$params], GoogleLongrunningOperation::class);
|
---|
60 | }
|
---|
61 | /**
|
---|
62 | * Deletes an existing Backup. (backups.delete)
|
---|
63 | *
|
---|
64 | * @param string $name Required. Name of the Backup resource. Format:
|
---|
65 | * `projects/locations/backupPlans/backups`
|
---|
66 | * @param array $optParams Optional parameters.
|
---|
67 | *
|
---|
68 | * @opt_param string etag Optional. If provided, this value must match the
|
---|
69 | * current value of the target Backup's etag field or the request is rejected.
|
---|
70 | * @opt_param bool force Optional. If set to true, any VolumeBackups below this
|
---|
71 | * Backup will also be deleted. Otherwise, the request will only succeed if the
|
---|
72 | * Backup has no VolumeBackups.
|
---|
73 | * @return GoogleLongrunningOperation
|
---|
74 | * @throws \Google\Service\Exception
|
---|
75 | */
|
---|
76 | public function delete($name, $optParams = [])
|
---|
77 | {
|
---|
78 | $params = ['name' => $name];
|
---|
79 | $params = array_merge($params, $optParams);
|
---|
80 | return $this->call('delete', [$params], GoogleLongrunningOperation::class);
|
---|
81 | }
|
---|
82 | /**
|
---|
83 | * Retrieve the details of a single Backup. (backups.get)
|
---|
84 | *
|
---|
85 | * @param string $name Required. Full name of the Backup resource. Format:
|
---|
86 | * `projects/locations/backupPlans/backups`
|
---|
87 | * @param array $optParams Optional parameters.
|
---|
88 | * @return Backup
|
---|
89 | * @throws \Google\Service\Exception
|
---|
90 | */
|
---|
91 | public function get($name, $optParams = [])
|
---|
92 | {
|
---|
93 | $params = ['name' => $name];
|
---|
94 | $params = array_merge($params, $optParams);
|
---|
95 | return $this->call('get', [$params], Backup::class);
|
---|
96 | }
|
---|
97 | /**
|
---|
98 | * Retrieve the link to the backupIndex. (backups.getBackupIndexDownloadUrl)
|
---|
99 | *
|
---|
100 | * @param string $backup Required. Full name of Backup resource. Format: project
|
---|
101 | * s/{project}/locations/{location}/backupPlans/{backup_plan}/backups/{backup}
|
---|
102 | * @param array $optParams Optional parameters.
|
---|
103 | * @return GetBackupIndexDownloadUrlResponse
|
---|
104 | * @throws \Google\Service\Exception
|
---|
105 | */
|
---|
106 | public function getBackupIndexDownloadUrl($backup, $optParams = [])
|
---|
107 | {
|
---|
108 | $params = ['backup' => $backup];
|
---|
109 | $params = array_merge($params, $optParams);
|
---|
110 | return $this->call('getBackupIndexDownloadUrl', [$params], GetBackupIndexDownloadUrlResponse::class);
|
---|
111 | }
|
---|
112 | /**
|
---|
113 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
114 | * resource exists and does not have a policy set. (backups.getIamPolicy)
|
---|
115 | *
|
---|
116 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
117 | * requested. See [Resource
|
---|
118 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
119 | * appropriate value for this field.
|
---|
120 | * @param array $optParams Optional parameters.
|
---|
121 | *
|
---|
122 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
123 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
124 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
125 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
126 | * conditional role bindings may specify any valid value or leave the field
|
---|
127 | * unset. The policy in the response might use the policy version that you
|
---|
128 | * specified, or it might use a lower policy version. For example, if you
|
---|
129 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
130 | * response uses version 1. To learn which resources support conditions in their
|
---|
131 | * IAM policies, see the [IAM
|
---|
132 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
133 | * policies).
|
---|
134 | * @return Policy
|
---|
135 | * @throws \Google\Service\Exception
|
---|
136 | */
|
---|
137 | public function getIamPolicy($resource, $optParams = [])
|
---|
138 | {
|
---|
139 | $params = ['resource' => $resource];
|
---|
140 | $params = array_merge($params, $optParams);
|
---|
141 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
142 | }
|
---|
143 | /**
|
---|
144 | * Lists the Backups for a given BackupPlan.
|
---|
145 | * (backups.listProjectsLocationsBackupPlansBackups)
|
---|
146 | *
|
---|
147 | * @param string $parent Required. The BackupPlan that contains the Backups to
|
---|
148 | * list. Format: `projects/locations/backupPlans`
|
---|
149 | * @param array $optParams Optional parameters.
|
---|
150 | *
|
---|
151 | * @opt_param string filter Optional. Field match expression used to filter the
|
---|
152 | * results.
|
---|
153 | * @opt_param string orderBy Optional. Field by which to sort the results.
|
---|
154 | * @opt_param int pageSize Optional. The target number of results to return in a
|
---|
155 | * single response. If not specified, a default value will be chosen by the
|
---|
156 | * service. Note that the response may include a partial list and a caller
|
---|
157 | * should only rely on the response's next_page_token to determine if there are
|
---|
158 | * more instances left to be queried.
|
---|
159 | * @opt_param string pageToken Optional. The value of next_page_token received
|
---|
160 | * from a previous `ListBackups` call. Provide this to retrieve the subsequent
|
---|
161 | * page in a multi-page list of results. When paginating, all other parameters
|
---|
162 | * provided to `ListBackups` must match the call that provided the page token.
|
---|
163 | * @return ListBackupsResponse
|
---|
164 | * @throws \Google\Service\Exception
|
---|
165 | */
|
---|
166 | public function listProjectsLocationsBackupPlansBackups($parent, $optParams = [])
|
---|
167 | {
|
---|
168 | $params = ['parent' => $parent];
|
---|
169 | $params = array_merge($params, $optParams);
|
---|
170 | return $this->call('list', [$params], ListBackupsResponse::class);
|
---|
171 | }
|
---|
172 | /**
|
---|
173 | * Update a Backup. (backups.patch)
|
---|
174 | *
|
---|
175 | * @param string $name Output only. The fully qualified name of the Backup.
|
---|
176 | * `projects/locations/backupPlans/backups`
|
---|
177 | * @param Backup $postBody
|
---|
178 | * @param array $optParams Optional parameters.
|
---|
179 | *
|
---|
180 | * @opt_param string updateMask Optional. This is used to specify the fields to
|
---|
181 | * be overwritten in the Backup targeted for update. The values for each of
|
---|
182 | * these updated fields will be taken from the `backup_plan` provided with this
|
---|
183 | * request. Field names are relative to the root of the resource. If no
|
---|
184 | * `update_mask` is provided, all fields in `backup` will be written to the
|
---|
185 | * target Backup resource. Note that OUTPUT_ONLY and IMMUTABLE fields in
|
---|
186 | * `backup` are ignored and are not used to update the target Backup.
|
---|
187 | * @return GoogleLongrunningOperation
|
---|
188 | * @throws \Google\Service\Exception
|
---|
189 | */
|
---|
190 | public function patch($name, Backup $postBody, $optParams = [])
|
---|
191 | {
|
---|
192 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
193 | $params = array_merge($params, $optParams);
|
---|
194 | return $this->call('patch', [$params], GoogleLongrunningOperation::class);
|
---|
195 | }
|
---|
196 | /**
|
---|
197 | * Sets the access control policy on the specified resource. Replaces any
|
---|
198 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
199 | * `PERMISSION_DENIED` errors. (backups.setIamPolicy)
|
---|
200 | *
|
---|
201 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
202 | * specified. See [Resource
|
---|
203 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
204 | * appropriate value for this field.
|
---|
205 | * @param SetIamPolicyRequest $postBody
|
---|
206 | * @param array $optParams Optional parameters.
|
---|
207 | * @return Policy
|
---|
208 | * @throws \Google\Service\Exception
|
---|
209 | */
|
---|
210 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
211 | {
|
---|
212 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
213 | $params = array_merge($params, $optParams);
|
---|
214 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
215 | }
|
---|
216 | /**
|
---|
217 | * Returns permissions that a caller has on the specified resource. If the
|
---|
218 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
219 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
220 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
221 | * This operation may "fail open" without warning. (backups.testIamPermissions)
|
---|
222 | *
|
---|
223 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
224 | * being requested. See [Resource
|
---|
225 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
226 | * appropriate value for this field.
|
---|
227 | * @param TestIamPermissionsRequest $postBody
|
---|
228 | * @param array $optParams Optional parameters.
|
---|
229 | * @return TestIamPermissionsResponse
|
---|
230 | * @throws \Google\Service\Exception
|
---|
231 | */
|
---|
232 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
233 | {
|
---|
234 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
235 | $params = array_merge($params, $optParams);
|
---|
236 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
237 | }
|
---|
238 | }
|
---|
239 |
|
---|
240 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
241 | class_alias(ProjectsLocationsBackupPlansBackups::class, 'Google_Service_BackupforGKE_Resource_ProjectsLocationsBackupPlansBackups');
|
---|