PageRenderTime 37ms CodeModel.GetById 9ms RepoModel.GetById 1ms app.codeStats 0ms

/application/third_party/google-api/vendor/google/apiclient-services/src/Google/Service/Storage/Resource/Buckets.php

https://gitlab.com/Anas7232/Layout-Changes
PHP | 268 lines | 64 code | 1 blank | 203 comment | 0 complexity | 815bdfe16879a922ae68ee5d3e8a9c9d MD5 | raw file
  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. * The "buckets" collection of methods.
  19. * Typical usage is:
  20. * <code>
  21. * $storageService = new Google_Service_Storage(...);
  22. * $buckets = $storageService->buckets;
  23. * </code>
  24. */
  25. class Google_Service_Storage_Resource_Buckets extends Google_Service_Resource
  26. {
  27. /**
  28. * Permanently deletes an empty bucket. (buckets.delete)
  29. *
  30. * @param string $bucket Name of a bucket.
  31. * @param array $optParams Optional parameters.
  32. *
  33. * @opt_param string ifMetagenerationMatch If set, only deletes the bucket if
  34. * its metageneration matches this value.
  35. * @opt_param string ifMetagenerationNotMatch If set, only deletes the bucket if
  36. * its metageneration does not match this value.
  37. * @opt_param string provisionalUserProject The project to be billed for this
  38. * request if the target bucket is requester-pays bucket.
  39. * @opt_param string userProject The project to be billed for this request.
  40. * Required for Requester Pays buckets.
  41. */
  42. public function delete($bucket, $optParams = array())
  43. {
  44. $params = array('bucket' => $bucket);
  45. $params = array_merge($params, $optParams);
  46. return $this->call('delete', array($params));
  47. }
  48. /**
  49. * Returns metadata for the specified bucket. (buckets.get)
  50. *
  51. * @param string $bucket Name of a bucket.
  52. * @param array $optParams Optional parameters.
  53. *
  54. * @opt_param string ifMetagenerationMatch Makes the return of the bucket
  55. * metadata conditional on whether the bucket's current metageneration matches
  56. * the given value.
  57. * @opt_param string ifMetagenerationNotMatch Makes the return of the bucket
  58. * metadata conditional on whether the bucket's current metageneration does not
  59. * match the given value.
  60. * @opt_param string projection Set of properties to return. Defaults to noAcl.
  61. * @opt_param string provisionalUserProject The project to be billed for this
  62. * request if the target bucket is requester-pays bucket.
  63. * @opt_param string userProject The project to be billed for this request.
  64. * Required for Requester Pays buckets.
  65. * @return Google_Service_Storage_Bucket
  66. */
  67. public function get($bucket, $optParams = array())
  68. {
  69. $params = array('bucket' => $bucket);
  70. $params = array_merge($params, $optParams);
  71. return $this->call('get', array($params), "Google_Service_Storage_Bucket");
  72. }
  73. /**
  74. * Returns an IAM policy for the specified bucket. (buckets.getIamPolicy)
  75. *
  76. * @param string $bucket Name of a bucket.
  77. * @param array $optParams Optional parameters.
  78. *
  79. * @opt_param int optionsRequestedPolicyVersion The IAM policy format version to
  80. * be returned. If the optionsRequestedPolicyVersion is for an older version
  81. * that doesn't support part of the requested IAM policy, the request fails.
  82. * @opt_param string provisionalUserProject The project to be billed for this
  83. * request if the target bucket is requester-pays bucket.
  84. * @opt_param string userProject The project to be billed for this request.
  85. * Required for Requester Pays buckets.
  86. * @return Google_Service_Storage_Policy
  87. */
  88. public function getIamPolicy($bucket, $optParams = array())
  89. {
  90. $params = array('bucket' => $bucket);
  91. $params = array_merge($params, $optParams);
  92. return $this->call('getIamPolicy', array($params), "Google_Service_Storage_Policy");
  93. }
  94. /**
  95. * Creates a new bucket. (buckets.insert)
  96. *
  97. * @param string $project A valid API project identifier.
  98. * @param Google_Service_Storage_Bucket $postBody
  99. * @param array $optParams Optional parameters.
  100. *
  101. * @opt_param string predefinedAcl Apply a predefined set of access controls to
  102. * this bucket.
  103. * @opt_param string predefinedDefaultObjectAcl Apply a predefined set of
  104. * default object access controls to this bucket.
  105. * @opt_param string projection Set of properties to return. Defaults to noAcl,
  106. * unless the bucket resource specifies acl or defaultObjectAcl properties, when
  107. * it defaults to full.
  108. * @opt_param string provisionalUserProject The project to be billed for this
  109. * request if the target bucket is requester-pays bucket.
  110. * @opt_param string userProject The project to be billed for this request.
  111. * @return Google_Service_Storage_Bucket
  112. */
  113. public function insert($project, Google_Service_Storage_Bucket $postBody, $optParams = array())
  114. {
  115. $params = array('project' => $project, 'postBody' => $postBody);
  116. $params = array_merge($params, $optParams);
  117. return $this->call('insert', array($params), "Google_Service_Storage_Bucket");
  118. }
  119. /**
  120. * Retrieves a list of buckets for a given project. (buckets.listBuckets)
  121. *
  122. * @param string $project A valid API project identifier.
  123. * @param array $optParams Optional parameters.
  124. *
  125. * @opt_param string maxResults Maximum number of buckets to return in a single
  126. * response. The service will use this parameter or 1,000 items, whichever is
  127. * smaller.
  128. * @opt_param string pageToken A previously-returned page token representing
  129. * part of the larger set of results to view.
  130. * @opt_param string prefix Filter results to buckets whose names begin with
  131. * this prefix.
  132. * @opt_param string projection Set of properties to return. Defaults to noAcl.
  133. * @opt_param string provisionalUserProject The project to be billed for this
  134. * request if the target bucket is requester-pays bucket.
  135. * @opt_param string userProject The project to be billed for this request.
  136. * @return Google_Service_Storage_Buckets
  137. */
  138. public function listBuckets($project, $optParams = array())
  139. {
  140. $params = array('project' => $project);
  141. $params = array_merge($params, $optParams);
  142. return $this->call('list', array($params), "Google_Service_Storage_Buckets");
  143. }
  144. /**
  145. * Locks retention policy on a bucket. (buckets.lockRetentionPolicy)
  146. *
  147. * @param string $bucket Name of a bucket.
  148. * @param string $ifMetagenerationMatch Makes the operation conditional on
  149. * whether bucket's current metageneration matches the given value.
  150. * @param array $optParams Optional parameters.
  151. *
  152. * @opt_param string provisionalUserProject The project to be billed for this
  153. * request if the target bucket is requester-pays bucket.
  154. * @opt_param string userProject The project to be billed for this request.
  155. * Required for Requester Pays buckets.
  156. * @return Google_Service_Storage_Bucket
  157. */
  158. public function lockRetentionPolicy($bucket, $ifMetagenerationMatch, $optParams = array())
  159. {
  160. $params = array('bucket' => $bucket, 'ifMetagenerationMatch' => $ifMetagenerationMatch);
  161. $params = array_merge($params, $optParams);
  162. return $this->call('lockRetentionPolicy', array($params), "Google_Service_Storage_Bucket");
  163. }
  164. /**
  165. * Patches a bucket. Changes to the bucket will be readable immediately after
  166. * writing, but configuration changes may take time to propagate.
  167. * (buckets.patch)
  168. *
  169. * @param string $bucket Name of a bucket.
  170. * @param Google_Service_Storage_Bucket $postBody
  171. * @param array $optParams Optional parameters.
  172. *
  173. * @opt_param string ifMetagenerationMatch Makes the return of the bucket
  174. * metadata conditional on whether the bucket's current metageneration matches
  175. * the given value.
  176. * @opt_param string ifMetagenerationNotMatch Makes the return of the bucket
  177. * metadata conditional on whether the bucket's current metageneration does not
  178. * match the given value.
  179. * @opt_param string predefinedAcl Apply a predefined set of access controls to
  180. * this bucket.
  181. * @opt_param string predefinedDefaultObjectAcl Apply a predefined set of
  182. * default object access controls to this bucket.
  183. * @opt_param string projection Set of properties to return. Defaults to full.
  184. * @opt_param string provisionalUserProject The project to be billed for this
  185. * request if the target bucket is requester-pays bucket.
  186. * @opt_param string userProject The project to be billed for this request.
  187. * Required for Requester Pays buckets.
  188. * @return Google_Service_Storage_Bucket
  189. */
  190. public function patch($bucket, Google_Service_Storage_Bucket $postBody, $optParams = array())
  191. {
  192. $params = array('bucket' => $bucket, 'postBody' => $postBody);
  193. $params = array_merge($params, $optParams);
  194. return $this->call('patch', array($params), "Google_Service_Storage_Bucket");
  195. }
  196. /**
  197. * Updates an IAM policy for the specified bucket. (buckets.setIamPolicy)
  198. *
  199. * @param string $bucket Name of a bucket.
  200. * @param Google_Service_Storage_Policy $postBody
  201. * @param array $optParams Optional parameters.
  202. *
  203. * @opt_param string provisionalUserProject The project to be billed for this
  204. * request if the target bucket is requester-pays bucket.
  205. * @opt_param string userProject The project to be billed for this request.
  206. * Required for Requester Pays buckets.
  207. * @return Google_Service_Storage_Policy
  208. */
  209. public function setIamPolicy($bucket, Google_Service_Storage_Policy $postBody, $optParams = array())
  210. {
  211. $params = array('bucket' => $bucket, 'postBody' => $postBody);
  212. $params = array_merge($params, $optParams);
  213. return $this->call('setIamPolicy', array($params), "Google_Service_Storage_Policy");
  214. }
  215. /**
  216. * Tests a set of permissions on the given bucket to see which, if any, are held
  217. * by the caller. (buckets.testIamPermissions)
  218. *
  219. * @param string $bucket Name of a bucket.
  220. * @param string|array $permissions Permissions to test.
  221. * @param array $optParams Optional parameters.
  222. *
  223. * @opt_param string provisionalUserProject The project to be billed for this
  224. * request if the target bucket is requester-pays bucket.
  225. * @opt_param string userProject The project to be billed for this request.
  226. * Required for Requester Pays buckets.
  227. * @return Google_Service_Storage_TestIamPermissionsResponse
  228. */
  229. public function testIamPermissions($bucket, $permissions, $optParams = array())
  230. {
  231. $params = array('bucket' => $bucket, 'permissions' => $permissions);
  232. $params = array_merge($params, $optParams);
  233. return $this->call('testIamPermissions', array($params), "Google_Service_Storage_TestIamPermissionsResponse");
  234. }
  235. /**
  236. * Updates a bucket. Changes to the bucket will be readable immediately after
  237. * writing, but configuration changes may take time to propagate.
  238. * (buckets.update)
  239. *
  240. * @param string $bucket Name of a bucket.
  241. * @param Google_Service_Storage_Bucket $postBody
  242. * @param array $optParams Optional parameters.
  243. *
  244. * @opt_param string ifMetagenerationMatch Makes the return of the bucket
  245. * metadata conditional on whether the bucket's current metageneration matches
  246. * the given value.
  247. * @opt_param string ifMetagenerationNotMatch Makes the return of the bucket
  248. * metadata conditional on whether the bucket's current metageneration does not
  249. * match the given value.
  250. * @opt_param string predefinedAcl Apply a predefined set of access controls to
  251. * this bucket.
  252. * @opt_param string predefinedDefaultObjectAcl Apply a predefined set of
  253. * default object access controls to this bucket.
  254. * @opt_param string projection Set of properties to return. Defaults to full.
  255. * @opt_param string provisionalUserProject The project to be billed for this
  256. * request if the target bucket is requester-pays bucket.
  257. * @opt_param string userProject The project to be billed for this request.
  258. * Required for Requester Pays buckets.
  259. * @return Google_Service_Storage_Bucket
  260. */
  261. public function update($bucket, Google_Service_Storage_Bucket $postBody, $optParams = array())
  262. {
  263. $params = array('bucket' => $bucket, 'postBody' => $postBody);
  264. $params = array_merge($params, $optParams);
  265. return $this->call('update', array($params), "Google_Service_Storage_Bucket");
  266. }
  267. }