KMServicesCloudFile.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. //
  2. // KMServicesFiles.h
  3. // PDF Reader
  4. //
  5. // Created by 丁林圭 on 2020/7/8.
  6. // Copyright © 2020 Kdan Mobile. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. typedef NS_ENUM(NSInteger, KMCloudServiceFileType) {
  10. KMCloudServiceFileType_File = 0,
  11. KMCloudServiceFileType_Folder,
  12. KMCloudServiceFileType_Deleted,
  13. };
  14. #pragma mark - KMGoogleDriveUserMetadata
  15. @interface KMGoogleDriveUserMetadata : NSObject
  16. @property (nonatomic, retain) NSString *accessToken; //授权服务器生成的访问令牌
  17. @property (nonatomic, retain) NSDate *accessTokenExpirationDate; //访问令牌的大致到期日期和时间
  18. @property (nonatomic, retain) NSString *tokenType; //令牌类型
  19. @property (nonatomic, retain) NSString *idToken; //简短ID令牌值
  20. @property (nonatomic, retain) NSString *refreshToken; //介绍刷新令牌
  21. @property (nonatomic, retain) NSString *scope; //介绍访问令牌的作用域
  22. @property (nonatomic, retain) NSString *userEmail; //用户邮箱
  23. @property (nonatomic, retain) NSDictionary *additionalParameters; //从令牌服务器返回的其他参数
  24. @end
  25. #pragma mark - KMDropboxUserMetadata
  26. @interface KMDropboxUserMetadata : NSObject
  27. @property (nonatomic, retain) NSString *accountId; ///用户的唯一Dropbox ID
  28. @property (nonatomic, retain) NSString *givenName; ///用户名的详细信息
  29. @property (nonatomic, retain) NSString *surname; ///也称为姓氏或姓氏
  30. @property (nonatomic, retain) NSString *email; ///用户的电子邮件地址
  31. @property (nonatomic, retain) NSNumber *emailVerified; ///用户是否已验证其电子邮件地址
  32. @property (nonatomic, retain) NSNumber *disabled; ///用户是否已被禁用
  33. @property (nonatomic, retain) NSString *country; ///用户的两个字母的国家代码(如果可用)
  34. @property (nonatomic, retain) NSString *locale; ///用户指定的语言
  35. @property (nonatomic, retain) NSString *referralLink; ///用户的推荐链接
  36. @end
  37. #pragma mark - KMDropboxErrorMetadata
  38. @interface KMDropboxErrorMetadata : NSObject
  39. /**
  40. DBFILESDeleteError *routeError
  41. /// Represents the possible error types that can be returned from network requests.
  42. typedef NS_ENUM(NSInteger, DBRequestErrorTag) {
  43. DBRequestErrorHttp, /// Errors produced at the HTTP layer.
  44. DBRequestErrorBadInput, /// Errors due to bad input parameters to an API Operation.
  45. DBRequestErrorAuth, /// Errors due to invalid authentication credentials.
  46. DBRequestErrorPathRoot, /// Errors due to invalid authentication credentials.
  47. DBRequestErrorAccess, /// Errors due to invalid permission to access.
  48. DBRequestErrorRateLimit, /// Error caused by rate limiting.
  49. DBRequestErrorInternalServer,/// Errors due to a problem on Dropbox.
  50. DBRequestErrorClient, /// Errors due to a problem on the client-side of the SDK.
  51. };
  52. */
  53. @property (nonatomic, retain) NSNumber *routeError;
  54. /**
  55. DBRequestError *networkError
  56. /// The `DBFILESDeleteErrorTag` enum type represents the possible tag states with which the `DBFILESDeleteError` union can exist.
  57. typedef NS_ENUM(NSInteger, DBFILESDeleteErrorTag) {
  58. DBFILESDeleteErrorPathLookup, /// (no description).
  59. DBFILESDeleteErrorPathWrite, /// (no description).
  60. DBFILESDeleteErrorTooManyWriteOperations,/// There are too many write operations in user's Dropbox. Please retry this request.
  61. DBFILESDeleteErrorTooManyFiles, /// There are too many files in one request. Please retry with fewer files.
  62. DBFILESDeleteErrorOther, /// (no description).
  63. };
  64. */
  65. @property (nonatomic, retain) NSNumber *networkError;
  66. @end
  67. #pragma mark - KMServicesFile
  68. @interface KMServicesCloudFile : NSObject
  69. @property (nonatomic, retain) NSDate *fileModiDate; //上次在Dropbox上修改文件的时间
  70. @property (nonatomic, retain) NSString *fileName; //路径的最后一个组件(包括扩展名)
  71. @property (nonatomic, assign) NSInteger fileSize; //文件大小(字节)
  72. @property (nonatomic, assign) KMCloudServiceFileType filetype; //文件类型
  73. @property (nonatomic, retain) NSString *fileId; //文件的唯一标识符
  74. @property (nonatomic, retain) NSString *path_lower; //用户Dropbox中小写的完整路径。
  75. @property (nonatomic, retain) NSString *rev; //文件当前版本的唯一标识符
  76. @property (nonatomic, retain) NSString *content_hash; //文件内容的哈希值。此字段可用于验证数据完整性。
  77. @property (nonatomic, retain) NSDate *client_modified; //对于文件,这是桌面客户端在将文件添加到Dropbox时设置的修改时间
  78. @property (nonatomic, retain) NSString *fileModiDateString;
  79. @property (nonatomic, retain) NSString *fileSizeString;
  80. @property (nonatomic, retain) NSString *mimeType; //文件的MIME类型
  81. @property (nonatomic, retain) NSString *kind; //标识这是哪种资源。值:固定字符串“drive#file”。
  82. @property (nonatomic, retain) NSDate *createdTime; //文件创建时间
  83. @property (nonatomic, retain) NSString *webViewLink;//在浏览器的相关Google编辑器或查看器中打开文件的链接。
  84. @property (nonatomic, retain) NSString *parensID; //包含的父文件夹ID; 仅在云盘空间包含,Google共享文件可为空
  85. @property (nonatomic, retain) NSNumber *ownedByMe; //用户是否拥有该文件。 Uses NSNumber of boolValue.
  86. @property (nonatomic,retain) NSString *lastUserName; //上次修改用户的纯文本可显示名称。
  87. @property (nonatomic, retain) NSString *displayName; //相对路径
  88. @property (nonatomic, retain) NSString *authorName; //作者
  89. - (NSComparisonResult)nameCompare:(KMServicesCloudFile *)item;
  90. - (NSComparisonResult)dateCompare:(KMServicesCloudFile *)item;
  91. - (NSComparisonResult)sizeCompare:(KMServicesCloudFile *)item;
  92. @end