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