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\ListTagBindingsResponse;
21use Google\Service\CloudResourceManager\Operation;
22use Google\Service\CloudResourceManager\TagBinding;
23
24/**
25 * The "tagBindings" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $cloudresourcemanagerService = new Google\Service\CloudResourceManager(...);
29 *   $tagBindings = $cloudresourcemanagerService->tagBindings;
30 *  </code>
31 */
32class TagBindings extends \Google\Service\Resource
33{
34  /**
35   * Creates a TagBinding between a TagValue and a cloud resource (currently
36   * project, folder, or organization). (tagBindings.create)
37   *
38   * @param TagBinding $postBody
39   * @param array $optParams Optional parameters.
40   *
41   * @opt_param bool validateOnly Optional. Set to true to perform the validations
42   * necessary for creating the resource, but not actually perform the action.
43   * @return Operation
44   */
45  public function create(TagBinding $postBody, $optParams = [])
46  {
47    $params = ['postBody' => $postBody];
48    $params = array_merge($params, $optParams);
49    return $this->call('create', [$params], Operation::class);
50  }
51  /**
52   * Deletes a TagBinding. (tagBindings.delete)
53   *
54   * @param string $name Required. The name of the TagBinding. This is a String of
55   * the form: `tagBindings/{id}` (e.g. `tagBindings/%2F%2Fcloudresourcemanager.go
56   * ogleapis.com%2Fprojects%2F123/tagValues/456`).
57   * @param array $optParams Optional parameters.
58   * @return Operation
59   */
60  public function delete($name, $optParams = [])
61  {
62    $params = ['name' => $name];
63    $params = array_merge($params, $optParams);
64    return $this->call('delete', [$params], Operation::class);
65  }
66  /**
67   * Lists the TagBindings for the given cloud resource, as specified with
68   * `parent`. NOTE: The `parent` field is expected to be a full resource name:
69   * https://cloud.google.com/apis/design/resource_names#full_resource_name
70   * (tagBindings.listTagBindings)
71   *
72   * @param array $optParams Optional parameters.
73   *
74   * @opt_param int pageSize Optional. The maximum number of TagBindings to return
75   * in the response. The server allows a maximum of 300 TagBindings to return. If
76   * unspecified, the server will use 100 as the default. Currently this api
77   * returns unpaginated response and `page_size` is ignored.
78   * @opt_param string pageToken Optional. A pagination token returned from a
79   * previous call to `ListTagBindings` that indicates where this listing should
80   * continue from. Currently this api returns unpaginated response and
81   * `page_token` is ignored.
82   * @opt_param string parent Required. The full resource name of a resource for
83   * which you want to list existing TagBindings. E.g.
84   * "//cloudresourcemanager.googleapis.com/projects/123"
85   * @return ListTagBindingsResponse
86   */
87  public function listTagBindings($optParams = [])
88  {
89    $params = [];
90    $params = array_merge($params, $optParams);
91    return $this->call('list', [$params], ListTagBindingsResponse::class);
92  }
93}
94
95// Adding a class alias for backwards compatibility with the previous class name.
96class_alias(TagBindings::class, 'Google_Service_CloudResourceManager_Resource_TagBindings');
97