-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell implementation of the Google+ API v1 -- -- Will implement the Google+ REST API. Google+ is a social network made -- by Google. Found out more at http://plus.google.com. Implements -- the full API as of Oct 15, 2011. Only features read-only API access -- beacuse that is all that Google has published thus far. Both API and -- OAuth authentication is supported, but note that if you intend to use -- OAuth, this library does not currently provide the means to procure -- and renew OAuth tokens. @package googleplus @version 0.3.1.1 module Web.GooglePlus.Monad -- | Represents authentication data with GooglePlus. Currently supports an -- OAuth token or an API key data GooglePlusAuth -- | Authentication using an API key APIKey :: Text -> GooglePlusAuth -- | Authenticate using a token obtianed via OAuth V2. Currently no way in -- the library to obtain refresh tokens OAuthToken :: Text -> GooglePlusAuth -- | Environment passed into requests when they are executed within a -- GooglePlusM data GooglePlusEnv GooglePlusEnv :: GooglePlusAuth -> GooglePlusEnv gpAuth :: GooglePlusEnv -> GooglePlusAuth -- | IO wrapper used to compose/sequence Google+ API actions. See -- Web.GooglePlus docs for examples newtype GooglePlusM a GooglePlusM :: ReaderT GooglePlusEnv IO a -> GooglePlusM a unGooglePlusM :: GooglePlusM a -> ReaderT GooglePlusEnv IO a instance Monad GooglePlusM instance MonadIO GooglePlusM instance MonadReader GooglePlusEnv GooglePlusM instance Show GooglePlusAuth module Web.GooglePlus.Types -- | A member of Google+ data Person Person :: ID -> Text -> Maybe PersonName -> Maybe Text -> Maybe Text -> Maybe Day -> Maybe Gender -> Maybe Text -> Maybe Text -> Maybe RelationshipStatus -> URL -> Image -> [Email] -> [PersonURL] -> [Organization] -> [Place] -> [Language] -> Maybe Bool -> Person -- | Id of the Person personId :: Person -> ID -- | Name of the Person, suitable for display personDisplayName :: Person -> Text -- | Person's actual, full name personName :: Person -> Maybe PersonName -- | Optional nickname of the Person personNickName :: Person -> Maybe Text -- | Brief description of the Person personTagline :: Person -> Maybe Text -- | Person's Birthday personBirthday :: Person -> Maybe Day -- | Person's gender personGender :: Person -> Maybe Gender -- | About Me profile section personAboutMe :: Person -> Maybe Text -- | Current location of the Person personCurrentLocation :: Person -> Maybe Text -- | Person's current relationship status personRelationshipStatus :: Person -> Maybe RelationshipStatus -- | URL to the person's profile personProfileURL :: Person -> URL -- | Profile image for the Person personImage :: Person -> Image -- | Email addresses that the person uses personEmails :: Person -> [Email] -- | External URLs on the Person's profile personURLs :: Person -> [PersonURL] -- | Organizations that the Person has belonged to, past and present personOrganizations :: Person -> [Organization] -- | Places in which the Person has lived personPlacesLived :: Person -> [Place] -- | Languages the Person speaks personLanguagesSpoken :: Person -> [Language] personHasApp :: Person -> Maybe Bool -- | A Person search result with limited informaiton. The full person's -- profile must be retrieved to get the rest data PersonSearchResult PersonSearchResult :: ID -> Text -> Image -> URL -> PersonSearchResult -- | Id of the Person personSRId :: PersonSearchResult -> ID -- | Name of the Person, suitable for display personSRDisplayName :: PersonSearchResult -> Text -- | Profile image for the Person personSRImage :: PersonSearchResult -> Image -- | URL to the person's profile personSRProfileURL :: PersonSearchResult -> URL -- | Identifier used for finding a Person data PersonID -- | ID for a specific user PersonID :: Text -> PersonID -- | The authenticated user Me :: PersonID type ID = Text -- | A person who may be associated with an Activity data Actor Actor :: Text -> ID -> Image -> URL -> Actor -- | The public display name of the Actor actorDisplayName :: Actor -> Text -- | The ID of the Actor actorId :: Actor -> ID -- | Data pertaining to the Actor's main profile image actorImage :: Actor -> Image -- | URL of the user's profile actorUrl :: Actor -> URL -- | Type of activity being performed data Verb -- | Publish content to the stream Post :: Verb -- | Check into a location Checkin :: Verb -- | Reshare an activity Share :: Verb -- | Object to which an activity pertains data ActivityObject ActivityObject :: Maybe Actor -> [Attachment] -> Text -> Maybe ID -> ActivityObjectType -> Maybe Text -> Integer -> Integer -> Integer -> URL -> ActivityObject -- | If the object is another Activity, this refers to the actor for that -- Activity activityObjectActor :: ActivityObject -> Maybe Actor -- | Media objects attached to this activity object activityObjectAttachments :: ActivityObject -> [Attachment] -- | Snipped of text if the object is an article activityObjectContent :: ActivityObject -> Text -- | ID of the media object's resource activityObjectId :: ActivityObject -> Maybe ID -- | Type of Object activityObjectType :: ActivityObject -> ActivityObjectType -- | Content text as provided by the author without any HTML formatting activityObjectOriginalContent :: ActivityObject -> Maybe Text -- | Number of people giving the Activity a +1 activityObjectPlusOners :: ActivityObject -> Integer -- | Number of replies to the Activity activityObjectReplies :: ActivityObject -> Integer -- | Number of people resharing the Activity activityObjectResharers :: ActivityObject -> Integer -- | URL pointing to the linked resource activityObjectURL :: ActivityObject -> URL -- | Types of objects that can be associated with an Activity data ActivityObjectType -- | Textual content Note :: ActivityObjectType -- | A Google+ Activity GooglePlusActivity :: ActivityObjectType -- | Service provider who originally published an Activity data Provider Provider :: Text -> Provider providerTitle :: Provider -> Text -- | Describes who has access to a given Activity resource data Access Access :: Maybe Text -> [AccessItem] -> Access -- | Description of the access, suitable for display accessDescription :: Access -> Maybe Text -- | List of access entries accessItems :: Access -> [AccessItem] -- | AccessEntry that describes the type of access someone may have to an -- Activity data AccessItem AccessItem :: Maybe ID -> AccessItemType -> AccessItem -- | ID of the entry. Only set when this AccessItem refers to a Person or -- Circle accessItemId :: AccessItem -> Maybe ID -- | Type of entity which has access to the associated Activity accessItemType :: AccessItem -> AccessItemType -- | Type of entity which may access an Activity data AccessItemType PersonAccess :: AccessItemType CircleAccess :: AccessItemType -- | Access granted to all members of the Actor's circles MyCirclesAccess :: AccessItemType -- | Access granted to members of the Actor's circles and their circles as -- well ExtendedCirclesAccess :: AccessItemType -- | Access to anyone on the internet PublicAccess :: AccessItemType -- | Geolocation based on longitude and latitude data Geocode Geocode :: Double -> Double -> Geocode latitude :: Geocode -> Double longitude :: Geocode -> Double -- | Activity on Google+, such as a post data Activity Activity :: Maybe Bool -> Text -> ZonedTime -> ZonedTime -> ID -> URL -> Actor -> Verb -> ActivityObject -> Maybe Text -> Maybe ID -> Provider -> Access -> Maybe Geocode -> Maybe Text -> Maybe Integer -> Maybe ID -> Maybe Text -> Activity -- | Meaning undocumented activityPlaceholder :: Activity -> Maybe Bool -- | Title of the activity activityTitle :: Activity -> Text -- | Date originally published activityPublished :: Activity -> ZonedTime -- | Date updated activityUpdated :: Activity -> ZonedTime -- | Activity ID activityId :: Activity -> ID -- | URL to view the Activity activityURL :: Activity -> URL -- | The person who performed the Activity activityActor :: Activity -> Actor -- | Indicates what action was performed activityVerb :: Activity -> Verb -- | The object of the Activity activityObject :: Activity -> ActivityObject -- | Additional content added by the person who shared this activity, -- applicable only when resharing an activity activityAnnotation :: Activity -> Maybe Text -- | ID of original activity if this activity is a crosspost from another -- system activityCrosspostSource :: Activity -> Maybe ID -- | Service provider initially providing the activity activityProvider :: Activity -> Provider -- | Identifies who has access to this activity activityAccess :: Activity -> Access -- | Where the activity occurred (Latitude/Longitude) activityGeocode :: Activity -> Maybe Geocode -- | Street address where the activity occurred activityAddress :: Activity -> Maybe Text -- | Radius of the region where the activity ocurred, centered at the -- Geocode activityRadius :: Activity -> Maybe Integer -- | ID of the place where the activity occurred activityPlaceId :: Activity -> Maybe ID activityPlaceName :: Activity -> Maybe Text -- | A feed of user activity data ActivityFeed ActivityFeed :: Text -> ZonedTime -> ID -> [Activity] -> ActivityFeed -- | Title of the feed in Google+ activityFeedTitle :: ActivityFeed -> Text -- | Time updated activityFeedUpdated :: ActivityFeed -> ZonedTime -- | Unique ID of the feed activityFeedId :: ActivityFeed -> ID -- | Activities in the feed (currently limited to first page activityFeedItems :: ActivityFeed -> [Activity] -- | Media attached to an Activity data Attachment Attachment :: Maybe Text -> Maybe Text -> Maybe Embed -> Maybe Image -> Maybe ID -> Maybe Image -> AttachmentType -> Maybe URL -> Attachment -- | Snippet of text if the Attachment is an article attachmentContent :: Attachment -> Maybe Text -- | Title of the Attachment attachmentDisplayName :: Attachment -> Maybe Text -- | Embeddable link if the Attachment is a video attachmentEmbed :: Attachment -> Maybe Embed -- | Full image if the Attachment is a photo attachmentFullImage :: Attachment -> Maybe Image -- | ID of the Attachment's resource attachmentId :: Attachment -> Maybe ID -- | Preview image attachmentImage :: Attachment -> Maybe Image -- | Type of attachment attachmentType :: Attachment -> AttachmentType -- | Lin k to text/html attachment attachmentURL :: Attachment -> Maybe URL -- | Type of Activity Attachment data AttachmentType Photo :: AttachmentType -- | A type that occurs in the wild but is not mentioned in the Google+ API -- docs PhotoAlbum :: AttachmentType Video :: AttachmentType -- | An article attachment specified by a link by the poster Article :: AttachmentType -- | Embeddable link for an attachment if it is a video data Embed Embed :: Text -> URL -> Embed -- | Type of embeddable link embedType :: Embed -> Text -- | Embeddable link embedUrl :: Embed -> URL -- | Person's gender data Gender Male :: Gender Female :: Gender OtherGender :: Gender -- | Full, real name of a Person data PersonName PersonName :: Text -> Text -> Text -> Text -> Text -> Text -> PersonName familyName :: PersonName -> Text -- | Fully formatted name of a Person including middle names, suffixes, -- etc. formatted :: PersonName -> Text -- | The given (first) name of a Person givenName :: PersonName -> Text -- | Prefix to a Person's name such as Dr. or Mrs. honorificPrefix :: PersonName -> Text -- | Suffix of a Person's name such as Jr. honorificSuffix :: PersonName -> Text middleName :: PersonName -> Text -- | Image resource on Google+ data Image Image :: URL -> Maybe Text -> Maybe Integer -> Maybe Integer -> Image imageURL :: Image -> URL -- | Media type of the link imageType :: Image -> Maybe Text imageWidth :: Image -> Maybe Integer imageHeight :: Image -> Maybe Integer -- | Email address belonging to the User data Email Email :: Bool -> EmailType -> Text -> Email -- | Whether or not the Email is the Person's primary Email emailPrimary :: Email -> Bool -- | Type/context of the Email address emailType :: Email -> EmailType -- | The actual text address of the Email emailAddressValue :: Email -> Text -- | Context/types of Emails that a Person can have data EmailType HomeEmail :: EmailType WorkEmail :: EmailType OtherEmail :: EmailType -- | External URLS that the Person has published data PersonURL PersonURL :: Bool -> Maybe PersonURLType -> URL -> PersonURL -- | Whether or not the URL is the Person's primary URl personUrlPrimary :: PersonURL -> Bool -- | Type of URL personUrlType :: PersonURL -> Maybe PersonURLType -- | Actual text URl for the Person personURLValue :: PersonURL -> URL -- | Context/types of URLS that a Person can have data PersonURLType HomeURL :: PersonURLType WorkURL :: PersonURLType BlogURL :: PersonURLType ProfileURL :: PersonURLType -- | This is not a documented value, yet I've encountered it in the wild. I -- have no idea what it means. JsonURL :: PersonURLType OtherURL :: PersonURLType -- | Organization to which a Persion currently or previously may belong data Organization Organization :: Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Text -> Bool -> Maybe Text -> Text -> OrganizationType -> Organization -- | Department of an Organization in which the Person resided organizationDepartment :: Organization -> Maybe Text -- | General description of the Organization organizationDescription :: Organization -> Maybe Text -- | Date on which the user stopped at the organization in an unspecified -- text format organizationEndDate :: Organization -> Maybe Text -- | Location of the Organization organizationLocation :: Organization -> Maybe Text -- | Name of the Organization organizationName :: Organization -> Text -- | Whether or not this Organization was the Person's primary one organizationPrimary :: Organization -> Bool -- | Date on which the user started at the organization in an unspecified -- text format organizationstartDate :: Organization -> Maybe Text -- | The Person's role at the Organization organizationTitle :: Organization -> Text -- | The type of Organization organizationType :: Organization -> OrganizationType -- | The capacity in which the Perosn participated in an Organization data OrganizationType Work :: OrganizationType School :: OrganizationType -- | A physical location where a Person resides/resided data Place Place :: Bool -> Text -> Place -- | Whether or not this is/was the Person's primary residence placePrimary :: Place -> Bool -- | Text description of the Place placeValue :: Place -> Text -- | Relationship status of a Person data RelationshipStatus Single :: RelationshipStatus InARelationship :: RelationshipStatus Engaged :: RelationshipStatus Married :: RelationshipStatus ItsComplicated :: RelationshipStatus OpenRelationship :: RelationshipStatus Widowed :: RelationshipStatus InDomesticPartnership :: RelationshipStatus InCivilUnion :: RelationshipStatus -- | Activity comment on Google+ data Comment Comment :: ID -> ZonedTime -> ZonedTime -> Actor -> Verb -> CommentObject -> URL -> [InReplyTo] -> Comment -- | ID of the comment commentId :: Comment -> ID -- | Date originally published commentPublished :: Comment -> ZonedTime -- | Date updated commentUpdated :: Comment -> ZonedTime -- | The actor who posted the comment commentActor :: Comment -> Actor -- | Indicates what action was performed commentVerb :: Comment -> Verb -- | The content of the object commentObject :: Comment -> CommentObject -- | URL to the comment commentUrl :: Comment -> URL -- | The activities to which this comment is a reply commentActivities :: Comment -> [InReplyTo] data CommentObject CommentObject :: Text -> CommentObject -- | Text content of the comments commentObjectContent :: CommentObject -> Text data InReplyTo InReplyTo :: ID -> URL -> InReplyTo -- | ID of the article inReplyToId :: InReplyTo -> ID -- | URL of the article inReplyToUrl :: InReplyTo -> URL instance Show Verb instance Eq Verb instance Show ActivityObjectType instance Eq ActivityObjectType instance Show Embed instance Eq Embed instance Show AttachmentType instance Eq AttachmentType instance Show Geocode instance Eq Geocode instance Show AccessItemType instance Eq AccessItemType instance Show AccessItem instance Eq AccessItem instance Show Access instance Eq Access instance Show Provider instance Eq Provider instance Show Gender instance Eq Gender instance Show PersonID instance Eq PersonID instance Show PersonName instance Eq PersonName instance Show Image instance Eq Image instance Show PersonSearchResult instance Eq PersonSearchResult instance Show Attachment instance Eq Attachment instance Show Actor instance Eq Actor instance Show ActivityObject instance Eq ActivityObject instance Show Activity instance Eq Activity instance Show ActivityFeed instance Eq ActivityFeed instance Show EmailType instance Eq EmailType instance Show Email instance Eq Email instance Show PersonURLType instance Eq PersonURLType instance Show PersonURL instance Eq PersonURL instance Show OrganizationType instance Eq OrganizationType instance Show Organization instance Eq Organization instance Show Place instance Eq Place instance Show RelationshipStatus instance Eq RelationshipStatus instance Show Person instance Eq Person instance Show CommentObject instance Eq CommentObject instance Show InReplyTo instance Eq InReplyTo instance Show Comment instance Eq Comment instance FromJSON InReplyTo instance FromJSON CommentObject instance FromJSON Comment instance FromJSON RelationshipStatus instance FromJSON Place instance FromJSON OrganizationType instance FromJSON Organization instance FromJSON URL instance FromJSON PersonURLType instance FromJSON PersonURL instance FromJSON EmailType instance FromJSON Email instance FromJSON Image instance FromJSON PersonName instance FromJSON Gender instance FromJSON Day instance FromJSON PersonSearchResult instance FromJSON Person instance FromJSON Provider instance FromJSON AccessItemType instance FromJSON AccessItem instance FromJSON Access instance FromJSON Geocode instance FromJSON AttachmentType instance FromJSON Embed instance FromJSON Attachment instance FromJSON ActivityObjectType instance FromJSON ActivityObject instance FromJSON Verb instance FromJSON Actor instance FromJSON ZonedTime instance Eq ZonedTime instance FromJSON Activity instance FromJSON ActivityFeed -- | Toplevel module for the Google+ API operating in the GooglePlusM -- Monad. Currently covers the (very) limited, read-only API that Google -- has exposed in v1 of the Google+ API -- --
-- {-# LANGUAGE OverloadedStrings #-}
-- import Web.GooglePlus
-- import Web.GooglePlus.Monad
-- import Web.GooglePlus.Types
-- import Control.Monad.Reader
-- import Data.Text (unpack)
--
-- doStuff :: GooglePlusM ()
-- doStuff = do
-- Right person <- getPerson Me
-- Right feed <- getLatestActivityFeed Me PublicCollection
-- -- ...
-- return ()
--
-- main :: IO ()
-- main = do
-- runReaderT (unGooglePlusM doStuff) env
-- where env = GooglePlusEnv { gpAuth = APIKey "MYKEY" }
--
module Web.GooglePlus
-- | Get a person who matches the given identifier
getPerson :: PersonID -> GooglePlusM (Either Text Person)
-- | Get an activity which matches the given activity ID
getActivity :: ID -> GooglePlusM (Either Text Activity)
-- | Get a comment which matches the given comment ID
getComment :: ID -> GooglePlusM (Either Text Comment)
-- | Get an activity who matches the given activity ID and collection to
-- use. Default page size is (20) and only fetches the first page. You
-- will receive an error from the server if the page size exceeds 100.
getLatestActivityFeed :: PersonID -> ActivityCollection -> Maybe Integer -> GooglePlusM (Either Text ActivityFeed)
-- | Paginating enumerator to consume a user's activity stream. Each chunk
-- will end up being an array with a single ActivityFeed in it with 1
-- page of data in it. This weirdness about the chunks only containing 1
-- element is mostly to maintain the metadata available on ActivityFeed
-- and have it available in each chunk. For a more natural chunking of
-- just Activities if you don't need that additional metadata, see
-- enumActivities. Note that this Enumerator will abort if it encounters
-- an error from the server, thus cutting the list short.
enumActivityFeed :: PersonID -> ActivityCollection -> Maybe Integer -> Enumerator ActivityFeed GooglePlusM b
-- | Simplified version of enumActivityFeed which retrieves all pages of an
-- activity feed and merges them into one. Note that this will not be as
-- efficient as enumActivityFeed in terms of memory/time because it
-- collects them all in memory first. Note that this should incur 1 API
-- call per page of results, so the max page size of 100 is used.
getActivityFeed :: PersonID -> ActivityCollection -> GooglePlusM ActivityFeed
-- | Paginating enumerator yielding a Chunk for each page. Use this if you
-- don't need the feed metadata that enumActivityFeed provides.
enumActivities :: PersonID -> ActivityCollection -> Maybe Integer -> Enumerator Activity GooglePlusM b
-- | Simplified version of enumActivities that fetches all the activitys of
-- a Person first, thus returning them. Note that this should incur 1 API
-- call per page of results, so the max page size of 100 is used.
getActivities :: PersonID -> ActivityCollection -> GooglePlusM [Activity]
-- | Search for a member of Google+. Paginating enumerator yielding a Chunk
-- for each page. Note that this Enumerator will abort if it encounters
-- an error from the server, thus cutting the list short.
enumPersonSearch :: Text -> Maybe Integer -> Enumerator PersonSearchResult GooglePlusM b
-- | Returns the full result set for a person search given a search string.
-- This interface is simpler to use but does not have the
-- flexibility/memory usage benefit of enumPersonSearch.
getPersonSearch :: Text -> GooglePlusM [PersonSearchResult]
-- | Find people associated with a particular Activity. Paginating
-- enumerator yielding a Chunk for each page. Paginating enumerator
-- yielding a Chunk for each page. Note that this Enumerator will abort
-- if it encounters an error from the server, thus cutting the list
-- short.
enumPeopleByActivity :: ID -> ListByActivityCollection -> Maybe Integer -> Enumerator Person GooglePlusM b
-- | Returns the full result set for a person search given a search string.
-- This interface is simpler to use but does not have the
-- flexibility/memory usage benefit of enumPeopleByActivity.
getPeopleByActivity :: ID -> ListByActivityCollection -> GooglePlusM [Person]
-- | Search for an activity on Google+. Paginating enumerator yielding a
-- Chunk for each page. Note that this Enumerator will abort if it
-- encounters an error from the server, thus cutting the list short.
enumActivitySearch :: Text -> SearchOrderBy -> Maybe Integer -> Enumerator Activity GooglePlusM b
-- | Returns the full result set for an activity search given a search
-- string. This interface is simpler to use but does not have the
-- flexibility/memory usage benefit of enumActivitySearch.
getActivitySearch :: Text -> SearchOrderBy -> GooglePlusM [Activity]
-- | Find comments for an activity on Google+. Paginating enumerator
-- yielding a Chunk for each page. Note that this Enumerator will abort
-- if it encounters an error from the server, thus cutting the list
-- short.
enumComments :: ID -> Maybe Integer -> Enumerator Comment GooglePlusM b
-- | Returns the full result set for an activity's comments. This interface
-- is simpler to use but does not have the flexibility/memory usage
-- benefit of enumComments.
getComments :: ID -> GooglePlusM [Comment]
data SearchOrderBy
-- | Sort by relevance to the to the user, most relevant first
Best :: SearchOrderBy
-- | Sort by most recent results first
Recent :: SearchOrderBy
-- | Specifies the type of Activities to get in an Activity listing.
-- Currently the API only allows public.
data ActivityCollection
PublicCollection :: ActivityCollection
data ListByActivityCollection
-- | List of people who have +1ed an activity
PlusOners :: ListByActivityCollection
-- | List of people who have reshared an activity
Resharers :: ListByActivityCollection
instance Show ActivityCollection
instance Eq ActivityCollection
instance Show ListByActivityCollection
instance Eq ListByActivityCollection
instance Show SearchOrderBy
instance Eq SearchOrderBy
instance FromJSON a => FromJSON (PaginatedResource a)
instance FromJSON PaginatedActivityFeed