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\GoogleLongrunningOperation;
|
---|
21 | use Google\Service\BackupforGKE\ListRestoresResponse;
|
---|
22 | use Google\Service\BackupforGKE\Policy;
|
---|
23 | use Google\Service\BackupforGKE\Restore;
|
---|
24 | use Google\Service\BackupforGKE\SetIamPolicyRequest;
|
---|
25 | use Google\Service\BackupforGKE\TestIamPermissionsRequest;
|
---|
26 | use Google\Service\BackupforGKE\TestIamPermissionsResponse;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "restores" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $gkebackupService = new Google\Service\BackupforGKE(...);
|
---|
33 | * $restores = $gkebackupService->projects_locations_restorePlans_restores;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class ProjectsLocationsRestorePlansRestores extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Creates a new Restore for the given RestorePlan. (restores.create)
|
---|
40 | *
|
---|
41 | * @param string $parent Required. The RestorePlan within which to create the
|
---|
42 | * Restore. Format: `projects/locations/restorePlans`
|
---|
43 | * @param Restore $postBody
|
---|
44 | * @param array $optParams Optional parameters.
|
---|
45 | *
|
---|
46 | * @opt_param string restoreId Required. The client-provided short name for the
|
---|
47 | * Restore resource. This name must: - be between 1 and 63 characters long
|
---|
48 | * (inclusive) - consist of only lower-case ASCII letters, numbers, and dashes -
|
---|
49 | * start with a lower-case letter - end with a lower-case letter or number - be
|
---|
50 | * unique within the set of Restores in this RestorePlan.
|
---|
51 | * @return GoogleLongrunningOperation
|
---|
52 | * @throws \Google\Service\Exception
|
---|
53 | */
|
---|
54 | public function create($parent, Restore $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 Restore. (restores.delete)
|
---|
62 | *
|
---|
63 | * @param string $name Required. Full name of the Restore Format:
|
---|
64 | * `projects/locations/restorePlans/restores`
|
---|
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 Restore's etag field or the request is rejected.
|
---|
69 | * @opt_param bool force Optional. If set to true, any VolumeRestores below this
|
---|
70 | * restore will also be deleted. Otherwise, the request will only succeed if the
|
---|
71 | * restore has no VolumeRestores.
|
---|
72 | * @return GoogleLongrunningOperation
|
---|
73 | * @throws \Google\Service\Exception
|
---|
74 | */
|
---|
75 | public function delete($name, $optParams = [])
|
---|
76 | {
|
---|
77 | $params = ['name' => $name];
|
---|
78 | $params = array_merge($params, $optParams);
|
---|
79 | return $this->call('delete', [$params], GoogleLongrunningOperation::class);
|
---|
80 | }
|
---|
81 | /**
|
---|
82 | * Retrieves the details of a single Restore. (restores.get)
|
---|
83 | *
|
---|
84 | * @param string $name Required. Name of the restore resource. Format:
|
---|
85 | * `projects/locations/restorePlans/restores`
|
---|
86 | * @param array $optParams Optional parameters.
|
---|
87 | * @return Restore
|
---|
88 | * @throws \Google\Service\Exception
|
---|
89 | */
|
---|
90 | public function get($name, $optParams = [])
|
---|
91 | {
|
---|
92 | $params = ['name' => $name];
|
---|
93 | $params = array_merge($params, $optParams);
|
---|
94 | return $this->call('get', [$params], Restore::class);
|
---|
95 | }
|
---|
96 | /**
|
---|
97 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
98 | * resource exists and does not have a policy set. (restores.getIamPolicy)
|
---|
99 | *
|
---|
100 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
101 | * requested. See [Resource
|
---|
102 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
103 | * appropriate value for this field.
|
---|
104 | * @param array $optParams Optional parameters.
|
---|
105 | *
|
---|
106 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
107 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
108 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
109 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
110 | * conditional role bindings may specify any valid value or leave the field
|
---|
111 | * unset. The policy in the response might use the policy version that you
|
---|
112 | * specified, or it might use a lower policy version. For example, if you
|
---|
113 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
114 | * response uses version 1. To learn which resources support conditions in their
|
---|
115 | * IAM policies, see the [IAM
|
---|
116 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
117 | * policies).
|
---|
118 | * @return Policy
|
---|
119 | * @throws \Google\Service\Exception
|
---|
120 | */
|
---|
121 | public function getIamPolicy($resource, $optParams = [])
|
---|
122 | {
|
---|
123 | $params = ['resource' => $resource];
|
---|
124 | $params = array_merge($params, $optParams);
|
---|
125 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
126 | }
|
---|
127 | /**
|
---|
128 | * Lists the Restores for a given RestorePlan.
|
---|
129 | * (restores.listProjectsLocationsRestorePlansRestores)
|
---|
130 | *
|
---|
131 | * @param string $parent Required. The RestorePlan that contains the Restores to
|
---|
132 | * list. Format: `projects/locations/restorePlans`
|
---|
133 | * @param array $optParams Optional parameters.
|
---|
134 | *
|
---|
135 | * @opt_param string filter Optional. Field match expression used to filter the
|
---|
136 | * results.
|
---|
137 | * @opt_param string orderBy Optional. Field by which to sort the results.
|
---|
138 | * @opt_param int pageSize Optional. The target number of results to return in a
|
---|
139 | * single response. If not specified, a default value will be chosen by the
|
---|
140 | * service. Note that the response may include a partial list and a caller
|
---|
141 | * should only rely on the response's next_page_token to determine if there are
|
---|
142 | * more instances left to be queried.
|
---|
143 | * @opt_param string pageToken Optional. The value of next_page_token received
|
---|
144 | * from a previous `ListRestores` call. Provide this to retrieve the subsequent
|
---|
145 | * page in a multi-page list of results. When paginating, all other parameters
|
---|
146 | * provided to `ListRestores` must match the call that provided the page token.
|
---|
147 | * @return ListRestoresResponse
|
---|
148 | * @throws \Google\Service\Exception
|
---|
149 | */
|
---|
150 | public function listProjectsLocationsRestorePlansRestores($parent, $optParams = [])
|
---|
151 | {
|
---|
152 | $params = ['parent' => $parent];
|
---|
153 | $params = array_merge($params, $optParams);
|
---|
154 | return $this->call('list', [$params], ListRestoresResponse::class);
|
---|
155 | }
|
---|
156 | /**
|
---|
157 | * Update a Restore. (restores.patch)
|
---|
158 | *
|
---|
159 | * @param string $name Output only. The full name of the Restore resource.
|
---|
160 | * Format: `projects/locations/restorePlans/restores`
|
---|
161 | * @param Restore $postBody
|
---|
162 | * @param array $optParams Optional parameters.
|
---|
163 | *
|
---|
164 | * @opt_param string updateMask Optional. This is used to specify the fields to
|
---|
165 | * be overwritten in the Restore targeted for update. The values for each of
|
---|
166 | * these updated fields will be taken from the `restore` provided with this
|
---|
167 | * request. Field names are relative to the root of the resource. If no
|
---|
168 | * `update_mask` is provided, all fields in `restore` will be written to the
|
---|
169 | * target Restore resource. Note that OUTPUT_ONLY and IMMUTABLE fields in
|
---|
170 | * `restore` are ignored and are not used to update the target Restore.
|
---|
171 | * @return GoogleLongrunningOperation
|
---|
172 | * @throws \Google\Service\Exception
|
---|
173 | */
|
---|
174 | public function patch($name, Restore $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. (restores.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. (restores.testIamPermissions)
|
---|
206 | *
|
---|
207 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
208 | * being requested. See [Resource
|
---|
209 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
210 | * appropriate value for this field.
|
---|
211 | * @param TestIamPermissionsRequest $postBody
|
---|
212 | * @param array $optParams Optional parameters.
|
---|
213 | * @return TestIamPermissionsResponse
|
---|
214 | * @throws \Google\Service\Exception
|
---|
215 | */
|
---|
216 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
217 | {
|
---|
218 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
219 | $params = array_merge($params, $optParams);
|
---|
220 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
221 | }
|
---|
222 | }
|
---|
223 |
|
---|
224 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
225 | class_alias(ProjectsLocationsRestorePlansRestores::class, 'Google_Service_BackupforGKE_Resource_ProjectsLocationsRestorePlansRestores');
|
---|