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\BigtableAdmin\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\BigtableAdmin\BigtableadminEmpty;
|
---|
21 | use Google\Service\BigtableAdmin\CheckConsistencyRequest;
|
---|
22 | use Google\Service\BigtableAdmin\CheckConsistencyResponse;
|
---|
23 | use Google\Service\BigtableAdmin\CreateTableRequest;
|
---|
24 | use Google\Service\BigtableAdmin\DropRowRangeRequest;
|
---|
25 | use Google\Service\BigtableAdmin\GenerateConsistencyTokenRequest;
|
---|
26 | use Google\Service\BigtableAdmin\GenerateConsistencyTokenResponse;
|
---|
27 | use Google\Service\BigtableAdmin\GetIamPolicyRequest;
|
---|
28 | use Google\Service\BigtableAdmin\ListTablesResponse;
|
---|
29 | use Google\Service\BigtableAdmin\ModifyColumnFamiliesRequest;
|
---|
30 | use Google\Service\BigtableAdmin\Operation;
|
---|
31 | use Google\Service\BigtableAdmin\Policy;
|
---|
32 | use Google\Service\BigtableAdmin\RestoreTableRequest;
|
---|
33 | use Google\Service\BigtableAdmin\SetIamPolicyRequest;
|
---|
34 | use Google\Service\BigtableAdmin\Table;
|
---|
35 | use Google\Service\BigtableAdmin\TestIamPermissionsRequest;
|
---|
36 | use Google\Service\BigtableAdmin\TestIamPermissionsResponse;
|
---|
37 | use Google\Service\BigtableAdmin\UndeleteTableRequest;
|
---|
38 |
|
---|
39 | /**
|
---|
40 | * The "tables" collection of methods.
|
---|
41 | * Typical usage is:
|
---|
42 | * <code>
|
---|
43 | * $bigtableadminService = new Google\Service\BigtableAdmin(...);
|
---|
44 | * $tables = $bigtableadminService->projects_instances_tables;
|
---|
45 | * </code>
|
---|
46 | */
|
---|
47 | class ProjectsInstancesTables extends \Google\Service\Resource
|
---|
48 | {
|
---|
49 | /**
|
---|
50 | * Checks replication consistency based on a consistency token, that is, if
|
---|
51 | * replication has caught up based on the conditions specified in the token and
|
---|
52 | * the check request. (tables.checkConsistency)
|
---|
53 | *
|
---|
54 | * @param string $name Required. The unique name of the Table for which to check
|
---|
55 | * replication consistency. Values are of the form
|
---|
56 | * `projects/{project}/instances/{instance}/tables/{table}`.
|
---|
57 | * @param CheckConsistencyRequest $postBody
|
---|
58 | * @param array $optParams Optional parameters.
|
---|
59 | * @return CheckConsistencyResponse
|
---|
60 | * @throws \Google\Service\Exception
|
---|
61 | */
|
---|
62 | public function checkConsistency($name, CheckConsistencyRequest $postBody, $optParams = [])
|
---|
63 | {
|
---|
64 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
65 | $params = array_merge($params, $optParams);
|
---|
66 | return $this->call('checkConsistency', [$params], CheckConsistencyResponse::class);
|
---|
67 | }
|
---|
68 | /**
|
---|
69 | * Creates a new table in the specified instance. The table can be created with
|
---|
70 | * a full set of initial column families, specified in the request.
|
---|
71 | * (tables.create)
|
---|
72 | *
|
---|
73 | * @param string $parent Required. The unique name of the instance in which to
|
---|
74 | * create the table. Values are of the form
|
---|
75 | * `projects/{project}/instances/{instance}`.
|
---|
76 | * @param CreateTableRequest $postBody
|
---|
77 | * @param array $optParams Optional parameters.
|
---|
78 | * @return Table
|
---|
79 | * @throws \Google\Service\Exception
|
---|
80 | */
|
---|
81 | public function create($parent, CreateTableRequest $postBody, $optParams = [])
|
---|
82 | {
|
---|
83 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
84 | $params = array_merge($params, $optParams);
|
---|
85 | return $this->call('create', [$params], Table::class);
|
---|
86 | }
|
---|
87 | /**
|
---|
88 | * Permanently deletes a specified table and all of its data. (tables.delete)
|
---|
89 | *
|
---|
90 | * @param string $name Required. The unique name of the table to be deleted.
|
---|
91 | * Values are of the form
|
---|
92 | * `projects/{project}/instances/{instance}/tables/{table}`.
|
---|
93 | * @param array $optParams Optional parameters.
|
---|
94 | * @return BigtableadminEmpty
|
---|
95 | * @throws \Google\Service\Exception
|
---|
96 | */
|
---|
97 | public function delete($name, $optParams = [])
|
---|
98 | {
|
---|
99 | $params = ['name' => $name];
|
---|
100 | $params = array_merge($params, $optParams);
|
---|
101 | return $this->call('delete', [$params], BigtableadminEmpty::class);
|
---|
102 | }
|
---|
103 | /**
|
---|
104 | * Permanently drop/delete a row range from a specified table. The request can
|
---|
105 | * specify whether to delete all rows in a table, or only those that match a
|
---|
106 | * particular prefix. Note that row key prefixes used here are treated as
|
---|
107 | * service data. For more information about how service data is handled, see the
|
---|
108 | * [Google Cloud Privacy Notice](https://cloud.google.com/terms/cloud-privacy-
|
---|
109 | * notice). (tables.dropRowRange)
|
---|
110 | *
|
---|
111 | * @param string $name Required. The unique name of the table on which to drop a
|
---|
112 | * range of rows. Values are of the form
|
---|
113 | * `projects/{project}/instances/{instance}/tables/{table}`.
|
---|
114 | * @param DropRowRangeRequest $postBody
|
---|
115 | * @param array $optParams Optional parameters.
|
---|
116 | * @return BigtableadminEmpty
|
---|
117 | * @throws \Google\Service\Exception
|
---|
118 | */
|
---|
119 | public function dropRowRange($name, DropRowRangeRequest $postBody, $optParams = [])
|
---|
120 | {
|
---|
121 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
122 | $params = array_merge($params, $optParams);
|
---|
123 | return $this->call('dropRowRange', [$params], BigtableadminEmpty::class);
|
---|
124 | }
|
---|
125 | /**
|
---|
126 | * Generates a consistency token for a Table, which can be used in
|
---|
127 | * CheckConsistency to check whether mutations to the table that finished before
|
---|
128 | * this call started have been replicated. The tokens will be available for 90
|
---|
129 | * days. (tables.generateConsistencyToken)
|
---|
130 | *
|
---|
131 | * @param string $name Required. The unique name of the Table for which to
|
---|
132 | * create a consistency token. Values are of the form
|
---|
133 | * `projects/{project}/instances/{instance}/tables/{table}`.
|
---|
134 | * @param GenerateConsistencyTokenRequest $postBody
|
---|
135 | * @param array $optParams Optional parameters.
|
---|
136 | * @return GenerateConsistencyTokenResponse
|
---|
137 | * @throws \Google\Service\Exception
|
---|
138 | */
|
---|
139 | public function generateConsistencyToken($name, GenerateConsistencyTokenRequest $postBody, $optParams = [])
|
---|
140 | {
|
---|
141 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
142 | $params = array_merge($params, $optParams);
|
---|
143 | return $this->call('generateConsistencyToken', [$params], GenerateConsistencyTokenResponse::class);
|
---|
144 | }
|
---|
145 | /**
|
---|
146 | * Gets metadata information about the specified table. (tables.get)
|
---|
147 | *
|
---|
148 | * @param string $name Required. The unique name of the requested table. Values
|
---|
149 | * are of the form `projects/{project}/instances/{instance}/tables/{table}`.
|
---|
150 | * @param array $optParams Optional parameters.
|
---|
151 | *
|
---|
152 | * @opt_param string view The view to be applied to the returned table's fields.
|
---|
153 | * Defaults to `SCHEMA_VIEW` if unspecified.
|
---|
154 | * @return Table
|
---|
155 | * @throws \Google\Service\Exception
|
---|
156 | */
|
---|
157 | public function get($name, $optParams = [])
|
---|
158 | {
|
---|
159 | $params = ['name' => $name];
|
---|
160 | $params = array_merge($params, $optParams);
|
---|
161 | return $this->call('get', [$params], Table::class);
|
---|
162 | }
|
---|
163 | /**
|
---|
164 | * Gets the access control policy for a Bigtable resource. Returns an empty
|
---|
165 | * policy if the resource exists but does not have a policy set.
|
---|
166 | * (tables.getIamPolicy)
|
---|
167 | *
|
---|
168 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
169 | * requested. See [Resource
|
---|
170 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
171 | * appropriate value for this field.
|
---|
172 | * @param GetIamPolicyRequest $postBody
|
---|
173 | * @param array $optParams Optional parameters.
|
---|
174 | * @return Policy
|
---|
175 | * @throws \Google\Service\Exception
|
---|
176 | */
|
---|
177 | public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
|
---|
178 | {
|
---|
179 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
180 | $params = array_merge($params, $optParams);
|
---|
181 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
182 | }
|
---|
183 | /**
|
---|
184 | * Lists all tables served from a specified instance.
|
---|
185 | * (tables.listProjectsInstancesTables)
|
---|
186 | *
|
---|
187 | * @param string $parent Required. The unique name of the instance for which
|
---|
188 | * tables should be listed. Values are of the form
|
---|
189 | * `projects/{project}/instances/{instance}`.
|
---|
190 | * @param array $optParams Optional parameters.
|
---|
191 | *
|
---|
192 | * @opt_param int pageSize Maximum number of results per page. A page_size of
|
---|
193 | * zero lets the server choose the number of items to return. A page_size which
|
---|
194 | * is strictly positive will return at most that many items. A negative
|
---|
195 | * page_size will cause an error. Following the first request, subsequent
|
---|
196 | * paginated calls are not required to pass a page_size. If a page_size is set
|
---|
197 | * in subsequent calls, it must match the page_size given in the first request.
|
---|
198 | * @opt_param string pageToken The value of `next_page_token` returned by a
|
---|
199 | * previous call.
|
---|
200 | * @opt_param string view The view to be applied to the returned tables' fields.
|
---|
201 | * Only NAME_ONLY view (default), REPLICATION_VIEW and ENCRYPTION_VIEW are
|
---|
202 | * supported.
|
---|
203 | * @return ListTablesResponse
|
---|
204 | * @throws \Google\Service\Exception
|
---|
205 | */
|
---|
206 | public function listProjectsInstancesTables($parent, $optParams = [])
|
---|
207 | {
|
---|
208 | $params = ['parent' => $parent];
|
---|
209 | $params = array_merge($params, $optParams);
|
---|
210 | return $this->call('list', [$params], ListTablesResponse::class);
|
---|
211 | }
|
---|
212 | /**
|
---|
213 | * Performs a series of column family modifications on the specified table.
|
---|
214 | * Either all or none of the modifications will occur before this method
|
---|
215 | * returns, but data requests received prior to that point may see a table where
|
---|
216 | * only some modifications have taken effect. (tables.modifyColumnFamilies)
|
---|
217 | *
|
---|
218 | * @param string $name Required. The unique name of the table whose families
|
---|
219 | * should be modified. Values are of the form
|
---|
220 | * `projects/{project}/instances/{instance}/tables/{table}`.
|
---|
221 | * @param ModifyColumnFamiliesRequest $postBody
|
---|
222 | * @param array $optParams Optional parameters.
|
---|
223 | * @return Table
|
---|
224 | * @throws \Google\Service\Exception
|
---|
225 | */
|
---|
226 | public function modifyColumnFamilies($name, ModifyColumnFamiliesRequest $postBody, $optParams = [])
|
---|
227 | {
|
---|
228 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
229 | $params = array_merge($params, $optParams);
|
---|
230 | return $this->call('modifyColumnFamilies', [$params], Table::class);
|
---|
231 | }
|
---|
232 | /**
|
---|
233 | * Updates a specified table. (tables.patch)
|
---|
234 | *
|
---|
235 | * @param string $name The unique name of the table. Values are of the form
|
---|
236 | * `projects/{project}/instances/{instance}/tables/_a-zA-Z0-9*`. Views:
|
---|
237 | * `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `STATS_VIEW`, `FULL`
|
---|
238 | * @param Table $postBody
|
---|
239 | * @param array $optParams Optional parameters.
|
---|
240 | *
|
---|
241 | * @opt_param string updateMask Required. The list of fields to update. A mask
|
---|
242 | * specifying which fields (e.g. `change_stream_config`) in the `table` field
|
---|
243 | * should be updated. This mask is relative to the `table` field, not to the
|
---|
244 | * request message. The wildcard (*) path is currently not supported. Currently
|
---|
245 | * UpdateTable is only supported for the following fields: *
|
---|
246 | * `change_stream_config` * `change_stream_config.retention_period` *
|
---|
247 | * `deletion_protection` If `column_families` is set in `update_mask`, it will
|
---|
248 | * return an UNIMPLEMENTED error.
|
---|
249 | * @return Operation
|
---|
250 | * @throws \Google\Service\Exception
|
---|
251 | */
|
---|
252 | public function patch($name, Table $postBody, $optParams = [])
|
---|
253 | {
|
---|
254 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
255 | $params = array_merge($params, $optParams);
|
---|
256 | return $this->call('patch', [$params], Operation::class);
|
---|
257 | }
|
---|
258 | /**
|
---|
259 | * Create a new table by restoring from a completed backup. The returned table
|
---|
260 | * long-running operation can be used to track the progress of the operation,
|
---|
261 | * and to cancel it. The metadata field type is RestoreTableMetadata. The
|
---|
262 | * response type is Table, if successful. (tables.restore)
|
---|
263 | *
|
---|
264 | * @param string $parent Required. The name of the instance in which to create
|
---|
265 | * the restored table. Values are of the form `projects//instances/`.
|
---|
266 | * @param RestoreTableRequest $postBody
|
---|
267 | * @param array $optParams Optional parameters.
|
---|
268 | * @return Operation
|
---|
269 | * @throws \Google\Service\Exception
|
---|
270 | */
|
---|
271 | public function restore($parent, RestoreTableRequest $postBody, $optParams = [])
|
---|
272 | {
|
---|
273 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
274 | $params = array_merge($params, $optParams);
|
---|
275 | return $this->call('restore', [$params], Operation::class);
|
---|
276 | }
|
---|
277 | /**
|
---|
278 | * Sets the access control policy on a Bigtable resource. Replaces any existing
|
---|
279 | * policy. (tables.setIamPolicy)
|
---|
280 | *
|
---|
281 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
282 | * specified. See [Resource
|
---|
283 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
284 | * appropriate value for this field.
|
---|
285 | * @param SetIamPolicyRequest $postBody
|
---|
286 | * @param array $optParams Optional parameters.
|
---|
287 | * @return Policy
|
---|
288 | * @throws \Google\Service\Exception
|
---|
289 | */
|
---|
290 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
291 | {
|
---|
292 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
293 | $params = array_merge($params, $optParams);
|
---|
294 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
295 | }
|
---|
296 | /**
|
---|
297 | * Returns permissions that the caller has on the specified Bigtable resource.
|
---|
298 | * (tables.testIamPermissions)
|
---|
299 | *
|
---|
300 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
301 | * being requested. See [Resource
|
---|
302 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
303 | * appropriate value for this field.
|
---|
304 | * @param TestIamPermissionsRequest $postBody
|
---|
305 | * @param array $optParams Optional parameters.
|
---|
306 | * @return TestIamPermissionsResponse
|
---|
307 | * @throws \Google\Service\Exception
|
---|
308 | */
|
---|
309 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
310 | {
|
---|
311 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
312 | $params = array_merge($params, $optParams);
|
---|
313 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
314 | }
|
---|
315 | /**
|
---|
316 | * Restores a specified table which was accidentally deleted. (tables.undelete)
|
---|
317 | *
|
---|
318 | * @param string $name Required. The unique name of the table to be restored.
|
---|
319 | * Values are of the form
|
---|
320 | * `projects/{project}/instances/{instance}/tables/{table}`.
|
---|
321 | * @param UndeleteTableRequest $postBody
|
---|
322 | * @param array $optParams Optional parameters.
|
---|
323 | * @return Operation
|
---|
324 | * @throws \Google\Service\Exception
|
---|
325 | */
|
---|
326 | public function undelete($name, UndeleteTableRequest $postBody, $optParams = [])
|
---|
327 | {
|
---|
328 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
329 | $params = array_merge($params, $optParams);
|
---|
330 | return $this->call('undelete', [$params], Operation::class);
|
---|
331 | }
|
---|
332 | }
|
---|
333 |
|
---|
334 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
335 | class_alias(ProjectsInstancesTables::class, 'Google_Service_BigtableAdmin_Resource_ProjectsInstancesTables');
|
---|