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\CloudDataplex\Resource;
19
20use Google\Service\CloudDataplex\GoogleCloudDataplexV1Lake;
21use Google\Service\CloudDataplex\GoogleCloudDataplexV1ListLakesResponse;
22use Google\Service\CloudDataplex\GoogleIamV1Policy;
23use Google\Service\CloudDataplex\GoogleIamV1SetIamPolicyRequest;
24use Google\Service\CloudDataplex\GoogleIamV1TestIamPermissionsRequest;
25use Google\Service\CloudDataplex\GoogleIamV1TestIamPermissionsResponse;
26use Google\Service\CloudDataplex\GoogleLongrunningOperation;
27
28/**
29 * The "lakes" collection of methods.
30 * Typical usage is:
31 *  <code>
32 *   $dataplexService = new Google\Service\CloudDataplex(...);
33 *   $lakes = $dataplexService->lakes;
34 *  </code>
35 */
36class ProjectsLocationsLakes extends \Google\Service\Resource
37{
38  /**
39   * Creates a lake resource. (lakes.create)
40   *
41   * @param string $parent Required. The resource name of the lake location, of
42   * the form: projects/{project_number}/locations/{location_id} where location_id
43   * refers to a GCP region.
44   * @param GoogleCloudDataplexV1Lake $postBody
45   * @param array $optParams Optional parameters.
46   *
47   * @opt_param string lakeId Required. Lake identifier. This ID will be used to
48   * generate names such as database and dataset names when publishing metadata to
49   * Hive Metastore and BigQuery. * Must contain only lowercase letters, numbers
50   * and hyphens. * Must start with a letter. * Must end with a number or a
51   * letter. * Must be between 1-63 characters. * Must be unique within the
52   * customer project / location.
53   * @opt_param bool validateOnly Optional. Only validate the request, but do not
54   * perform mutations. The default is false.
55   * @return GoogleLongrunningOperation
56   */
57  public function create($parent, GoogleCloudDataplexV1Lake $postBody, $optParams = [])
58  {
59    $params = ['parent' => $parent, 'postBody' => $postBody];
60    $params = array_merge($params, $optParams);
61    return $this->call('create', [$params], GoogleLongrunningOperation::class);
62  }
63  /**
64   * Deletes a lake resource. All zones within the lake must be deleted before the
65   * lake can be deleted. (lakes.delete)
66   *
67   * @param string $name Required. The resource name of the lake:
68   * projects/{project_number}/locations/{location_id}/lakes/{lake_id}
69   * @param array $optParams Optional parameters.
70   * @return GoogleLongrunningOperation
71   */
72  public function delete($name, $optParams = [])
73  {
74    $params = ['name' => $name];
75    $params = array_merge($params, $optParams);
76    return $this->call('delete', [$params], GoogleLongrunningOperation::class);
77  }
78  /**
79   * Retrieves a lake resource. (lakes.get)
80   *
81   * @param string $name Required. The resource name of the lake:
82   * projects/{project_number}/locations/{location_id}/lakes/{lake_id}
83   * @param array $optParams Optional parameters.
84   * @return GoogleCloudDataplexV1Lake
85   */
86  public function get($name, $optParams = [])
87  {
88    $params = ['name' => $name];
89    $params = array_merge($params, $optParams);
90    return $this->call('get', [$params], GoogleCloudDataplexV1Lake::class);
91  }
92  /**
93   * Gets the access control policy for a resource. Returns an empty policy if the
94   * resource exists and does not have a policy set. (lakes.getIamPolicy)
95   *
96   * @param string $resource REQUIRED: The resource for which the policy is being
97   * requested. See the operation documentation for the appropriate value for this
98   * field.
99   * @param array $optParams Optional parameters.
100   *
101   * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
102   * version that will be used to format the policy.Valid values are 0, 1, and 3.
103   * Requests specifying an invalid value will be rejected.Requests for policies
104   * with any conditional role bindings must specify version 3. Policies with no
105   * conditional role bindings may specify any valid value or leave the field
106   * unset.The policy in the response might use the policy version that you
107   * specified, or it might use a lower policy version. For example, if you
108   * specify version 3, but the policy has no conditional role bindings, the
109   * response uses version 1.To learn which resources support conditions in their
110   * IAM policies, see the IAM documentation
111   * (https://cloud.google.com/iam/help/conditions/resource-policies).
112   * @return GoogleIamV1Policy
113   */
114  public function getIamPolicy($resource, $optParams = [])
115  {
116    $params = ['resource' => $resource];
117    $params = array_merge($params, $optParams);
118    return $this->call('getIamPolicy', [$params], GoogleIamV1Policy::class);
119  }
120  /**
121   * Lists lake resources in a project and location.
122   * (lakes.listProjectsLocationsLakes)
123   *
124   * @param string $parent Required. The resource name of the lake location, of
125   * the form: projects/{project_number}/locations/{location_id} where location_id
126   * refers to a GCP region.
127   * @param array $optParams Optional parameters.
128   *
129   * @opt_param string filter Optional. Filter request.
130   * @opt_param string orderBy Optional. Order by fields for the result.
131   * @opt_param int pageSize Optional. Maximum number of Lakes to return. The
132   * service may return fewer than this value. If unspecified, at most 10 lakes
133   * will be returned. The maximum value is 1000; values above 1000 will be
134   * coerced to 1000.
135   * @opt_param string pageToken Optional. Page token received from a previous
136   * ListLakes call. Provide this to retrieve the subsequent page. When
137   * paginating, all other parameters provided to ListLakes must match the call
138   * that provided the page token.
139   * @return GoogleCloudDataplexV1ListLakesResponse
140   */
141  public function listProjectsLocationsLakes($parent, $optParams = [])
142  {
143    $params = ['parent' => $parent];
144    $params = array_merge($params, $optParams);
145    return $this->call('list', [$params], GoogleCloudDataplexV1ListLakesResponse::class);
146  }
147  /**
148   * Updates a lake resource. (lakes.patch)
149   *
150   * @param string $name Output only. The relative resource name of the lake, of
151   * the form: projects/{project_number}/locations/{location_id}/lakes/{lake_id}.
152   * @param GoogleCloudDataplexV1Lake $postBody
153   * @param array $optParams Optional parameters.
154   *
155   * @opt_param string updateMask Required. Mask of fields to update.
156   * @opt_param bool validateOnly Optional. Only validate the request, but do not
157   * perform mutations. The default is false.
158   * @return GoogleLongrunningOperation
159   */
160  public function patch($name, GoogleCloudDataplexV1Lake $postBody, $optParams = [])
161  {
162    $params = ['name' => $name, 'postBody' => $postBody];
163    $params = array_merge($params, $optParams);
164    return $this->call('patch', [$params], GoogleLongrunningOperation::class);
165  }
166  /**
167   * Sets the access control policy on the specified resource. Replaces any
168   * existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
169   * errors. (lakes.setIamPolicy)
170   *
171   * @param string $resource REQUIRED: The resource for which the policy is being
172   * specified. See the operation documentation for the appropriate value for this
173   * field.
174   * @param GoogleIamV1SetIamPolicyRequest $postBody
175   * @param array $optParams Optional parameters.
176   * @return GoogleIamV1Policy
177   */
178  public function setIamPolicy($resource, GoogleIamV1SetIamPolicyRequest $postBody, $optParams = [])
179  {
180    $params = ['resource' => $resource, 'postBody' => $postBody];
181    $params = array_merge($params, $optParams);
182    return $this->call('setIamPolicy', [$params], GoogleIamV1Policy::class);
183  }
184  /**
185   * Returns permissions that a caller has on the specified resource. If the
186   * resource does not exist, this will return an empty set of permissions, not a
187   * NOT_FOUND error.Note: This operation is designed to be used for building
188   * permission-aware UIs and command-line tools, not for authorization checking.
189   * This operation may "fail open" without warning. (lakes.testIamPermissions)
190   *
191   * @param string $resource REQUIRED: The resource for which the policy detail is
192   * being requested. See the operation documentation for the appropriate value
193   * for this field.
194   * @param GoogleIamV1TestIamPermissionsRequest $postBody
195   * @param array $optParams Optional parameters.
196   * @return GoogleIamV1TestIamPermissionsResponse
197   */
198  public function testIamPermissions($resource, GoogleIamV1TestIamPermissionsRequest $postBody, $optParams = [])
199  {
200    $params = ['resource' => $resource, 'postBody' => $postBody];
201    $params = array_merge($params, $optParams);
202    return $this->call('testIamPermissions', [$params], GoogleIamV1TestIamPermissionsResponse::class);
203  }
204}
205
206// Adding a class alias for backwards compatibility with the previous class name.
207class_alias(ProjectsLocationsLakes::class, 'Google_Service_CloudDataplex_Resource_ProjectsLocationsLakes');
208