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