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\AccessContextManager\Resource;
19
20use Google\Service\AccessContextManager\GcpUserAccessBinding;
21use Google\Service\AccessContextManager\ListGcpUserAccessBindingsResponse;
22use Google\Service\AccessContextManager\Operation;
23
24/**
25 * The "gcpUserAccessBindings" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $accesscontextmanagerService = new Google\Service\AccessContextManager(...);
29 *   $gcpUserAccessBindings = $accesscontextmanagerService->gcpUserAccessBindings;
30 *  </code>
31 */
32class OrganizationsGcpUserAccessBindings extends \Google\Service\Resource
33{
34  /**
35   * Creates a GcpUserAccessBinding. If the client specifies a name, the server
36   * ignores it. Fails if a resource already exists with the same group_key.
37   * Completion of this long-running operation does not necessarily signify that
38   * the new binding is deployed onto all affected users, which may take more
39   * time. (gcpUserAccessBindings.create)
40   *
41   * @param string $parent Required. Example: "organizations/256"
42   * @param GcpUserAccessBinding $postBody
43   * @param array $optParams Optional parameters.
44   * @return Operation
45   */
46  public function create($parent, GcpUserAccessBinding $postBody, $optParams = [])
47  {
48    $params = ['parent' => $parent, 'postBody' => $postBody];
49    $params = array_merge($params, $optParams);
50    return $this->call('create', [$params], Operation::class);
51  }
52  /**
53   * Deletes a GcpUserAccessBinding. Completion of this long-running operation
54   * does not necessarily signify that the binding deletion is deployed onto all
55   * affected users, which may take more time. (gcpUserAccessBindings.delete)
56   *
57   * @param string $name Required. Example:
58   * "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N"
59   * @param array $optParams Optional parameters.
60   * @return Operation
61   */
62  public function delete($name, $optParams = [])
63  {
64    $params = ['name' => $name];
65    $params = array_merge($params, $optParams);
66    return $this->call('delete', [$params], Operation::class);
67  }
68  /**
69   * Gets the GcpUserAccessBinding with the given name.
70   * (gcpUserAccessBindings.get)
71   *
72   * @param string $name Required. Example:
73   * "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N"
74   * @param array $optParams Optional parameters.
75   * @return GcpUserAccessBinding
76   */
77  public function get($name, $optParams = [])
78  {
79    $params = ['name' => $name];
80    $params = array_merge($params, $optParams);
81    return $this->call('get', [$params], GcpUserAccessBinding::class);
82  }
83  /**
84   * Lists all GcpUserAccessBindings for a Google Cloud organization.
85   * (gcpUserAccessBindings.listOrganizationsGcpUserAccessBindings)
86   *
87   * @param string $parent Required. Example: "organizations/256"
88   * @param array $optParams Optional parameters.
89   *
90   * @opt_param int pageSize Optional. Maximum number of items to return. The
91   * server may return fewer items. If left blank, the server may return any
92   * number of items.
93   * @opt_param string pageToken Optional. If left blank, returns the first page.
94   * To enumerate all items, use the next_page_token from your previous list
95   * operation.
96   * @return ListGcpUserAccessBindingsResponse
97   */
98  public function listOrganizationsGcpUserAccessBindings($parent, $optParams = [])
99  {
100    $params = ['parent' => $parent];
101    $params = array_merge($params, $optParams);
102    return $this->call('list', [$params], ListGcpUserAccessBindingsResponse::class);
103  }
104  /**
105   * Updates a GcpUserAccessBinding. Completion of this long-running operation
106   * does not necessarily signify that the changed binding is deployed onto all
107   * affected users, which may take more time. (gcpUserAccessBindings.patch)
108   *
109   * @param string $name Immutable. Assigned by the server during creation. The
110   * last segment has an arbitrary length and has only URI unreserved characters
111   * (as defined by [RFC 3986 Section
112   * 2.3](https://tools.ietf.org/html/rfc3986#section-2.3)). Should not be
113   * specified by the client during creation. Example:
114   * "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N"
115   * @param GcpUserAccessBinding $postBody
116   * @param array $optParams Optional parameters.
117   *
118   * @opt_param string updateMask Required. Only the fields specified in this mask
119   * are updated. Because name and group_key cannot be changed, update_mask is
120   * required and must always be: update_mask { paths: "access_levels" }
121   * @return Operation
122   */
123  public function patch($name, GcpUserAccessBinding $postBody, $optParams = [])
124  {
125    $params = ['name' => $name, 'postBody' => $postBody];
126    $params = array_merge($params, $optParams);
127    return $this->call('patch', [$params], Operation::class);
128  }
129}
130
131// Adding a class alias for backwards compatibility with the previous class name.
132class_alias(OrganizationsGcpUserAccessBindings::class, 'Google_Service_AccessContextManager_Resource_OrganizationsGcpUserAccessBindings');
133