洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
3.3 KiB

9 months ago
  1. //
  2. // OSSClient.h
  3. // oss_ios_sdk
  4. //
  5. // Created by zhouzhuo on 8/16/15.
  6. // Copyright (c) 2015 aliyun.com. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @class OSSGetServiceRequest;
  10. @class OSSCreateBucketRequest;
  11. @class OSSDeleteBucketRequest;
  12. @class OSSHeadObjectRequest;
  13. @class OSSGetBucketRequest;
  14. @class OSSGetBucketACLRequest;
  15. @class OSSGetObjectRequest;
  16. @class OSSGetObjectACLRequest;
  17. @class OSSPutObjectRequest;
  18. @class OSSPutObjectACLRequest;
  19. @class OSSDeleteObjectRequest;
  20. @class OSSDeleteMultipleObjectsRequest;
  21. @class OSSCopyObjectRequest;
  22. @class OSSInitMultipartUploadRequest;
  23. @class OSSUploadPartRequest;
  24. @class OSSCompleteMultipartUploadRequest;
  25. @class OSSListPartsRequest;
  26. @class OSSListMultipartUploadsRequest;
  27. @class OSSAbortMultipartUploadRequest;
  28. @class OSSAppendObjectRequest;
  29. @class OSSResumableUploadRequest;
  30. @class OSSMultipartUploadRequest;
  31. @class OSSCallBackRequest;
  32. @class OSSImagePersistRequest;
  33. @class OSSGetBucketInfoRequest;
  34. @class OSSPutSymlinkRequest;
  35. @class OSSGetSymlinkRequest;
  36. @class OSSRestoreObjectRequest;
  37. @class OSSTask;
  38. @class OSSExecutor;
  39. @class OSSNetworking;
  40. @class OSSClientConfiguration;
  41. @protocol OSSCredentialProvider;
  42. NS_ASSUME_NONNULL_BEGIN
  43. /**
  44. OSSClient is the entry class to access OSS in an iOS client. It provides all the methods to communicate with OSS.
  45. Generally speaking, only one instance of OSSClient is needed in the whole app.
  46. */
  47. @interface OSSClient : NSObject
  48. /**
  49. OSS endpoint. It varies in different regions. Please check out OSS official website for the exact endpoints for your data.
  50. */
  51. @property (nonatomic, strong) NSString * endpoint;
  52. /**
  53. The networking instance for sending and receiving data
  54. */
  55. @property (nonatomic, strong) OSSNetworking * networking;
  56. /**
  57. The credential provider instance
  58. */
  59. @property (nonatomic, strong) id<OSSCredentialProvider> credentialProvider;
  60. /**
  61. Client configuration instance
  62. */
  63. @property (nonatomic, strong) OSSClientConfiguration * clientConfiguration;
  64. /**
  65. oss operation task queue
  66. */
  67. @property (nonatomic, strong, readonly) OSSExecutor * ossOperationExecutor;
  68. /**
  69. Initializes an OSSClient instance with the default client configuration.
  70. @endpoint it specifies domain of the bucket's region. Starting 2017, the domain must be prefixed with "https://" to follow Apple's ATS policy.
  71. For example: "https://oss-cn-hangzhou.aliyuncs.com"
  72. @credentialProvider The credential provider
  73. */
  74. - (instancetype)initWithEndpoint:(NSString *)endpoint
  75. credentialProvider:(id<OSSCredentialProvider>) credentialProvider;
  76. /**
  77. Initializes an OSSClient with the custom client configuration.
  78. @endpoint it specifies domain of the bucket's region. Starting 2017, the domain must be prefixed with "https://" to follow Apple's ATS policy.
  79. For example: "https://oss-cn-hangzhou.aliyuncs.com"
  80. @credentialProvider The credential provider
  81. @conf The custom client configuration such as retry time, timeout values, etc.
  82. */
  83. - (instancetype)initWithEndpoint:(NSString *)endpoint
  84. credentialProvider:(id<OSSCredentialProvider>)credentialProvider
  85. clientConfiguration:(OSSClientConfiguration *)conf;
  86. @end
  87. @interface OSSClient (Object)
  88. /**
  89. The corresponding RESTFul API: PutObject
  90. Uploads a file.
  91. */
  92. - (OSSTask *)putObject:(OSSPutObjectRequest *)request;
  93. @end
  94. NS_ASSUME_NONNULL_END