{-# 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.Translate.ListTextTranslationJobs
(
ListTextTranslationJobs (..),
newListTextTranslationJobs,
listTextTranslationJobs_filter,
listTextTranslationJobs_maxResults,
listTextTranslationJobs_nextToken,
ListTextTranslationJobsResponse (..),
newListTextTranslationJobsResponse,
listTextTranslationJobsResponse_nextToken,
listTextTranslationJobsResponse_textTranslationJobPropertiesList,
listTextTranslationJobsResponse_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.Translate.Types
data ListTextTranslationJobs = ListTextTranslationJobs'
{
ListTextTranslationJobs -> Maybe TextTranslationJobFilter
filter' :: Prelude.Maybe TextTranslationJobFilter,
ListTextTranslationJobs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListTextTranslationJobs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListTextTranslationJobs -> ListTextTranslationJobs -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTextTranslationJobs -> ListTextTranslationJobs -> Bool
$c/= :: ListTextTranslationJobs -> ListTextTranslationJobs -> Bool
== :: ListTextTranslationJobs -> ListTextTranslationJobs -> Bool
$c== :: ListTextTranslationJobs -> ListTextTranslationJobs -> Bool
Prelude.Eq, ReadPrec [ListTextTranslationJobs]
ReadPrec ListTextTranslationJobs
Int -> ReadS ListTextTranslationJobs
ReadS [ListTextTranslationJobs]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTextTranslationJobs]
$creadListPrec :: ReadPrec [ListTextTranslationJobs]
readPrec :: ReadPrec ListTextTranslationJobs
$creadPrec :: ReadPrec ListTextTranslationJobs
readList :: ReadS [ListTextTranslationJobs]
$creadList :: ReadS [ListTextTranslationJobs]
readsPrec :: Int -> ReadS ListTextTranslationJobs
$creadsPrec :: Int -> ReadS ListTextTranslationJobs
Prelude.Read, Int -> ListTextTranslationJobs -> ShowS
[ListTextTranslationJobs] -> ShowS
ListTextTranslationJobs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTextTranslationJobs] -> ShowS
$cshowList :: [ListTextTranslationJobs] -> ShowS
show :: ListTextTranslationJobs -> String
$cshow :: ListTextTranslationJobs -> String
showsPrec :: Int -> ListTextTranslationJobs -> ShowS
$cshowsPrec :: Int -> ListTextTranslationJobs -> ShowS
Prelude.Show, forall x. Rep ListTextTranslationJobs x -> ListTextTranslationJobs
forall x. ListTextTranslationJobs -> Rep ListTextTranslationJobs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTextTranslationJobs x -> ListTextTranslationJobs
$cfrom :: forall x. ListTextTranslationJobs -> Rep ListTextTranslationJobs x
Prelude.Generic)
newListTextTranslationJobs ::
ListTextTranslationJobs
newListTextTranslationJobs :: ListTextTranslationJobs
newListTextTranslationJobs =
ListTextTranslationJobs'
{ $sel:filter':ListTextTranslationJobs' :: Maybe TextTranslationJobFilter
filter' = forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListTextTranslationJobs' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListTextTranslationJobs' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listTextTranslationJobs_filter :: Lens.Lens' ListTextTranslationJobs (Prelude.Maybe TextTranslationJobFilter)
listTextTranslationJobs_filter :: Lens' ListTextTranslationJobs (Maybe TextTranslationJobFilter)
listTextTranslationJobs_filter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTextTranslationJobs' {Maybe TextTranslationJobFilter
filter' :: Maybe TextTranslationJobFilter
$sel:filter':ListTextTranslationJobs' :: ListTextTranslationJobs -> Maybe TextTranslationJobFilter
filter'} -> Maybe TextTranslationJobFilter
filter') (\s :: ListTextTranslationJobs
s@ListTextTranslationJobs' {} Maybe TextTranslationJobFilter
a -> ListTextTranslationJobs
s {$sel:filter':ListTextTranslationJobs' :: Maybe TextTranslationJobFilter
filter' = Maybe TextTranslationJobFilter
a} :: ListTextTranslationJobs)
listTextTranslationJobs_maxResults :: Lens.Lens' ListTextTranslationJobs (Prelude.Maybe Prelude.Natural)
listTextTranslationJobs_maxResults :: Lens' ListTextTranslationJobs (Maybe Natural)
listTextTranslationJobs_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTextTranslationJobs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListTextTranslationJobs' :: ListTextTranslationJobs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListTextTranslationJobs
s@ListTextTranslationJobs' {} Maybe Natural
a -> ListTextTranslationJobs
s {$sel:maxResults:ListTextTranslationJobs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListTextTranslationJobs)
listTextTranslationJobs_nextToken :: Lens.Lens' ListTextTranslationJobs (Prelude.Maybe Prelude.Text)
listTextTranslationJobs_nextToken :: Lens' ListTextTranslationJobs (Maybe Text)
listTextTranslationJobs_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTextTranslationJobs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTextTranslationJobs' :: ListTextTranslationJobs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTextTranslationJobs
s@ListTextTranslationJobs' {} Maybe Text
a -> ListTextTranslationJobs
s {$sel:nextToken:ListTextTranslationJobs' :: Maybe Text
nextToken = Maybe Text
a} :: ListTextTranslationJobs)
instance Core.AWSRequest ListTextTranslationJobs where
type
AWSResponse ListTextTranslationJobs =
ListTextTranslationJobsResponse
request :: (Service -> Service)
-> ListTextTranslationJobs -> Request ListTextTranslationJobs
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 ListTextTranslationJobs
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListTextTranslationJobs)))
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 [TextTranslationJobProperties]
-> Int
-> ListTextTranslationJobsResponse
ListTextTranslationJobsResponse'
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
"TextTranslationJobPropertiesList"
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 ListTextTranslationJobs where
hashWithSalt :: Int -> ListTextTranslationJobs -> Int
hashWithSalt Int
_salt ListTextTranslationJobs' {Maybe Natural
Maybe Text
Maybe TextTranslationJobFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe TextTranslationJobFilter
$sel:nextToken:ListTextTranslationJobs' :: ListTextTranslationJobs -> Maybe Text
$sel:maxResults:ListTextTranslationJobs' :: ListTextTranslationJobs -> Maybe Natural
$sel:filter':ListTextTranslationJobs' :: ListTextTranslationJobs -> Maybe TextTranslationJobFilter
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TextTranslationJobFilter
filter'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListTextTranslationJobs where
rnf :: ListTextTranslationJobs -> ()
rnf ListTextTranslationJobs' {Maybe Natural
Maybe Text
Maybe TextTranslationJobFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe TextTranslationJobFilter
$sel:nextToken:ListTextTranslationJobs' :: ListTextTranslationJobs -> Maybe Text
$sel:maxResults:ListTextTranslationJobs' :: ListTextTranslationJobs -> Maybe Natural
$sel:filter':ListTextTranslationJobs' :: ListTextTranslationJobs -> Maybe TextTranslationJobFilter
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe TextTranslationJobFilter
filter'
seq :: forall a b. a -> b -> b
`Prelude.seq` 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
nextToken
instance Data.ToHeaders ListTextTranslationJobs where
toHeaders :: ListTextTranslationJobs -> 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
"AWSShineFrontendService_20170701.ListTextTranslationJobs" ::
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 ListTextTranslationJobs where
toJSON :: ListTextTranslationJobs -> Value
toJSON ListTextTranslationJobs' {Maybe Natural
Maybe Text
Maybe TextTranslationJobFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe TextTranslationJobFilter
$sel:nextToken:ListTextTranslationJobs' :: ListTextTranslationJobs -> Maybe Text
$sel:maxResults:ListTextTranslationJobs' :: ListTextTranslationJobs -> Maybe Natural
$sel:filter':ListTextTranslationJobs' :: ListTextTranslationJobs -> Maybe TextTranslationJobFilter
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Filter" 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 TextTranslationJobFilter
filter',
(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
"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
]
)
instance Data.ToPath ListTextTranslationJobs where
toPath :: ListTextTranslationJobs -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListTextTranslationJobs where
toQuery :: ListTextTranslationJobs -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListTextTranslationJobsResponse = ListTextTranslationJobsResponse'
{
ListTextTranslationJobsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListTextTranslationJobsResponse
-> Maybe [TextTranslationJobProperties]
textTranslationJobPropertiesList :: Prelude.Maybe [TextTranslationJobProperties],
ListTextTranslationJobsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListTextTranslationJobsResponse
-> ListTextTranslationJobsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTextTranslationJobsResponse
-> ListTextTranslationJobsResponse -> Bool
$c/= :: ListTextTranslationJobsResponse
-> ListTextTranslationJobsResponse -> Bool
== :: ListTextTranslationJobsResponse
-> ListTextTranslationJobsResponse -> Bool
$c== :: ListTextTranslationJobsResponse
-> ListTextTranslationJobsResponse -> Bool
Prelude.Eq, ReadPrec [ListTextTranslationJobsResponse]
ReadPrec ListTextTranslationJobsResponse
Int -> ReadS ListTextTranslationJobsResponse
ReadS [ListTextTranslationJobsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTextTranslationJobsResponse]
$creadListPrec :: ReadPrec [ListTextTranslationJobsResponse]
readPrec :: ReadPrec ListTextTranslationJobsResponse
$creadPrec :: ReadPrec ListTextTranslationJobsResponse
readList :: ReadS [ListTextTranslationJobsResponse]
$creadList :: ReadS [ListTextTranslationJobsResponse]
readsPrec :: Int -> ReadS ListTextTranslationJobsResponse
$creadsPrec :: Int -> ReadS ListTextTranslationJobsResponse
Prelude.Read, Int -> ListTextTranslationJobsResponse -> ShowS
[ListTextTranslationJobsResponse] -> ShowS
ListTextTranslationJobsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTextTranslationJobsResponse] -> ShowS
$cshowList :: [ListTextTranslationJobsResponse] -> ShowS
show :: ListTextTranslationJobsResponse -> String
$cshow :: ListTextTranslationJobsResponse -> String
showsPrec :: Int -> ListTextTranslationJobsResponse -> ShowS
$cshowsPrec :: Int -> ListTextTranslationJobsResponse -> ShowS
Prelude.Show, forall x.
Rep ListTextTranslationJobsResponse x
-> ListTextTranslationJobsResponse
forall x.
ListTextTranslationJobsResponse
-> Rep ListTextTranslationJobsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTextTranslationJobsResponse x
-> ListTextTranslationJobsResponse
$cfrom :: forall x.
ListTextTranslationJobsResponse
-> Rep ListTextTranslationJobsResponse x
Prelude.Generic)
newListTextTranslationJobsResponse ::
Prelude.Int ->
ListTextTranslationJobsResponse
newListTextTranslationJobsResponse :: Int -> ListTextTranslationJobsResponse
newListTextTranslationJobsResponse Int
pHttpStatus_ =
ListTextTranslationJobsResponse'
{ $sel:nextToken:ListTextTranslationJobsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:textTranslationJobPropertiesList:ListTextTranslationJobsResponse' :: Maybe [TextTranslationJobProperties]
textTranslationJobPropertiesList =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListTextTranslationJobsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listTextTranslationJobsResponse_nextToken :: Lens.Lens' ListTextTranslationJobsResponse (Prelude.Maybe Prelude.Text)
listTextTranslationJobsResponse_nextToken :: Lens' ListTextTranslationJobsResponse (Maybe Text)
listTextTranslationJobsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTextTranslationJobsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTextTranslationJobsResponse' :: ListTextTranslationJobsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTextTranslationJobsResponse
s@ListTextTranslationJobsResponse' {} Maybe Text
a -> ListTextTranslationJobsResponse
s {$sel:nextToken:ListTextTranslationJobsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListTextTranslationJobsResponse)
listTextTranslationJobsResponse_textTranslationJobPropertiesList :: Lens.Lens' ListTextTranslationJobsResponse (Prelude.Maybe [TextTranslationJobProperties])
listTextTranslationJobsResponse_textTranslationJobPropertiesList :: Lens'
ListTextTranslationJobsResponse
(Maybe [TextTranslationJobProperties])
listTextTranslationJobsResponse_textTranslationJobPropertiesList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTextTranslationJobsResponse' {Maybe [TextTranslationJobProperties]
textTranslationJobPropertiesList :: Maybe [TextTranslationJobProperties]
$sel:textTranslationJobPropertiesList:ListTextTranslationJobsResponse' :: ListTextTranslationJobsResponse
-> Maybe [TextTranslationJobProperties]
textTranslationJobPropertiesList} -> Maybe [TextTranslationJobProperties]
textTranslationJobPropertiesList) (\s :: ListTextTranslationJobsResponse
s@ListTextTranslationJobsResponse' {} Maybe [TextTranslationJobProperties]
a -> ListTextTranslationJobsResponse
s {$sel:textTranslationJobPropertiesList:ListTextTranslationJobsResponse' :: Maybe [TextTranslationJobProperties]
textTranslationJobPropertiesList = Maybe [TextTranslationJobProperties]
a} :: ListTextTranslationJobsResponse) 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
listTextTranslationJobsResponse_httpStatus :: Lens.Lens' ListTextTranslationJobsResponse Prelude.Int
listTextTranslationJobsResponse_httpStatus :: Lens' ListTextTranslationJobsResponse Int
listTextTranslationJobsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTextTranslationJobsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListTextTranslationJobsResponse' :: ListTextTranslationJobsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListTextTranslationJobsResponse
s@ListTextTranslationJobsResponse' {} Int
a -> ListTextTranslationJobsResponse
s {$sel:httpStatus:ListTextTranslationJobsResponse' :: Int
httpStatus = Int
a} :: ListTextTranslationJobsResponse)
instance
Prelude.NFData
ListTextTranslationJobsResponse
where
rnf :: ListTextTranslationJobsResponse -> ()
rnf ListTextTranslationJobsResponse' {Int
Maybe [TextTranslationJobProperties]
Maybe Text
httpStatus :: Int
textTranslationJobPropertiesList :: Maybe [TextTranslationJobProperties]
nextToken :: Maybe Text
$sel:httpStatus:ListTextTranslationJobsResponse' :: ListTextTranslationJobsResponse -> Int
$sel:textTranslationJobPropertiesList:ListTextTranslationJobsResponse' :: ListTextTranslationJobsResponse
-> Maybe [TextTranslationJobProperties]
$sel:nextToken:ListTextTranslationJobsResponse' :: ListTextTranslationJobsResponse -> 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 [TextTranslationJobProperties]
textTranslationJobPropertiesList
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus