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