Safe Haskell | None |
---|---|
Language | Haskell2010 |
Servant types and client for the authorization API
Synopsis
- newtype SubscriptionKey = SubKey Text
- data AuthToken
- data TranslatorException
- issueToken :: Manager -> SubscriptionKey -> IO (Either TranslatorException AuthToken)
Documentation
newtype SubscriptionKey Source #
A key to your subscription to the service. Used to retrieve an AuthToken
.
Instances
Show SubscriptionKey Source # | |
Defined in Microsoft.Translator.API.Auth showsPrec :: Int -> SubscriptionKey -> ShowS # show :: SubscriptionKey -> String # showList :: [SubscriptionKey] -> ShowS # | |
IsString SubscriptionKey Source # | |
Defined in Microsoft.Translator.API.Auth fromString :: String -> SubscriptionKey # | |
ToHttpApiData SubscriptionKey Source # | |
Defined in Microsoft.Translator.API.Auth toUrlPiece :: SubscriptionKey -> Text # toEncodedUrlPiece :: SubscriptionKey -> Builder # toHeader :: SubscriptionKey -> ByteString # toQueryParam :: SubscriptionKey -> Text # |
The JSON Web Token issued by MS Microsoft.Translator token service. Consists of wrapped text. Valid for ten minutes.
Instances
Show AuthToken Source # | |
Generic AuthToken Source # | |
ToHttpApiData AuthToken Source # | |
Defined in Microsoft.Translator.API.Auth toUrlPiece :: AuthToken -> Text # toEncodedUrlPiece :: AuthToken -> Builder # toHeader :: AuthToken -> ByteString # toQueryParam :: AuthToken -> Text # | |
type Rep AuthToken Source # | |
Defined in Microsoft.Translator.API.Auth |
data TranslatorException Source #
Instances
Show TranslatorException Source # | |
Defined in Microsoft.Translator.Exception showsPrec :: Int -> TranslatorException -> ShowS # show :: TranslatorException -> String # showList :: [TranslatorException] -> ShowS # | |
Exception TranslatorException Source # | |
issueToken :: Manager -> SubscriptionKey -> IO (Either TranslatorException AuthToken) Source #
Retrieve a token from the API. It will be valid for 10 minutes.