-- 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.3.3.1 -- | 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 ScopeGmailFull :: Scope ScopeGmailSend :: Scope ScopeDriveFile :: Scope ScopeDriveMetadataRead :: 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 basic data types. module Google.Type newtype FileId FileId :: Text -> FileId [$sel:fileId:FileId] :: FileId -> Text newtype MediaType MediaType :: Text -> MediaType [$sel:mediaTypeName:MediaType] :: MediaType -> Text newtype MediaContent MediaContent :: ByteString -> MediaContent [$sel:content:MediaContent] :: MediaContent -> ByteString data Metadata Metadata :: Maybe Text -> Maybe MediaType -> Maybe [FileId] -> Metadata [$sel:name:Metadata] :: Metadata -> Maybe Text [$sel:mimeType:Metadata] :: Metadata -> Maybe MediaType [$sel:parents:Metadata] :: Metadata -> Maybe [FileId] data Arbitrary data Multipart data ConversionFormat FormatHtml :: ConversionFormat FormatHtmlZipped :: ConversionFormat FormatPlainText :: ConversionFormat FormatRichText :: ConversionFormat FormatOpenOfficeDoc :: ConversionFormat FormatPdf :: ConversionFormat FormatMsWordDoc :: ConversionFormat FormatEpub :: ConversionFormat FormatMsExcel :: ConversionFormat FormatOpenOfficeSheet :: ConversionFormat FormatCsv :: ConversionFormat FormatTsv :: ConversionFormat FormatJpeg :: ConversionFormat FormatPng :: ConversionFormat FormatSvg :: ConversionFormat FormatMsPowerPoint :: ConversionFormat FormatMsOfficePresentation :: ConversionFormat FormatJson :: ConversionFormat data SortKey CreatedTime :: SortKey Folder :: SortKey ModifiedByMeTime :: SortKey ModifiedTime :: SortKey Name :: SortKey NameNatural :: SortKey QuotaBytesUsed :: SortKey Recency :: SortKey SsharedWithMeTime :: SortKey Starred :: SortKey ViewedByMeTime :: SortKey newtype QueryString QueryString :: Text -> QueryString [$sel:queryString:QueryString] :: QueryString -> Text data Order Asc :: SortKey -> Order Desc :: SortKey -> Order newtype LabelId LabelId :: Text -> LabelId instance Web.Internal.HttpApiData.ToHttpApiData Google.Type.LabelId instance GHC.Show.Show Google.Type.LabelId instance GHC.Generics.Generic Google.Type.LabelId instance GHC.Classes.Eq Google.Type.LabelId instance GHC.Show.Show Google.Type.Order instance GHC.Generics.Generic Google.Type.Order instance GHC.Classes.Eq Google.Type.Order instance Web.Internal.HttpApiData.ToHttpApiData [Google.Type.LabelId] instance Web.Internal.HttpApiData.ToHttpApiData Google.Type.Order instance Web.Internal.HttpApiData.ToHttpApiData [Google.Type.Order] instance Data.Aeson.Types.ToJSON.ToJSON Google.Type.QueryString instance Data.Aeson.Types.FromJSON.FromJSON Google.Type.QueryString instance Web.Internal.HttpApiData.ToHttpApiData Google.Type.QueryString instance GHC.Show.Show Google.Type.QueryString instance GHC.Generics.Generic Google.Type.QueryString instance GHC.Classes.Eq Google.Type.QueryString instance GHC.Show.Show Google.Type.SortKey instance GHC.Generics.Generic Google.Type.SortKey instance GHC.Classes.Eq Google.Type.SortKey instance GHC.Show.Show Google.Type.ConversionFormat instance GHC.Generics.Generic Google.Type.ConversionFormat instance GHC.Classes.Eq Google.Type.ConversionFormat instance Web.Internal.HttpApiData.ToHttpApiData Google.Type.SortKey instance Servant.API.ContentTypes.Accept Google.Type.Arbitrary instance Web.Internal.HttpApiData.ToHttpApiData Google.Type.ConversionFormat instance Servant.API.ContentTypes.Accept Google.Type.Multipart instance Servant.API.ContentTypes.MimeUnrender Google.Type.Arbitrary Google.Type.MediaContent instance Data.Aeson.Types.ToJSON.ToJSON Google.Type.Metadata instance Data.Aeson.Types.FromJSON.FromJSON Google.Type.Metadata instance GHC.Show.Show Google.Type.Metadata instance GHC.Generics.Generic Google.Type.Metadata instance GHC.Classes.Eq Google.Type.Metadata instance GHC.Show.Show Google.Type.MediaContent instance GHC.Generics.Generic Google.Type.MediaContent instance GHC.Classes.Eq Google.Type.MediaContent instance Data.Aeson.Types.ToJSON.ToJSON Google.Type.MediaType instance Data.Aeson.Types.FromJSON.FromJSON Google.Type.MediaType instance GHC.Show.Show Google.Type.MediaType instance GHC.Generics.Generic Google.Type.MediaType instance GHC.Classes.Eq Google.Type.MediaType instance Data.Aeson.Types.ToJSON.ToJSON Google.Type.FileId instance Data.Aeson.Types.FromJSON.FromJSON Google.Type.FileId instance Web.Internal.HttpApiData.ToHttpApiData Google.Type.FileId instance GHC.Show.Show Google.Type.FileId instance GHC.Generics.Generic Google.Type.FileId instance GHC.Classes.Eq Google.Type.FileId -- | 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 newtype Account Account :: Text -> Account [$sel:email:Account] :: Account -> Text newtype DateTime DateTime :: UTCTime -> DateTime [$sel:dateTime:DateTime] :: DateTime -> UTCTime newtype ZonedDateTime ZonedDateTime :: Maybe ZonedTime -> ZonedDateTime [$sel:dateTime:ZonedDateTime] :: ZonedDateTime -> Maybe ZonedTime data CalendarEvent CalendarEvent :: Text -> Account -> Maybe [Account] -> Maybe Text -> Maybe Text -> Maybe ZonedDateTime -> Maybe ZonedDateTime -> CalendarEvent [$sel:status:CalendarEvent] :: CalendarEvent -> Text [$sel:creator:CalendarEvent] :: CalendarEvent -> Account [$sel:attendees:CalendarEvent] :: CalendarEvent -> Maybe [Account] [$sel:summary:CalendarEvent] :: CalendarEvent -> Maybe Text [$sel:description:CalendarEvent] :: CalendarEvent -> Maybe Text [$sel:start:CalendarEvent] :: CalendarEvent -> Maybe ZonedDateTime [$sel:end:CalendarEvent] :: CalendarEvent -> Maybe ZonedDateTime data CalendarEventList CalendarEventList :: Text -> Text -> [CalendarEvent] -> CalendarEventList [$sel:kind:CalendarEventList] :: CalendarEventList -> Text [$sel:summary:CalendarEventList] :: CalendarEventList -> Text [$sel:items:CalendarEventList] :: CalendarEventList -> [CalendarEvent] data GmailSend GmailSend :: Text -> GmailSend [$sel:id:GmailSend] :: GmailSend -> Text data GmailList GmailList :: [GmailMessage] -> GmailList [$sel:messages:GmailList] :: GmailList -> [GmailMessage] data GmailMessage GmailMessage :: Text -> Text -> Maybe Text -> GmailMessage [$sel:id:GmailMessage] :: GmailMessage -> Text [$sel:threadId:GmailMessage] :: GmailMessage -> Text [$sel:snippet:GmailMessage] :: GmailMessage -> Maybe Text data FileResource FileResource :: Text -> FileId -> Text -> MediaType -> FileResource [$sel:kind:FileResource] :: FileResource -> Text [$sel:id:FileResource] :: FileResource -> FileId [$sel:name:FileResource] :: FileResource -> Text [$sel:mimeType:FileResource] :: FileResource -> MediaType data FileList FileList :: Text -> [FileResource] -> FileList [$sel:kind:FileList] :: FileList -> Text [$sel:files:FileList] :: FileList -> [FileResource] newtype MediaContent MediaContent :: ByteString -> MediaContent [$sel:content:MediaContent] :: MediaContent -> ByteString instance Data.Aeson.Types.ToJSON.ToJSON Google.Response.FileList instance Data.Aeson.Types.FromJSON.FromJSON Google.Response.FileList instance GHC.Show.Show Google.Response.FileList instance GHC.Generics.Generic Google.Response.FileList instance GHC.Classes.Eq Google.Response.FileList instance Data.Aeson.Types.ToJSON.ToJSON Google.Response.FileResource instance Data.Aeson.Types.FromJSON.FromJSON Google.Response.FileResource instance GHC.Show.Show Google.Response.FileResource instance GHC.Generics.Generic Google.Response.FileResource instance GHC.Classes.Eq Google.Response.FileResource instance Data.Aeson.Types.ToJSON.ToJSON Google.Response.GmailList instance Data.Aeson.Types.FromJSON.FromJSON Google.Response.GmailList instance GHC.Show.Show Google.Response.GmailList instance GHC.Generics.Generic Google.Response.GmailList instance GHC.Classes.Eq Google.Response.GmailList instance Data.Aeson.Types.ToJSON.ToJSON Google.Response.GmailMessage instance Data.Aeson.Types.FromJSON.FromJSON Google.Response.GmailMessage instance Web.Internal.FormUrlEncoded.FromForm Google.Response.GmailMessage instance Web.Internal.FormUrlEncoded.ToForm Google.Response.GmailMessage instance GHC.Show.Show Google.Response.GmailMessage instance GHC.Generics.Generic Google.Response.GmailMessage instance GHC.Classes.Eq Google.Response.GmailMessage 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.CalendarEventList instance Data.Aeson.Types.FromJSON.FromJSON Google.Response.CalendarEventList instance GHC.Show.Show Google.Response.CalendarEventList instance GHC.Generics.Generic Google.Response.CalendarEventList instance GHC.Classes.Eq Google.Response.CalendarEventList 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.ZonedDateTime instance Data.Aeson.Types.FromJSON.FromJSON Google.Response.ZonedDateTime instance GHC.Classes.Eq Google.Response.ZonedDateTime instance Web.Internal.HttpApiData.ToHttpApiData Google.Response.ZonedDateTime instance Web.Internal.HttpApiData.FromHttpApiData Google.Response.ZonedDateTime instance GHC.Show.Show Google.Response.ZonedDateTime instance GHC.Generics.Generic Google.Response.ZonedDateTime instance Data.Aeson.Types.ToJSON.ToJSON Google.Response.DateTime instance Data.Aeson.Types.FromJSON.FromJSON Google.Response.DateTime instance Web.Internal.HttpApiData.ToHttpApiData Google.Response.DateTime instance Web.Internal.HttpApiData.FromHttpApiData Google.Response.DateTime instance GHC.Show.Show Google.Response.DateTime instance GHC.Generics.Generic Google.Response.DateTime instance GHC.Classes.Eq Google.Response.DateTime instance Data.Aeson.Types.ToJSON.ToJSON Google.Response.Account instance Data.Aeson.Types.FromJSON.FromJSON Google.Response.Account instance Web.Internal.HttpApiData.FromHttpApiData [Google.Response.Account] instance Web.Internal.HttpApiData.ToHttpApiData [Google.Response.Account] instance Web.Internal.HttpApiData.ToHttpApiData Google.Response.Account instance Web.Internal.HttpApiData.FromHttpApiData Google.Response.Account instance GHC.Show.Show Google.Response.Account instance GHC.Generics.Generic Google.Response.Account instance GHC.Classes.Eq Google.Response.Account 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 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 newtype 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 MultipartBody MultipartBody :: Metadata -> MediaType -> MediaContent -> MultipartBody [$sel:metadata:MultipartBody] :: MultipartBody -> Metadata [$sel:mediaType:MultipartBody] :: MultipartBody -> MediaType [$sel:mediaContent:MultipartBody] :: MultipartBody -> MediaContent data GetFileParams GetFileParams :: Maybe QueryString -> Maybe [Order] -> GetFileParams [$sel:query:GetFileParams] :: GetFileParams -> Maybe QueryString [$sel:orderBy:GetFileParams] :: GetFileParams -> Maybe [Order] data DownloadFileParams DownloadFileParams :: FileId -> ConversionFormat -> DownloadFileParams [$sel:fileId:DownloadFileParams] :: DownloadFileParams -> FileId [$sel:conversionFormat:DownloadFileParams] :: DownloadFileParams -> ConversionFormat data Token Token :: Text -> Text -> Token [$sel:grantType:Token] :: Token -> Text [$sel:assertion:Token] :: Token -> Text instance GHC.Show.Show Google.Form.DownloadFileParams instance GHC.Generics.Generic Google.Form.DownloadFileParams instance GHC.Classes.Eq Google.Form.DownloadFileParams instance GHC.Show.Show Google.Form.MultipartBody instance GHC.Generics.Generic Google.Form.MultipartBody instance GHC.Classes.Eq Google.Form.MultipartBody instance GHC.Show.Show Google.Form.GetFileParams instance GHC.Generics.Generic Google.Form.GetFileParams instance GHC.Classes.Eq Google.Form.GetFileParams instance Servant.API.ContentTypes.MimeRender Google.Type.Multipart Google.Form.MultipartBody 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 Web.Internal.HttpApiData.ToHttpApiData 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 Data.String.IsString Google.Form.Account instance GHC.Show.Show Google.Form.Account instance GHC.Generics.Generic Google.Form.Account instance GHC.Classes.Eq Google.Form.Account -- | Define functions to call Google APIs. module Google.Client getToken :: Maybe Email -> JWT -> [Scope] -> IO (Either ClientError Token) getCalendarEventList :: Token -> Text -> Maybe Bool -> Maybe DateTime -> Maybe DateTime -> Maybe Text -> IO (Either ClientError CalendarEventList) postCalendarEvent :: Token -> CalendarEvent -> IO (Either ClientError CalendarEvent) postGmailSend :: Token -> Email -> IO (Either ClientError GmailSend) getGmailList :: Token -> Maybe Int -> Maybe [LabelId] -> IO (Either ClientError GmailList) getGmailMessage :: Token -> Text -> IO (Either ClientError GmailMessage) getDriveFileList :: Token -> GetFileParams -> IO (Either ClientError FileList) createDriveFileMultipart :: Token -> MultipartBody -> IO (Either ClientError FileResource) downloadDriveFile :: Token -> DownloadFileParams -> IO (Either ClientError MediaContent) 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