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\CloudResourceManager\Resource; 19 20use Google\Service\CloudResourceManager\ListTagHoldsResponse; 21use Google\Service\CloudResourceManager\Operation; 22use Google\Service\CloudResourceManager\TagHold; 23 24/** 25 * The "tagHolds" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $cloudresourcemanagerService = new Google\Service\CloudResourceManager(...); 29 * $tagHolds = $cloudresourcemanagerService->tagHolds; 30 * </code> 31 */ 32class TagValuesTagHolds extends \Google\Service\Resource 33{ 34 /** 35 * Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource 36 * and origin exists under the same TagValue. (tagHolds.create) 37 * 38 * @param string $parent Required. The resource name of the TagHold's parent 39 * TagValue. Must be of the form: `tagValues/{tag-value-id}`. 40 * @param TagHold $postBody 41 * @param array $optParams Optional parameters. 42 * 43 * @opt_param bool validateOnly Optional. Set to true to perform the validations 44 * necessary for creating the resource, but not actually perform the action. 45 * @return Operation 46 */ 47 public function create($parent, TagHold $postBody, $optParams = []) 48 { 49 $params = ['parent' => $parent, 'postBody' => $postBody]; 50 $params = array_merge($params, $optParams); 51 return $this->call('create', [$params], Operation::class); 52 } 53 /** 54 * Deletes a TagHold. (tagHolds.delete) 55 * 56 * @param string $name Required. The resource name of the TagHold to delete. 57 * Must be of the form: `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. 58 * @param array $optParams Optional parameters. 59 * 60 * @opt_param bool validateOnly Optional. Set to true to perform the validations 61 * necessary for deleting the resource, but not actually perform the action. 62 * @return Operation 63 */ 64 public function delete($name, $optParams = []) 65 { 66 $params = ['name' => $name]; 67 $params = array_merge($params, $optParams); 68 return $this->call('delete', [$params], Operation::class); 69 } 70 /** 71 * Lists TagHolds under a TagValue. (tagHolds.listTagValuesTagHolds) 72 * 73 * @param string $parent Required. The resource name of the parent TagValue. 74 * Must be of the form: `tagValues/{tag-value-id}`. 75 * @param array $optParams Optional parameters. 76 * 77 * @opt_param string filter Optional. Criteria used to select a subset of 78 * TagHolds parented by the TagValue to return. This field follows the syntax 79 * defined by aip.dev/160; the `holder` and `origin` fields are supported for 80 * filtering. Currently only `AND` syntax is supported. Some example queries 81 * are: * `holder = //compute.googleapis.com/compute/projects/myproject/regions 82 * /us-east-1/instanceGroupManagers/instance-group` * `origin = 35678234` * 83 * `holder = //compute.googleapis.com/compute/projects/myproject/regions/us- 84 * east-1/instanceGroupManagers/instance-group AND origin = 35678234` 85 * @opt_param int pageSize Optional. The maximum number of TagHolds to return in 86 * the response. The server allows a maximum of 300 TagHolds to return. If 87 * unspecified, the server will use 100 as the default. 88 * @opt_param string pageToken Optional. A pagination token returned from a 89 * previous call to `ListTagHolds` that indicates where this listing should 90 * continue from. 91 * @return ListTagHoldsResponse 92 */ 93 public function listTagValuesTagHolds($parent, $optParams = []) 94 { 95 $params = ['parent' => $parent]; 96 $params = array_merge($params, $optParams); 97 return $this->call('list', [$params], ListTagHoldsResponse::class); 98 } 99} 100 101// Adding a class alias for backwards compatibility with the previous class name. 102class_alias(TagValuesTagHolds::class, 'Google_Service_CloudResourceManager_Resource_TagValuesTagHolds'); 103