{-# 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.GetVocabularyFilter
(
GetVocabularyFilter (..),
newGetVocabularyFilter,
getVocabularyFilter_vocabularyFilterName,
GetVocabularyFilterResponse (..),
newGetVocabularyFilterResponse,
getVocabularyFilterResponse_downloadUri,
getVocabularyFilterResponse_languageCode,
getVocabularyFilterResponse_lastModifiedTime,
getVocabularyFilterResponse_vocabularyFilterName,
getVocabularyFilterResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Transcribe.Types
data GetVocabularyFilter = GetVocabularyFilter'
{
GetVocabularyFilter -> Text
vocabularyFilterName :: Prelude.Text
}
deriving (GetVocabularyFilter -> GetVocabularyFilter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetVocabularyFilter -> GetVocabularyFilter -> Bool
$c/= :: GetVocabularyFilter -> GetVocabularyFilter -> Bool
== :: GetVocabularyFilter -> GetVocabularyFilter -> Bool
$c== :: GetVocabularyFilter -> GetVocabularyFilter -> Bool
Prelude.Eq, ReadPrec [GetVocabularyFilter]
ReadPrec GetVocabularyFilter
Int -> ReadS GetVocabularyFilter
ReadS [GetVocabularyFilter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetVocabularyFilter]
$creadListPrec :: ReadPrec [GetVocabularyFilter]
readPrec :: ReadPrec GetVocabularyFilter
$creadPrec :: ReadPrec GetVocabularyFilter
readList :: ReadS [GetVocabularyFilter]
$creadList :: ReadS [GetVocabularyFilter]
readsPrec :: Int -> ReadS GetVocabularyFilter
$creadsPrec :: Int -> ReadS GetVocabularyFilter
Prelude.Read, Int -> GetVocabularyFilter -> ShowS
[GetVocabularyFilter] -> ShowS
GetVocabularyFilter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetVocabularyFilter] -> ShowS
$cshowList :: [GetVocabularyFilter] -> ShowS
show :: GetVocabularyFilter -> String
$cshow :: GetVocabularyFilter -> String
showsPrec :: Int -> GetVocabularyFilter -> ShowS
$cshowsPrec :: Int -> GetVocabularyFilter -> ShowS
Prelude.Show, forall x. Rep GetVocabularyFilter x -> GetVocabularyFilter
forall x. GetVocabularyFilter -> Rep GetVocabularyFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetVocabularyFilter x -> GetVocabularyFilter
$cfrom :: forall x. GetVocabularyFilter -> Rep GetVocabularyFilter x
Prelude.Generic)
newGetVocabularyFilter ::
Prelude.Text ->
GetVocabularyFilter
newGetVocabularyFilter :: Text -> GetVocabularyFilter
newGetVocabularyFilter Text
pVocabularyFilterName_ =
GetVocabularyFilter'
{ $sel:vocabularyFilterName:GetVocabularyFilter' :: Text
vocabularyFilterName =
Text
pVocabularyFilterName_
}
getVocabularyFilter_vocabularyFilterName :: Lens.Lens' GetVocabularyFilter Prelude.Text
getVocabularyFilter_vocabularyFilterName :: Lens' GetVocabularyFilter Text
getVocabularyFilter_vocabularyFilterName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVocabularyFilter' {Text
vocabularyFilterName :: Text
$sel:vocabularyFilterName:GetVocabularyFilter' :: GetVocabularyFilter -> Text
vocabularyFilterName} -> Text
vocabularyFilterName) (\s :: GetVocabularyFilter
s@GetVocabularyFilter' {} Text
a -> GetVocabularyFilter
s {$sel:vocabularyFilterName:GetVocabularyFilter' :: Text
vocabularyFilterName = Text
a} :: GetVocabularyFilter)
instance Core.AWSRequest GetVocabularyFilter where
type
AWSResponse GetVocabularyFilter =
GetVocabularyFilterResponse
request :: (Service -> Service)
-> GetVocabularyFilter -> Request GetVocabularyFilter
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetVocabularyFilter
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetVocabularyFilter)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe LanguageCode
-> Maybe POSIX
-> Maybe Text
-> Int
-> GetVocabularyFilterResponse
GetVocabularyFilterResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"DownloadUri")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LanguageCode")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LastModifiedTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"VocabularyFilterName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetVocabularyFilter where
hashWithSalt :: Int -> GetVocabularyFilter -> Int
hashWithSalt Int
_salt GetVocabularyFilter' {Text
vocabularyFilterName :: Text
$sel:vocabularyFilterName:GetVocabularyFilter' :: GetVocabularyFilter -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vocabularyFilterName
instance Prelude.NFData GetVocabularyFilter where
rnf :: GetVocabularyFilter -> ()
rnf GetVocabularyFilter' {Text
vocabularyFilterName :: Text
$sel:vocabularyFilterName:GetVocabularyFilter' :: GetVocabularyFilter -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
vocabularyFilterName
instance Data.ToHeaders GetVocabularyFilter where
toHeaders :: GetVocabularyFilter -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Transcribe.GetVocabularyFilter" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON GetVocabularyFilter where
toJSON :: GetVocabularyFilter -> Value
toJSON GetVocabularyFilter' {Text
vocabularyFilterName :: Text
$sel:vocabularyFilterName:GetVocabularyFilter' :: GetVocabularyFilter -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
( Key
"VocabularyFilterName"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
vocabularyFilterName
)
]
)
instance Data.ToPath GetVocabularyFilter where
toPath :: GetVocabularyFilter -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetVocabularyFilter where
toQuery :: GetVocabularyFilter -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetVocabularyFilterResponse = GetVocabularyFilterResponse'
{
GetVocabularyFilterResponse -> Maybe Text
downloadUri :: Prelude.Maybe Prelude.Text,
GetVocabularyFilterResponse -> Maybe LanguageCode
languageCode :: Prelude.Maybe LanguageCode,
GetVocabularyFilterResponse -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Data.POSIX,
GetVocabularyFilterResponse -> Maybe Text
vocabularyFilterName :: Prelude.Maybe Prelude.Text,
GetVocabularyFilterResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetVocabularyFilterResponse -> GetVocabularyFilterResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetVocabularyFilterResponse -> GetVocabularyFilterResponse -> Bool
$c/= :: GetVocabularyFilterResponse -> GetVocabularyFilterResponse -> Bool
== :: GetVocabularyFilterResponse -> GetVocabularyFilterResponse -> Bool
$c== :: GetVocabularyFilterResponse -> GetVocabularyFilterResponse -> Bool
Prelude.Eq, ReadPrec [GetVocabularyFilterResponse]
ReadPrec GetVocabularyFilterResponse
Int -> ReadS GetVocabularyFilterResponse
ReadS [GetVocabularyFilterResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetVocabularyFilterResponse]
$creadListPrec :: ReadPrec [GetVocabularyFilterResponse]
readPrec :: ReadPrec GetVocabularyFilterResponse
$creadPrec :: ReadPrec GetVocabularyFilterResponse
readList :: ReadS [GetVocabularyFilterResponse]
$creadList :: ReadS [GetVocabularyFilterResponse]
readsPrec :: Int -> ReadS GetVocabularyFilterResponse
$creadsPrec :: Int -> ReadS GetVocabularyFilterResponse
Prelude.Read, Int -> GetVocabularyFilterResponse -> ShowS
[GetVocabularyFilterResponse] -> ShowS
GetVocabularyFilterResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetVocabularyFilterResponse] -> ShowS
$cshowList :: [GetVocabularyFilterResponse] -> ShowS
show :: GetVocabularyFilterResponse -> String
$cshow :: GetVocabularyFilterResponse -> String
showsPrec :: Int -> GetVocabularyFilterResponse -> ShowS
$cshowsPrec :: Int -> GetVocabularyFilterResponse -> ShowS
Prelude.Show, forall x.
Rep GetVocabularyFilterResponse x -> GetVocabularyFilterResponse
forall x.
GetVocabularyFilterResponse -> Rep GetVocabularyFilterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetVocabularyFilterResponse x -> GetVocabularyFilterResponse
$cfrom :: forall x.
GetVocabularyFilterResponse -> Rep GetVocabularyFilterResponse x
Prelude.Generic)
newGetVocabularyFilterResponse ::
Prelude.Int ->
GetVocabularyFilterResponse
newGetVocabularyFilterResponse :: Int -> GetVocabularyFilterResponse
newGetVocabularyFilterResponse Int
pHttpStatus_ =
GetVocabularyFilterResponse'
{ $sel:downloadUri:GetVocabularyFilterResponse' :: Maybe Text
downloadUri =
forall a. Maybe a
Prelude.Nothing,
$sel:languageCode:GetVocabularyFilterResponse' :: Maybe LanguageCode
languageCode = forall a. Maybe a
Prelude.Nothing,
$sel:lastModifiedTime:GetVocabularyFilterResponse' :: Maybe POSIX
lastModifiedTime = forall a. Maybe a
Prelude.Nothing,
$sel:vocabularyFilterName:GetVocabularyFilterResponse' :: Maybe Text
vocabularyFilterName = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetVocabularyFilterResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getVocabularyFilterResponse_downloadUri :: Lens.Lens' GetVocabularyFilterResponse (Prelude.Maybe Prelude.Text)
getVocabularyFilterResponse_downloadUri :: Lens' GetVocabularyFilterResponse (Maybe Text)
getVocabularyFilterResponse_downloadUri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVocabularyFilterResponse' {Maybe Text
downloadUri :: Maybe Text
$sel:downloadUri:GetVocabularyFilterResponse' :: GetVocabularyFilterResponse -> Maybe Text
downloadUri} -> Maybe Text
downloadUri) (\s :: GetVocabularyFilterResponse
s@GetVocabularyFilterResponse' {} Maybe Text
a -> GetVocabularyFilterResponse
s {$sel:downloadUri:GetVocabularyFilterResponse' :: Maybe Text
downloadUri = Maybe Text
a} :: GetVocabularyFilterResponse)
getVocabularyFilterResponse_languageCode :: Lens.Lens' GetVocabularyFilterResponse (Prelude.Maybe LanguageCode)
getVocabularyFilterResponse_languageCode :: Lens' GetVocabularyFilterResponse (Maybe LanguageCode)
getVocabularyFilterResponse_languageCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVocabularyFilterResponse' {Maybe LanguageCode
languageCode :: Maybe LanguageCode
$sel:languageCode:GetVocabularyFilterResponse' :: GetVocabularyFilterResponse -> Maybe LanguageCode
languageCode} -> Maybe LanguageCode
languageCode) (\s :: GetVocabularyFilterResponse
s@GetVocabularyFilterResponse' {} Maybe LanguageCode
a -> GetVocabularyFilterResponse
s {$sel:languageCode:GetVocabularyFilterResponse' :: Maybe LanguageCode
languageCode = Maybe LanguageCode
a} :: GetVocabularyFilterResponse)
getVocabularyFilterResponse_lastModifiedTime :: Lens.Lens' GetVocabularyFilterResponse (Prelude.Maybe Prelude.UTCTime)
getVocabularyFilterResponse_lastModifiedTime :: Lens' GetVocabularyFilterResponse (Maybe UTCTime)
getVocabularyFilterResponse_lastModifiedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVocabularyFilterResponse' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:GetVocabularyFilterResponse' :: GetVocabularyFilterResponse -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: GetVocabularyFilterResponse
s@GetVocabularyFilterResponse' {} Maybe POSIX
a -> GetVocabularyFilterResponse
s {$sel:lastModifiedTime:GetVocabularyFilterResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: GetVocabularyFilterResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
getVocabularyFilterResponse_vocabularyFilterName :: Lens.Lens' GetVocabularyFilterResponse (Prelude.Maybe Prelude.Text)
getVocabularyFilterResponse_vocabularyFilterName :: Lens' GetVocabularyFilterResponse (Maybe Text)
getVocabularyFilterResponse_vocabularyFilterName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVocabularyFilterResponse' {Maybe Text
vocabularyFilterName :: Maybe Text
$sel:vocabularyFilterName:GetVocabularyFilterResponse' :: GetVocabularyFilterResponse -> Maybe Text
vocabularyFilterName} -> Maybe Text
vocabularyFilterName) (\s :: GetVocabularyFilterResponse
s@GetVocabularyFilterResponse' {} Maybe Text
a -> GetVocabularyFilterResponse
s {$sel:vocabularyFilterName:GetVocabularyFilterResponse' :: Maybe Text
vocabularyFilterName = Maybe Text
a} :: GetVocabularyFilterResponse)
getVocabularyFilterResponse_httpStatus :: Lens.Lens' GetVocabularyFilterResponse Prelude.Int
getVocabularyFilterResponse_httpStatus :: Lens' GetVocabularyFilterResponse Int
getVocabularyFilterResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVocabularyFilterResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetVocabularyFilterResponse' :: GetVocabularyFilterResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetVocabularyFilterResponse
s@GetVocabularyFilterResponse' {} Int
a -> GetVocabularyFilterResponse
s {$sel:httpStatus:GetVocabularyFilterResponse' :: Int
httpStatus = Int
a} :: GetVocabularyFilterResponse)
instance Prelude.NFData GetVocabularyFilterResponse where
rnf :: GetVocabularyFilterResponse -> ()
rnf GetVocabularyFilterResponse' {Int
Maybe Text
Maybe POSIX
Maybe LanguageCode
httpStatus :: Int
vocabularyFilterName :: Maybe Text
lastModifiedTime :: Maybe POSIX
languageCode :: Maybe LanguageCode
downloadUri :: Maybe Text
$sel:httpStatus:GetVocabularyFilterResponse' :: GetVocabularyFilterResponse -> Int
$sel:vocabularyFilterName:GetVocabularyFilterResponse' :: GetVocabularyFilterResponse -> Maybe Text
$sel:lastModifiedTime:GetVocabularyFilterResponse' :: GetVocabularyFilterResponse -> Maybe POSIX
$sel:languageCode:GetVocabularyFilterResponse' :: GetVocabularyFilterResponse -> Maybe LanguageCode
$sel:downloadUri:GetVocabularyFilterResponse' :: GetVocabularyFilterResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
downloadUri
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LanguageCode
languageCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vocabularyFilterName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus