-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Google APIs for server to server applications -- -- This library provides a way to use Google API for server to server -- applications. @package google-server-api @version 0.2.0.0 -- | Define data types to represent all of the requests that are sent to -- the API. module Google.Form data CalendarEvent CalendarEvent :: Account -> [Account] -> Text -> Text -> DateTime -> DateTime -> CalendarEvent [$sel:creator:CalendarEvent] :: CalendarEvent -> Account [$sel:attendees:CalendarEvent] :: CalendarEvent -> [Account] [$sel:summary:CalendarEvent] :: CalendarEvent -> Text [$sel:description:CalendarEvent] :: CalendarEvent -> Text [$sel:start:CalendarEvent] :: CalendarEvent -> DateTime [$sel:end:CalendarEvent] :: CalendarEvent -> DateTime data GmailSend GmailSend :: Text -> GmailSend [$sel:raw:GmailSend] :: GmailSend -> Text data Account Account :: Text -> Account [$sel:email:Account] :: Account -> Text data DateTime DateTime :: UTCTime -> DateTime [$sel:dateTime:DateTime] :: DateTime -> UTCTime data Email Email :: Text -> Text -> Maybe Text -> [Text] -> Text -> Text -> Email [$sel:to:Email] :: Email -> Text [$sel:from:Email] :: Email -> Text [$sel:replyTo:Email] :: Email -> Maybe Text [$sel:ccs:Email] :: Email -> [Text] [$sel:subject:Email] :: Email -> Text [$sel:body:Email] :: Email -> Text toMail :: Email -> IO Mail data Token Token :: Text -> Text -> Token [$sel:grantType:Token] :: Token -> Text [$sel:assertion:Token] :: Token -> Text instance Data.Aeson.Types.ToJSON.ToJSON Google.Form.GmailSend instance Data.Aeson.Types.FromJSON.FromJSON Google.Form.GmailSend instance GHC.Show.Show Google.Form.GmailSend instance GHC.Generics.Generic Google.Form.GmailSend instance GHC.Classes.Eq Google.Form.GmailSend instance Data.Aeson.Types.ToJSON.ToJSON Google.Form.Email instance Data.Aeson.Types.FromJSON.FromJSON Google.Form.Email instance GHC.Show.Show Google.Form.Email instance GHC.Generics.Generic Google.Form.Email instance GHC.Classes.Eq Google.Form.Email instance GHC.Show.Show Google.Form.Token instance GHC.Generics.Generic Google.Form.Token instance GHC.Classes.Eq Google.Form.Token instance Web.Internal.FormUrlEncoded.ToForm Google.Form.Token instance Data.Aeson.Types.ToJSON.ToJSON Google.Form.CalendarEvent instance Data.Aeson.Types.FromJSON.FromJSON Google.Form.CalendarEvent instance GHC.Show.Show Google.Form.CalendarEvent instance GHC.Generics.Generic Google.Form.CalendarEvent instance GHC.Classes.Eq Google.Form.CalendarEvent instance Data.Aeson.Types.ToJSON.ToJSON Google.Form.DateTime instance Data.Aeson.Types.FromJSON.FromJSON Google.Form.DateTime instance GHC.Show.Show Google.Form.DateTime instance GHC.Generics.Generic Google.Form.DateTime instance GHC.Classes.Eq Google.Form.DateTime instance Data.Aeson.Types.ToJSON.ToJSON Google.Form.Account instance Data.Aeson.Types.FromJSON.FromJSON Google.Form.Account instance GHC.Show.Show Google.Form.Account instance GHC.Generics.Generic Google.Form.Account instance GHC.Classes.Eq Google.Form.Account -- | Create a signed JWT needed to make the access token request to gain -- access to Google APIs for server to server applications. -- -- For all usage details, see -- https://developers.google.com/identity/protocols/OAuth2ServiceAccount -- -- This module is borrowed from google-oauth2-jwt package. module Google.JWT data JWT class HasJWT a getJwt :: HasJWT a => a -> JWT readServiceKeyFile :: FilePath -> IO (Maybe JWT) newtype SignedJWT SignedJWT :: ByteString -> SignedJWT [$sel:unSignedJWT:SignedJWT] :: SignedJWT -> ByteString newtype Email Email :: Text -> Email [$sel:unEmail:Email] :: Email -> Text data Scope ScopeCalendarFull :: Scope ScopeCalendarRead :: Scope ScopeGmailSend :: Scope -- | Create the signed JWT ready for transmission in the access token -- request as assertion value. -- --
-- grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion= --getSignedJWT :: JWT -> Maybe Email -> [Scope] -> Maybe Int -> IO (Either String SignedJWT) instance GHC.Classes.Ord Google.JWT.Scope instance GHC.Read.Read Google.JWT.Scope instance GHC.Show.Show Google.JWT.Scope instance GHC.Classes.Eq Google.JWT.Scope instance GHC.Read.Read Google.JWT.JWT instance GHC.Show.Show Google.JWT.JWT instance GHC.Classes.Eq Google.JWT.JWT instance GHC.Classes.Ord Google.JWT.Email instance GHC.Read.Read Google.JWT.Email instance GHC.Show.Show Google.JWT.Email instance GHC.Classes.Eq Google.JWT.Email instance GHC.Classes.Ord Google.JWT.SignedJWT instance GHC.Read.Read Google.JWT.SignedJWT instance GHC.Show.Show Google.JWT.SignedJWT instance GHC.Classes.Eq Google.JWT.SignedJWT instance Google.JWT.HasJWT Google.JWT.JWT -- | Define data types to represent all of the responses that are received -- from the Google API. module Google.Response data Token Token :: Text -> Text -> Int -> Token [$sel:accessToken:Token] :: Token -> Text [$sel:tokenType:Token] :: Token -> Text [$sel:expiresIn:Token] :: Token -> Int data CalendarEvent CalendarEvent :: Text -> CalendarEvent [$sel:status:CalendarEvent] :: CalendarEvent -> Text data GmailSend GmailSend :: Text -> GmailSend [$sel:id:GmailSend] :: GmailSend -> Text instance Data.Aeson.Types.ToJSON.ToJSON Google.Response.GmailSend instance Data.Aeson.Types.FromJSON.FromJSON Google.Response.GmailSend instance Web.Internal.FormUrlEncoded.FromForm Google.Response.GmailSend instance Web.Internal.FormUrlEncoded.ToForm Google.Response.GmailSend instance GHC.Show.Show Google.Response.GmailSend instance GHC.Generics.Generic Google.Response.GmailSend instance GHC.Classes.Eq Google.Response.GmailSend instance Data.Aeson.Types.ToJSON.ToJSON Google.Response.CalendarEvent instance Data.Aeson.Types.FromJSON.FromJSON Google.Response.CalendarEvent instance Web.Internal.FormUrlEncoded.FromForm Google.Response.CalendarEvent instance Web.Internal.FormUrlEncoded.ToForm Google.Response.CalendarEvent instance GHC.Show.Show Google.Response.CalendarEvent instance GHC.Generics.Generic Google.Response.CalendarEvent instance GHC.Classes.Eq Google.Response.CalendarEvent instance Data.Aeson.Types.ToJSON.ToJSON Google.Response.Token instance Data.Aeson.Types.FromJSON.FromJSON Google.Response.Token instance Web.Internal.FormUrlEncoded.FromForm Google.Response.Token instance Web.Internal.FormUrlEncoded.ToForm Google.Response.Token instance GHC.Show.Show Google.Response.Token instance GHC.Generics.Generic Google.Response.Token instance GHC.Classes.Eq Google.Response.Token -- | Define functions to call Google APIs. module Google.Client getToken :: (HasHttpManager r, MonadError ServantError m, MonadIO m, MonadReader r m) => Maybe Email -> JWT -> [Scope] -> m Token postCalendarEvent :: (HasHttpManager r, MonadError ServantError m, MonadIO m, MonadReader r m) => Token -> CalendarEvent -> m CalendarEvent postGmailSend :: (HasHttpManager r, MonadError ServantError m, MonadIO m, MonadReader r m) => Token -> Email -> m GmailSend -- | Convert ServantError to arbitrary error type. run :: forall r m a e. (HasHttpManager r, MonadIO m, MonadError e m, MonadLogger m, MonadReader r m) => e -> ReaderT r (ExceptT ServantError IO) a -> m a instance Data.Aeson.Types.ToJSON.ToJSON Google.Client.Bearer instance Web.Internal.HttpApiData.ToHttpApiData Google.Client.Bearer instance GHC.Show.Show Google.Client.Bearer instance GHC.Classes.Ord Google.Client.Bearer instance GHC.Generics.Generic Google.Client.Bearer instance Data.Aeson.Types.FromJSON.FromJSON Google.Client.Bearer instance Web.Internal.HttpApiData.FromHttpApiData Google.Client.Bearer instance GHC.Classes.Eq Google.Client.Bearer instance Data.Data.Data Google.Client.Bearer