{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Transcribe.DescribeLanguageModel
(
DescribeLanguageModel (..),
newDescribeLanguageModel,
describeLanguageModel_modelName,
DescribeLanguageModelResponse (..),
newDescribeLanguageModelResponse,
describeLanguageModelResponse_languageModel,
describeLanguageModelResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Transcribe.Types
data DescribeLanguageModel = DescribeLanguageModel'
{
DescribeLanguageModel -> Text
modelName :: Prelude.Text
}
deriving (DescribeLanguageModel -> DescribeLanguageModel -> Bool
(DescribeLanguageModel -> DescribeLanguageModel -> Bool)
-> (DescribeLanguageModel -> DescribeLanguageModel -> Bool)
-> Eq DescribeLanguageModel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeLanguageModel -> DescribeLanguageModel -> Bool
$c/= :: DescribeLanguageModel -> DescribeLanguageModel -> Bool
== :: DescribeLanguageModel -> DescribeLanguageModel -> Bool
$c== :: DescribeLanguageModel -> DescribeLanguageModel -> Bool
Prelude.Eq, ReadPrec [DescribeLanguageModel]
ReadPrec DescribeLanguageModel
Int -> ReadS DescribeLanguageModel
ReadS [DescribeLanguageModel]
(Int -> ReadS DescribeLanguageModel)
-> ReadS [DescribeLanguageModel]
-> ReadPrec DescribeLanguageModel
-> ReadPrec [DescribeLanguageModel]
-> Read DescribeLanguageModel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeLanguageModel]
$creadListPrec :: ReadPrec [DescribeLanguageModel]
readPrec :: ReadPrec DescribeLanguageModel
$creadPrec :: ReadPrec DescribeLanguageModel
readList :: ReadS [DescribeLanguageModel]
$creadList :: ReadS [DescribeLanguageModel]
readsPrec :: Int -> ReadS DescribeLanguageModel
$creadsPrec :: Int -> ReadS DescribeLanguageModel
Prelude.Read, Int -> DescribeLanguageModel -> ShowS
[DescribeLanguageModel] -> ShowS
DescribeLanguageModel -> String
(Int -> DescribeLanguageModel -> ShowS)
-> (DescribeLanguageModel -> String)
-> ([DescribeLanguageModel] -> ShowS)
-> Show DescribeLanguageModel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeLanguageModel] -> ShowS
$cshowList :: [DescribeLanguageModel] -> ShowS
show :: DescribeLanguageModel -> String
$cshow :: DescribeLanguageModel -> String
showsPrec :: Int -> DescribeLanguageModel -> ShowS
$cshowsPrec :: Int -> DescribeLanguageModel -> ShowS
Prelude.Show, (forall x. DescribeLanguageModel -> Rep DescribeLanguageModel x)
-> (forall x. Rep DescribeLanguageModel x -> DescribeLanguageModel)
-> Generic DescribeLanguageModel
forall x. Rep DescribeLanguageModel x -> DescribeLanguageModel
forall x. DescribeLanguageModel -> Rep DescribeLanguageModel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeLanguageModel x -> DescribeLanguageModel
$cfrom :: forall x. DescribeLanguageModel -> Rep DescribeLanguageModel x
Prelude.Generic)
newDescribeLanguageModel ::
Prelude.Text ->
DescribeLanguageModel
newDescribeLanguageModel :: Text -> DescribeLanguageModel
newDescribeLanguageModel Text
pModelName_ =
DescribeLanguageModel' :: Text -> DescribeLanguageModel
DescribeLanguageModel' {$sel:modelName:DescribeLanguageModel' :: Text
modelName = Text
pModelName_}
describeLanguageModel_modelName :: Lens.Lens' DescribeLanguageModel Prelude.Text
describeLanguageModel_modelName :: (Text -> f Text)
-> DescribeLanguageModel -> f DescribeLanguageModel
describeLanguageModel_modelName = (DescribeLanguageModel -> Text)
-> (DescribeLanguageModel -> Text -> DescribeLanguageModel)
-> Lens DescribeLanguageModel DescribeLanguageModel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLanguageModel' {Text
modelName :: Text
$sel:modelName:DescribeLanguageModel' :: DescribeLanguageModel -> Text
modelName} -> Text
modelName) (\s :: DescribeLanguageModel
s@DescribeLanguageModel' {} Text
a -> DescribeLanguageModel
s {$sel:modelName:DescribeLanguageModel' :: Text
modelName = Text
a} :: DescribeLanguageModel)
instance Core.AWSRequest DescribeLanguageModel where
type
AWSResponse DescribeLanguageModel =
DescribeLanguageModelResponse
request :: DescribeLanguageModel -> Request DescribeLanguageModel
request = Service -> DescribeLanguageModel -> Request DescribeLanguageModel
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeLanguageModel
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeLanguageModel)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeLanguageModel))
-> Logger
-> Service
-> Proxy DescribeLanguageModel
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeLanguageModel)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe LanguageModel -> Int -> DescribeLanguageModelResponse
DescribeLanguageModelResponse'
(Maybe LanguageModel -> Int -> DescribeLanguageModelResponse)
-> Either String (Maybe LanguageModel)
-> Either String (Int -> DescribeLanguageModelResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe LanguageModel)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LanguageModel")
Either String (Int -> DescribeLanguageModelResponse)
-> Either String Int -> Either String DescribeLanguageModelResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DescribeLanguageModel
instance Prelude.NFData DescribeLanguageModel
instance Core.ToHeaders DescribeLanguageModel where
toHeaders :: DescribeLanguageModel -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeLanguageModel -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Transcribe.DescribeLanguageModel" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DescribeLanguageModel where
toJSON :: DescribeLanguageModel -> Value
toJSON DescribeLanguageModel' {Text
modelName :: Text
$sel:modelName:DescribeLanguageModel' :: DescribeLanguageModel -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ModelName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
modelName)]
)
instance Core.ToPath DescribeLanguageModel where
toPath :: DescribeLanguageModel -> ByteString
toPath = ByteString -> DescribeLanguageModel -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeLanguageModel where
toQuery :: DescribeLanguageModel -> QueryString
toQuery = QueryString -> DescribeLanguageModel -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeLanguageModelResponse = DescribeLanguageModelResponse'
{
DescribeLanguageModelResponse -> Maybe LanguageModel
languageModel :: Prelude.Maybe LanguageModel,
DescribeLanguageModelResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeLanguageModelResponse
-> DescribeLanguageModelResponse -> Bool
(DescribeLanguageModelResponse
-> DescribeLanguageModelResponse -> Bool)
-> (DescribeLanguageModelResponse
-> DescribeLanguageModelResponse -> Bool)
-> Eq DescribeLanguageModelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeLanguageModelResponse
-> DescribeLanguageModelResponse -> Bool
$c/= :: DescribeLanguageModelResponse
-> DescribeLanguageModelResponse -> Bool
== :: DescribeLanguageModelResponse
-> DescribeLanguageModelResponse -> Bool
$c== :: DescribeLanguageModelResponse
-> DescribeLanguageModelResponse -> Bool
Prelude.Eq, ReadPrec [DescribeLanguageModelResponse]
ReadPrec DescribeLanguageModelResponse
Int -> ReadS DescribeLanguageModelResponse
ReadS [DescribeLanguageModelResponse]
(Int -> ReadS DescribeLanguageModelResponse)
-> ReadS [DescribeLanguageModelResponse]
-> ReadPrec DescribeLanguageModelResponse
-> ReadPrec [DescribeLanguageModelResponse]
-> Read DescribeLanguageModelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeLanguageModelResponse]
$creadListPrec :: ReadPrec [DescribeLanguageModelResponse]
readPrec :: ReadPrec DescribeLanguageModelResponse
$creadPrec :: ReadPrec DescribeLanguageModelResponse
readList :: ReadS [DescribeLanguageModelResponse]
$creadList :: ReadS [DescribeLanguageModelResponse]
readsPrec :: Int -> ReadS DescribeLanguageModelResponse
$creadsPrec :: Int -> ReadS DescribeLanguageModelResponse
Prelude.Read, Int -> DescribeLanguageModelResponse -> ShowS
[DescribeLanguageModelResponse] -> ShowS
DescribeLanguageModelResponse -> String
(Int -> DescribeLanguageModelResponse -> ShowS)
-> (DescribeLanguageModelResponse -> String)
-> ([DescribeLanguageModelResponse] -> ShowS)
-> Show DescribeLanguageModelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeLanguageModelResponse] -> ShowS
$cshowList :: [DescribeLanguageModelResponse] -> ShowS
show :: DescribeLanguageModelResponse -> String
$cshow :: DescribeLanguageModelResponse -> String
showsPrec :: Int -> DescribeLanguageModelResponse -> ShowS
$cshowsPrec :: Int -> DescribeLanguageModelResponse -> ShowS
Prelude.Show, (forall x.
DescribeLanguageModelResponse
-> Rep DescribeLanguageModelResponse x)
-> (forall x.
Rep DescribeLanguageModelResponse x
-> DescribeLanguageModelResponse)
-> Generic DescribeLanguageModelResponse
forall x.
Rep DescribeLanguageModelResponse x
-> DescribeLanguageModelResponse
forall x.
DescribeLanguageModelResponse
-> Rep DescribeLanguageModelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeLanguageModelResponse x
-> DescribeLanguageModelResponse
$cfrom :: forall x.
DescribeLanguageModelResponse
-> Rep DescribeLanguageModelResponse x
Prelude.Generic)
newDescribeLanguageModelResponse ::
Prelude.Int ->
DescribeLanguageModelResponse
newDescribeLanguageModelResponse :: Int -> DescribeLanguageModelResponse
newDescribeLanguageModelResponse Int
pHttpStatus_ =
DescribeLanguageModelResponse' :: Maybe LanguageModel -> Int -> DescribeLanguageModelResponse
DescribeLanguageModelResponse'
{ $sel:languageModel:DescribeLanguageModelResponse' :: Maybe LanguageModel
languageModel =
Maybe LanguageModel
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeLanguageModelResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeLanguageModelResponse_languageModel :: Lens.Lens' DescribeLanguageModelResponse (Prelude.Maybe LanguageModel)
describeLanguageModelResponse_languageModel :: (Maybe LanguageModel -> f (Maybe LanguageModel))
-> DescribeLanguageModelResponse -> f DescribeLanguageModelResponse
describeLanguageModelResponse_languageModel = (DescribeLanguageModelResponse -> Maybe LanguageModel)
-> (DescribeLanguageModelResponse
-> Maybe LanguageModel -> DescribeLanguageModelResponse)
-> Lens
DescribeLanguageModelResponse
DescribeLanguageModelResponse
(Maybe LanguageModel)
(Maybe LanguageModel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLanguageModelResponse' {Maybe LanguageModel
languageModel :: Maybe LanguageModel
$sel:languageModel:DescribeLanguageModelResponse' :: DescribeLanguageModelResponse -> Maybe LanguageModel
languageModel} -> Maybe LanguageModel
languageModel) (\s :: DescribeLanguageModelResponse
s@DescribeLanguageModelResponse' {} Maybe LanguageModel
a -> DescribeLanguageModelResponse
s {$sel:languageModel:DescribeLanguageModelResponse' :: Maybe LanguageModel
languageModel = Maybe LanguageModel
a} :: DescribeLanguageModelResponse)
describeLanguageModelResponse_httpStatus :: Lens.Lens' DescribeLanguageModelResponse Prelude.Int
describeLanguageModelResponse_httpStatus :: (Int -> f Int)
-> DescribeLanguageModelResponse -> f DescribeLanguageModelResponse
describeLanguageModelResponse_httpStatus = (DescribeLanguageModelResponse -> Int)
-> (DescribeLanguageModelResponse
-> Int -> DescribeLanguageModelResponse)
-> Lens
DescribeLanguageModelResponse DescribeLanguageModelResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLanguageModelResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeLanguageModelResponse' :: DescribeLanguageModelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeLanguageModelResponse
s@DescribeLanguageModelResponse' {} Int
a -> DescribeLanguageModelResponse
s {$sel:httpStatus:DescribeLanguageModelResponse' :: Int
httpStatus = Int
a} :: DescribeLanguageModelResponse)
instance Prelude.NFData DescribeLanguageModelResponse