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