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\BigLakeService\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\BigLakeService\Database;
|
---|
21 | use Google\Service\BigLakeService\ListDatabasesResponse;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "databases" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $biglakeService = new Google\Service\BigLakeService(...);
|
---|
28 | * $databases = $biglakeService->projects_locations_catalogs_databases;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class ProjectsLocationsCatalogsDatabases extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Creates a new database. (databases.create)
|
---|
35 | *
|
---|
36 | * @param string $parent Required. The parent resource where this database will
|
---|
37 | * be created. Format:
|
---|
38 | * projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}
|
---|
39 | * @param Database $postBody
|
---|
40 | * @param array $optParams Optional parameters.
|
---|
41 | *
|
---|
42 | * @opt_param string databaseId Required. The ID to use for the database, which
|
---|
43 | * will become the final component of the database's resource name.
|
---|
44 | * @return Database
|
---|
45 | * @throws \Google\Service\Exception
|
---|
46 | */
|
---|
47 | public function create($parent, Database $postBody, $optParams = [])
|
---|
48 | {
|
---|
49 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
50 | $params = array_merge($params, $optParams);
|
---|
51 | return $this->call('create', [$params], Database::class);
|
---|
52 | }
|
---|
53 | /**
|
---|
54 | * Deletes an existing database specified by the database ID. (databases.delete)
|
---|
55 | *
|
---|
56 | * @param string $name Required. The name of the database to delete. Format: pro
|
---|
57 | * jects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/da
|
---|
58 | * tabases/{database_id}
|
---|
59 | * @param array $optParams Optional parameters.
|
---|
60 | * @return Database
|
---|
61 | * @throws \Google\Service\Exception
|
---|
62 | */
|
---|
63 | public function delete($name, $optParams = [])
|
---|
64 | {
|
---|
65 | $params = ['name' => $name];
|
---|
66 | $params = array_merge($params, $optParams);
|
---|
67 | return $this->call('delete', [$params], Database::class);
|
---|
68 | }
|
---|
69 | /**
|
---|
70 | * Gets the database specified by the resource name. (databases.get)
|
---|
71 | *
|
---|
72 | * @param string $name Required. The name of the database to retrieve. Format: p
|
---|
73 | * rojects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/
|
---|
74 | * databases/{database_id}
|
---|
75 | * @param array $optParams Optional parameters.
|
---|
76 | * @return Database
|
---|
77 | * @throws \Google\Service\Exception
|
---|
78 | */
|
---|
79 | public function get($name, $optParams = [])
|
---|
80 | {
|
---|
81 | $params = ['name' => $name];
|
---|
82 | $params = array_merge($params, $optParams);
|
---|
83 | return $this->call('get', [$params], Database::class);
|
---|
84 | }
|
---|
85 | /**
|
---|
86 | * List all databases in a specified catalog.
|
---|
87 | * (databases.listProjectsLocationsCatalogsDatabases)
|
---|
88 | *
|
---|
89 | * @param string $parent Required. The parent, which owns this collection of
|
---|
90 | * databases. Format:
|
---|
91 | * projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}
|
---|
92 | * @param array $optParams Optional parameters.
|
---|
93 | *
|
---|
94 | * @opt_param int pageSize The maximum number of databases to return. The
|
---|
95 | * service may return fewer than this value. If unspecified, at most 50
|
---|
96 | * databases will be returned. The maximum value is 1000; values above 1000 will
|
---|
97 | * be coerced to 1000.
|
---|
98 | * @opt_param string pageToken A page token, received from a previous
|
---|
99 | * `ListDatabases` call. Provide this to retrieve the subsequent page. When
|
---|
100 | * paginating, all other parameters provided to `ListDatabases` must match the
|
---|
101 | * call that provided the page token.
|
---|
102 | * @return ListDatabasesResponse
|
---|
103 | * @throws \Google\Service\Exception
|
---|
104 | */
|
---|
105 | public function listProjectsLocationsCatalogsDatabases($parent, $optParams = [])
|
---|
106 | {
|
---|
107 | $params = ['parent' => $parent];
|
---|
108 | $params = array_merge($params, $optParams);
|
---|
109 | return $this->call('list', [$params], ListDatabasesResponse::class);
|
---|
110 | }
|
---|
111 | /**
|
---|
112 | * Updates an existing database specified by the database ID. (databases.patch)
|
---|
113 | *
|
---|
114 | * @param string $name Output only. The resource name. Format: projects/{project
|
---|
115 | * _id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{datab
|
---|
116 | * ase_id}
|
---|
117 | * @param Database $postBody
|
---|
118 | * @param array $optParams Optional parameters.
|
---|
119 | *
|
---|
120 | * @opt_param string updateMask The list of fields to update. For the
|
---|
121 | * `FieldMask` definition, see https://developers.google.com/protocol-
|
---|
122 | * buffers/docs/reference/google.protobuf#fieldmask If not set, defaults to all
|
---|
123 | * of the fields that are allowed to update.
|
---|
124 | * @return Database
|
---|
125 | * @throws \Google\Service\Exception
|
---|
126 | */
|
---|
127 | public function patch($name, Database $postBody, $optParams = [])
|
---|
128 | {
|
---|
129 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
130 | $params = array_merge($params, $optParams);
|
---|
131 | return $this->call('patch', [$params], Database::class);
|
---|
132 | }
|
---|
133 | }
|
---|
134 |
|
---|
135 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
136 | class_alias(ProjectsLocationsCatalogsDatabases::class, 'Google_Service_BigLakeService_Resource_ProjectsLocationsCatalogsDatabases');
|
---|