aliyun-oss-react-native

OSSConstants.h 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. //
  2. // OSSConstants.h
  3. // AliyunOSSSDK
  4. //
  5. // Created by huaixu on 2018/1/22.
  6. // Copyright © 2018年 aliyun. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. typedef NSString* _Nullable (^OSSCustomSignContentBlock) (NSString * contentToSign, NSError **error);
  11. typedef NSData * _Nullable (^OSSResponseDecoderBlock) (NSData * data);
  12. typedef void (^OSSNetworkingUploadProgressBlock) (int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend);
  13. typedef void (^OSSNetworkingDownloadProgressBlock) (int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite);
  14. typedef void (^OSSNetworkingRetryBlock) (void);
  15. typedef void (^OSSNetworkingCompletionHandlerBlock) (id _Nullable responseObject, NSError * _Nullable error);
  16. typedef void (^OSSNetworkingOnRecieveDataBlock) (NSData * data);
  17. /**
  18. The flag of verification about crc64
  19. */
  20. typedef NS_ENUM(NSUInteger, OSSRequestCRCFlag) {
  21. OSSRequestCRCUninitialized,
  22. OSSRequestCRCOpen,
  23. OSSRequestCRCClosed
  24. };
  25. /**
  26. Retry type definition
  27. */
  28. typedef NS_ENUM(NSInteger, OSSNetworkingRetryType) {
  29. OSSNetworkingRetryTypeUnknown,
  30. OSSNetworkingRetryTypeShouldRetry,
  31. OSSNetworkingRetryTypeShouldNotRetry,
  32. OSSNetworkingRetryTypeShouldRefreshCredentialsAndRetry,
  33. OSSNetworkingRetryTypeShouldCorrectClockSkewAndRetry
  34. };
  35. /**
  36. * @brief: The following constants are provided by OSSNetworking as possible operation types.
  37. */
  38. typedef NS_ENUM(NSInteger, OSSOperationType) {
  39. OSSOperationTypeGetService,
  40. OSSOperationTypeCreateBucket,
  41. OSSOperationTypeDeleteBucket,
  42. OSSOperationTypeGetBucket,
  43. OSSOperationTypeGetBucketACL,
  44. OSSOperationTypeHeadObject,
  45. OSSOperationTypeGetObject,
  46. OSSOperationTypeGetObjectACL,
  47. OSSOperationTypePutObject,
  48. OSSOperationTypePutObjectACL,
  49. OSSOperationTypeAppendObject,
  50. OSSOperationTypeDeleteObject,
  51. OSSOperationTypeDeleteMultipleObjects,
  52. OSSOperationTypeCopyObject,
  53. OSSOperationTypeInitMultipartUpload,
  54. OSSOperationTypeUploadPart,
  55. OSSOperationTypeCompleteMultipartUpload,
  56. OSSOperationTypeAbortMultipartUpload,
  57. OSSOperationTypeListMultipart,
  58. OSSOperationTypeListMultipartUploads,
  59. OSSOperationTypeTriggerCallBack,
  60. OSSOperationTypeImagePersist
  61. };
  62. /**
  63. * @brief: The following constants are provided by OSSClient as possible error codes.
  64. */
  65. typedef NS_ENUM(NSInteger, OSSClientErrorCODE) {
  66. OSSClientErrorCodeNetworkingFailWithResponseCode0,
  67. OSSClientErrorCodeSignFailed,
  68. OSSClientErrorCodeFileCantWrite,
  69. OSSClientErrorCodeInvalidArgument,
  70. OSSClientErrorCodeNilUploadid,
  71. OSSClientErrorCodeTaskCancelled,
  72. OSSClientErrorCodeNetworkError,
  73. OSSClientErrorCodeInvalidCRC,
  74. OSSClientErrorCodeCannotResumeUpload,
  75. OSSClientErrorCodeExcpetionCatched,
  76. OSSClientErrorCodeNotKnown
  77. };
  78. typedef NS_ENUM(NSInteger, OSSXMLDictionaryAttributesMode)
  79. {
  80. OSSXMLDictionaryAttributesModePrefixed = 0, //default
  81. OSSXMLDictionaryAttributesModeDictionary,
  82. OSSXMLDictionaryAttributesModeUnprefixed,
  83. OSSXMLDictionaryAttributesModeDiscard
  84. };
  85. typedef NS_ENUM(NSInteger, OSSXMLDictionaryNodeNameMode)
  86. {
  87. OSSXMLDictionaryNodeNameModeRootOnly = 0, //default
  88. OSSXMLDictionaryNodeNameModeAlways,
  89. OSSXMLDictionaryNodeNameModeNever
  90. };
  91. typedef NSString * OSSXMLDictionaryAttributeName NS_EXTENSIBLE_STRING_ENUM;
  92. OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryAttributesKey;
  93. OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryCommentsKey;
  94. OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryTextKey;
  95. OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryNodeNameKey;
  96. OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryAttributePrefix;
  97. NS_ASSUME_NONNULL_END