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\GoogleCloudDatacatalogV1Contacts;
23use Google\Service\DataCatalog\GoogleCloudDatacatalogV1Entry;
24use Google\Service\DataCatalog\GoogleCloudDatacatalogV1EntryOverview;
25use Google\Service\DataCatalog\GoogleCloudDatacatalogV1ListEntriesResponse;
26use Google\Service\DataCatalog\GoogleCloudDatacatalogV1ModifyEntryContactsRequest;
27use Google\Service\DataCatalog\GoogleCloudDatacatalogV1ModifyEntryOverviewRequest;
28use Google\Service\DataCatalog\GoogleCloudDatacatalogV1StarEntryRequest;
29use Google\Service\DataCatalog\GoogleCloudDatacatalogV1StarEntryResponse;
30use Google\Service\DataCatalog\GoogleCloudDatacatalogV1UnstarEntryRequest;
31use Google\Service\DataCatalog\GoogleCloudDatacatalogV1UnstarEntryResponse;
32use Google\Service\DataCatalog\Policy;
33use Google\Service\DataCatalog\TestIamPermissionsRequest;
34use Google\Service\DataCatalog\TestIamPermissionsResponse;
35
36/**
37 * The "entries" collection of methods.
38 * Typical usage is:
39 *  <code>
40 *   $datacatalogService = new Google\Service\DataCatalog(...);
41 *   $entries = $datacatalogService->entries;
42 *  </code>
43 */
44class ProjectsLocationsEntryGroupsEntries extends \Google\Service\Resource
45{
46  /**
47   * Creates an entry. You can create entries only with 'FILESET', 'CLUSTER',
48   * 'DATA_STREAM', or custom types. Data Catalog automatically creates entries
49   * with other types during metadata ingestion from integrated systems. You must
50   * enable the Data Catalog API in the project identified by the `parent`
51   * parameter. For more information, see [Data Catalog resource
52   * project](https://cloud.google.com/data-catalog/docs/concepts/resource-
53   * project). An entry group can have a maximum of 100,000 entries.
54   * (entries.create)
55   *
56   * @param string $parent Required. The name of the entry group this entry
57   * belongs to. Note: The entry itself and its child resources might not be
58   * stored in the location specified in its name.
59   * @param GoogleCloudDatacatalogV1Entry $postBody
60   * @param array $optParams Optional parameters.
61   *
62   * @opt_param string entryId Required. The ID of the entry to create. The ID
63   * must contain only letters (a-z, A-Z), numbers (0-9), and underscores (_). The
64   * maximum size is 64 bytes when encoded in UTF-8.
65   * @return GoogleCloudDatacatalogV1Entry
66   */
67  public function create($parent, GoogleCloudDatacatalogV1Entry $postBody, $optParams = [])
68  {
69    $params = ['parent' => $parent, 'postBody' => $postBody];
70    $params = array_merge($params, $optParams);
71    return $this->call('create', [$params], GoogleCloudDatacatalogV1Entry::class);
72  }
73  /**
74   * Deletes an existing entry. You can delete only the entries created by the
75   * CreateEntry method. You must enable the Data Catalog API in the project
76   * identified by the `name` parameter. For more information, see [Data Catalog
77   * resource project](https://cloud.google.com/data-catalog/docs/concepts
78   * /resource-project). (entries.delete)
79   *
80   * @param string $name Required. The name of the entry to delete.
81   * @param array $optParams Optional parameters.
82   * @return DatacatalogEmpty
83   */
84  public function delete($name, $optParams = [])
85  {
86    $params = ['name' => $name];
87    $params = array_merge($params, $optParams);
88    return $this->call('delete', [$params], DatacatalogEmpty::class);
89  }
90  /**
91   * Gets an entry. (entries.get)
92   *
93   * @param string $name Required. The name of the entry to get.
94   * @param array $optParams Optional parameters.
95   * @return GoogleCloudDatacatalogV1Entry
96   */
97  public function get($name, $optParams = [])
98  {
99    $params = ['name' => $name];
100    $params = array_merge($params, $optParams);
101    return $this->call('get', [$params], GoogleCloudDatacatalogV1Entry::class);
102  }
103  /**
104   * Gets the access control policy for a resource. May return: * A`NOT_FOUND`
105   * error if the resource doesn't exist or you don't have the permission to view
106   * it. * An empty policy if the resource exists but doesn't have a set policy.
107   * Supported resources are: - Tag templates - Entry groups Note: This method
108   * doesn't get policies from Google Cloud Platform resources ingested into Data
109   * Catalog. To call this method, you must have the following Google IAM
110   * permissions: - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag
111   * templates. - `datacatalog.entryGroups.getIamPolicy` to get policies on entry
112   * groups. (entries.getIamPolicy)
113   *
114   * @param string $resource REQUIRED: The resource for which the policy is being
115   * requested. See the operation documentation for the appropriate value for this
116   * field.
117   * @param GetIamPolicyRequest $postBody
118   * @param array $optParams Optional parameters.
119   * @return Policy
120   */
121  public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
122  {
123    $params = ['resource' => $resource, 'postBody' => $postBody];
124    $params = array_merge($params, $optParams);
125    return $this->call('getIamPolicy', [$params], Policy::class);
126  }
127  /**
128   * Lists entries. Note: Currently, this method can list only custom entries. To
129   * get a list of both custom and automatically created entries, use
130   * SearchCatalog. (entries.listProjectsLocationsEntryGroupsEntries)
131   *
132   * @param string $parent Required. The name of the entry group that contains the
133   * entries to list. Can be provided in URL format.
134   * @param array $optParams Optional parameters.
135   *
136   * @opt_param int pageSize The maximum number of items to return. Default is 10.
137   * Maximum limit is 1000. Throws an invalid argument if `page_size` is more than
138   * 1000.
139   * @opt_param string pageToken Pagination token that specifies the next page to
140   * return. If empty, the first page is returned.
141   * @opt_param string readMask The fields to return for each entry. If empty or
142   * omitted, all fields are returned. For example, to return a list of entries
143   * with only the `name` field, set `read_mask` to only one path with the `name`
144   * value.
145   * @return GoogleCloudDatacatalogV1ListEntriesResponse
146   */
147  public function listProjectsLocationsEntryGroupsEntries($parent, $optParams = [])
148  {
149    $params = ['parent' => $parent];
150    $params = array_merge($params, $optParams);
151    return $this->call('list', [$params], GoogleCloudDatacatalogV1ListEntriesResponse::class);
152  }
153  /**
154   * Modifies contacts, part of the business context of an Entry. To call this
155   * method, you must have the `datacatalog.entries.updateContacts` IAM permission
156   * on the corresponding project. (entries.modifyEntryContacts)
157   *
158   * @param string $name Required. The full resource name of the entry.
159   * @param GoogleCloudDatacatalogV1ModifyEntryContactsRequest $postBody
160   * @param array $optParams Optional parameters.
161   * @return GoogleCloudDatacatalogV1Contacts
162   */
163  public function modifyEntryContacts($name, GoogleCloudDatacatalogV1ModifyEntryContactsRequest $postBody, $optParams = [])
164  {
165    $params = ['name' => $name, 'postBody' => $postBody];
166    $params = array_merge($params, $optParams);
167    return $this->call('modifyEntryContacts', [$params], GoogleCloudDatacatalogV1Contacts::class);
168  }
169  /**
170   * Modifies entry overview, part of the business context of an Entry. To call
171   * this method, you must have the `datacatalog.entries.updateOverview` IAM
172   * permission on the corresponding project. (entries.modifyEntryOverview)
173   *
174   * @param string $name Required. The full resource name of the entry.
175   * @param GoogleCloudDatacatalogV1ModifyEntryOverviewRequest $postBody
176   * @param array $optParams Optional parameters.
177   * @return GoogleCloudDatacatalogV1EntryOverview
178   */
179  public function modifyEntryOverview($name, GoogleCloudDatacatalogV1ModifyEntryOverviewRequest $postBody, $optParams = [])
180  {
181    $params = ['name' => $name, 'postBody' => $postBody];
182    $params = array_merge($params, $optParams);
183    return $this->call('modifyEntryOverview', [$params], GoogleCloudDatacatalogV1EntryOverview::class);
184  }
185  /**
186   * Updates an existing entry. You must enable the Data Catalog API in the
187   * project identified by the `entry.name` parameter. For more information, see
188   * [Data Catalog resource project](https://cloud.google.com/data-
189   * catalog/docs/concepts/resource-project). (entries.patch)
190   *
191   * @param string $name Output only. The resource name of an entry in URL format.
192   * Note: The entry itself and its child resources might not be stored in the
193   * location specified in its name.
194   * @param GoogleCloudDatacatalogV1Entry $postBody
195   * @param array $optParams Optional parameters.
196   *
197   * @opt_param string updateMask Names of fields whose values to overwrite on an
198   * entry. If this parameter is absent or empty, all modifiable fields are
199   * overwritten. If such fields are non-required and omitted in the request body,
200   * their values are emptied. You can modify only the fields listed below. For
201   * entries with type `DATA_STREAM`: * `schema` For entries with type `FILESET`:
202   * * `schema` * `display_name` * `description` * `gcs_fileset_spec` *
203   * `gcs_fileset_spec.file_patterns` For entries with `user_specified_type`: *
204   * `schema` * `display_name` * `description` * `user_specified_type` *
205   * `user_specified_system` * `linked_resource` * `source_system_timestamps`
206   * @return GoogleCloudDatacatalogV1Entry
207   */
208  public function patch($name, GoogleCloudDatacatalogV1Entry $postBody, $optParams = [])
209  {
210    $params = ['name' => $name, 'postBody' => $postBody];
211    $params = array_merge($params, $optParams);
212    return $this->call('patch', [$params], GoogleCloudDatacatalogV1Entry::class);
213  }
214  /**
215   * Marks an Entry as starred by the current user. Starring information is
216   * private to each user. (entries.star)
217   *
218   * @param string $name Required. The name of the entry to mark as starred.
219   * @param GoogleCloudDatacatalogV1StarEntryRequest $postBody
220   * @param array $optParams Optional parameters.
221   * @return GoogleCloudDatacatalogV1StarEntryResponse
222   */
223  public function star($name, GoogleCloudDatacatalogV1StarEntryRequest $postBody, $optParams = [])
224  {
225    $params = ['name' => $name, 'postBody' => $postBody];
226    $params = array_merge($params, $optParams);
227    return $this->call('star', [$params], GoogleCloudDatacatalogV1StarEntryResponse::class);
228  }
229  /**
230   * Gets your permissions on a resource. Returns an empty set of permissions if
231   * the resource doesn't exist. Supported resources are: - Tag templates - Entry
232   * groups Note: This method gets policies only within Data Catalog and can't be
233   * used to get policies from BigQuery, Pub/Sub, Dataproc Metastore, and any
234   * external Google Cloud Platform resources ingested into Data Catalog. No
235   * Google IAM permissions are required to call this method.
236   * (entries.testIamPermissions)
237   *
238   * @param string $resource REQUIRED: The resource for which the policy detail is
239   * being requested. See the operation documentation for the appropriate value
240   * for this field.
241   * @param TestIamPermissionsRequest $postBody
242   * @param array $optParams Optional parameters.
243   * @return TestIamPermissionsResponse
244   */
245  public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
246  {
247    $params = ['resource' => $resource, 'postBody' => $postBody];
248    $params = array_merge($params, $optParams);
249    return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
250  }
251  /**
252   * Marks an Entry as NOT starred by the current user. Starring information is
253   * private to each user. (entries.unstar)
254   *
255   * @param string $name Required. The name of the entry to mark as **not**
256   * starred.
257   * @param GoogleCloudDatacatalogV1UnstarEntryRequest $postBody
258   * @param array $optParams Optional parameters.
259   * @return GoogleCloudDatacatalogV1UnstarEntryResponse
260   */
261  public function unstar($name, GoogleCloudDatacatalogV1UnstarEntryRequest $postBody, $optParams = [])
262  {
263    $params = ['name' => $name, 'postBody' => $postBody];
264    $params = array_merge($params, $optParams);
265    return $this->call('unstar', [$params], GoogleCloudDatacatalogV1UnstarEntryResponse::class);
266  }
267}
268
269// Adding a class alias for backwards compatibility with the previous class name.
270class_alias(ProjectsLocationsEntryGroupsEntries::class, 'Google_Service_DataCatalog_Resource_ProjectsLocationsEntryGroupsEntries');
271