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\ObjectAccessControl;
21use Google\Service\Storage\ObjectAccessControls as ObjectAccessControlsModel;
22
23/**
24 * The "objectAccessControls" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $storageService = new Google\Service\Storage(...);
28 *   $objectAccessControls = $storageService->objectAccessControls;
29 *  </code>
30 */
31class ObjectAccessControls extends \Google\Service\Resource
32{
33  /**
34   * Permanently deletes the ACL entry for the specified entity on the specified
35   * object. (objectAccessControls.delete)
36   *
37   * @param string $bucket Name of a bucket.
38   * @param string $object Name of the object. For information about how to URL
39   * encode object names to be path safe, see Encoding URI Path Parts.
40   * @param string $entity The entity holding the permission. Can be user-userId,
41   * user-emailAddress, group-groupId, group-emailAddress, allUsers, or
42   * allAuthenticatedUsers.
43   * @param array $optParams Optional parameters.
44   *
45   * @opt_param string generation If present, selects a specific revision of this
46   * object (as opposed to the latest version, the default).
47   * @opt_param string userProject The project to be billed for this request.
48   * Required for Requester Pays buckets.
49   */
50  public function delete($bucket, $object, $entity, $optParams = [])
51  {
52    $params = ['bucket' => $bucket, 'object' => $object, 'entity' => $entity];
53    $params = array_merge($params, $optParams);
54    return $this->call('delete', [$params]);
55  }
56  /**
57   * Returns the ACL entry for the specified entity on the specified object.
58   * (objectAccessControls.get)
59   *
60   * @param string $bucket Name of a bucket.
61   * @param string $object Name of the object. For information about how to URL
62   * encode object names to be path safe, see Encoding URI Path Parts.
63   * @param string $entity The entity holding the permission. Can be user-userId,
64   * user-emailAddress, group-groupId, group-emailAddress, allUsers, or
65   * allAuthenticatedUsers.
66   * @param array $optParams Optional parameters.
67   *
68   * @opt_param string generation If present, selects a specific revision of this
69   * object (as opposed to the latest version, the default).
70   * @opt_param string userProject The project to be billed for this request.
71   * Required for Requester Pays buckets.
72   * @return ObjectAccessControl
73   */
74  public function get($bucket, $object, $entity, $optParams = [])
75  {
76    $params = ['bucket' => $bucket, 'object' => $object, 'entity' => $entity];
77    $params = array_merge($params, $optParams);
78    return $this->call('get', [$params], ObjectAccessControl::class);
79  }
80  /**
81   * Creates a new ACL entry on the specified object.
82   * (objectAccessControls.insert)
83   *
84   * @param string $bucket Name of a bucket.
85   * @param string $object Name of the object. For information about how to URL
86   * encode object names to be path safe, see Encoding URI Path Parts.
87   * @param ObjectAccessControl $postBody
88   * @param array $optParams Optional parameters.
89   *
90   * @opt_param string generation If present, selects a specific revision of this
91   * object (as opposed to the latest version, the default).
92   * @opt_param string userProject The project to be billed for this request.
93   * Required for Requester Pays buckets.
94   * @return ObjectAccessControl
95   */
96  public function insert($bucket, $object, ObjectAccessControl $postBody, $optParams = [])
97  {
98    $params = ['bucket' => $bucket, 'object' => $object, 'postBody' => $postBody];
99    $params = array_merge($params, $optParams);
100    return $this->call('insert', [$params], ObjectAccessControl::class);
101  }
102  /**
103   * Retrieves ACL entries on the specified object.
104   * (objectAccessControls.listObjectAccessControls)
105   *
106   * @param string $bucket Name of a bucket.
107   * @param string $object Name of the object. For information about how to URL
108   * encode object names to be path safe, see Encoding URI Path Parts.
109   * @param array $optParams Optional parameters.
110   *
111   * @opt_param string generation If present, selects a specific revision of this
112   * object (as opposed to the latest version, the default).
113   * @opt_param string userProject The project to be billed for this request.
114   * Required for Requester Pays buckets.
115   * @return ObjectAccessControlsModel
116   */
117  public function listObjectAccessControls($bucket, $object, $optParams = [])
118  {
119    $params = ['bucket' => $bucket, 'object' => $object];
120    $params = array_merge($params, $optParams);
121    return $this->call('list', [$params], ObjectAccessControlsModel::class);
122  }
123  /**
124   * Patches an ACL entry on the specified object. (objectAccessControls.patch)
125   *
126   * @param string $bucket Name of a bucket.
127   * @param string $object Name of the object. For information about how to URL
128   * encode object names to be path safe, see Encoding URI Path Parts.
129   * @param string $entity The entity holding the permission. Can be user-userId,
130   * user-emailAddress, group-groupId, group-emailAddress, allUsers, or
131   * allAuthenticatedUsers.
132   * @param ObjectAccessControl $postBody
133   * @param array $optParams Optional parameters.
134   *
135   * @opt_param string generation If present, selects a specific revision of this
136   * object (as opposed to the latest version, the default).
137   * @opt_param string userProject The project to be billed for this request.
138   * Required for Requester Pays buckets.
139   * @return ObjectAccessControl
140   */
141  public function patch($bucket, $object, $entity, ObjectAccessControl $postBody, $optParams = [])
142  {
143    $params = ['bucket' => $bucket, 'object' => $object, 'entity' => $entity, 'postBody' => $postBody];
144    $params = array_merge($params, $optParams);
145    return $this->call('patch', [$params], ObjectAccessControl::class);
146  }
147  /**
148   * Updates an ACL entry on the specified object. (objectAccessControls.update)
149   *
150   * @param string $bucket Name of a bucket.
151   * @param string $object Name of the object. For information about how to URL
152   * encode object names to be path safe, see Encoding URI Path Parts.
153   * @param string $entity The entity holding the permission. Can be user-userId,
154   * user-emailAddress, group-groupId, group-emailAddress, allUsers, or
155   * allAuthenticatedUsers.
156   * @param ObjectAccessControl $postBody
157   * @param array $optParams Optional parameters.
158   *
159   * @opt_param string generation If present, selects a specific revision of this
160   * object (as opposed to the latest version, the default).
161   * @opt_param string userProject The project to be billed for this request.
162   * Required for Requester Pays buckets.
163   * @return ObjectAccessControl
164   */
165  public function update($bucket, $object, $entity, ObjectAccessControl $postBody, $optParams = [])
166  {
167    $params = ['bucket' => $bucket, 'object' => $object, 'entity' => $entity, 'postBody' => $postBody];
168    $params = array_merge($params, $optParams);
169    return $this->call('update', [$params], ObjectAccessControl::class);
170  }
171}
172
173// Adding a class alias for backwards compatibility with the previous class name.
174class_alias(ObjectAccessControls::class, 'Google_Service_Storage_Resource_ObjectAccessControls');
175