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\DataprocMetastore\Resource; 19 20use Google\Service\DataprocMetastore\ExportMetadataRequest; 21use Google\Service\DataprocMetastore\ListServicesResponse; 22use Google\Service\DataprocMetastore\Operation; 23use Google\Service\DataprocMetastore\Policy; 24use Google\Service\DataprocMetastore\RemoveIamPolicyRequest; 25use Google\Service\DataprocMetastore\RemoveIamPolicyResponse; 26use Google\Service\DataprocMetastore\RestoreServiceRequest; 27use Google\Service\DataprocMetastore\Service; 28use Google\Service\DataprocMetastore\SetIamPolicyRequest; 29use Google\Service\DataprocMetastore\TestIamPermissionsRequest; 30use Google\Service\DataprocMetastore\TestIamPermissionsResponse; 31 32/** 33 * The "services" collection of methods. 34 * Typical usage is: 35 * <code> 36 * $metastoreService = new Google\Service\DataprocMetastore(...); 37 * $services = $metastoreService->services; 38 * </code> 39 */ 40class ProjectsLocationsServices extends \Google\Service\Resource 41{ 42 /** 43 * Creates a metastore service in a project and location. (services.create) 44 * 45 * @param string $parent Required. The relative resource name of the location in 46 * which to create a metastore service, in the following 47 * form:projects/{project_number}/locations/{location_id}. 48 * @param Service $postBody 49 * @param array $optParams Optional parameters. 50 * 51 * @opt_param string requestId Optional. A request ID. Specify a unique request 52 * ID to allow the server to ignore the request if it has completed. The server 53 * will ignore subsequent requests that provide a duplicate request ID for at 54 * least 60 minutes after the first request.For example, if an initial request 55 * times out, followed by another request with the same request ID, the server 56 * ignores the second request to prevent the creation of duplicate 57 * commitments.The request ID must be a valid UUID 58 * (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero 59 * UUID (00000000-0000-0000-0000-000000000000) is not supported. 60 * @opt_param string serviceId Required. The ID of the metastore service, which 61 * is used as the final component of the metastore service's name.This value 62 * must be between 2 and 63 characters long inclusive, begin with a letter, end 63 * with a letter or number, and consist of alpha-numeric ASCII characters or 64 * hyphens. 65 * @return Operation 66 */ 67 public function create($parent, Service $postBody, $optParams = []) 68 { 69 $params = ['parent' => $parent, 'postBody' => $postBody]; 70 $params = array_merge($params, $optParams); 71 return $this->call('create', [$params], Operation::class); 72 } 73 /** 74 * Deletes a single service. (services.delete) 75 * 76 * @param string $name Required. The relative resource name of the metastore 77 * service to delete, in the following 78 * form:projects/{project_number}/locations/{location_id}/services/{service_id}. 79 * @param array $optParams Optional parameters. 80 * 81 * @opt_param string requestId Optional. A request ID. Specify a unique request 82 * ID to allow the server to ignore the request if it has completed. The server 83 * will ignore subsequent requests that provide a duplicate request ID for at 84 * least 60 minutes after the first request.For example, if an initial request 85 * times out, followed by another request with the same request ID, the server 86 * ignores the second request to prevent the creation of duplicate 87 * commitments.The request ID must be a valid UUID 88 * (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero 89 * UUID (00000000-0000-0000-0000-000000000000) is not supported. 90 * @return Operation 91 */ 92 public function delete($name, $optParams = []) 93 { 94 $params = ['name' => $name]; 95 $params = array_merge($params, $optParams); 96 return $this->call('delete', [$params], Operation::class); 97 } 98 /** 99 * Exports metadata from a service. (services.exportMetadata) 100 * 101 * @param string $service Required. The relative resource name of the metastore 102 * service to run export, in the following 103 * form:projects/{project_id}/locations/{location_id}/services/{service_id}. 104 * @param ExportMetadataRequest $postBody 105 * @param array $optParams Optional parameters. 106 * @return Operation 107 */ 108 public function exportMetadata($service, ExportMetadataRequest $postBody, $optParams = []) 109 { 110 $params = ['service' => $service, 'postBody' => $postBody]; 111 $params = array_merge($params, $optParams); 112 return $this->call('exportMetadata', [$params], Operation::class); 113 } 114 /** 115 * Gets the details of a single service. (services.get) 116 * 117 * @param string $name Required. The relative resource name of the metastore 118 * service to retrieve, in the following 119 * form:projects/{project_number}/locations/{location_id}/services/{service_id}. 120 * @param array $optParams Optional parameters. 121 * @return Service 122 */ 123 public function get($name, $optParams = []) 124 { 125 $params = ['name' => $name]; 126 $params = array_merge($params, $optParams); 127 return $this->call('get', [$params], Service::class); 128 } 129 /** 130 * Gets the access control policy for a resource. Returns an empty policy if the 131 * resource exists and does not have a policy set. (services.getIamPolicy) 132 * 133 * @param string $resource REQUIRED: The resource for which the policy is being 134 * requested. See the operation documentation for the appropriate value for this 135 * field. 136 * @param array $optParams Optional parameters. 137 * 138 * @opt_param int options.requestedPolicyVersion Optional. The maximum policy 139 * version that will be used to format the policy.Valid values are 0, 1, and 3. 140 * Requests specifying an invalid value will be rejected.Requests for policies 141 * with any conditional role bindings must specify version 3. Policies with no 142 * conditional role bindings may specify any valid value or leave the field 143 * unset.The policy in the response might use the policy version that you 144 * specified, or it might use a lower policy version. For example, if you 145 * specify version 3, but the policy has no conditional role bindings, the 146 * response uses version 1.To learn which resources support conditions in their 147 * IAM policies, see the IAM documentation 148 * (https://cloud.google.com/iam/help/conditions/resource-policies). 149 * @return Policy 150 */ 151 public function getIamPolicy($resource, $optParams = []) 152 { 153 $params = ['resource' => $resource]; 154 $params = array_merge($params, $optParams); 155 return $this->call('getIamPolicy', [$params], Policy::class); 156 } 157 /** 158 * Lists services in a project and location. 159 * (services.listProjectsLocationsServices) 160 * 161 * @param string $parent Required. The relative resource name of the location of 162 * metastore services to list, in the following 163 * form:projects/{project_number}/locations/{location_id}. 164 * @param array $optParams Optional parameters. 165 * 166 * @opt_param string filter Optional. The filter to apply to list results. 167 * @opt_param string orderBy Optional. Specify the ordering of results as 168 * described in Sorting Order 169 * (https://cloud.google.com/apis/design/design_patterns#sorting_order). If not 170 * specified, the results will be sorted in the default order. 171 * @opt_param int pageSize Optional. The maximum number of services to return. 172 * The response may contain less than the maximum number. If unspecified, no 173 * more than 500 services are returned. The maximum value is 1000; values above 174 * 1000 are changed to 1000. 175 * @opt_param string pageToken Optional. A page token, received from a previous 176 * DataprocMetastore.ListServices call. Provide this token to retrieve the 177 * subsequent page.To retrieve the first page, supply an empty page token.When 178 * paginating, other parameters provided to DataprocMetastore.ListServices must 179 * match the call that provided the page token. 180 * @return ListServicesResponse 181 */ 182 public function listProjectsLocationsServices($parent, $optParams = []) 183 { 184 $params = ['parent' => $parent]; 185 $params = array_merge($params, $optParams); 186 return $this->call('list', [$params], ListServicesResponse::class); 187 } 188 /** 189 * Updates the parameters of a single service. (services.patch) 190 * 191 * @param string $name Immutable. The relative resource name of the metastore 192 * service, of the 193 * form:projects/{project_number}/locations/{location_id}/services/{service_id}. 194 * @param Service $postBody 195 * @param array $optParams Optional parameters. 196 * 197 * @opt_param string requestId Optional. A request ID. Specify a unique request 198 * ID to allow the server to ignore the request if it has completed. The server 199 * will ignore subsequent requests that provide a duplicate request ID for at 200 * least 60 minutes after the first request.For example, if an initial request 201 * times out, followed by another request with the same request ID, the server 202 * ignores the second request to prevent the creation of duplicate 203 * commitments.The request ID must be a valid UUID 204 * (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero 205 * UUID (00000000-0000-0000-0000-000000000000) is not supported. 206 * @opt_param string updateMask Required. A field mask used to specify the 207 * fields to be overwritten in the metastore service resource by the update. 208 * Fields specified in the update_mask are relative to the resource (not to the 209 * full request). A field is overwritten if it is in the mask. 210 * @return Operation 211 */ 212 public function patch($name, Service $postBody, $optParams = []) 213 { 214 $params = ['name' => $name, 'postBody' => $postBody]; 215 $params = array_merge($params, $optParams); 216 return $this->call('patch', [$params], Operation::class); 217 } 218 /** 219 * Removes the attached IAM policies for a resource (services.removeIamPolicy) 220 * 221 * @param string $resource Required. The relative resource name of the dataplane 222 * resource to remove IAM policy, in the following form:projects/{project_id}/lo 223 * cations/{location_id}/services/{service_id}/databases/{database_id} or projec 224 * ts/{project_id}/locations/{location_id}/services/{service_id}/databases/{data 225 * base_id}/tables/{table_id}. 226 * @param RemoveIamPolicyRequest $postBody 227 * @param array $optParams Optional parameters. 228 * @return RemoveIamPolicyResponse 229 */ 230 public function removeIamPolicy($resource, RemoveIamPolicyRequest $postBody, $optParams = []) 231 { 232 $params = ['resource' => $resource, 'postBody' => $postBody]; 233 $params = array_merge($params, $optParams); 234 return $this->call('removeIamPolicy', [$params], RemoveIamPolicyResponse::class); 235 } 236 /** 237 * Restores a service from a backup. (services.restore) 238 * 239 * @param string $service Required. The relative resource name of the metastore 240 * service to run restore, in the following 241 * form:projects/{project_id}/locations/{location_id}/services/{service_id}. 242 * @param RestoreServiceRequest $postBody 243 * @param array $optParams Optional parameters. 244 * @return Operation 245 */ 246 public function restore($service, RestoreServiceRequest $postBody, $optParams = []) 247 { 248 $params = ['service' => $service, 'postBody' => $postBody]; 249 $params = array_merge($params, $optParams); 250 return $this->call('restore', [$params], Operation::class); 251 } 252 /** 253 * Sets the access control policy on the specified resource. Replaces any 254 * existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED 255 * errors. (services.setIamPolicy) 256 * 257 * @param string $resource REQUIRED: The resource for which the policy is being 258 * specified. See the operation documentation for the appropriate value for this 259 * field. 260 * @param SetIamPolicyRequest $postBody 261 * @param array $optParams Optional parameters. 262 * @return Policy 263 */ 264 public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = []) 265 { 266 $params = ['resource' => $resource, 'postBody' => $postBody]; 267 $params = array_merge($params, $optParams); 268 return $this->call('setIamPolicy', [$params], Policy::class); 269 } 270 /** 271 * Returns permissions that a caller has on the specified resource. If the 272 * resource does not exist, this will return an empty set of permissions, not a 273 * NOT_FOUND error.Note: This operation is designed to be used for building 274 * permission-aware UIs and command-line tools, not for authorization checking. 275 * This operation may "fail open" without warning. (services.testIamPermissions) 276 * 277 * @param string $resource REQUIRED: The resource for which the policy detail is 278 * being requested. See the operation documentation for the appropriate value 279 * for this field. 280 * @param TestIamPermissionsRequest $postBody 281 * @param array $optParams Optional parameters. 282 * @return TestIamPermissionsResponse 283 */ 284 public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = []) 285 { 286 $params = ['resource' => $resource, 'postBody' => $postBody]; 287 $params = array_merge($params, $optParams); 288 return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class); 289 } 290} 291 292// Adding a class alias for backwards compatibility with the previous class name. 293class_alias(ProjectsLocationsServices::class, 'Google_Service_DataprocMetastore_Resource_ProjectsLocationsServices'); 294