1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498 |
- //
- // OSSModel.h
- // oss_ios_sdk
- //
- // Created by zhouzhuo on 8/16/15.
- // Copyright (c) 2015 aliyun.com. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- #import "OSSRequest.h"
- #import "OSSResult.h"
- @class OSSAllRequestNeededMessage;
- @class OSSFederationToken;
- @class OSSTask;
- @class OSSClientConfiguration;
- NS_ASSUME_NONNULL_BEGIN
- typedef OSSFederationToken * _Nullable (^OSSGetFederationTokenBlock) (void);
- /**
- Categories NSDictionary
- */
- @interface NSDictionary (OSS)
- - (NSString *)base64JsonString;
- @end
- /**
- A thread-safe dictionary
- */
- @interface OSSSyncMutableDictionary : NSObject
- @property (nonatomic, strong) NSMutableDictionary *dictionary;
- @property (nonatomic, strong) dispatch_queue_t dispatchQueue;
- - (id)objectForKey:(id)aKey;
- - (NSArray *)allKeys;
- - (void)setObject:(id)anObject forKey:(id <NSCopying>)aKey;
- - (void)removeObjectForKey:(id)aKey;
- @end
- /**
- FederationToken class
- */
- @interface OSSFederationToken : NSObject
- @property (nonatomic, copy) NSString * tAccessKey;
- @property (nonatomic, copy) NSString * tSecretKey;
- @property (nonatomic, copy) NSString * tToken;
- /**
- Token's expiration time in milliseconds of the unix time.
- */
- @property (atomic, assign) int64_t expirationTimeInMilliSecond;
- /**
- Token's expiration time in GMT format string.
- */
- @property (atomic, strong, nullable) NSString *expirationTimeInGMTFormat;
- @end
- /**
- CredentialProvider protocol, needs to implement sign API.
- */
- @protocol OSSCredentialProvider <NSObject>
- @optional
- - (nullable NSString *)sign:(NSString *)content error:(NSError **)error;
- @end
- /**
- The plaint text AK/SK credential provider for test purposely.
- */
- __attribute__((deprecated("PLEASE DO NOT USE THIS CLASS AGAIN")))
- @interface OSSPlainTextAKSKPairCredentialProvider : NSObject <OSSCredentialProvider>
- @property (nonatomic, copy) NSString * accessKey;
- @property (nonatomic, copy) NSString * secretKey;
- - (instancetype)initWithPlainTextAccessKey:(NSString *)accessKey
- secretKey:(NSString *)secretKey __attribute__((deprecated("We recommend the STS authentication mode on mobile")));
- @end
- /**
- TODOTODO
- The custom signed credential provider
- */
- @interface OSSCustomSignerCredentialProvider : NSObject <OSSCredentialProvider>
- @property (nonatomic, copy, readonly,) NSString * _Nonnull (^ _Nonnull signContent)( NSString * _Nonnull , NSError * _Nullable *_Nullable);
- + (instancetype _Nullable)new NS_UNAVAILABLE;
- - (instancetype _Nullable)init NS_UNAVAILABLE;
- /**
- * During the task execution, this API is called for signing
- * It's executed at the background thread instead of UI thread.
- */
- - (instancetype _Nullable)initWithImplementedSigner:(OSSCustomSignContentBlock)signContent NS_DESIGNATED_INITIALIZER;
- @end
- /**
- TODOTODO
- User's custom federation credential provider.
- */
- @interface OSSFederationCredentialProvider : NSObject <OSSCredentialProvider>
- @property (nonatomic, strong) OSSFederationToken * cachedToken;
- @property (nonatomic, copy) OSSFederationToken * (^federationTokenGetter)(void);
- /**
- During the task execution, this method is called to get the new STS token.
- It runs in the background thread, not the UI thread.
- */
- - (instancetype)initWithFederationTokenGetter:(OSSGetFederationTokenBlock)federationTokenGetter;
- - (nullable OSSFederationToken *)getToken:(NSError **)error;
- @end
- /**
- The STS token's credential provider.
- */
- __attribute__((deprecated("Please use OSSAuthCredentialProvider or its subClass instead!")))
- @interface OSSStsTokenCredentialProvider : NSObject <OSSCredentialProvider>
- @property (nonatomic, copy) NSString * accessKeyId;
- @property (nonatomic, copy) NSString * secretKeyId;
- @property (nonatomic, copy) NSString * securityToken;
- - (OSSFederationToken *)getToken;
- - (instancetype)initWithAccessKeyId:(NSString *)accessKeyId
- secretKeyId:(NSString *)secretKeyId
- securityToken:(NSString *)securityToken;
- @end
- /**
- Auth credential provider require a STS INFO Server URL,also you can customize a decoder block which returns json data.
-
-
- OSSAuthCredentialProvider *acp = [[OSSAuthCredentialProvider alloc] initWithAuthServerUrl:@"sts_server_url" responseDecoder:^NSData * (NSData * data) {
- // 1.hanle response from server.
-
- // 2.initialize json object from step 1. json object require message like {AccessKeyId:@"xxx",AccessKeySecret:@"xxx",SecurityToken:@"xxx",Expiration:@"xxx"}
-
- // 3.generate jsonData from step 2 and return it.
- }];
-
- */
- @interface OSSAuthCredentialProvider : OSSFederationCredentialProvider
- @property (nonatomic, copy) NSString * authServerUrl;
- @property (nonatomic, copy) NSData * (^responseDecoder)(NSData *);
- - (instancetype)initWithAuthServerUrl:(NSString *)authServerUrl;
- - (instancetype)initWithAuthServerUrl:(NSString *)authServerUrl responseDecoder:(nullable OSSResponseDecoderBlock)decoder;
- @end
- /**
- OSSClient side configuration.
- */
- @interface OSSClientConfiguration : NSObject
- /**
- Max retry count
- */
- @property (nonatomic, assign) uint32_t maxRetryCount;
- /**
- Max concurrent requests
- */
- @property (nonatomic, assign) uint32_t maxConcurrentRequestCount;
- /**
- Flag of enabling background file transmit service.
- Note: it's only applicable for file upload.
- */
- @property (nonatomic, assign) BOOL enableBackgroundTransmitService;
- /**
- Flag of using Http request for DNS resolution.
- */
- @property (nonatomic, assign) BOOL isHttpdnsEnable;
- /**
- Sets the session Id for background file transmission
- */
- @property (nonatomic, copy) NSString * backgroundSesseionIdentifier;
- /**
- Sets request timeout
- */
- @property (nonatomic, assign) NSTimeInterval timeoutIntervalForRequest;
- /**
- Sets single object download's max time
- */
- @property (nonatomic, assign) NSTimeInterval timeoutIntervalForResource;
- /**
- Sets proxy host and port.
- */
- @property (nonatomic, copy) NSString * proxyHost;
- @property (nonatomic, strong) NSNumber * proxyPort;
- /**
- Sets UA
- */
- @property (nonatomic, copy) NSString * userAgentMark;
- /**
- Sets CName excluded list.
- */
- @property (nonatomic, strong, setter=setCnameExcludeList:) NSArray * cnameExcludeList;
- /**
- 是否开启crc校验(当同时设置了此选项和请求中的checkCRC开关时,以请求中的checkCRC开关为准)
- */
- @property (nonatomic, assign) BOOL crc64Verifiable;
- @end
- @protocol OSSRequestInterceptor <NSObject>
- - (OSSTask *)interceptRequestMessage:(OSSAllRequestNeededMessage *)request;
- @end
- /**
- Signs the request when it's being created.
- */
- @interface OSSSignerInterceptor : NSObject <OSSRequestInterceptor>
- @property (nonatomic, strong) id<OSSCredentialProvider> credentialProvider;
- - (instancetype)initWithCredentialProvider:(id<OSSCredentialProvider>)credentialProvider;
- @end
- /**
- Updates the UA when creating the request.
- */
- @interface OSSUASettingInterceptor : NSObject <OSSRequestInterceptor>
- @property (nonatomic, weak) OSSClientConfiguration *clientConfiguration;
- - (instancetype)initWithClientConfiguration:(OSSClientConfiguration *) clientConfiguration;
- @end
- /**
- Fixes the time skew issue when creating the request.
- */
- @interface OSSTimeSkewedFixingInterceptor : NSObject <OSSRequestInterceptor>
- @end
- /**
- The download range of OSS object
- */
- @interface OSSRange : NSObject
- @property (nonatomic, assign) int64_t startPosition;
- @property (nonatomic, assign) int64_t endPosition;
- - (instancetype)initWithStart:(int64_t)start
- withEnd:(int64_t)end;
- /**
- * Converts the header to string: 'bytes=${start}-${end}'
- */
- - (NSString *)toHeaderString;
- @end
- #pragma mark RequestAndResultClass
- /**
- The request to list all buckets of current user.
- */
- @interface OSSGetServiceRequest : OSSRequest
- /**
- The prefix filter for listing buckets---optional.
- */
- @property (nonatomic, copy) NSString * prefix;
- /**
- The marker filter for listing buckets----optional.
- The marker filter is to ensure any returned bucket name must be greater than the marker in the lexicographic order.
- */
- @property (nonatomic, copy) NSString * marker;
- /**
- The max entries to return. By default it's 100 and max value of this property is 1000.
- */
- @property (nonatomic, assign) int32_t maxKeys;
- @end
- /**
- The result class of listing all buckets
- */
- @interface OSSGetServiceResult : OSSResult
- /**
- The owner Id
- */
- @property (nonatomic, copy) NSString * ownerId;
- /**
- Bucket owner name---currently it's same as owner Id.
- */
- @property (nonatomic, copy) NSString * ownerDispName;
- /**
- The prefix of this query. It's only set when there's remaining buckets to return.
- */
- @property (nonatomic, copy) NSString * prefix;
- /**
- The marker of this query. It's only set when there's remaining buckets to return.
- */
- @property (nonatomic, copy) NSString * marker;
- /**
- The max buckets to return. It's only set when there's remaining buckets to return.
- */
- @property (nonatomic, assign) int32_t maxKeys;
- /**
- Flag of the result is truncated. If it's truncated, it means there's remaining buckets to return.
- */
- @property (nonatomic, assign) BOOL isTruncated;
- /**
- The marker for the next ListBucket call. It's only set when there's remaining buckets to return.
- */
- @property (nonatomic, copy) NSString * nextMarker;
- /**
- The container of the buckets. It's a dictionary array, in which every element has keys "Name", "CreationDate" and "Location".
- */
- @property (nonatomic, strong, nullable) NSArray * buckets;
- @end
- /**
- The request to create bucket
- */
- @interface OSSCreateBucketRequest : OSSRequest
- /**
- * 存储空间,命名规范如下:(1)只能包括小写字母、数字和短横线(-);(2)必须以小写字母或者数字开头和结尾;(3)长度必须在3-63字节之间.
- */
- @property (nonatomic, copy) NSString * bucketName;
- /**
- The bucket location
- For more information about OSS datacenter and endpoint, please check out <a>https://docs.aliyun.com/#/pub/oss/product-documentation/domain-region</a>
- */
- @property (nonatomic, copy) NSString * location __attribute__ ((deprecated));
- /**
- Sets Bucket access permission. For now there're three permissions:public-read-write,public-read and private. if this key is not set, the default value is private
- */
- @property (nonatomic, copy) NSString * xOssACL;
- @property (nonatomic, assign) OSSBucketStorageClass storageClass;
- - (NSString *)storageClassAsString;
- @end
- /**
- Result class of bucket creation
- */
- @interface OSSCreateBucketResult : OSSResult
- /**
- Bucket datacenter
- */
- @property (nonatomic, copy) NSString * location;
- @end
- /**
- The request class of deleting bucket
- */
- @interface OSSDeleteBucketRequest : OSSRequest
- /**
- Bucket name
- */
- @property (nonatomic, copy) NSString * bucketName;
- @end
- /**
- Result class of deleting bucket
- */
- @interface OSSDeleteBucketResult : OSSResult
- @end
- /**
- The request class of listing objects under a bucket
- */
- @interface OSSGetBucketRequest : OSSRequest
- /**
- Bucket name
- */
- @property (nonatomic, copy) NSString * bucketName;
- /**
- The delimiter is very important and it determines the behavior of common prefix.
- For most cases, use the default '/' as the delimiter.
- For example, if a bucket has folder 'prefix/' and a file 'abc'. And inside the folder it has file '123.txt'
- If the delimiter is '/', then the ListObject will return a common prefix 'prefix/' and a file 'abc'.
- If the delimiter is something else, then ListObject will return three files: prefix/, abc and prefix/123.txt. No common prefix!.
- */
- @property (nonatomic, copy) NSString * delimiter;
- /**
- The marker filter for listing objects----optional.
- The marker filter is to ensure any returned object name must be greater than the marker in the lexicographic order.
- */
- @property (nonatomic, copy) NSString * marker;
- /**
- The max entries count to return. By default it's 100 and it could be up to 1000.
- */
- @property (nonatomic, assign) int32_t maxKeys;
- /**
- The filter prefix of the objects to return----the returned objects' name must have the prefix.
- */
- @property (nonatomic, copy) NSString * prefix;
- @end
- /**
- The result class of listing objects.
- */
- @interface OSSGetBucketResult : OSSResult
- /**
- Bucket name
- */
- @property (nonatomic, copy) NSString * bucketName;
- /**
- The prefix of the objects returned----the returned objects must have this prefix.
- */
- @property (nonatomic, copy) NSString * prefix;
- /**
- The marker filter of the objects returned---all objects returned are greater than this marker in lexicographic order.
- */
- @property (nonatomic, copy) NSString * marker;
- /**
- The max entries to return. By default it's 100 and it could be up to 1000.
- */
- @property (nonatomic, assign) int32_t maxKeys;
- /**
- The delimiter to differentiate the folder object and file object.
- For object whose name ends with the delimiter, then it's treated as folder or common prefixes.
- */
- @property (nonatomic, copy) NSString * delimiter;
- /**
- The maker for the next call. If no more entries to return, it's null.
- */
- @property (nonatomic, copy) NSString * nextMarker;
- /**
- Flag of truncated result. If it's truncated, it means there's more entries to return.
- */
- @property (nonatomic, assign) BOOL isTruncated;
- /**
- The dictionary arrary, in which each dictionary has keys of "Key", "LastModified", "ETag", "Type", "Size", "StorageClass" and "Owner".
- */
- @property (nonatomic, strong, nullable) NSArray * contents;
- /**
- The arrary of common prefixes. Each element is one common prefix.
- */
- @property (nonatomic, strong) NSArray * commentPrefixes;
- @end
- /**
- The request class to get the bucket ACL.
- */
- @interface OSSGetBucketACLRequest : OSSRequest
- /**
- Bucket name
- */
- @property (nonatomic, copy) NSString * bucketName;
- @end
- /**
- The result class to get the bucket ACL.
- */
- @interface OSSGetBucketACLResult : OSSResult
- /**
- The bucket ACL. It could be one of the three values: private/public-read/public-read-write.
- */
- @property (nonatomic, copy) NSString * aclGranted;
- @end
- /**
- The request class to get object metadata
- */
- @interface OSSHeadObjectRequest : OSSRequest
- /**
- Bucket name
- */
- @property (nonatomic, copy) NSString * bucketName;
- /**
- Object name
- */
- @property (nonatomic, copy) NSString * objectKey;
- @end
- /**
- The result class of getting object metadata.
- */
- @interface OSSHeadObjectResult : OSSResult
- /**
- Object metadata
- */
- @property (nonatomic, copy) NSDictionary * objectMeta;
- @end
- /**
- The request class to get object
- */
- @interface OSSGetObjectRequest : OSSRequest
- /**
- Bucket name
- */
- @property (nonatomic, copy) NSString * bucketName;
- /**
- Object name
- */
- @property (nonatomic, copy) NSString * objectKey;
- /**
- OSS Download Range: For example, bytes=0-9 means uploading the first to the tenth's character.
- */
- @property (nonatomic, strong) OSSRange * range;
- /**
- The local file path to download to.
- */
- @property (nonatomic, strong) NSURL * downloadToFileURL;
- /**
- Image processing configuration.
- */
- @property (nonatomic, copy) NSString * xOssProcess;
- /**
- Download progress callback.
- It runs at background thread.
- */
- @property (nonatomic, copy) OSSNetworkingDownloadProgressBlock downloadProgress;
- /**
- During the object download, the callback is called upon response is received.
- It runs under background thread (not UI thread)
- */
- @property (nonatomic, copy) OSSNetworkingOnRecieveDataBlock onRecieveData;
- /**
- * set request headers
- */
- @property (nonatomic, copy) NSDictionary *headerFields;
- @end
- /**
- Result class of downloading an object.
- */
- @interface OSSGetObjectResult : OSSResult
- /**
- The in-memory content of the downloaded object, if the local file path is not specified.
- */
- @property (nonatomic, strong) NSData * downloadedData;
- /**
- The object metadata dictionary
- */
- @property (nonatomic, copy) NSDictionary * objectMeta;
- @end
- /**
- The response class to update the object ACL.
- */
- @interface OSSPutObjectACLResult : OSSResult
- @end
- /**
- The request class to upload an object.
- */
- @interface OSSPutObjectRequest : OSSRequest
- /**
- Bucket name
- */
- @property (nonatomic, copy) NSString * bucketName;
- /**
- Object name
- */
- @property (nonatomic, copy) NSString * objectKey;
- /**
- The in-memory data to upload.
- */
- @property (nonatomic, strong) NSData * uploadingData;
- /**
- The local file path to upload.
- */
- @property (nonatomic, strong) NSURL * uploadingFileURL;
- /**
- The callback parameters.
- */
- @property (nonatomic, copy) NSDictionary * callbackParam;
- /**
- The callback variables.
- */
- @property (nonatomic, copy) NSDictionary * callbackVar;
- /**
- The content type.
- */
- @property (nonatomic, copy) NSString * contentType;
- /**
- The content's MD5 digest.
- It's calculated on the request body (not headers) according to RFC 1864 to get the 128 bit digest data.
- Then use base64 encoding on the 128bit result to get this MD5 value.
- This header is for integrity check on the data. And it's recommended to turn on for every body.
- */
- @property (nonatomic, copy) NSString * contentMd5;
- /**
- Specifies the download name of the object. Checks out RFC2616 for more details.
- */
- @property (nonatomic, copy) NSString * contentDisposition;
- /**
- Specifies the content encoding during the download. Checks out RFC2616 for more details.
- */
- @property (nonatomic, copy) NSString * contentEncoding;
- /**
- Specifies the cache behavior during the download. Checks out RFC2616 for more details.
- */
- @property (nonatomic, copy) NSString * cacheControl;
- /**
- Expiration time in milliseconds. Checks out RFC2616 for more details.
- */
- @property (nonatomic, copy) NSString * expires;
- /**
- The object's metadata.
- When the object is being uploaded, it could be specified with http headers prefixed with x-oss-meta for user metadata.
- The total size of all user metadata cannot be more than 8K.
- It also could include standard HTTP headers in this object.
- */
- @property (nonatomic, copy) NSDictionary * objectMeta;
- /**
- The upload progress callback.
- It runs in background thread (not UI thread).
- */
- @property (nonatomic, copy) OSSNetworkingUploadProgressBlock uploadProgress;
- /**
- The upload retry callback.
- It runs in background thread (not UI thread).
- */
- @property (nonatomic, copy) OSSNetworkingRetryBlock uploadRetryCallback;
- /**
- * the sha1 of content
- */
- @property (nonatomic, copy) NSString *contentSHA1;
-
- @end
- /**
- The request class to update the object ACL.
- */
- @interface OSSPutObjectACLRequest : OSSPutObjectRequest
- /**
- *@brief:指定oss创建object时的访问权限,合法值:public-read、private、public-read-write
- */
- @property (nonatomic, copy, nullable) NSString *acl;
- @end
- /**
- The result class to put an object
- */
- @interface OSSPutObjectResult : OSSResult
- /**
- ETag (entity tag) is the tag during the object creation in OSS server side.
- It's the MD5 value for put object request. If the object is created by other APIs, the ETag is the UUID of the content.
- ETag could be used to check if the object has been updated.
- */
- @property (nonatomic, copy) NSString * eTag;
- /**
- If the callback is specified, this is the callback response result.
- */
- @property (nonatomic, copy) NSString * serverReturnJsonString;
- @end
- /**
- * append object request
- */
- @interface OSSAppendObjectRequest : OSSRequest
- /**
- Bucket name
- */
- @property (nonatomic, copy) NSString * bucketName;
- /**
- Object name
- */
- @property (nonatomic, copy) NSString * objectKey;
- /**
- Specifies which position to append. For a new file, the first append should start from 0. And the subsequential calls will start from the current length of the object.
- For example, if the first append's size is 65536, then the appendPosition value in the next call will be 65536.
- In its response, the header x-oss-next-append-position is included for next call.
- */
- @property (nonatomic, assign) int64_t appendPosition;
- /**
- The in-memory data to upload from.
- */
- @property (nonatomic, strong) NSData * uploadingData;
- /**
- The local file path to upload from.
- */
- @property (nonatomic, strong) NSURL * uploadingFileURL;
- /**
- Sets the content type
- */
- @property (nonatomic, copy) NSString * contentType;
- /**
- The content's MD5 digest value.
- It's calculated from the MD5 value of the request body according to RFC 1864 and then encoded by base64.
- */
- @property (nonatomic, copy) NSString *contentMd5;
- /**
- The object's name during the download according to RFC 2616.
- */
- @property (nonatomic, copy) NSString * contentDisposition;
- /**
- The content encoding during the object upload. Checks out RFC2616 for more detail.
- */
- @property (nonatomic, copy) NSString * contentEncoding;
- /**
- Specifies the cache control behavior when it's being downloaded.Checks out RFC 2616 for more details.
- */
- @property (nonatomic, copy) NSString * cacheControl;
- /**
- Expiration time. Checks out RFC2616 for more information.
- */
- @property (nonatomic, copy) NSString * expires;
- /**
- The object's metadata, which start with x-oss-meta-, such as x-oss-meta-location.
- Each request can have multiple metadata as long as the total size of all metadata is no bigger than 8KB.
- It could include standard headers as well.
- */
- @property (nonatomic, copy) NSDictionary * objectMeta;
- /**
- Upload progress callback.
- It's called on the background thread.
- */
- @property (nonatomic, copy) OSSNetworkingUploadProgressBlock uploadProgress;
- /**
- * the sha1 of content
- */
- @property (nonatomic, copy) NSString *contentSHA1;
- @end
- /**
- * append object result
- */
- @interface OSSAppendObjectResult : OSSResult
- /**
- TODOTODO
- ETag (entity tag). It's created for every object when it's created.
- For Objects created by PUT, ETag is the MD5 value of the content data. For others, ETag is the UUID of the content.
- ETag is used for checking data integrity.
- */
- @property (nonatomic, copy) NSString * eTag;
- /**
- Specifies the next starting position. It's essentially the current object size.
- This header is included in the successful response or the error response when the start position does not match the object size.
- */
- @property (nonatomic, assign, readwrite) int64_t xOssNextAppendPosition;
- @end
- /**
- The request of deleting an object.
- */
- @interface OSSDeleteObjectRequest : OSSRequest
- /**
- Bucket name
- */
- @property (nonatomic, copy) NSString * bucketName;
- /**
- Object object
- */
- @property (nonatomic, copy) NSString * objectKey;
- @end
- /**
- Result class of deleting an object
- */
- @interface OSSDeleteObjectResult : OSSResult
- @end
- /**
- Request class of copying an object in OSS.
- */
- @interface OSSCopyObjectRequest : OSSRequest
- /**
- Bucket name
- */
- @property (nonatomic, copy) NSString * bucketName;
- /**
- Object name
- */
- @property (nonatomic, copy) NSString * objectKey;
- /**
- * Source object's address (the caller needs the read permission on this object)
- */
- @property (nonatomic, copy) NSString * sourceCopyFrom DEPRECATED_MSG_ATTRIBUTE("please use sourceBucketName & sourceObjectKey instead!it will be removed in next version.");
- @property (nonatomic, copy) NSString * sourceBucketName;
- @property (nonatomic, copy) NSString * sourceObjectKey;
- /**
- The content type
- */
- @property (nonatomic, copy) NSString * contentType;
- /**
- The content's MD5 digest.
- It's calculated according to RFC 1864 and encoded in base64.
- Though it's optional, it's recommended to turn it on for integrity check.
- */
- @property (nonatomic, copy) NSString * contentMd5;
- /**
- The user metadata dictionary, which starts with x-oss-meta-.
- The total size of user metadata can be no more than 8KB.
- It could include standard http headers as well.
- */
- @property (nonatomic, copy) NSDictionary * objectMeta;
- /**
- * the sha1 of content
- */
- @property (nonatomic, copy) NSString *contentSHA1;
- @end
- /**
- The result class of copying an object
- */
- @interface OSSCopyObjectResult : OSSResult
- /**
- The last modified time
- */
- @property (nonatomic, copy) NSString * lastModifed;
- /**
- The ETag of the new object.
- */
- @property (nonatomic, copy) NSString * eTag;
- @end
- /**
- Request class of initiating a multipart upload.
- */
- @interface OSSInitMultipartUploadRequest : OSSRequest
- /**
- Bucket name
- */
- @property (nonatomic, copy) NSString * bucketName;
- /**
- Object name
- */
- @property (nonatomic, copy) NSString * objectKey;
- /**
- Content type
- */
- @property (nonatomic, copy) NSString * contentType;
- /**
- The object's download name. Checks out RFC 2616 for more details.
- */
- @property (nonatomic, copy) NSString * contentDisposition;
- /**
- The content encoding. Checks out RFC 2616.
- */
- @property (nonatomic, copy) NSString * contentEncoding;
- /**
- Specifies the cache control behavior when it's downloaded. Checks out RFC 2616 for more details.
- */
- @property (nonatomic, copy) NSString * cacheControl;
- /**
- Expiration time in milliseconds. Checks out RFC 2616 for more details.
- */
- @property (nonatomic, copy) NSString * expires;
- /**
- The dictionary of object's custom metadata, which starts with x-oss-meta-.
- The total size of user metadata is no more than 8KB.
- It could include other standard http headers.
- */
- @property (nonatomic, copy) NSDictionary * objectMeta;
- /**
- * When Setting this value to YES , parts will be uploaded in order. Default value is NO.
- */
- @property (nonatomic, assign) BOOL sequential;
- @end
- /**
- The resutl class of initiating a multipart upload.
- */
- @interface OSSInitMultipartUploadResult : OSSResult
- /**
- The upload Id of the multipart upload
- */
- @property (nonatomic, copy) NSString * uploadId;
- @end
- /**
- The request class of uploading one part.
- */
- @interface OSSUploadPartRequest : OSSRequest
- /**
- Bucket name
- */
- @property (nonatomic, copy) NSString * bucketName;
- /**
- Object name
- */
- @property (nonatomic, copy) NSString * objectkey;
- /**
- Multipart Upload id.
- */
- @property (nonatomic, copy) NSString * uploadId;
- /**
- The part number of this part.
- */
- @property (nonatomic, assign) int partNumber;
- /**
- The content MD5 value.
- It's calculated according to RFC 1864 and encoded in base64.
- Though it's optional, it's recommended to turn it on for integrity check.
- */
- @property (nonatomic, copy) NSString * contentMd5;
- /**
- The in-memory data to upload from.
- */
- @property (nonatomic, strong) NSData * uploadPartData;
- /**
- The local file path to upload from
- */
- @property (nonatomic, strong) NSURL * uploadPartFileURL;
- /**
- The upload progress callback.
- It runs in background thread (not UI thread);
- */
- @property (nonatomic, copy) OSSNetworkingUploadProgressBlock uploadPartProgress;
- /**
- * the sha1 of content
- */
- @property (nonatomic, copy) NSString *contentSHA1;
- @end
- /**
- The result class of uploading one part.
- */
- @interface OSSUploadPartResult : OSSResult
- @property (nonatomic, copy) NSString * eTag;
- @end
- /**
- The Part information. It's called by CompleteMultipartUpload().
- */
- @interface OSSPartInfo : NSObject<NSCopying>
- /**
- The part number in this part upload.
- */
- @property (nonatomic, assign) int32_t partNum;
- /**
- ETag value of this part returned by OSS.
- */
- @property (nonatomic, copy) NSString * eTag;
- /**
- The part size.
- */
- @property (nonatomic, assign) int64_t size;
- @property (nonatomic, assign) uint64_t crc64;
- + (instancetype)partInfoWithPartNum:(int32_t)partNum eTag:(NSString *)eTag size:(int64_t)size __attribute__((deprecated("Use partInfoWithPartNum:eTag:size:crc64: to instead!")));
- + (instancetype)partInfoWithPartNum:(int32_t)partNum eTag:(NSString *)eTag size:(int64_t)size crc64:(uint64_t)crc64;
- - (NSDictionary *)entityToDictionary;
- @end
- /**
- The request class of completing a multipart upload.
- */
- @interface OSSCompleteMultipartUploadRequest : OSSRequest
- /**
- Bucket name
- */
- @property (nonatomic, copy) NSString * bucketName;
- /**
- Object name
- */
- @property (nonatomic, copy) NSString * objectKey;
- /**
- Multipart upload Id
- */
- @property (nonatomic, copy) NSString * uploadId;
- /**
- The content MD5 value.
- It's calculated according to RFC 1864 and encoded in base64.
- Though it's optional, it's recommended to turn it on for integrity check.
- */
- @property (nonatomic, copy) NSString * contentMd5;
- /**
- All parts' information.
- */
- @property (nonatomic, strong) NSArray * partInfos;
- /**
- Server side callback parameter
- */
- @property (nonatomic, copy) NSDictionary * callbackParam;
- /**
- Callback variables
- */
- @property (nonatomic, copy) NSDictionary * callbackVar;
- /**
- The metadata header
- */
- @property (nonatomic, copy) NSDictionary * completeMetaHeader;
- /**
- * the sha1 of content
- */
- @property (nonatomic, copy) NSString *contentSHA1;
- @end
- /**
- The resutl class of completing a multipart upload.
- */
- @interface OSSCompleteMultipartUploadResult : OSSResult
- /**
- The object's URL
- */
- @property (nonatomic, copy) NSString * location;
- /**
- ETag (entity tag).
- It's generated when the object is created.
- */
- @property (nonatomic, copy) NSString * eTag;
- /**
- The callback response if the callback is specified.
- The resutl class of initiating a multipart upload.
- */
- @property (nonatomic, copy) NSString * serverReturnJsonString;
- @end
- /**
- The request class of listing all parts that have been uploaded.
- */
- @interface OSSListPartsRequest : OSSRequest
- /**
- Bucket name
- The request class of uploading one part.*/
- @property (nonatomic, copy) NSString * bucketName;
- /**
- Object name
- */
- @property (nonatomic, copy) NSString * objectKey;
- /**
- The multipart upload Id.
- */
- @property (nonatomic, copy) NSString * uploadId;
- /**
- The max part count to return
- */
- @property (nonatomic, assign) int maxParts;
- /**
- The part number marker filter---only parts whose part number is greater than this value will be returned.
- */
- @property (nonatomic, assign) int partNumberMarker;
- @end
- /**
- The result class of listing uploaded parts.
- */
- @interface OSSListPartsResult : OSSResult
- /**
- The next part number marker. If the response does not include all data, this header specifies what's the start point for the next list call.
- */
- @property (nonatomic, assign) int nextPartNumberMarker;
- /**
- The max parts count to return.
- */
- @property (nonatomic, assign) int maxParts;
- /**
- Flag of truncated data in the response. If it's true, it means there're more data to come.
- If it's false, it means all data have been returned.
- */
- @property (nonatomic, assign) BOOL isTruncated;
- /**
- The array of the part information.
- */
- @property (nonatomic, strong, nullable) NSArray * parts;
- @end
- /**
- The request class of listing all multipart uploads.
- */
- @interface OSSListMultipartUploadsRequest : OSSRequest
- /**
- Bucket name.
- */
- @property (nonatomic, copy) NSString * bucketName;
- /**
- The delimiter.
- */
- @property (nonatomic, copy) NSString * delimiter;
- /**
- The prefix.
- */
- @property (nonatomic, copy) NSString * prefix;
- /**
- The max number of uploads.
- */
- @property (nonatomic, assign) int32_t maxUploads;
- /**
- The key marker filter.
- */
- @property (nonatomic, copy) NSString * keyMarker;
- /**
- The upload Id marker.
- */
- @property (nonatomic, copy) NSString * uploadIdMarker;
- /**
- The encoding type of the object in the response body.
- */
- @property (nonatomic, copy) NSString * encodingType;
- @end
- /**
- The result class of listing multipart uploads.
- */
- @interface OSSListMultipartUploadsResult : OSSResult
- /**
- Bucket name
- */
- @property (nonatomic, copy) NSString * bucketName;
- /**
- The marker filter of the objects returned---all objects returned are greater than this marker in lexicographic order.
- */
- @property (nonatomic, copy) NSString * keyMarker;
- /**
- The delimiter to differentiate the folder object and file object.
- For object whose name ends with the delimiter, then it's treated as folder or common prefixes.
- */
- @property (nonatomic, copy) NSString * delimiter;
- /**
- The prefix of the objects returned----the returned objects must have this prefix.
- */
- @property (nonatomic, copy) NSString * prefix;
- /**
- The upload Id marker.
- */
- @property (nonatomic, copy) NSString * uploadIdMarker;
- /**
- The max entries to return. By default it's 100 and it could be up to 1000.
- */
- @property (nonatomic, assign) int32_t maxUploads;
- /**
- If not all results are returned this time, the response request includes the NextKeyMarker element to indicate the value of KeyMarker in the next request.
- */
- @property (nonatomic, copy) NSString * nextKeyMarker;
- /**
- If not all results are returned this time, the response request includes the NextUploadMarker element to indicate the value of UploadMarker in the next request.
- */
- @property (nonatomic, copy) NSString * nextUploadIdMarker;
- /**
- Flag of truncated result. If it's truncated, it means there's more entries to return.
- */
- @property (nonatomic, assign) BOOL isTruncated;
- @property (nonatomic, strong, nullable) NSArray * uploads;
- /**
- The arrary of common prefixes. Each element is one common prefix.
- */
- @property (nonatomic, strong) NSArray * commonPrefixes;
- @end
- /**
- Request to abort a multipart upload
- */
- @interface OSSAbortMultipartUploadRequest : OSSRequest
- /**
- Bucket name
- */
- @property (nonatomic, copy) NSString * bucketName;
- /**
- Object name
- */
- @property (nonatomic, copy) NSString * objectKey;
- /**
- The multipart upload Id.
- */
- @property (nonatomic, copy) NSString * uploadId;
- @end
- /**
- The result class of aborting a multipart upload
- */
- @interface OSSAbortMultipartUploadResult : OSSResult
- @end
- /**
- The request class of multipart upload.
- */
- @interface OSSMultipartUploadRequest : OSSRequest
- /**
- The upload Id
- */
- @property (nonatomic, copy) NSString * uploadId;
- /**
- Bucket name
- */
- @property (nonatomic, copy) NSString * bucketName;
- /**
- Object object
- */
- @property (nonatomic, copy) NSString * objectKey;
- /**
- The local file path to upload from.
- */
- @property (nonatomic, strong) NSURL * uploadingFileURL;
- /**
- The part size, minimal value is 100KB.
- */
- @property (nonatomic, assign) NSUInteger partSize;
- /**
- Upload progress callback.
- It runs at the background thread (not UI thread).
- */
- @property (nonatomic, copy) OSSNetworkingUploadProgressBlock uploadProgress;
- /**
- The callback parmeters
- */
- @property (nonatomic, copy) NSDictionary * callbackParam;
- /**
- The callback variables
- */
- @property (nonatomic, copy) NSDictionary * callbackVar;
- /**
- Content type
- */
- @property (nonatomic, copy) NSString * contentType;
- /**
- The metadata header
- */
- @property (nonatomic, copy) NSDictionary * completeMetaHeader;
- /**
- * the sha1 of content
- */
- @property (nonatomic, copy) NSString *contentSHA1;
- /**
- * the md5 of content
- */
- @property (nonatomic, copy) NSString *md5String;
- - (void)cancel;
- @end
- /**
- The request class of resumable upload.
- */
- @interface OSSResumableUploadRequest : OSSMultipartUploadRequest
- /**
- directory path about create record uploadId file
- */
- @property (nonatomic, copy) NSString * recordDirectoryPath;
- /**
- need or not delete uploadId with cancel
- */
- @property (nonatomic, assign) BOOL deleteUploadIdOnCancelling;
- /**
- All running children requests
- */
- @property (atomic, weak) OSSRequest * runningChildrenRequest;
- @end
- /**
- The result class of resumable uploading
- */
- @interface OSSResumableUploadResult : OSSResult
- /**
- The callback response, if the callback is specified.
- */
- @property (nonatomic, copy) NSString * serverReturnJsonString;
- @end
- /**
- for more information,Please refer to the link https://help.aliyun.com/document_detail/31989.html
- */
- @interface OSSCallBackRequest : OSSRequest
- @property (nonatomic, copy) NSString *bucketName;
- @property (nonatomic, copy) NSString *objectName;
- /**
- The callback parameters.when you set this value,there are required params as below:
- {
- "callbackUrl": xxx
- "callbackBody": xxx
- }
- */
- @property (nonatomic, copy) NSDictionary *callbackParam;
- /**
- The callback variables.
- */
- @property (nonatomic, copy) NSDictionary *callbackVar;
- @end
- @interface OSSCallBackResult : OSSResult
- @property (nonatomic, copy) NSDictionary *serverReturnXML;
- /**
- If the callback is specified, this is the callback response result.
- */
- @property (nonatomic, copy) NSString *serverReturnJsonString;
- @end
- /**
- for more information,Please refer to the link https://help.aliyun.com/document_detail/55811.html
- */
- @interface OSSImagePersistRequest : OSSRequest
- @property (nonatomic, copy) NSString *fromBucket;
- @property (nonatomic, copy) NSString *fromObject;
- @property (nonatomic, copy) NSString *toBucket;
- @property (nonatomic, copy) NSString *toObject;
- @property (nonatomic, copy) NSString *action;
- @end
- @interface OSSImagePersistResult : OSSResult
- @end
- NS_ASSUME_NONNULL_END
|