{-# 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.ListVocabularies
(
ListVocabularies (..),
newListVocabularies,
listVocabularies_maxResults,
listVocabularies_nameContains,
listVocabularies_nextToken,
listVocabularies_stateEquals,
ListVocabulariesResponse (..),
newListVocabulariesResponse,
listVocabulariesResponse_nextToken,
listVocabulariesResponse_status,
listVocabulariesResponse_vocabularies,
listVocabulariesResponse_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 ListVocabularies = ListVocabularies'
{
ListVocabularies -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListVocabularies -> Maybe Text
nameContains :: Prelude.Maybe Prelude.Text,
ListVocabularies -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListVocabularies -> Maybe VocabularyState
stateEquals :: Prelude.Maybe VocabularyState
}
deriving (ListVocabularies -> ListVocabularies -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVocabularies -> ListVocabularies -> Bool
$c/= :: ListVocabularies -> ListVocabularies -> Bool
== :: ListVocabularies -> ListVocabularies -> Bool
$c== :: ListVocabularies -> ListVocabularies -> Bool
Prelude.Eq, ReadPrec [ListVocabularies]
ReadPrec ListVocabularies
Int -> ReadS ListVocabularies
ReadS [ListVocabularies]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVocabularies]
$creadListPrec :: ReadPrec [ListVocabularies]
readPrec :: ReadPrec ListVocabularies
$creadPrec :: ReadPrec ListVocabularies
readList :: ReadS [ListVocabularies]
$creadList :: ReadS [ListVocabularies]
readsPrec :: Int -> ReadS ListVocabularies
$creadsPrec :: Int -> ReadS ListVocabularies
Prelude.Read, Int -> ListVocabularies -> ShowS
[ListVocabularies] -> ShowS
ListVocabularies -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVocabularies] -> ShowS
$cshowList :: [ListVocabularies] -> ShowS
show :: ListVocabularies -> String
$cshow :: ListVocabularies -> String
showsPrec :: Int -> ListVocabularies -> ShowS
$cshowsPrec :: Int -> ListVocabularies -> ShowS
Prelude.Show, forall x. Rep ListVocabularies x -> ListVocabularies
forall x. ListVocabularies -> Rep ListVocabularies x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListVocabularies x -> ListVocabularies
$cfrom :: forall x. ListVocabularies -> Rep ListVocabularies x
Prelude.Generic)
newListVocabularies ::
ListVocabularies
newListVocabularies :: ListVocabularies
newListVocabularies =
ListVocabularies'
{ $sel:maxResults:ListVocabularies' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nameContains:ListVocabularies' :: Maybe Text
nameContains = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListVocabularies' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:stateEquals:ListVocabularies' :: Maybe VocabularyState
stateEquals = forall a. Maybe a
Prelude.Nothing
}
listVocabularies_maxResults :: Lens.Lens' ListVocabularies (Prelude.Maybe Prelude.Natural)
listVocabularies_maxResults :: Lens' ListVocabularies (Maybe Natural)
listVocabularies_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVocabularies' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListVocabularies' :: ListVocabularies -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListVocabularies
s@ListVocabularies' {} Maybe Natural
a -> ListVocabularies
s {$sel:maxResults:ListVocabularies' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListVocabularies)
listVocabularies_nameContains :: Lens.Lens' ListVocabularies (Prelude.Maybe Prelude.Text)
listVocabularies_nameContains :: Lens' ListVocabularies (Maybe Text)
listVocabularies_nameContains = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVocabularies' {Maybe Text
nameContains :: Maybe Text
$sel:nameContains:ListVocabularies' :: ListVocabularies -> Maybe Text
nameContains} -> Maybe Text
nameContains) (\s :: ListVocabularies
s@ListVocabularies' {} Maybe Text
a -> ListVocabularies
s {$sel:nameContains:ListVocabularies' :: Maybe Text
nameContains = Maybe Text
a} :: ListVocabularies)
listVocabularies_nextToken :: Lens.Lens' ListVocabularies (Prelude.Maybe Prelude.Text)
listVocabularies_nextToken :: Lens' ListVocabularies (Maybe Text)
listVocabularies_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVocabularies' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListVocabularies' :: ListVocabularies -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListVocabularies
s@ListVocabularies' {} Maybe Text
a -> ListVocabularies
s {$sel:nextToken:ListVocabularies' :: Maybe Text
nextToken = Maybe Text
a} :: ListVocabularies)
listVocabularies_stateEquals :: Lens.Lens' ListVocabularies (Prelude.Maybe VocabularyState)
listVocabularies_stateEquals :: Lens' ListVocabularies (Maybe VocabularyState)
listVocabularies_stateEquals = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVocabularies' {Maybe VocabularyState
stateEquals :: Maybe VocabularyState
$sel:stateEquals:ListVocabularies' :: ListVocabularies -> Maybe VocabularyState
stateEquals} -> Maybe VocabularyState
stateEquals) (\s :: ListVocabularies
s@ListVocabularies' {} Maybe VocabularyState
a -> ListVocabularies
s {$sel:stateEquals:ListVocabularies' :: Maybe VocabularyState
stateEquals = Maybe VocabularyState
a} :: ListVocabularies)
instance Core.AWSRequest ListVocabularies where
type
AWSResponse ListVocabularies =
ListVocabulariesResponse
request :: (Service -> Service)
-> ListVocabularies -> Request ListVocabularies
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 ListVocabularies
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListVocabularies)))
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 VocabularyState
-> Maybe [VocabularyInfo]
-> Int
-> ListVocabulariesResponse
ListVocabulariesResponse'
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
"NextToken")
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
"Status")
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
"Vocabularies" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
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 ListVocabularies where
hashWithSalt :: Int -> ListVocabularies -> Int
hashWithSalt Int
_salt ListVocabularies' {Maybe Natural
Maybe Text
Maybe VocabularyState
stateEquals :: Maybe VocabularyState
nextToken :: Maybe Text
nameContains :: Maybe Text
maxResults :: Maybe Natural
$sel:stateEquals:ListVocabularies' :: ListVocabularies -> Maybe VocabularyState
$sel:nextToken:ListVocabularies' :: ListVocabularies -> Maybe Text
$sel:nameContains:ListVocabularies' :: ListVocabularies -> Maybe Text
$sel:maxResults:ListVocabularies' :: ListVocabularies -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nameContains
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VocabularyState
stateEquals
instance Prelude.NFData ListVocabularies where
rnf :: ListVocabularies -> ()
rnf ListVocabularies' {Maybe Natural
Maybe Text
Maybe VocabularyState
stateEquals :: Maybe VocabularyState
nextToken :: Maybe Text
nameContains :: Maybe Text
maxResults :: Maybe Natural
$sel:stateEquals:ListVocabularies' :: ListVocabularies -> Maybe VocabularyState
$sel:nextToken:ListVocabularies' :: ListVocabularies -> Maybe Text
$sel:nameContains:ListVocabularies' :: ListVocabularies -> Maybe Text
$sel:maxResults:ListVocabularies' :: ListVocabularies -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nameContains
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VocabularyState
stateEquals
instance Data.ToHeaders ListVocabularies where
toHeaders :: ListVocabularies -> 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.ListVocabularies" ::
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 ListVocabularies where
toJSON :: ListVocabularies -> Value
toJSON ListVocabularies' {Maybe Natural
Maybe Text
Maybe VocabularyState
stateEquals :: Maybe VocabularyState
nextToken :: Maybe Text
nameContains :: Maybe Text
maxResults :: Maybe Natural
$sel:stateEquals:ListVocabularies' :: ListVocabularies -> Maybe VocabularyState
$sel:nextToken:ListVocabularies' :: ListVocabularies -> Maybe Text
$sel:nameContains:ListVocabularies' :: ListVocabularies -> Maybe Text
$sel:maxResults:ListVocabularies' :: ListVocabularies -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"NameContains" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nameContains,
(Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
(Key
"StateEquals" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VocabularyState
stateEquals
]
)
instance Data.ToPath ListVocabularies where
toPath :: ListVocabularies -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListVocabularies where
toQuery :: ListVocabularies -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListVocabulariesResponse = ListVocabulariesResponse'
{
ListVocabulariesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListVocabulariesResponse -> Maybe VocabularyState
status :: Prelude.Maybe VocabularyState,
ListVocabulariesResponse -> Maybe [VocabularyInfo]
vocabularies :: Prelude.Maybe [VocabularyInfo],
ListVocabulariesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListVocabulariesResponse -> ListVocabulariesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVocabulariesResponse -> ListVocabulariesResponse -> Bool
$c/= :: ListVocabulariesResponse -> ListVocabulariesResponse -> Bool
== :: ListVocabulariesResponse -> ListVocabulariesResponse -> Bool
$c== :: ListVocabulariesResponse -> ListVocabulariesResponse -> Bool
Prelude.Eq, ReadPrec [ListVocabulariesResponse]
ReadPrec ListVocabulariesResponse
Int -> ReadS ListVocabulariesResponse
ReadS [ListVocabulariesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVocabulariesResponse]
$creadListPrec :: ReadPrec [ListVocabulariesResponse]
readPrec :: ReadPrec ListVocabulariesResponse
$creadPrec :: ReadPrec ListVocabulariesResponse
readList :: ReadS [ListVocabulariesResponse]
$creadList :: ReadS [ListVocabulariesResponse]
readsPrec :: Int -> ReadS ListVocabulariesResponse
$creadsPrec :: Int -> ReadS ListVocabulariesResponse
Prelude.Read, Int -> ListVocabulariesResponse -> ShowS
[ListVocabulariesResponse] -> ShowS
ListVocabulariesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVocabulariesResponse] -> ShowS
$cshowList :: [ListVocabulariesResponse] -> ShowS
show :: ListVocabulariesResponse -> String
$cshow :: ListVocabulariesResponse -> String
showsPrec :: Int -> ListVocabulariesResponse -> ShowS
$cshowsPrec :: Int -> ListVocabulariesResponse -> ShowS
Prelude.Show, forall x.
Rep ListVocabulariesResponse x -> ListVocabulariesResponse
forall x.
ListVocabulariesResponse -> Rep ListVocabulariesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListVocabulariesResponse x -> ListVocabulariesResponse
$cfrom :: forall x.
ListVocabulariesResponse -> Rep ListVocabulariesResponse x
Prelude.Generic)
newListVocabulariesResponse ::
Prelude.Int ->
ListVocabulariesResponse
newListVocabulariesResponse :: Int -> ListVocabulariesResponse
newListVocabulariesResponse Int
pHttpStatus_ =
ListVocabulariesResponse'
{ $sel:nextToken:ListVocabulariesResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:status:ListVocabulariesResponse' :: Maybe VocabularyState
status = forall a. Maybe a
Prelude.Nothing,
$sel:vocabularies:ListVocabulariesResponse' :: Maybe [VocabularyInfo]
vocabularies = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListVocabulariesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listVocabulariesResponse_nextToken :: Lens.Lens' ListVocabulariesResponse (Prelude.Maybe Prelude.Text)
listVocabulariesResponse_nextToken :: Lens' ListVocabulariesResponse (Maybe Text)
listVocabulariesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVocabulariesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListVocabulariesResponse' :: ListVocabulariesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListVocabulariesResponse
s@ListVocabulariesResponse' {} Maybe Text
a -> ListVocabulariesResponse
s {$sel:nextToken:ListVocabulariesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListVocabulariesResponse)
listVocabulariesResponse_status :: Lens.Lens' ListVocabulariesResponse (Prelude.Maybe VocabularyState)
listVocabulariesResponse_status :: Lens' ListVocabulariesResponse (Maybe VocabularyState)
listVocabulariesResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVocabulariesResponse' {Maybe VocabularyState
status :: Maybe VocabularyState
$sel:status:ListVocabulariesResponse' :: ListVocabulariesResponse -> Maybe VocabularyState
status} -> Maybe VocabularyState
status) (\s :: ListVocabulariesResponse
s@ListVocabulariesResponse' {} Maybe VocabularyState
a -> ListVocabulariesResponse
s {$sel:status:ListVocabulariesResponse' :: Maybe VocabularyState
status = Maybe VocabularyState
a} :: ListVocabulariesResponse)
listVocabulariesResponse_vocabularies :: Lens.Lens' ListVocabulariesResponse (Prelude.Maybe [VocabularyInfo])
listVocabulariesResponse_vocabularies :: Lens' ListVocabulariesResponse (Maybe [VocabularyInfo])
listVocabulariesResponse_vocabularies = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVocabulariesResponse' {Maybe [VocabularyInfo]
vocabularies :: Maybe [VocabularyInfo]
$sel:vocabularies:ListVocabulariesResponse' :: ListVocabulariesResponse -> Maybe [VocabularyInfo]
vocabularies} -> Maybe [VocabularyInfo]
vocabularies) (\s :: ListVocabulariesResponse
s@ListVocabulariesResponse' {} Maybe [VocabularyInfo]
a -> ListVocabulariesResponse
s {$sel:vocabularies:ListVocabulariesResponse' :: Maybe [VocabularyInfo]
vocabularies = Maybe [VocabularyInfo]
a} :: ListVocabulariesResponse) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listVocabulariesResponse_httpStatus :: Lens.Lens' ListVocabulariesResponse Prelude.Int
listVocabulariesResponse_httpStatus :: Lens' ListVocabulariesResponse Int
listVocabulariesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVocabulariesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListVocabulariesResponse' :: ListVocabulariesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListVocabulariesResponse
s@ListVocabulariesResponse' {} Int
a -> ListVocabulariesResponse
s {$sel:httpStatus:ListVocabulariesResponse' :: Int
httpStatus = Int
a} :: ListVocabulariesResponse)
instance Prelude.NFData ListVocabulariesResponse where
rnf :: ListVocabulariesResponse -> ()
rnf ListVocabulariesResponse' {Int
Maybe [VocabularyInfo]
Maybe Text
Maybe VocabularyState
httpStatus :: Int
vocabularies :: Maybe [VocabularyInfo]
status :: Maybe VocabularyState
nextToken :: Maybe Text
$sel:httpStatus:ListVocabulariesResponse' :: ListVocabulariesResponse -> Int
$sel:vocabularies:ListVocabulariesResponse' :: ListVocabulariesResponse -> Maybe [VocabularyInfo]
$sel:status:ListVocabulariesResponse' :: ListVocabulariesResponse -> Maybe VocabularyState
$sel:nextToken:ListVocabulariesResponse' :: ListVocabulariesResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VocabularyState
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [VocabularyInfo]
vocabularies
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus