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