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\Storage\Resource;
19
20use Google\Service\Storage\BucketAccessControl;
21use Google\Service\Storage\BucketAccessControls as BucketAccessControlsModel;
22
23/**
24 * The "bucketAccessControls" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $storageService = new Google\Service\Storage(...);
28 *   $bucketAccessControls = $storageService->bucketAccessControls;
29 *  </code>
30 */
31class BucketAccessControls extends \Google\Service\Resource
32{
33  /**
34   * Permanently deletes the ACL entry for the specified entity on the specified
35   * bucket. (bucketAccessControls.delete)
36   *
37   * @param string $bucket Name of a bucket.
38   * @param string $entity The entity holding the permission. Can be user-userId,
39   * user-emailAddress, group-groupId, group-emailAddress, allUsers, or
40   * allAuthenticatedUsers.
41   * @param array $optParams Optional parameters.
42   *
43   * @opt_param string userProject The project to be billed for this request.
44   * Required for Requester Pays buckets.
45   */
46  public function delete($bucket, $entity, $optParams = [])
47  {
48    $params = ['bucket' => $bucket, 'entity' => $entity];
49    $params = array_merge($params, $optParams);
50    return $this->call('delete', [$params]);
51  }
52  /**
53   * Returns the ACL entry for the specified entity on the specified bucket.
54   * (bucketAccessControls.get)
55   *
56   * @param string $bucket Name of a bucket.
57   * @param string $entity The entity holding the permission. Can be user-userId,
58   * user-emailAddress, group-groupId, group-emailAddress, allUsers, or
59   * allAuthenticatedUsers.
60   * @param array $optParams Optional parameters.
61   *
62   * @opt_param string userProject The project to be billed for this request.
63   * Required for Requester Pays buckets.
64   * @return BucketAccessControl
65   */
66  public function get($bucket, $entity, $optParams = [])
67  {
68    $params = ['bucket' => $bucket, 'entity' => $entity];
69    $params = array_merge($params, $optParams);
70    return $this->call('get', [$params], BucketAccessControl::class);
71  }
72  /**
73   * Creates a new ACL entry on the specified bucket.
74   * (bucketAccessControls.insert)
75   *
76   * @param string $bucket Name of a bucket.
77   * @param BucketAccessControl $postBody
78   * @param array $optParams Optional parameters.
79   *
80   * @opt_param string userProject The project to be billed for this request.
81   * Required for Requester Pays buckets.
82   * @return BucketAccessControl
83   */
84  public function insert($bucket, BucketAccessControl $postBody, $optParams = [])
85  {
86    $params = ['bucket' => $bucket, 'postBody' => $postBody];
87    $params = array_merge($params, $optParams);
88    return $this->call('insert', [$params], BucketAccessControl::class);
89  }
90  /**
91   * Retrieves ACL entries on the specified bucket.
92   * (bucketAccessControls.listBucketAccessControls)
93   *
94   * @param string $bucket Name of a bucket.
95   * @param array $optParams Optional parameters.
96   *
97   * @opt_param string userProject The project to be billed for this request.
98   * Required for Requester Pays buckets.
99   * @return BucketAccessControlsModel
100   */
101  public function listBucketAccessControls($bucket, $optParams = [])
102  {
103    $params = ['bucket' => $bucket];
104    $params = array_merge($params, $optParams);
105    return $this->call('list', [$params], BucketAccessControlsModel::class);
106  }
107  /**
108   * Patches an ACL entry on the specified bucket. (bucketAccessControls.patch)
109   *
110   * @param string $bucket Name of a bucket.
111   * @param string $entity The entity holding the permission. Can be user-userId,
112   * user-emailAddress, group-groupId, group-emailAddress, allUsers, or
113   * allAuthenticatedUsers.
114   * @param BucketAccessControl $postBody
115   * @param array $optParams Optional parameters.
116   *
117   * @opt_param string userProject The project to be billed for this request.
118   * Required for Requester Pays buckets.
119   * @return BucketAccessControl
120   */
121  public function patch($bucket, $entity, BucketAccessControl $postBody, $optParams = [])
122  {
123    $params = ['bucket' => $bucket, 'entity' => $entity, 'postBody' => $postBody];
124    $params = array_merge($params, $optParams);
125    return $this->call('patch', [$params], BucketAccessControl::class);
126  }
127  /**
128   * Updates an ACL entry on the specified bucket. (bucketAccessControls.update)
129   *
130   * @param string $bucket Name of a bucket.
131   * @param string $entity The entity holding the permission. Can be user-userId,
132   * user-emailAddress, group-groupId, group-emailAddress, allUsers, or
133   * allAuthenticatedUsers.
134   * @param BucketAccessControl $postBody
135   * @param array $optParams Optional parameters.
136   *
137   * @opt_param string userProject The project to be billed for this request.
138   * Required for Requester Pays buckets.
139   * @return BucketAccessControl
140   */
141  public function update($bucket, $entity, BucketAccessControl $postBody, $optParams = [])
142  {
143    $params = ['bucket' => $bucket, 'entity' => $entity, 'postBody' => $postBody];
144    $params = array_merge($params, $optParams);
145    return $this->call('update', [$params], BucketAccessControl::class);
146  }
147}
148
149// Adding a class alias for backwards compatibility with the previous class name.
150class_alias(BucketAccessControls::class, 'Google_Service_Storage_Resource_BucketAccessControls');
151