| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Microsoft.Translator.API.Auth
Description
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 Methods showsPrec :: Int -> SubscriptionKey -> ShowS # show :: SubscriptionKey -> String # showList :: [SubscriptionKey] -> ShowS # | |
| IsString SubscriptionKey Source # | |
Defined in Microsoft.Translator.API.Auth Methods fromString :: String -> SubscriptionKey # | |
| ToHttpApiData SubscriptionKey Source # | |
Defined in Microsoft.Translator.API.Auth Methods 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 Methods 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 Methods showsPrec :: Int -> TranslatorException -> ShowS # show :: TranslatorException -> String # showList :: [TranslatorException] -> ShowS # | |
| Exception TranslatorException Source # | |
Defined in Microsoft.Translator.Exception Methods toException :: TranslatorException -> SomeException # fromException :: SomeException -> Maybe TranslatorException # | |
issueToken :: Manager -> SubscriptionKey -> IO (Either TranslatorException AuthToken) Source #
Retrieve a token from the API. It will be valid for 10 minutes.