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\CloudresourcemanagerEmpty;
21use Google\Service\CloudResourceManager\Lien;
22use Google\Service\CloudResourceManager\ListLiensResponse;
23
24/**
25 * The "liens" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $cloudresourcemanagerService = new Google\Service\CloudResourceManager(...);
29 *   $liens = $cloudresourcemanagerService->liens;
30 *  </code>
31 */
32class Liens extends \Google\Service\Resource
33{
34  /**
35   * Create a Lien which applies to the resource denoted by the `parent` field.
36   * Callers of this method will require permission on the `parent` resource. For
37   * example, applying to `projects/1234` requires permission
38   * `resourcemanager.projects.updateLiens`. NOTE: Some resources may limit the
39   * number of Liens which may be applied. (liens.create)
40   *
41   * @param Lien $postBody
42   * @param array $optParams Optional parameters.
43   * @return Lien
44   */
45  public function create(Lien $postBody, $optParams = [])
46  {
47    $params = ['postBody' => $postBody];
48    $params = array_merge($params, $optParams);
49    return $this->call('create', [$params], Lien::class);
50  }
51  /**
52   * Delete a Lien by `name`. Callers of this method will require permission on
53   * the `parent` resource. For example, a Lien with a `parent` of `projects/1234`
54   * requires permission `resourcemanager.projects.updateLiens`. (liens.delete)
55   *
56   * @param string $name Required. The name/identifier of the Lien to delete.
57   * @param array $optParams Optional parameters.
58   * @return CloudresourcemanagerEmpty
59   */
60  public function delete($name, $optParams = [])
61  {
62    $params = ['name' => $name];
63    $params = array_merge($params, $optParams);
64    return $this->call('delete', [$params], CloudresourcemanagerEmpty::class);
65  }
66  /**
67   * Retrieve a Lien by `name`. Callers of this method will require permission on
68   * the `parent` resource. For example, a Lien with a `parent` of `projects/1234`
69   * requires permission `resourcemanager.projects.get` (liens.get)
70   *
71   * @param string $name Required. The name/identifier of the Lien.
72   * @param array $optParams Optional parameters.
73   * @return Lien
74   */
75  public function get($name, $optParams = [])
76  {
77    $params = ['name' => $name];
78    $params = array_merge($params, $optParams);
79    return $this->call('get', [$params], Lien::class);
80  }
81  /**
82   * List all Liens applied to the `parent` resource. Callers of this method will
83   * require permission on the `parent` resource. For example, a Lien with a
84   * `parent` of `projects/1234` requires permission
85   * `resourcemanager.projects.get`. (liens.listLiens)
86   *
87   * @param array $optParams Optional parameters.
88   *
89   * @opt_param int pageSize The maximum number of items to return. This is a
90   * suggestion for the server. The server can return fewer liens than requested.
91   * If unspecified, server picks an appropriate default.
92   * @opt_param string pageToken The `next_page_token` value returned from a
93   * previous List request, if any.
94   * @opt_param string parent Required. The name of the resource to list all
95   * attached Liens. For example, `projects/1234`.
96   * (google.api.field_policy).resource_type annotation is not set since the
97   * parent depends on the meta api implementation. This field could be a project
98   * or other sub project resources.
99   * @return ListLiensResponse
100   */
101  public function listLiens($optParams = [])
102  {
103    $params = [];
104    $params = array_merge($params, $optParams);
105    return $this->call('list', [$params], ListLiensResponse::class);
106  }
107}
108
109// Adding a class alias for backwards compatibility with the previous class name.
110class_alias(Liens::class, 'Google_Service_CloudResourceManager_Resource_Liens');
111