QNZoneInfo.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // QNZoneInfo.h
  3. // QiniuSDK
  4. //
  5. // Created by yangsen on 2020/4/16.
  6. // Copyright © 2020 Qiniu. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. extern NSString *const QNZoneInfoSDKDefaultIOHost;
  11. extern NSString *const QNZoneInfoEmptyRegionId;
  12. @interface QNZoneInfo : NSObject
  13. @property(nonatomic, assign, readonly)long ttl;
  14. @property(nonatomic, assign, readonly)BOOL http3Enabled;
  15. @property(nonatomic, strong, readonly)NSArray<NSString *> *domains;
  16. @property(nonatomic, strong, readonly)NSArray<NSString *> *old_domains;
  17. @property(nonatomic, copy, readonly)NSString *regionId;
  18. @property(nonatomic, strong, readonly)NSArray <NSString *> *allHosts;
  19. @property(nonatomic, strong, readonly)NSDictionary *detailInfo;
  20. + (QNZoneInfo *)zoneInfoWithMainHosts:(NSArray <NSString *> *)mainHosts
  21. regionId:(NSString * _Nullable)regionId;
  22. + (QNZoneInfo *)zoneInfoWithMainHosts:(NSArray <NSString *> *)mainHosts
  23. oldHosts:(NSArray <NSString *> * _Nullable)oldHosts
  24. regionId:(NSString * _Nullable)regionId;
  25. /// 根据键值对构造对象 【内部使用】
  26. /// @param detailInfo 键值对信息
  27. + (QNZoneInfo *)zoneInfoFromDictionary:(NSDictionary *)detailInfo;
  28. - (BOOL)isValid;
  29. @end
  30. @interface QNZonesInfo : NSObject
  31. @property (readonly) BOOL isValid;
  32. @property (nonatomic, strong, readonly) NSArray<QNZoneInfo *> *zonesInfo;
  33. /// 根据键值对构造对象 【内部使用】
  34. /// @param dictionary 键值对信息
  35. + (instancetype)infoWithDictionary:(NSDictionary *)dictionary;
  36. - (instancetype)initWithZonesInfo:(NSArray<QNZoneInfo *> *)zonesInfo;
  37. @end
  38. NS_ASSUME_NONNULL_END