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\DataCatalog\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\DataCatalog\DatacatalogEmpty;
|
---|
21 | use Google\Service\DataCatalog\GetIamPolicyRequest;
|
---|
22 | use Google\Service\DataCatalog\GoogleCloudDatacatalogV1EntryGroup;
|
---|
23 | use Google\Service\DataCatalog\GoogleCloudDatacatalogV1ListEntryGroupsResponse;
|
---|
24 | use Google\Service\DataCatalog\Policy;
|
---|
25 | use Google\Service\DataCatalog\SetIamPolicyRequest;
|
---|
26 | use Google\Service\DataCatalog\TestIamPermissionsRequest;
|
---|
27 | use Google\Service\DataCatalog\TestIamPermissionsResponse;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * The "entryGroups" collection of methods.
|
---|
31 | * Typical usage is:
|
---|
32 | * <code>
|
---|
33 | * $datacatalogService = new Google\Service\DataCatalog(...);
|
---|
34 | * $entryGroups = $datacatalogService->projects_locations_entryGroups;
|
---|
35 | * </code>
|
---|
36 | */
|
---|
37 | class ProjectsLocationsEntryGroups extends \Google\Service\Resource
|
---|
38 | {
|
---|
39 | /**
|
---|
40 | * Creates an entry group. An entry group contains logically related entries
|
---|
41 | * together with [Cloud Identity and Access Management](/data-
|
---|
42 | * catalog/docs/concepts/iam) policies. These policies specify users who can
|
---|
43 | * create, edit, and view entries within entry groups. Data Catalog
|
---|
44 | * automatically creates entry groups with names that start with the `@` symbol
|
---|
45 | * for the following resources: * BigQuery entries (`@bigquery`) * Pub/Sub
|
---|
46 | * topics (`@pubsub`) * Dataproc Metastore services
|
---|
47 | * (`@dataproc_metastore_{SERVICE_NAME_HASH}`) You can create your own entry
|
---|
48 | * groups for Cloud Storage fileset entries and custom entries together with the
|
---|
49 | * corresponding IAM policies. User-created entry groups can't contain the `@`
|
---|
50 | * symbol, it is reserved for automatically created groups. Entry groups, like
|
---|
51 | * entries, can be searched. A maximum of 10,000 entry groups may be created per
|
---|
52 | * organization across all locations. You must enable the Data Catalog API in
|
---|
53 | * the project identified by the `parent` parameter. For more information, see
|
---|
54 | * [Data Catalog resource project](https://cloud.google.com/data-
|
---|
55 | * catalog/docs/concepts/resource-project). (entryGroups.create)
|
---|
56 | *
|
---|
57 | * @param string $parent Required. The names of the project and location that
|
---|
58 | * the new entry group belongs to. Note: The entry group itself and its child
|
---|
59 | * resources might not be stored in the location specified in its name.
|
---|
60 | * @param GoogleCloudDatacatalogV1EntryGroup $postBody
|
---|
61 | * @param array $optParams Optional parameters.
|
---|
62 | *
|
---|
63 | * @opt_param string entryGroupId Required. The ID of the entry group to create.
|
---|
64 | * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
|
---|
65 | * and must start with a letter or underscore. The maximum size is 64 bytes when
|
---|
66 | * encoded in UTF-8.
|
---|
67 | * @return GoogleCloudDatacatalogV1EntryGroup
|
---|
68 | * @throws \Google\Service\Exception
|
---|
69 | */
|
---|
70 | public function create($parent, GoogleCloudDatacatalogV1EntryGroup $postBody, $optParams = [])
|
---|
71 | {
|
---|
72 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
73 | $params = array_merge($params, $optParams);
|
---|
74 | return $this->call('create', [$params], GoogleCloudDatacatalogV1EntryGroup::class);
|
---|
75 | }
|
---|
76 | /**
|
---|
77 | * Deletes an entry group. You must enable the Data Catalog API in the project
|
---|
78 | * identified by the `name` parameter. For more information, see [Data Catalog
|
---|
79 | * resource project](https://cloud.google.com/data-
|
---|
80 | * catalog/docs/concepts/resource-project). (entryGroups.delete)
|
---|
81 | *
|
---|
82 | * @param string $name Required. The name of the entry group to delete.
|
---|
83 | * @param array $optParams Optional parameters.
|
---|
84 | *
|
---|
85 | * @opt_param bool force Optional. If true, deletes all entries in the entry
|
---|
86 | * group.
|
---|
87 | * @return DatacatalogEmpty
|
---|
88 | * @throws \Google\Service\Exception
|
---|
89 | */
|
---|
90 | public function delete($name, $optParams = [])
|
---|
91 | {
|
---|
92 | $params = ['name' => $name];
|
---|
93 | $params = array_merge($params, $optParams);
|
---|
94 | return $this->call('delete', [$params], DatacatalogEmpty::class);
|
---|
95 | }
|
---|
96 | /**
|
---|
97 | * Gets an entry group. (entryGroups.get)
|
---|
98 | *
|
---|
99 | * @param string $name Required. The name of the entry group to get.
|
---|
100 | * @param array $optParams Optional parameters.
|
---|
101 | *
|
---|
102 | * @opt_param string readMask The fields to return. If empty or omitted, all
|
---|
103 | * fields are returned.
|
---|
104 | * @return GoogleCloudDatacatalogV1EntryGroup
|
---|
105 | * @throws \Google\Service\Exception
|
---|
106 | */
|
---|
107 | public function get($name, $optParams = [])
|
---|
108 | {
|
---|
109 | $params = ['name' => $name];
|
---|
110 | $params = array_merge($params, $optParams);
|
---|
111 | return $this->call('get', [$params], GoogleCloudDatacatalogV1EntryGroup::class);
|
---|
112 | }
|
---|
113 | /**
|
---|
114 | * Gets the access control policy for a resource. May return: * A`NOT_FOUND`
|
---|
115 | * error if the resource doesn't exist or you don't have the permission to view
|
---|
116 | * it. * An empty policy if the resource exists but doesn't have a set policy.
|
---|
117 | * Supported resources are: - Tag templates - Entry groups Note: This method
|
---|
118 | * doesn't get policies from Google Cloud Platform resources ingested into Data
|
---|
119 | * Catalog. To call this method, you must have the following Google IAM
|
---|
120 | * permissions: - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag
|
---|
121 | * templates. - `datacatalog.entryGroups.getIamPolicy` to get policies on entry
|
---|
122 | * groups. (entryGroups.getIamPolicy)
|
---|
123 | *
|
---|
124 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
125 | * requested. See [Resource
|
---|
126 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
127 | * appropriate value for this field.
|
---|
128 | * @param GetIamPolicyRequest $postBody
|
---|
129 | * @param array $optParams Optional parameters.
|
---|
130 | * @return Policy
|
---|
131 | * @throws \Google\Service\Exception
|
---|
132 | */
|
---|
133 | public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
|
---|
134 | {
|
---|
135 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
136 | $params = array_merge($params, $optParams);
|
---|
137 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
138 | }
|
---|
139 | /**
|
---|
140 | * Lists entry groups. (entryGroups.listProjectsLocationsEntryGroups)
|
---|
141 | *
|
---|
142 | * @param string $parent Required. The name of the location that contains the
|
---|
143 | * entry groups to list. Can be provided as a URL.
|
---|
144 | * @param array $optParams Optional parameters.
|
---|
145 | *
|
---|
146 | * @opt_param int pageSize Optional. The maximum number of items to return.
|
---|
147 | * Default is 10. Maximum limit is 1000. Throws an invalid argument if
|
---|
148 | * `page_size` is greater than 1000.
|
---|
149 | * @opt_param string pageToken Optional. Pagination token that specifies the
|
---|
150 | * next page to return. If empty, returns the first page.
|
---|
151 | * @return GoogleCloudDatacatalogV1ListEntryGroupsResponse
|
---|
152 | * @throws \Google\Service\Exception
|
---|
153 | */
|
---|
154 | public function listProjectsLocationsEntryGroups($parent, $optParams = [])
|
---|
155 | {
|
---|
156 | $params = ['parent' => $parent];
|
---|
157 | $params = array_merge($params, $optParams);
|
---|
158 | return $this->call('list', [$params], GoogleCloudDatacatalogV1ListEntryGroupsResponse::class);
|
---|
159 | }
|
---|
160 | /**
|
---|
161 | * Updates an entry group. You must enable the Data Catalog API in the project
|
---|
162 | * identified by the `entry_group.name` parameter. For more information, see
|
---|
163 | * [Data Catalog resource project](https://cloud.google.com/data-
|
---|
164 | * catalog/docs/concepts/resource-project). (entryGroups.patch)
|
---|
165 | *
|
---|
166 | * @param string $name Identifier. The resource name of the entry group in URL
|
---|
167 | * format. Note: The entry group itself and its child resources might not be
|
---|
168 | * stored in the location specified in its name.
|
---|
169 | * @param GoogleCloudDatacatalogV1EntryGroup $postBody
|
---|
170 | * @param array $optParams Optional parameters.
|
---|
171 | *
|
---|
172 | * @opt_param string updateMask Names of fields whose values to overwrite on an
|
---|
173 | * entry group. If this parameter is absent or empty, all modifiable fields are
|
---|
174 | * overwritten. If such fields are non-required and omitted in the request body,
|
---|
175 | * their values are emptied.
|
---|
176 | * @return GoogleCloudDatacatalogV1EntryGroup
|
---|
177 | * @throws \Google\Service\Exception
|
---|
178 | */
|
---|
179 | public function patch($name, GoogleCloudDatacatalogV1EntryGroup $postBody, $optParams = [])
|
---|
180 | {
|
---|
181 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
182 | $params = array_merge($params, $optParams);
|
---|
183 | return $this->call('patch', [$params], GoogleCloudDatacatalogV1EntryGroup::class);
|
---|
184 | }
|
---|
185 | /**
|
---|
186 | * Sets an access control policy for a resource. Replaces any existing policy.
|
---|
187 | * Supported resources are: - Tag templates - Entry groups Note: This method
|
---|
188 | * sets policies only within Data Catalog and can't be used to manage policies
|
---|
189 | * in BigQuery, Pub/Sub, Dataproc Metastore, and any external Google Cloud
|
---|
190 | * Platform resources synced with the Data Catalog. To call this method, you
|
---|
191 | * must have the following Google IAM permissions: -
|
---|
192 | * `datacatalog.tagTemplates.setIamPolicy` to set policies on tag templates. -
|
---|
193 | * `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups.
|
---|
194 | * (entryGroups.setIamPolicy)
|
---|
195 | *
|
---|
196 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
197 | * specified. See [Resource
|
---|
198 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
199 | * appropriate value for this field.
|
---|
200 | * @param SetIamPolicyRequest $postBody
|
---|
201 | * @param array $optParams Optional parameters.
|
---|
202 | * @return Policy
|
---|
203 | * @throws \Google\Service\Exception
|
---|
204 | */
|
---|
205 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
206 | {
|
---|
207 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
208 | $params = array_merge($params, $optParams);
|
---|
209 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
210 | }
|
---|
211 | /**
|
---|
212 | * Gets your permissions on a resource. Returns an empty set of permissions if
|
---|
213 | * the resource doesn't exist. Supported resources are: - Tag templates - Entry
|
---|
214 | * groups Note: This method gets policies only within Data Catalog and can't be
|
---|
215 | * used to get policies from BigQuery, Pub/Sub, Dataproc Metastore, and any
|
---|
216 | * external Google Cloud Platform resources ingested into Data Catalog. No
|
---|
217 | * Google IAM permissions are required to call this method.
|
---|
218 | * (entryGroups.testIamPermissions)
|
---|
219 | *
|
---|
220 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
221 | * being requested. See [Resource
|
---|
222 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
223 | * appropriate value for this field.
|
---|
224 | * @param TestIamPermissionsRequest $postBody
|
---|
225 | * @param array $optParams Optional parameters.
|
---|
226 | * @return TestIamPermissionsResponse
|
---|
227 | * @throws \Google\Service\Exception
|
---|
228 | */
|
---|
229 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
230 | {
|
---|
231 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
232 | $params = array_merge($params, $optParams);
|
---|
233 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
234 | }
|
---|
235 | }
|
---|
236 |
|
---|
237 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
238 | class_alias(ProjectsLocationsEntryGroups::class, 'Google_Service_DataCatalog_Resource_ProjectsLocationsEntryGroups');
|
---|