module Web.Twitter.Types.Lens
(
AsStatus(..)
, AsUser(..)
, HasCreatedAt(..)
, AsImageSize(..)
, TT.Status
, statusContributors
, statusCoordinates
, statusCreatedAt
, statusCurrentUserRetweet
, statusEntities
, statusExtendedEntities
, statusFavoriteCount
, statusFavorited
, statusFilterLevel
, statusId
, statusInReplyToScreenName
, statusInReplyToStatusId
, statusInReplyToUserId
, statusLang
, statusPlace
, statusPossiblySensitive
, statusScopes
, statusQuotedStatusId
, statusQuotedStatus
, statusRetweetCount
, statusRetweeted
, statusRetweetedStatus
, statusSource
, statusText
, statusTruncated
, statusUser
, statusWithheldCopyright
, statusWithheldInCountries
, statusWithheldScope
, TT.SearchResult
, searchResultStatuses
, searchResultSearchMetadata
, TT.SearchStatus
, searchStatusCreatedAt
, searchStatusId
, searchStatusText
, searchStatusSource
, searchStatusUser
, searchStatusCoordinates
, TT.SearchMetadata
, searchMetadataMaxId
, searchMetadataSinceId
, searchMetadataRefreshURL
, searchMetadataNextResults
, searchMetadataCount
, searchMetadataCompletedIn
, searchMetadataSinceIdStr
, searchMetadataQuery
, searchMetadataMaxIdStr
, TT.RetweetedStatus
, rsCreatedAt
, rsId
, rsText
, rsSource
, rsTruncated
, rsEntities
, rsUser
, rsRetweetedStatus
, rsCoordinates
, TT.DirectMessage
, dmCreatedAt
, dmSenderScreenName
, dmSender
, dmText
, dmRecipientScreeName
, dmId
, dmRecipient
, dmRecipientId
, dmSenderId
, dmCoordinates
, TT.Event
, evCreatedAt
, evTargetObject
, evEvent
, evTarget
, evSource
, TT.Delete
, delId
, delUserId
, TT.User
, userContributorsEnabled
, userCreatedAt
, userDefaultProfile
, userDefaultProfileImage
, userDescription
, userFavoritesCount
, userFollowRequestSent
, userFollowing
, userFollowersCount
, userFriendsCount
, userGeoEnabled
, userId
, userIsTranslator
, userLang
, userListedCount
, userLocation
, userName
, userNotifications
, userProfileBackgroundColor
, userProfileBackgroundImageURL
, userProfileBackgroundImageURLHttps
, userProfileBackgroundTile
, userProfileBannerURL
, userProfileImageURL
, userProfileImageURLHttps
, userProfileLinkColor
, userProfileSidebarBorderColor
, userProfileSidebarFillColor
, userProfileTextColor
, userProfileUseBackgroundImage
, userProtected
, userScreenName
, userShowAllInlineMedia
, userStatusesCount
, userTimeZone
, userURL
, userUtcOffset
, userVerified
, userWithheldInCountries
, userWithheldScope
, TT.List
, listId
, listName
, listFullName
, listMemberCount
, listSubscriberCount
, listMode
, listUser
, TT.Entities
, enHashTags
, enUserMentions
, enURLs
, enMedia
, TT.Entity
, entityBody
, entityIndices
, TT.HashTagEntity
, hashTagText
, TT.UserEntity
, userEntityUserId
, userEntityUserName
, userEntityUserScreenName
, TT.URLEntity
, ueURL
, ueExpanded
, ueDisplay
, TT.MediaEntity
, meType
, meId
, meSizes
, meMediaURL
, meMediaURLHttps
, meURL
, TT.MediaSize
, msWidth
, msHeight
, msResize
, TT.Coordinates
, coordinates
, coordinatesType
, TT.Place
, placeAttributes
, placeBoundingBox
, placeCountry
, placeCountryCode
, placeFullName
, placeId
, placeName
, placeType
, placeURL
, TT.BoundingBox
, boundingBoxCoordinates
, boundingBoxType
, TT.Contributor
, contributorId
, contributorScreenName
, TT.UploadedMedia
, uploadedMediaId
, uploadedMediaSize
, uploadedMediaImage
, TT.ImageSizeType
, imageSizeTypeWidth
, imageSizeTypeHeight
, imageSizeTypeType
, TT.UserId
, TT.Friends
, TT.URIString
, TT.UserName
, TT.StatusId
, TT.LanguageCode
, TT.StreamingAPI(..)
, TT.EventTarget(..)
, TT.EntityIndices
, _SStatus
, _SRetweetedStatus
, _SEvent
, _SDelete
, _SFriends
, _SDirectMessage
, _SUnknown
, _ETUser
, _ETStatus
, _ETList
, _ETUnknown
)
where
import Control.Lens hiding (makeLenses)
import Data.Text (Text)
import Data.Time
import qualified Web.Twitter.Types as TT
import Web.Twitter.Types.Lens.TH
makeLenses ''TT.Status
makeLenses ''TT.SearchResult
makeLenses ''TT.SearchStatus
makeLenses ''TT.SearchMetadata
makeLenses ''TT.RetweetedStatus
makeLenses ''TT.DirectMessage
makeLenses ''TT.Event
makeLenses ''TT.Delete
makeLenses ''TT.User
makeLenses ''TT.List
makeLenses ''TT.Entities
makeLenses ''TT.Entity
makeLenses ''TT.HashTagEntity
makeLenses ''TT.UserEntity
makeLenses ''TT.URLEntity
makeLenses ''TT.MediaEntity
makeLenses ''TT.MediaSize
makeLenses ''TT.Coordinates
makeLenses ''TT.Place
makeLenses ''TT.BoundingBox
makeLenses ''TT.Contributor
makeLenses ''TT.ImageSizeType
makeLenses ''TT.UploadedMedia
class AsStatus s where
status_id :: Lens' s TT.StatusId
text :: Lens' s Text
user :: Lens' s TT.User
geolocation :: Lens' s (Maybe TT.Coordinates)
instance AsStatus TT.Status where
status_id = statusId
text = statusText
user = statusUser
geolocation = statusCoordinates
instance AsStatus TT.SearchStatus where
status_id = searchStatusId
text = searchStatusText
user = searchStatusUser
geolocation = searchStatusCoordinates
instance AsStatus TT.RetweetedStatus where
status_id = rsId
text = rsText
user = rsUser
geolocation = rsCoordinates
instance AsStatus TT.DirectMessage where
status_id = dmId
text = dmText
user = dmSender
geolocation = dmCoordinates
class AsUser u where
user_id :: Lens' u TT.UserId
name :: Lens' u TT.UserName
screen_name :: Lens' u Text
instance AsUser TT.User where
user_id = userId
name = userName
screen_name = userScreenName
instance AsUser TT.UserEntity where
user_id = userEntityUserId
name = userEntityUserName
screen_name = userEntityUserScreenName
instance AsUser (TT.Entity TT.UserEntity) where
user_id = entityBody.userEntityUserId
name = entityBody.userEntityUserName
screen_name = entityBody.userEntityUserScreenName
class HasCreatedAt a where
created_at :: Lens' a UTCTime
instance HasCreatedAt TT.Status where
created_at = statusCreatedAt
instance HasCreatedAt TT.SearchStatus where
created_at = searchStatusCreatedAt
instance HasCreatedAt TT.RetweetedStatus where
created_at = rsCreatedAt
instance HasCreatedAt TT.DirectMessage where
created_at = dmCreatedAt
instance HasCreatedAt TT.User where
created_at = userCreatedAt
class AsImageSize a where
width :: Lens' a Int
height :: Lens' a Int
instance AsImageSize TT.MediaSize where
width = msWidth
height = msHeight
instance AsImageSize TT.ImageSizeType where
width = imageSizeTypeWidth
height = imageSizeTypeHeight
makePrisms ''TT.StreamingAPI
makePrisms ''TT.EventTarget