source: vendor/google/apiclient-services/src/Storage/Resource/ManagedFolders.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 2 weeks ago

Upload project files

  • Property mode set to 100644
File size: 7.4 KB
Line 
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\ManagedFolder;
21use Google\Service\Storage\ManagedFolders as ManagedFoldersModel;
22use Google\Service\Storage\Policy;
23use Google\Service\Storage\TestIamPermissionsResponse;
24
25/**
26 * The "managedFolders" collection of methods.
27 * Typical usage is:
28 * <code>
29 * $storageService = new Google\Service\Storage(...);
30 * $managedFolders = $storageService->managedFolders;
31 * </code>
32 */
33class ManagedFolders extends \Google\Service\Resource
34{
35 /**
36 * Permanently deletes a managed folder. (managedFolders.delete)
37 *
38 * @param string $bucket Name of the bucket containing the managed folder.
39 * @param string $managedFolder The managed folder name/path.
40 * @param array $optParams Optional parameters.
41 *
42 * @opt_param bool allowNonEmpty Allows the deletion of a managed folder even if
43 * it is not empty. A managed folder is empty if there are no objects or managed
44 * folders that it applies to. Callers must have
45 * storage.managedFolders.setIamPolicy permission.
46 * @opt_param string ifMetagenerationMatch If set, only deletes the managed
47 * folder if its metageneration matches this value.
48 * @opt_param string ifMetagenerationNotMatch If set, only deletes the managed
49 * folder if its metageneration does not match this value.
50 * @throws \Google\Service\Exception
51 */
52 public function delete($bucket, $managedFolder, $optParams = [])
53 {
54 $params = ['bucket' => $bucket, 'managedFolder' => $managedFolder];
55 $params = array_merge($params, $optParams);
56 return $this->call('delete', [$params]);
57 }
58 /**
59 * Returns metadata of the specified managed folder. (managedFolders.get)
60 *
61 * @param string $bucket Name of the bucket containing the managed folder.
62 * @param string $managedFolder The managed folder name/path.
63 * @param array $optParams Optional parameters.
64 *
65 * @opt_param string ifMetagenerationMatch Makes the return of the managed
66 * folder metadata conditional on whether the managed folder's current
67 * metageneration matches the given value.
68 * @opt_param string ifMetagenerationNotMatch Makes the return of the managed
69 * folder metadata conditional on whether the managed folder's current
70 * metageneration does not match the given value.
71 * @return ManagedFolder
72 * @throws \Google\Service\Exception
73 */
74 public function get($bucket, $managedFolder, $optParams = [])
75 {
76 $params = ['bucket' => $bucket, 'managedFolder' => $managedFolder];
77 $params = array_merge($params, $optParams);
78 return $this->call('get', [$params], ManagedFolder::class);
79 }
80 /**
81 * Returns an IAM policy for the specified managed folder.
82 * (managedFolders.getIamPolicy)
83 *
84 * @param string $bucket Name of the bucket containing the managed folder.
85 * @param string $managedFolder The managed folder name/path.
86 * @param array $optParams Optional parameters.
87 *
88 * @opt_param int optionsRequestedPolicyVersion The IAM policy format version to
89 * be returned. If the optionsRequestedPolicyVersion is for an older version
90 * that doesn't support part of the requested IAM policy, the request fails.
91 * @opt_param string userProject The project to be billed for this request.
92 * Required for Requester Pays buckets.
93 * @return Policy
94 * @throws \Google\Service\Exception
95 */
96 public function getIamPolicy($bucket, $managedFolder, $optParams = [])
97 {
98 $params = ['bucket' => $bucket, 'managedFolder' => $managedFolder];
99 $params = array_merge($params, $optParams);
100 return $this->call('getIamPolicy', [$params], Policy::class);
101 }
102 /**
103 * Creates a new managed folder. (managedFolders.insert)
104 *
105 * @param string $bucket Name of the bucket containing the managed folder.
106 * @param ManagedFolder $postBody
107 * @param array $optParams Optional parameters.
108 * @return ManagedFolder
109 * @throws \Google\Service\Exception
110 */
111 public function insert($bucket, ManagedFolder $postBody, $optParams = [])
112 {
113 $params = ['bucket' => $bucket, 'postBody' => $postBody];
114 $params = array_merge($params, $optParams);
115 return $this->call('insert', [$params], ManagedFolder::class);
116 }
117 /**
118 * Lists managed folders in the given bucket.
119 * (managedFolders.listManagedFolders)
120 *
121 * @param string $bucket Name of the bucket containing the managed folder.
122 * @param array $optParams Optional parameters.
123 *
124 * @opt_param int pageSize Maximum number of items to return in a single page of
125 * responses.
126 * @opt_param string pageToken A previously-returned page token representing
127 * part of the larger set of results to view.
128 * @opt_param string prefix The managed folder name/path prefix to filter the
129 * output list of results.
130 * @return ManagedFoldersModel
131 * @throws \Google\Service\Exception
132 */
133 public function listManagedFolders($bucket, $optParams = [])
134 {
135 $params = ['bucket' => $bucket];
136 $params = array_merge($params, $optParams);
137 return $this->call('list', [$params], ManagedFoldersModel::class);
138 }
139 /**
140 * Updates an IAM policy for the specified managed folder.
141 * (managedFolders.setIamPolicy)
142 *
143 * @param string $bucket Name of the bucket containing the managed folder.
144 * @param string $managedFolder The managed folder name/path.
145 * @param Policy $postBody
146 * @param array $optParams Optional parameters.
147 *
148 * @opt_param string userProject The project to be billed for this request.
149 * Required for Requester Pays buckets.
150 * @return Policy
151 * @throws \Google\Service\Exception
152 */
153 public function setIamPolicy($bucket, $managedFolder, Policy $postBody, $optParams = [])
154 {
155 $params = ['bucket' => $bucket, 'managedFolder' => $managedFolder, 'postBody' => $postBody];
156 $params = array_merge($params, $optParams);
157 return $this->call('setIamPolicy', [$params], Policy::class);
158 }
159 /**
160 * Tests a set of permissions on the given managed folder to see which, if any,
161 * are held by the caller. (managedFolders.testIamPermissions)
162 *
163 * @param string $bucket Name of the bucket containing the managed folder.
164 * @param string $managedFolder The managed folder name/path.
165 * @param string|array $permissions Permissions to test.
166 * @param array $optParams Optional parameters.
167 *
168 * @opt_param string userProject The project to be billed for this request.
169 * Required for Requester Pays buckets.
170 * @return TestIamPermissionsResponse
171 * @throws \Google\Service\Exception
172 */
173 public function testIamPermissions($bucket, $managedFolder, $permissions, $optParams = [])
174 {
175 $params = ['bucket' => $bucket, 'managedFolder' => $managedFolder, 'permissions' => $permissions];
176 $params = array_merge($params, $optParams);
177 return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
178 }
179}
180
181// Adding a class alias for backwards compatibility with the previous class name.
182class_alias(ManagedFolders::class, 'Google_Service_Storage_Resource_ManagedFolders');
Note: See TracBrowser for help on using the repository browser.