module Web.Twitter.Types where
type ColorString = String
type DateString = String
type UserId = String
type URLString = String
type UserName = String
type StatusId = String
data Format = FormatXML | FormatJSON | FormatRSS | FormatAtom
newtype UserID = UserID { userID :: UserId }
data Status
= Status
{ statusCreated :: DateString
, statusId :: StatusId
, statusText :: String
, statusSource :: String
, statusTruncated :: Bool
, statusInReplyTo :: Maybe StatusId
, statusInReplyToUser :: Maybe UserId
, statusFavorite :: Maybe Bool
, statusUser :: User
}
nullStatus :: Status
nullStatus = Status
{ statusCreated = ""
, statusId = ""
, statusText = ""
, statusSource = ""
, statusTruncated = False
, statusInReplyTo = Nothing
, statusInReplyToUser = Nothing
, statusFavorite = Nothing
, statusUser = nullUser
}
data User
= User
{ userId :: UserId
, userName :: UserName
, userScreenName :: String
, userDescription :: String
, userLocation :: String
, userProfileImageURL :: Maybe URLString
, userURL :: Maybe URLString
, userProtected :: Maybe Bool
, userFollowers :: Maybe Int
}
nullUser :: User
nullUser = User
{ userId = ""
, userName = ""
, userScreenName = ""
, userDescription = ""
, userLocation = ""
, userProfileImageURL = Nothing
, userURL = Nothing
, userProtected = Nothing
, userFollowers = Nothing
}
data UserInfo
= UserInfo
{ userInfoBackgroundTile :: Bool
, userInfoLinkColor :: ColorString
, userInfoBackground :: ColorString
, userInfoBackgroundImageURL :: URLString
, userInfoTextColor :: ColorString
, userInfoSidebarFill :: ColorString
, userInfoSidebarColor :: ColorString
, userInfoFollowers :: Int
, userInfoDescription :: String
, userInfoUTCOffset :: Int
, userInfoFavorites :: Int
, userInfoCreated :: DateString
, userInfoTimezone :: String
, userInfoImageURL :: URLString
, userInfoURL :: Maybe URLString
, userInfoStatusCount :: Int
, userInfoFriends :: Int
, userInfoScreenName :: UserName
, userInfoProtected :: Bool
, userInfoLocation :: String
, userInfoName :: UserName
, userInfoId :: UserId
}
nullUserInfo :: UserInfo
nullUserInfo = UserInfo
{ userInfoBackgroundTile = False
, userInfoLinkColor = ""
, userInfoBackground = ""
, userInfoBackgroundImageURL = ""
, userInfoTextColor = ""
, userInfoSidebarFill = ""
, userInfoSidebarColor = ""
, userInfoFollowers = 0
, userInfoDescription = ""
, userInfoUTCOffset = 0
, userInfoFavorites = 0
, userInfoCreated = ""
, userInfoTimezone = ""
, userInfoImageURL = ""
, userInfoURL = Nothing
, userInfoStatusCount = 0
, userInfoFriends = 0
, userInfoScreenName = ""
, userInfoProtected = False
, userInfoLocation = ""
, userInfoName = ""
, userInfoId = ""
}
data DirectMessage
= DirectMessage
{ directRecipient :: Maybe User
, directSender :: Maybe User
, directSenderId :: UserId
, directSenderName :: UserName
, directRecipientId :: UserId
, directRecipientName :: UserId
, directText :: String
, directId :: StatusId
, directCreated :: DateString
}
nullDirectMessage :: DirectMessage
nullDirectMessage = DirectMessage
{ directRecipient = Nothing
, directSender = Nothing
, directSenderId = ""
, directSenderName = ""
, directRecipientId = ""
, directRecipientName = ""
, directText = ""
, directId = ""
, directCreated = ""
}
data RateLimit
= RateLimit
{ rateLimitResetSecs :: Integer
, rateLimitResetTime :: DateString
, rateLimitRemHits :: Integer
, rateLimitHourlyLimit :: Integer
}
nullRateLimit :: RateLimit
nullRateLimit = RateLimit
{ rateLimitResetSecs = 0
, rateLimitResetTime = ""
, rateLimitRemHits = 0
, rateLimitHourlyLimit = 0
}
data Trends
= Trends
{ trendsAsOf :: DateString
, trendsInfo :: [(String, URLString)]
}
nullTrends :: Trends
nullTrends = Trends
{ trendsAsOf = ""
, trendsInfo = []
}
data SearchResult
= SearchResult
{ searchResultText :: String
, searchResultId :: StatusId
, searchResultFromUser :: UserName
, searchResultFromUserId :: UserId
, searchResultAt :: DateString
, searchResultLanguage :: Maybe String
, searchResultToUser :: Maybe UserName
, searchResultToUserId :: Maybe UserId
}
nullSearchResult :: SearchResult
nullSearchResult = SearchResult
{ searchResultText = ""
, searchResultId = ""
, searchResultFromUser = ""
, searchResultFromUserId = ""
, searchResultAt = ""
, searchResultLanguage = Nothing
, searchResultToUser = Nothing
, searchResultToUserId = Nothing
}
nullUserID :: UserID
nullUserID = UserID { userID = "" }