T1Model.h 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. //
  2. // T1Model.h
  3. // YYKitExample
  4. //
  5. // Created by ibireme on 15/10/9.
  6. // Copyright (C) 2015 ibireme. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "YYKit.h"
  10. @class T1User;
  11. @interface T1UserMention : NSObject
  12. @property (nonatomic, assign) uint32_t uid;
  13. @property (nonatomic, strong) NSString *uidStr;
  14. @property (nonatomic, strong) NSString *name; // e.g. "Nick Lockwood"
  15. @property (nonatomic, strong) NSString *screenName; // e.g. "nicklockwood"
  16. @property (nonatomic, strong) NSArray<NSNumber *> *indices; // Array<NSNumber> from, to
  17. @property (nonatomic, assign) NSRange range; // range from indices
  18. @property (nonatomic, strong) NSArray<NSValue *> *ranges; // Array<NSValue(NSRange)> nil if range is less than or equal to one.
  19. @property (nonatomic, strong) T1User *user; // reference
  20. @end
  21. @interface T1URL : NSObject
  22. @property (nonatomic, strong) NSString *url; // e.g. "http://t.co/YuvsPou0rj"
  23. @property (nonatomic, strong) NSString *displayURL; // e.g. "apple.com/tv/compare/"
  24. @property (nonatomic, strong) NSString *expandedURL; // e.g. "http://www.apple.com/tv/compare/"
  25. @property (nonatomic, strong) NSArray<NSNumber *> *indices; // Array<NSNumber> from, to
  26. @property (nonatomic, assign) NSRange range; // range from indices
  27. @property (nonatomic, strong) NSArray<NSValue *> *ranges; // Array<NSValue(NSRange)> nil if range is less than or equal to one.
  28. @end
  29. @interface T1HashTag : NSObject
  30. @property (nonatomic, strong) NSString *text;
  31. @property (nonatomic, strong) NSArray<NSNumber *> *indices; // Array<NSNumber> from, to
  32. @property (nonatomic, assign) NSRange range; // range from indices
  33. @property (nonatomic, strong) NSArray<NSValue *> *ranges; // Array<NSValue(NSRange)> nil if range is less than or equal to one.
  34. @end
  35. @interface T1MediaMeta : NSObject
  36. @property (nonatomic, assign) int width;
  37. @property (nonatomic, assign) int height;
  38. @property (nonatomic, assign) CGSize size;
  39. @property (nonatomic, strong) NSString *resize; // fit, crop
  40. @property (nonatomic, assign) BOOL isCrop; // resize is "crop"
  41. @property (nonatomic, strong) NSArray<NSValue *> *faces; // Array<NSValue(CGRect)>
  42. @property (nonatomic, strong) NSURL *url; // add
  43. @end
  44. @interface T1Media : NSObject
  45. @property (nonatomic, assign) uint64_t mid;
  46. @property (nonatomic, strong) NSString *midStr;
  47. @property (nonatomic, strong) NSString *type; // photo/..
  48. @property (nonatomic, strong) NSString *url; // e.g. "http://t.co/X4kGxbKcBu"
  49. @property (nonatomic, strong) NSString *displayURL; // e.g. "pic.twitter.com/X4kGxbKcBu"
  50. @property (nonatomic, strong) NSString *expandedURL; // e.g. "http://twitter.com/edelwax/status/652117831883034624/photo/1"
  51. @property (nonatomic, strong) NSString *mediaURL; // e.g. "http://pbs.twimg.com/media/CQzJtkbXAAAO2v3.png"
  52. @property (nonatomic, strong) NSString *mediaURLHttps; // e.g. "https://pbs.twimg.com/media/CQzJtkbXAAAO2v3.png"
  53. @property (nonatomic, strong) NSArray<NSNumber *> *indices; // Array<NSNumber> from, to
  54. @property (nonatomic, assign) NSRange range; // range from indices
  55. @property (nonatomic, strong) NSArray<NSValue *> *ranges; // Array<NSValue(NSRange)> nil if range is less than or equal to one.
  56. @property (nonatomic, strong) T1MediaMeta *mediaThumb;
  57. @property (nonatomic, strong) T1MediaMeta *mediaSmall;
  58. @property (nonatomic, strong) T1MediaMeta *mediaMedium;
  59. @property (nonatomic, strong) T1MediaMeta *mediaLarge;
  60. @property (nonatomic, strong) T1MediaMeta *mediaOrig;
  61. @end
  62. @interface T1Place : NSObject
  63. @property (nonatomic, strong) NSString *pid;
  64. @property (nonatomic, strong) NSString *name;
  65. @property (nonatomic, strong) NSString *fullName;
  66. @property (nonatomic, strong) NSString *placeType;
  67. @property (nonatomic, strong) NSString *country;
  68. @property (nonatomic, strong) NSString *countryCode;
  69. @property (nonatomic, strong) NSArray *containedWithin;
  70. @property (nonatomic, strong) NSDictionary *boundingBox;
  71. @property (nonatomic, strong) NSDictionary *attributes;
  72. @end
  73. @interface T1Card : NSObject
  74. @property (nonatomic, strong) NSDictionary *users; // <NSString(uid), T1User>
  75. @property (nonatomic, strong) NSString *cardTypeURL;
  76. @property (nonatomic, strong) NSString *name;
  77. @property (nonatomic, strong) NSString *url;
  78. @property (nonatomic, strong) NSDictionary *bindingValues;
  79. @end
  80. @interface T1User : NSObject
  81. @property (nonatomic, assign) uint64_t uid;
  82. @property (nonatomic, strong) NSString *uidStr;
  83. @property (nonatomic, strong) NSString *name; // e.g. "Nick Lockwood"
  84. @property (nonatomic, strong) NSString *screenName; // e.g. "nicklockwood"
  85. @property (nonatomic, strong) NSString *url;
  86. @property (nonatomic, strong) NSString *desc;
  87. @property (nonatomic, strong) NSString *location;
  88. @property (nonatomic, strong) NSDate *createdAt;
  89. @property (nonatomic, assign) uint32_t listedCount;
  90. @property (nonatomic, assign) uint32_t statusesCount;
  91. @property (nonatomic, assign) uint32_t favouritesCount;
  92. @property (nonatomic, assign) uint32_t friendsCount;
  93. // http://pbs.twimg.com/profile_images/558109954561679360/j1f9DiJi_normal.jpeg original
  94. // http://pbs.twimg.com/profile_images/558109954561679360/j1f9DiJi_reasonably_small.jpeg replaced
  95. @property (nonatomic, strong) NSURL *profileImageURL;
  96. @property (nonatomic, strong) NSURL *profileImageURLReasonablySmall; // replaced
  97. @property (nonatomic, strong) NSURL *profileImageURLHttps;
  98. @property (nonatomic, strong) NSURL *profileBackgroundImageURL;
  99. @property (nonatomic, strong) NSURL *profileBackgroundImageURLHttps;
  100. @property (nonatomic, strong) NSString *profileBackgroundColor;
  101. @property (nonatomic, strong) NSString *profileTextColor;
  102. @property (nonatomic, strong) NSString *profileSidebarFillColor;
  103. @property (nonatomic, strong) NSString *profileSidebarBorderColor;
  104. @property (nonatomic, strong) NSString *profileLinkColor;
  105. @property (nonatomic, strong) NSDictionary *entities;
  106. @property (nonatomic, strong) NSDictionary *counts;
  107. @property (nonatomic, assign) BOOL verified;
  108. @property (nonatomic, assign) BOOL following;
  109. @property (nonatomic, assign) BOOL followRequestSent;
  110. @property (nonatomic, assign) BOOL defaultProfile;
  111. @property (nonatomic, assign) BOOL defaultProfileImage;
  112. @property (nonatomic, assign) BOOL profileBackgroundTile;
  113. @property (nonatomic, assign) BOOL profileUseBackgroundImage;
  114. @property (nonatomic, assign) BOOL isProtected;
  115. @property (nonatomic, assign) BOOL isTranslator;
  116. @property (nonatomic, assign) BOOL notifications;
  117. @property (nonatomic, assign) BOOL geoEnabled;
  118. @property (nonatomic, assign) BOOL contributorsEnabled;
  119. @property (nonatomic, assign) BOOL isTranslationEnabled;
  120. @property (nonatomic, assign) BOOL hasExtendedProfile;
  121. @property (nonatomic, strong) NSString *lang;
  122. @property (nonatomic, strong) NSString *timeZone;
  123. @property (nonatomic, assign) int32_t utcOffset;
  124. @end
  125. @interface T1Tweet : NSObject
  126. @property (nonatomic, assign) uint64_t tid;
  127. @property (nonatomic, strong) NSString *tidStr;
  128. @property (nonatomic, strong) T1User *user;
  129. @property (nonatomic, strong) T1Place *place;
  130. @property (nonatomic, strong) T1Card *card;
  131. @property (nonatomic, strong) T1Tweet *retweetedStatus;
  132. @property (nonatomic, strong) T1Tweet *quotedStatus;
  133. @property (nonatomic, strong) NSString *text;
  134. @property (nonatomic, strong) NSString *source;
  135. @property (nonatomic, strong) NSArray<T1Media *> *medias;
  136. @property (nonatomic, strong) NSArray<T1Media *> *extendedMedias;
  137. @property (nonatomic, strong) NSArray<T1UserMention *> *userMentions;
  138. @property (nonatomic, strong) NSArray<T1URL *> *urls;
  139. @property (nonatomic, strong) NSArray<T1HashTag *> *hashTags;
  140. @property (nonatomic, strong) NSDate *createdAt;
  141. @property (nonatomic, assign) BOOL truncated;
  142. @property (nonatomic, assign) BOOL favorited;
  143. @property (nonatomic, assign) BOOL retweeted;
  144. @property (nonatomic, assign) BOOL isQuoteStatus;
  145. @property (nonatomic, assign) uint32_t favoriteCount;
  146. @property (nonatomic, assign) uint32_t retweetCount;
  147. @property (nonatomic, assign) uint64_t conversationID;
  148. @property (nonatomic, assign) uint32_t inReplyToUserId;
  149. @property (nonatomic, strong) NSArray *contributors;
  150. @property (nonatomic, assign) uint64_t inReplyToStatusID;
  151. @property (nonatomic, strong) NSString *inReplyToStatusIDStr;
  152. @property (nonatomic, strong) NSString *inReplyToUserIDStr;
  153. @property (nonatomic, strong) NSString *inReplyToScreenName;
  154. @property (nonatomic, strong) NSString *lang;
  155. @property (nonatomic, strong) NSDictionary *geo;
  156. @property (nonatomic, strong) NSString *supplementalLanguage;
  157. @property (nonatomic, strong) NSArray *coordinates;
  158. @end
  159. @interface T1Conversation : NSObject
  160. @property (nonatomic, strong) NSString *targetTweetID;
  161. @property (nonatomic, strong) NSArray *participantIDs;
  162. @property (nonatomic, assign) uint32_t participantsCount;
  163. @property (nonatomic, assign) uint32_t targetCount; // 0 if no target items
  164. @property (nonatomic, strong) NSString *rootUserID;
  165. @property (nonatomic, strong) NSArray *contextIDs; //<
  166. @property (nonatomic, strong) NSArray *entityIDs;
  167. @property (nonatomic, strong) NSArray *tweets; // Array<T1Tweet>
  168. @end
  169. @interface T1APIRespose : NSObject
  170. @property (nonatomic, strong) NSDictionary *moments; ///< empty
  171. @property (nonatomic, strong) NSDictionary<NSString *, T1User *> *users; ///< <UID(NSString), T1User>
  172. @property (nonatomic, strong) NSDictionary<NSString *, T1Tweet *> *tweets; ///< <TID(NSString), T1Tweet>
  173. @property (nonatomic, strong) NSArray *timelineItmes; ///< Array<T1Tweet/T1Conversation>
  174. @property (nonatomic, strong) NSArray *timeline; ///< Array<Dictionary>
  175. @property (nonatomic, strong) NSString *cursorTop;
  176. @property (nonatomic, strong) NSString *cursorBottom;
  177. @property (nonatomic, strong) NSArray *cursorGaps;
  178. @end