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\GoogleCloudDataplexV1ListZonesResponse; 21use Google\Service\CloudDataplex\GoogleCloudDataplexV1Zone; 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 "zones" collection of methods. 30 * Typical usage is: 31 * <code> 32 * $dataplexService = new Google\Service\CloudDataplex(...); 33 * $zones = $dataplexService->zones; 34 * </code> 35 */ 36class ProjectsLocationsLakesZones extends \Google\Service\Resource 37{ 38 /** 39 * Creates a zone resource within a lake. (zones.create) 40 * 41 * @param string $parent Required. The resource name of the parent lake: 42 * projects/{project_number}/locations/{location_id}/lakes/{lake_id} 43 * @param GoogleCloudDataplexV1Zone $postBody 44 * @param array $optParams Optional parameters. 45 * 46 * @opt_param bool validateOnly Optional. Only validate the request, but do not 47 * perform mutations. The default is false. 48 * @opt_param string zoneId Required. Zone identifier. This ID will be used to 49 * generate names such as database and dataset names when publishing metadata to 50 * Hive Metastore and BigQuery. * Must contain only lowercase letters, numbers 51 * and hyphens. * Must start with a letter. * Must end with a number or a 52 * letter. * Must be between 1-63 characters. * Must be unique across all lakes 53 * from all locations in a project. * Must not be one of the reserved IDs (i.e. 54 * "default", "global-temp") 55 * @return GoogleLongrunningOperation 56 */ 57 public function create($parent, GoogleCloudDataplexV1Zone $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 zone resource. All assets within a zone must be deleted before the 65 * zone can be deleted. (zones.delete) 66 * 67 * @param string $name Required. The resource name of the zone: 68 * projects/{project_number}/locations/{location_id}/lakes/{lake_id} 69 * /zones/{zone_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 a zone resource. (zones.get) 81 * 82 * @param string $name Required. The resource name of the zone: 83 * projects/{project_number}/locations/{location_id}/lakes/{lake_id} 84 * /zones/{zone_id} 85 * @param array $optParams Optional parameters. 86 * @return GoogleCloudDataplexV1Zone 87 */ 88 public function get($name, $optParams = []) 89 { 90 $params = ['name' => $name]; 91 $params = array_merge($params, $optParams); 92 return $this->call('get', [$params], GoogleCloudDataplexV1Zone::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. (zones.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 zone resources in a lake. (zones.listProjectsLocationsLakesZones) 124 * 125 * @param string $parent Required. The resource name of the parent lake: 126 * projects/{project_number}/locations/{location_id}/lakes/{lake_id} 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 zones to return. The 132 * service may return fewer than this value. If unspecified, at most 10 zones 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 * ListZones call. Provide this to retrieve the subsequent page. When 137 * paginating, all other parameters provided to ListZones must match the call 138 * that provided the page token. 139 * @return GoogleCloudDataplexV1ListZonesResponse 140 */ 141 public function listProjectsLocationsLakesZones($parent, $optParams = []) 142 { 143 $params = ['parent' => $parent]; 144 $params = array_merge($params, $optParams); 145 return $this->call('list', [$params], GoogleCloudDataplexV1ListZonesResponse::class); 146 } 147 /** 148 * Updates a zone resource. (zones.patch) 149 * 150 * @param string $name Output only. The relative resource name of the zone, of 151 * the form: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/z 152 * ones/{zone_id}. 153 * @param GoogleCloudDataplexV1Zone $postBody 154 * @param array $optParams Optional parameters. 155 * 156 * @opt_param string updateMask Required. Mask of fields to update. 157 * @opt_param bool validateOnly Optional. Only validate the request, but do not 158 * perform mutations. The default is false. 159 * @return GoogleLongrunningOperation 160 */ 161 public function patch($name, GoogleCloudDataplexV1Zone $postBody, $optParams = []) 162 { 163 $params = ['name' => $name, 'postBody' => $postBody]; 164 $params = array_merge($params, $optParams); 165 return $this->call('patch', [$params], GoogleLongrunningOperation::class); 166 } 167 /** 168 * Sets the access control policy on the specified resource. Replaces any 169 * existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED 170 * errors. (zones.setIamPolicy) 171 * 172 * @param string $resource REQUIRED: The resource for which the policy is being 173 * specified. See the operation documentation for the appropriate value for this 174 * field. 175 * @param GoogleIamV1SetIamPolicyRequest $postBody 176 * @param array $optParams Optional parameters. 177 * @return GoogleIamV1Policy 178 */ 179 public function setIamPolicy($resource, GoogleIamV1SetIamPolicyRequest $postBody, $optParams = []) 180 { 181 $params = ['resource' => $resource, 'postBody' => $postBody]; 182 $params = array_merge($params, $optParams); 183 return $this->call('setIamPolicy', [$params], GoogleIamV1Policy::class); 184 } 185 /** 186 * Returns permissions that a caller has on the specified resource. If the 187 * resource does not exist, this will return an empty set of permissions, not a 188 * NOT_FOUND error.Note: This operation is designed to be used for building 189 * permission-aware UIs and command-line tools, not for authorization checking. 190 * This operation may "fail open" without warning. (zones.testIamPermissions) 191 * 192 * @param string $resource REQUIRED: The resource for which the policy detail is 193 * being requested. See the operation documentation for the appropriate value 194 * for this field. 195 * @param GoogleIamV1TestIamPermissionsRequest $postBody 196 * @param array $optParams Optional parameters. 197 * @return GoogleIamV1TestIamPermissionsResponse 198 */ 199 public function testIamPermissions($resource, GoogleIamV1TestIamPermissionsRequest $postBody, $optParams = []) 200 { 201 $params = ['resource' => $resource, 'postBody' => $postBody]; 202 $params = array_merge($params, $optParams); 203 return $this->call('testIamPermissions', [$params], GoogleIamV1TestIamPermissionsResponse::class); 204 } 205} 206 207// Adding a class alias for backwards compatibility with the previous class name. 208class_alias(ProjectsLocationsLakesZones::class, 'Google_Service_CloudDataplex_Resource_ProjectsLocationsLakesZones'); 209