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\DataprocMetastore\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\DataprocMetastore\Backup;
|
---|
21 | use Google\Service\DataprocMetastore\ListBackupsResponse;
|
---|
22 | use Google\Service\DataprocMetastore\Operation;
|
---|
23 | use Google\Service\DataprocMetastore\Policy;
|
---|
24 | use Google\Service\DataprocMetastore\SetIamPolicyRequest;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "backups" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $metastoreService = new Google\Service\DataprocMetastore(...);
|
---|
31 | * $backups = $metastoreService->projects_locations_services_backups;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class ProjectsLocationsServicesBackups extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Creates a new backup in a given project and location. (backups.create)
|
---|
38 | *
|
---|
39 | * @param string $parent Required. The relative resource name of the service in
|
---|
40 | * which to create a backup of the following
|
---|
41 | * form:projects/{project_number}/locations/{location_id}/services/{service_id}.
|
---|
42 | * @param Backup $postBody
|
---|
43 | * @param array $optParams Optional parameters.
|
---|
44 | *
|
---|
45 | * @opt_param string backupId Required. The ID of the backup, which is used as
|
---|
46 | * the final component of the backup's name.This value must be between 1 and 64
|
---|
47 | * characters long, begin with a letter, end with a letter or number, and
|
---|
48 | * consist of alpha-numeric ASCII characters or hyphens.
|
---|
49 | * @opt_param string requestId Optional. A request ID. Specify a unique request
|
---|
50 | * ID to allow the server to ignore the request if it has completed. The server
|
---|
51 | * will ignore subsequent requests that provide a duplicate request ID for at
|
---|
52 | * least 60 minutes after the first request.For example, if an initial request
|
---|
53 | * times out, followed by another request with the same request ID, the server
|
---|
54 | * ignores the second request to prevent the creation of duplicate
|
---|
55 | * commitments.The request ID must be a valid UUID
|
---|
56 | * (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero
|
---|
57 | * UUID (00000000-0000-0000-0000-000000000000) is not supported.
|
---|
58 | * @return Operation
|
---|
59 | * @throws \Google\Service\Exception
|
---|
60 | */
|
---|
61 | public function create($parent, Backup $postBody, $optParams = [])
|
---|
62 | {
|
---|
63 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
64 | $params = array_merge($params, $optParams);
|
---|
65 | return $this->call('create', [$params], Operation::class);
|
---|
66 | }
|
---|
67 | /**
|
---|
68 | * Deletes a single backup. (backups.delete)
|
---|
69 | *
|
---|
70 | * @param string $name Required. The relative resource name of the backup to
|
---|
71 | * delete, in the following form:projects/{project_number}/locations/{location_i
|
---|
72 | * d}/services/{service_id}/backups/{backup_id}.
|
---|
73 | * @param array $optParams Optional parameters.
|
---|
74 | *
|
---|
75 | * @opt_param string requestId Optional. A request ID. Specify a unique request
|
---|
76 | * ID to allow the server to ignore the request if it has completed. The server
|
---|
77 | * will ignore subsequent requests that provide a duplicate request ID for at
|
---|
78 | * least 60 minutes after the first request.For example, if an initial request
|
---|
79 | * times out, followed by another request with the same request ID, the server
|
---|
80 | * ignores the second request to prevent the creation of duplicate
|
---|
81 | * commitments.The request ID must be a valid UUID
|
---|
82 | * (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero
|
---|
83 | * UUID (00000000-0000-0000-0000-000000000000) is not supported.
|
---|
84 | * @return Operation
|
---|
85 | * @throws \Google\Service\Exception
|
---|
86 | */
|
---|
87 | public function delete($name, $optParams = [])
|
---|
88 | {
|
---|
89 | $params = ['name' => $name];
|
---|
90 | $params = array_merge($params, $optParams);
|
---|
91 | return $this->call('delete', [$params], Operation::class);
|
---|
92 | }
|
---|
93 | /**
|
---|
94 | * Gets details of a single backup. (backups.get)
|
---|
95 | *
|
---|
96 | * @param string $name Required. The relative resource name of the backup to
|
---|
97 | * retrieve, in the following form:projects/{project_number}/locations/{location
|
---|
98 | * _id}/services/{service_id}/backups/{backup_id}.
|
---|
99 | * @param array $optParams Optional parameters.
|
---|
100 | * @return Backup
|
---|
101 | * @throws \Google\Service\Exception
|
---|
102 | */
|
---|
103 | public function get($name, $optParams = [])
|
---|
104 | {
|
---|
105 | $params = ['name' => $name];
|
---|
106 | $params = array_merge($params, $optParams);
|
---|
107 | return $this->call('get', [$params], Backup::class);
|
---|
108 | }
|
---|
109 | /**
|
---|
110 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
111 | * resource exists and does not have a policy set. (backups.getIamPolicy)
|
---|
112 | *
|
---|
113 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
114 | * requested. See Resource names
|
---|
115 | * (https://cloud.google.com/apis/design/resource_names) for the appropriate
|
---|
116 | * value for this field.
|
---|
117 | * @param array $optParams Optional parameters.
|
---|
118 | *
|
---|
119 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
120 | * version that will be used to format the policy.Valid values are 0, 1, and 3.
|
---|
121 | * Requests specifying an invalid value will be rejected.Requests for policies
|
---|
122 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
123 | * conditional role bindings may specify any valid value or leave the field
|
---|
124 | * unset.The policy in the response might use the policy version that you
|
---|
125 | * specified, or it might use a lower policy version. For example, if you
|
---|
126 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
127 | * response uses version 1.To learn which resources support conditions in their
|
---|
128 | * IAM policies, see the IAM documentation
|
---|
129 | * (https://cloud.google.com/iam/help/conditions/resource-policies).
|
---|
130 | * @return Policy
|
---|
131 | * @throws \Google\Service\Exception
|
---|
132 | */
|
---|
133 | public function getIamPolicy($resource, $optParams = [])
|
---|
134 | {
|
---|
135 | $params = ['resource' => $resource];
|
---|
136 | $params = array_merge($params, $optParams);
|
---|
137 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
138 | }
|
---|
139 | /**
|
---|
140 | * Lists backups in a service. (backups.listProjectsLocationsServicesBackups)
|
---|
141 | *
|
---|
142 | * @param string $parent Required. The relative resource name of the service
|
---|
143 | * whose backups to list, in the following form:projects/{project_number}/locati
|
---|
144 | * ons/{location_id}/services/{service_id}/backups.
|
---|
145 | * @param array $optParams Optional parameters.
|
---|
146 | *
|
---|
147 | * @opt_param string filter Optional. The filter to apply to list results.
|
---|
148 | * @opt_param string orderBy Optional. Specify the ordering of results as
|
---|
149 | * described in Sorting Order
|
---|
150 | * (https://cloud.google.com/apis/design/design_patterns#sorting_order). If not
|
---|
151 | * specified, the results will be sorted in the default order.
|
---|
152 | * @opt_param int pageSize Optional. The maximum number of backups to return.
|
---|
153 | * The response may contain less than the maximum number. If unspecified, no
|
---|
154 | * more than 500 backups are returned. The maximum value is 1000; values above
|
---|
155 | * 1000 are changed to 1000.
|
---|
156 | * @opt_param string pageToken Optional. A page token, received from a previous
|
---|
157 | * DataprocMetastore.ListBackups call. Provide this token to retrieve the
|
---|
158 | * subsequent page.To retrieve the first page, supply an empty page token.When
|
---|
159 | * paginating, other parameters provided to DataprocMetastore.ListBackups must
|
---|
160 | * match the call that provided the page token.
|
---|
161 | * @return ListBackupsResponse
|
---|
162 | * @throws \Google\Service\Exception
|
---|
163 | */
|
---|
164 | public function listProjectsLocationsServicesBackups($parent, $optParams = [])
|
---|
165 | {
|
---|
166 | $params = ['parent' => $parent];
|
---|
167 | $params = array_merge($params, $optParams);
|
---|
168 | return $this->call('list', [$params], ListBackupsResponse::class);
|
---|
169 | }
|
---|
170 | /**
|
---|
171 | * Sets the access control policy on the specified resource. Replaces any
|
---|
172 | * existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
|
---|
173 | * errors. (backups.setIamPolicy)
|
---|
174 | *
|
---|
175 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
176 | * specified. See Resource names
|
---|
177 | * (https://cloud.google.com/apis/design/resource_names) for the appropriate
|
---|
178 | * value for this field.
|
---|
179 | * @param SetIamPolicyRequest $postBody
|
---|
180 | * @param array $optParams Optional parameters.
|
---|
181 | * @return Policy
|
---|
182 | * @throws \Google\Service\Exception
|
---|
183 | */
|
---|
184 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
185 | {
|
---|
186 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
187 | $params = array_merge($params, $optParams);
|
---|
188 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
189 | }
|
---|
190 | }
|
---|
191 |
|
---|
192 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
193 | class_alias(ProjectsLocationsServicesBackups::class, 'Google_Service_DataprocMetastore_Resource_ProjectsLocationsServicesBackups');
|
---|