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
18namespace Google\Service\DataCatalog\Resource;
19
20use Google\Service\DataCatalog\DatacatalogEmpty;
21use Google\Service\DataCatalog\GetIamPolicyRequest;
22use Google\Service\DataCatalog\GoogleCloudDatacatalogV1EntryGroup;
23use Google\Service\DataCatalog\GoogleCloudDatacatalogV1ListEntryGroupsResponse;
24use Google\Service\DataCatalog\Policy;
25use Google\Service\DataCatalog\SetIamPolicyRequest;
26use Google\Service\DataCatalog\TestIamPermissionsRequest;
27use 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->entryGroups;
35 *  </code>
36 */
37class 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   */
69  public function create($parent, GoogleCloudDatacatalogV1EntryGroup $postBody, $optParams = [])
70  {
71    $params = ['parent' => $parent, 'postBody' => $postBody];
72    $params = array_merge($params, $optParams);
73    return $this->call('create', [$params], GoogleCloudDatacatalogV1EntryGroup::class);
74  }
75  /**
76   * Deletes an entry group. You must enable the Data Catalog API in the project
77   * identified by the `name` parameter. For more information, see [Data Catalog
78   * resource project](https://cloud.google.com/data-catalog/docs/concepts
79   * /resource-project). (entryGroups.delete)
80   *
81   * @param string $name Required. The name of the entry group to delete.
82   * @param array $optParams Optional parameters.
83   *
84   * @opt_param bool force Optional. If true, deletes all entries in the entry
85   * group.
86   * @return DatacatalogEmpty
87   */
88  public function delete($name, $optParams = [])
89  {
90    $params = ['name' => $name];
91    $params = array_merge($params, $optParams);
92    return $this->call('delete', [$params], DatacatalogEmpty::class);
93  }
94  /**
95   * Gets an entry group. (entryGroups.get)
96   *
97   * @param string $name Required. The name of the entry group to get.
98   * @param array $optParams Optional parameters.
99   *
100   * @opt_param string readMask The fields to return. If empty or omitted, all
101   * fields are returned.
102   * @return GoogleCloudDatacatalogV1EntryGroup
103   */
104  public function get($name, $optParams = [])
105  {
106    $params = ['name' => $name];
107    $params = array_merge($params, $optParams);
108    return $this->call('get', [$params], GoogleCloudDatacatalogV1EntryGroup::class);
109  }
110  /**
111   * Gets the access control policy for a resource. May return: * A`NOT_FOUND`
112   * error if the resource doesn't exist or you don't have the permission to view
113   * it. * An empty policy if the resource exists but doesn't have a set policy.
114   * Supported resources are: - Tag templates - Entry groups Note: This method
115   * doesn't get policies from Google Cloud Platform resources ingested into Data
116   * Catalog. To call this method, you must have the following Google IAM
117   * permissions: - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag
118   * templates. - `datacatalog.entryGroups.getIamPolicy` to get policies on entry
119   * groups. (entryGroups.getIamPolicy)
120   *
121   * @param string $resource REQUIRED: The resource for which the policy is being
122   * requested. See the operation documentation for the appropriate value for this
123   * field.
124   * @param GetIamPolicyRequest $postBody
125   * @param array $optParams Optional parameters.
126   * @return Policy
127   */
128  public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
129  {
130    $params = ['resource' => $resource, 'postBody' => $postBody];
131    $params = array_merge($params, $optParams);
132    return $this->call('getIamPolicy', [$params], Policy::class);
133  }
134  /**
135   * Lists entry groups. (entryGroups.listProjectsLocationsEntryGroups)
136   *
137   * @param string $parent Required. The name of the location that contains the
138   * entry groups to list. Can be provided as a URL.
139   * @param array $optParams Optional parameters.
140   *
141   * @opt_param int pageSize Optional. The maximum number of items to return.
142   * Default is 10. Maximum limit is 1000. Throws an invalid argument if
143   * `page_size` is greater than 1000.
144   * @opt_param string pageToken Optional. Pagination token that specifies the
145   * next page to return. If empty, returns the first page.
146   * @return GoogleCloudDatacatalogV1ListEntryGroupsResponse
147   */
148  public function listProjectsLocationsEntryGroups($parent, $optParams = [])
149  {
150    $params = ['parent' => $parent];
151    $params = array_merge($params, $optParams);
152    return $this->call('list', [$params], GoogleCloudDatacatalogV1ListEntryGroupsResponse::class);
153  }
154  /**
155   * Updates an entry group. You must enable the Data Catalog API in the project
156   * identified by the `entry_group.name` parameter. For more information, see
157   * [Data Catalog resource project](https://cloud.google.com/data-
158   * catalog/docs/concepts/resource-project). (entryGroups.patch)
159   *
160   * @param string $name The resource name of the entry group in URL format. Note:
161   * The entry group itself and its child resources might not be stored in the
162   * location specified in its name.
163   * @param GoogleCloudDatacatalogV1EntryGroup $postBody
164   * @param array $optParams Optional parameters.
165   *
166   * @opt_param string updateMask Names of fields whose values to overwrite on an
167   * entry group. If this parameter is absent or empty, all modifiable fields are
168   * overwritten. If such fields are non-required and omitted in the request body,
169   * their values are emptied.
170   * @return GoogleCloudDatacatalogV1EntryGroup
171   */
172  public function patch($name, GoogleCloudDatacatalogV1EntryGroup $postBody, $optParams = [])
173  {
174    $params = ['name' => $name, 'postBody' => $postBody];
175    $params = array_merge($params, $optParams);
176    return $this->call('patch', [$params], GoogleCloudDatacatalogV1EntryGroup::class);
177  }
178  /**
179   * Sets an access control policy for a resource. Replaces any existing policy.
180   * Supported resources are: - Tag templates - Entry groups Note: This method
181   * sets policies only within Data Catalog and can't be used to manage policies
182   * in BigQuery, Pub/Sub, Dataproc Metastore, and any external Google Cloud
183   * Platform resources synced with the Data Catalog. To call this method, you
184   * must have the following Google IAM permissions: -
185   * `datacatalog.tagTemplates.setIamPolicy` to set policies on tag templates. -
186   * `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups.
187   * (entryGroups.setIamPolicy)
188   *
189   * @param string $resource REQUIRED: The resource for which the policy is being
190   * specified. See the operation documentation for the appropriate value for this
191   * field.
192   * @param SetIamPolicyRequest $postBody
193   * @param array $optParams Optional parameters.
194   * @return Policy
195   */
196  public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
197  {
198    $params = ['resource' => $resource, 'postBody' => $postBody];
199    $params = array_merge($params, $optParams);
200    return $this->call('setIamPolicy', [$params], Policy::class);
201  }
202  /**
203   * Gets your permissions on a resource. Returns an empty set of permissions if
204   * the resource doesn't exist. Supported resources are: - Tag templates - Entry
205   * groups Note: This method gets policies only within Data Catalog and can't be
206   * used to get policies from BigQuery, Pub/Sub, Dataproc Metastore, and any
207   * external Google Cloud Platform resources ingested into Data Catalog. No
208   * Google IAM permissions are required to call this method.
209   * (entryGroups.testIamPermissions)
210   *
211   * @param string $resource REQUIRED: The resource for which the policy detail is
212   * being requested. See the operation documentation for the appropriate value
213   * for this field.
214   * @param TestIamPermissionsRequest $postBody
215   * @param array $optParams Optional parameters.
216   * @return TestIamPermissionsResponse
217   */
218  public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
219  {
220    $params = ['resource' => $resource, 'postBody' => $postBody];
221    $params = array_merge($params, $optParams);
222    return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
223  }
224}
225
226// Adding a class alias for backwards compatibility with the previous class name.
227class_alias(ProjectsLocationsEntryGroups::class, 'Google_Service_DataCatalog_Resource_ProjectsLocationsEntryGroups');
228