QCloudPutBucketRequest.h 6.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. //
  2. // PutBucket.h
  3. // PutBucket
  4. //
  5. // Created by tencent
  6. // Copyright (c) 2015年 tencent. All rights reserved.
  7. //
  8. // ██████╗ ██████╗██╗ ██████╗ ██╗ ██╗██████╗ ████████╗███████╗██████╗ ███╗ ███╗██╗███╗ ██╗ █████╗ ██╗ ██╗ █████╗ ██████╗
  9. // ██╔═══██╗██╔════╝██║ ██╔═══██╗██║ ██║██╔══██╗ ╚══██╔══╝██╔════╝██╔══██╗████╗ ████║██║████╗ ██║██╔══██╗██║ ██║ ██╔══██╗██╔══██╗
  10. // ██║ ██║██║ ██║ ██║ ██║██║ ██║██║ ██║ ██║ █████╗ ██████╔╝██╔████╔██║██║██╔██╗ ██║███████║██║ ██║ ███████║██████╔╝
  11. // ██║▄▄ ██║██║ ██║ ██║ ██║██║ ██║██║ ██║ ██║ ██╔══╝ ██╔══██╗██║╚██╔╝██║██║██║╚██╗██║██╔══██║██║ ██║ ██╔══██║██╔══██╗
  12. // ╚██████╔╝╚██████╗███████╗╚██████╔╝╚██████╔╝██████╔╝ ██║ ███████╗██║ ██║██║ ╚═╝ ██║██║██║ ╚████║██║ ██║███████╗ ███████╗██║ ██║██████╔╝
  13. // ╚══▀▀═╝ ╚═════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝ ╚══════╝╚═╝ ╚═╝╚═════╝
  14. //
  15. //
  16. // _ __ _ _
  17. // (_) / _| | | | |
  18. // ___ ___ _ ____ ___ ___ ___ | |_ ___ _ __ __| | _____ _____| | ___ _ __ ___ _ __ ___
  19. // / __|/ _ \ '__\ \ / / |/ __/ _ \ | _/ _ \| '__| / _` |/ _ \ \ / / _ \ |/ _ \| '_ \ / _ \ '__/ __|
  20. // \__ \ __/ | \ V /| | (_| __/ | || (_) | | | (_| | __/\ V / __/ | (_) | |_) | __/ | \__
  21. // |___/\___|_| \_/ |_|\___\___| |_| \___/|_| \__,_|\___| \_/ \___|_|\___/| .__/ \___|_| |___/
  22. // ______ ______ ______ ______ ______ ______ ______ ______ | |
  23. // |______|______|______|______|______|______|______|______| |_|
  24. //
  25. #import <Foundation/Foundation.h>
  26. #import <QCloudCore/QCloudCore.h>
  27. NS_ASSUME_NONNULL_BEGIN
  28. /**
  29. 创建存储桶(Bucket)的方法.
  30. 在开始使用 COS 时,需要在指定的账号下先创建一个 Bucket 以便于对象的使用和管理. 并指定 Bucket 所属的地域.创建 Bucket 的用户默认成为 Bucket 的持有者.若创建 Bucket 时没有指定访问权限,则默认 为私有读写(private)权限.
  31. 可用地域,可以查看https://cloud.tencent.com/document/product/436/6224.
  32. 关于创建 Bucket 描述,请查看 https://cloud.tencent.com/document/product/436/14106.
  33. 关于创建存储桶(Bucket)接口的具体 描述,请查看 https://cloud.tencent.com/document/product/436/7738.
  34. cos iOS SDK 中创建 Bucket的方法具体步骤如下:
  35. 1. 实例化 QCloudPutBucketRequest,填入需要的参数。
  36. 2. 调用 QCloudCOSXMLService 对象中的 PutBucket 方法发出请求。
  37. 3. 从回调的 finishBlock 中的 outputObject 获取具体内容。
  38. 示例:
  39. @code
  40. QCloudPutBucketRequest* request = [QCloudPutBucketRequest new];
  41. request.bucket = bucketName; //additional actions after finishing
  42. [request setFinishBlock:^(id outputObject, NSError* error) {
  43. }];
  44. [[QCloudCOSXMLService defaultCOSXML] PutBucket:request];
  45. @endcode
  46. */
  47. @interface QCloudPutBucketRequest : QCloudBizHTTPRequest
  48. /**
  49. 定义 Object 的 ACL 属性。有效值:private,public-read-write,public-read;默认值:private
  50. */
  51. @property (strong, nonatomic) NSString *accessControlList;
  52. /**
  53. 赋予被授权者读的权限。格式:x-cos-grant-read: id=" ",id=" ";
  54. 当需要给子账户授权时,id="qcs::cam::uin/<OwnerUin>:uin/<SubUin>",
  55. 当需要给根账户授权时,id="qcs::cam::uin/<OwnerUin>:uin/<OwnerUin>"
  56. 其中,<OwnerUin>为根账户的uin,而<SubUin>为子账户的uin,使用时替换
  57. */
  58. @property (strong, nonatomic) NSString *grantRead;
  59. /**
  60. 赋予被授权者写的权限。格式:x-cos-grant-write: id=" ",id=" ";
  61. 当需要给子账户授权时,id="qcs::cam::uin/<OwnerUin>:uin/<SubUin>",
  62. 当需要给根账户授权时,id="qcs::cam::uin/<OwnerUin>:uin/<OwnerUin>"
  63. 其中,<OwnerUin>为根账户的uin,而<SubUin>为子账户的uin,使用时替换
  64. */
  65. @property (strong, nonatomic) NSString *grantWrite;
  66. /**
  67. 赋予被授权者读写权限。格式: id=" ",id=" " ;
  68. 当需要给子账户授权时,id="qcs::cam::uin/<OwnerUin>:uin/<SubUin>",
  69. 当需要给根账户授权时,id="qcs::cam::uin/<OwnerUin>:uin/<OwnerUin>"
  70. 其中,<OwnerUin>为根账户的uin,而<SubUin>为子账户的uin,使用时替换
  71. */
  72. @property (strong, nonatomic) NSString *grantFullControl;
  73. /**
  74. 要创建的存储桶名
  75. 注意存储桶名只能由数字和小写字母组成,并且长度不能超过40个字符,否则会创建失败
  76. */
  77. @property (strong, nonatomic) NSString *bucket;
  78. @end
  79. NS_ASSUME_NONNULL_END