QCloudCOSXMLService.h 5.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // QCloudCOSXMLService.h
  3. // QCloudCOSXMLService
  4. //
  5. // Created by tencent
  6. //
  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/QCloudService.h>
  27. @interface QCloudCOSXMLService : QCloudService
  28. #pragma hidden super selectors
  29. - (int) performRequest:(QCloudBizHTTPRequest *)httpRequst NS_UNAVAILABLE;
  30. - (int) performRequest:(QCloudBizHTTPRequest *)httpRequst withFinishBlock:(QCloudRequestFinishBlock)block NS_UNAVAILABLE;
  31. #pragma Factory
  32. + (QCloudCOSXMLService*) defaultCOSXML;
  33. + (QCloudCOSXMLService*) cosxmlServiceForKey:(NSString*)key;
  34. /**
  35. 检查是否存在key对应的service
  36. @param key key
  37. @return 存在与否
  38. */
  39. + (BOOL) hasServiceForKey:(NSString*)key;
  40. + (QCloudCOSXMLService*) registerDefaultCOSXMLWithConfiguration:(QCloudServiceConfiguration*)configuration;
  41. + (QCloudCOSXMLService*) registerCOSXMLWithConfiguration:(QCloudServiceConfiguration*)configuration withKey:(NSString*)key;
  42. + (void) removeCOSXMLWithKey:(NSString*)key;
  43. /**
  44. 根据Bukcet, Object来生成可以直接访问的URL。如果您的Bucket是私有读的话,那么访问的时候需要带上签名,反之则不需要。
  45. 需要注意的是,如果通过该接口来生成带签名的URL的话,因为签名可能是在服务器生成的,该方法是同步方法,可能因为网络请求阻塞,建议不要在主线程里调用。
  46. 此外, 传入的Object需要是URLEncode后的结果。
  47. @param bucket 存储桶
  48. @param object 存储对象, 请传入URL Encode后的结果
  49. @param withAuthorization 是否需要签名,如果是私有读的Bucket,那么该URL需要带上签名才能访问
  50. @return object URL
  51. */
  52. - (NSString*)getURLWithBucket:(NSString*)bucket object:(NSString*)object withAuthorization:(BOOL)withAuthorization;
  53. @end