{-# 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.MediaConvert.CreateJob
(
CreateJob (..),
newCreateJob,
createJob_jobTemplate,
createJob_accelerationSettings,
createJob_priority,
createJob_statusUpdateInterval,
createJob_hopDestinations,
createJob_simulateReservedQueue,
createJob_queue,
createJob_userMetadata,
createJob_billingTagsSource,
createJob_clientRequestToken,
createJob_tags,
createJob_role,
createJob_settings,
CreateJobResponse (..),
newCreateJobResponse,
createJobResponse_job,
createJobResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateJob = CreateJob'
{
CreateJob -> Maybe Text
jobTemplate :: Prelude.Maybe Prelude.Text,
CreateJob -> Maybe AccelerationSettings
accelerationSettings :: Prelude.Maybe AccelerationSettings,
CreateJob -> Maybe Int
priority :: Prelude.Maybe Prelude.Int,
CreateJob -> Maybe StatusUpdateInterval
statusUpdateInterval :: Prelude.Maybe StatusUpdateInterval,
CreateJob -> Maybe [HopDestination]
hopDestinations :: Prelude.Maybe [HopDestination],
CreateJob -> Maybe SimulateReservedQueue
simulateReservedQueue :: Prelude.Maybe SimulateReservedQueue,
CreateJob -> Maybe Text
queue :: Prelude.Maybe Prelude.Text,
CreateJob -> Maybe (HashMap Text Text)
userMetadata :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CreateJob -> Maybe BillingTagsSource
billingTagsSource :: Prelude.Maybe BillingTagsSource,
CreateJob -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
CreateJob -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CreateJob -> Text
role' :: Prelude.Text,
CreateJob -> JobSettings
settings :: JobSettings
}
deriving (CreateJob -> CreateJob -> Bool
(CreateJob -> CreateJob -> Bool)
-> (CreateJob -> CreateJob -> Bool) -> Eq CreateJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateJob -> CreateJob -> Bool
$c/= :: CreateJob -> CreateJob -> Bool
== :: CreateJob -> CreateJob -> Bool
$c== :: CreateJob -> CreateJob -> Bool
Prelude.Eq, ReadPrec [CreateJob]
ReadPrec CreateJob
Int -> ReadS CreateJob
ReadS [CreateJob]
(Int -> ReadS CreateJob)
-> ReadS [CreateJob]
-> ReadPrec CreateJob
-> ReadPrec [CreateJob]
-> Read CreateJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateJob]
$creadListPrec :: ReadPrec [CreateJob]
readPrec :: ReadPrec CreateJob
$creadPrec :: ReadPrec CreateJob
readList :: ReadS [CreateJob]
$creadList :: ReadS [CreateJob]
readsPrec :: Int -> ReadS CreateJob
$creadsPrec :: Int -> ReadS CreateJob
Prelude.Read, Int -> CreateJob -> ShowS
[CreateJob] -> ShowS
CreateJob -> String
(Int -> CreateJob -> ShowS)
-> (CreateJob -> String)
-> ([CreateJob] -> ShowS)
-> Show CreateJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateJob] -> ShowS
$cshowList :: [CreateJob] -> ShowS
show :: CreateJob -> String
$cshow :: CreateJob -> String
showsPrec :: Int -> CreateJob -> ShowS
$cshowsPrec :: Int -> CreateJob -> ShowS
Prelude.Show, (forall x. CreateJob -> Rep CreateJob x)
-> (forall x. Rep CreateJob x -> CreateJob) -> Generic CreateJob
forall x. Rep CreateJob x -> CreateJob
forall x. CreateJob -> Rep CreateJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateJob x -> CreateJob
$cfrom :: forall x. CreateJob -> Rep CreateJob x
Prelude.Generic)
newCreateJob ::
Prelude.Text ->
JobSettings ->
CreateJob
newCreateJob :: Text -> JobSettings -> CreateJob
newCreateJob Text
pRole_ JobSettings
pSettings_ =
CreateJob' :: Maybe Text
-> Maybe AccelerationSettings
-> Maybe Int
-> Maybe StatusUpdateInterval
-> Maybe [HopDestination]
-> Maybe SimulateReservedQueue
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe BillingTagsSource
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> JobSettings
-> CreateJob
CreateJob'
{ $sel:jobTemplate:CreateJob' :: Maybe Text
jobTemplate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:accelerationSettings:CreateJob' :: Maybe AccelerationSettings
accelerationSettings = Maybe AccelerationSettings
forall a. Maybe a
Prelude.Nothing,
$sel:priority:CreateJob' :: Maybe Int
priority = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:statusUpdateInterval:CreateJob' :: Maybe StatusUpdateInterval
statusUpdateInterval = Maybe StatusUpdateInterval
forall a. Maybe a
Prelude.Nothing,
$sel:hopDestinations:CreateJob' :: Maybe [HopDestination]
hopDestinations = Maybe [HopDestination]
forall a. Maybe a
Prelude.Nothing,
$sel:simulateReservedQueue:CreateJob' :: Maybe SimulateReservedQueue
simulateReservedQueue = Maybe SimulateReservedQueue
forall a. Maybe a
Prelude.Nothing,
$sel:queue:CreateJob' :: Maybe Text
queue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:userMetadata:CreateJob' :: Maybe (HashMap Text Text)
userMetadata = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:billingTagsSource:CreateJob' :: Maybe BillingTagsSource
billingTagsSource = Maybe BillingTagsSource
forall a. Maybe a
Prelude.Nothing,
$sel:clientRequestToken:CreateJob' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateJob' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:role':CreateJob' :: Text
role' = Text
pRole_,
$sel:settings:CreateJob' :: JobSettings
settings = JobSettings
pSettings_
}
createJob_jobTemplate :: Lens.Lens' CreateJob (Prelude.Maybe Prelude.Text)
createJob_jobTemplate :: (Maybe Text -> f (Maybe Text)) -> CreateJob -> f CreateJob
createJob_jobTemplate = (CreateJob -> Maybe Text)
-> (CreateJob -> Maybe Text -> CreateJob)
-> Lens CreateJob CreateJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe Text
jobTemplate :: Maybe Text
$sel:jobTemplate:CreateJob' :: CreateJob -> Maybe Text
jobTemplate} -> Maybe Text
jobTemplate) (\s :: CreateJob
s@CreateJob' {} Maybe Text
a -> CreateJob
s {$sel:jobTemplate:CreateJob' :: Maybe Text
jobTemplate = Maybe Text
a} :: CreateJob)
createJob_accelerationSettings :: Lens.Lens' CreateJob (Prelude.Maybe AccelerationSettings)
createJob_accelerationSettings :: (Maybe AccelerationSettings -> f (Maybe AccelerationSettings))
-> CreateJob -> f CreateJob
createJob_accelerationSettings = (CreateJob -> Maybe AccelerationSettings)
-> (CreateJob -> Maybe AccelerationSettings -> CreateJob)
-> Lens
CreateJob
CreateJob
(Maybe AccelerationSettings)
(Maybe AccelerationSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe AccelerationSettings
accelerationSettings :: Maybe AccelerationSettings
$sel:accelerationSettings:CreateJob' :: CreateJob -> Maybe AccelerationSettings
accelerationSettings} -> Maybe AccelerationSettings
accelerationSettings) (\s :: CreateJob
s@CreateJob' {} Maybe AccelerationSettings
a -> CreateJob
s {$sel:accelerationSettings:CreateJob' :: Maybe AccelerationSettings
accelerationSettings = Maybe AccelerationSettings
a} :: CreateJob)
createJob_priority :: Lens.Lens' CreateJob (Prelude.Maybe Prelude.Int)
createJob_priority :: (Maybe Int -> f (Maybe Int)) -> CreateJob -> f CreateJob
createJob_priority = (CreateJob -> Maybe Int)
-> (CreateJob -> Maybe Int -> CreateJob)
-> Lens CreateJob CreateJob (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe Int
priority :: Maybe Int
$sel:priority:CreateJob' :: CreateJob -> Maybe Int
priority} -> Maybe Int
priority) (\s :: CreateJob
s@CreateJob' {} Maybe Int
a -> CreateJob
s {$sel:priority:CreateJob' :: Maybe Int
priority = Maybe Int
a} :: CreateJob)
createJob_statusUpdateInterval :: Lens.Lens' CreateJob (Prelude.Maybe StatusUpdateInterval)
createJob_statusUpdateInterval :: (Maybe StatusUpdateInterval -> f (Maybe StatusUpdateInterval))
-> CreateJob -> f CreateJob
createJob_statusUpdateInterval = (CreateJob -> Maybe StatusUpdateInterval)
-> (CreateJob -> Maybe StatusUpdateInterval -> CreateJob)
-> Lens
CreateJob
CreateJob
(Maybe StatusUpdateInterval)
(Maybe StatusUpdateInterval)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe StatusUpdateInterval
statusUpdateInterval :: Maybe StatusUpdateInterval
$sel:statusUpdateInterval:CreateJob' :: CreateJob -> Maybe StatusUpdateInterval
statusUpdateInterval} -> Maybe StatusUpdateInterval
statusUpdateInterval) (\s :: CreateJob
s@CreateJob' {} Maybe StatusUpdateInterval
a -> CreateJob
s {$sel:statusUpdateInterval:CreateJob' :: Maybe StatusUpdateInterval
statusUpdateInterval = Maybe StatusUpdateInterval
a} :: CreateJob)
createJob_hopDestinations :: Lens.Lens' CreateJob (Prelude.Maybe [HopDestination])
createJob_hopDestinations :: (Maybe [HopDestination] -> f (Maybe [HopDestination]))
-> CreateJob -> f CreateJob
createJob_hopDestinations = (CreateJob -> Maybe [HopDestination])
-> (CreateJob -> Maybe [HopDestination] -> CreateJob)
-> Lens
CreateJob
CreateJob
(Maybe [HopDestination])
(Maybe [HopDestination])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe [HopDestination]
hopDestinations :: Maybe [HopDestination]
$sel:hopDestinations:CreateJob' :: CreateJob -> Maybe [HopDestination]
hopDestinations} -> Maybe [HopDestination]
hopDestinations) (\s :: CreateJob
s@CreateJob' {} Maybe [HopDestination]
a -> CreateJob
s {$sel:hopDestinations:CreateJob' :: Maybe [HopDestination]
hopDestinations = Maybe [HopDestination]
a} :: CreateJob) ((Maybe [HopDestination] -> f (Maybe [HopDestination]))
-> CreateJob -> f CreateJob)
-> ((Maybe [HopDestination] -> f (Maybe [HopDestination]))
-> Maybe [HopDestination] -> f (Maybe [HopDestination]))
-> (Maybe [HopDestination] -> f (Maybe [HopDestination]))
-> CreateJob
-> f CreateJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[HopDestination] [HopDestination] [HopDestination] [HopDestination]
-> Iso
(Maybe [HopDestination])
(Maybe [HopDestination])
(Maybe [HopDestination])
(Maybe [HopDestination])
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 AnIso
[HopDestination] [HopDestination] [HopDestination] [HopDestination]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createJob_simulateReservedQueue :: Lens.Lens' CreateJob (Prelude.Maybe SimulateReservedQueue)
createJob_simulateReservedQueue :: (Maybe SimulateReservedQueue -> f (Maybe SimulateReservedQueue))
-> CreateJob -> f CreateJob
createJob_simulateReservedQueue = (CreateJob -> Maybe SimulateReservedQueue)
-> (CreateJob -> Maybe SimulateReservedQueue -> CreateJob)
-> Lens
CreateJob
CreateJob
(Maybe SimulateReservedQueue)
(Maybe SimulateReservedQueue)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe SimulateReservedQueue
simulateReservedQueue :: Maybe SimulateReservedQueue
$sel:simulateReservedQueue:CreateJob' :: CreateJob -> Maybe SimulateReservedQueue
simulateReservedQueue} -> Maybe SimulateReservedQueue
simulateReservedQueue) (\s :: CreateJob
s@CreateJob' {} Maybe SimulateReservedQueue
a -> CreateJob
s {$sel:simulateReservedQueue:CreateJob' :: Maybe SimulateReservedQueue
simulateReservedQueue = Maybe SimulateReservedQueue
a} :: CreateJob)
createJob_queue :: Lens.Lens' CreateJob (Prelude.Maybe Prelude.Text)
createJob_queue :: (Maybe Text -> f (Maybe Text)) -> CreateJob -> f CreateJob
createJob_queue = (CreateJob -> Maybe Text)
-> (CreateJob -> Maybe Text -> CreateJob)
-> Lens CreateJob CreateJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe Text
queue :: Maybe Text
$sel:queue:CreateJob' :: CreateJob -> Maybe Text
queue} -> Maybe Text
queue) (\s :: CreateJob
s@CreateJob' {} Maybe Text
a -> CreateJob
s {$sel:queue:CreateJob' :: Maybe Text
queue = Maybe Text
a} :: CreateJob)
createJob_userMetadata :: Lens.Lens' CreateJob (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createJob_userMetadata :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateJob -> f CreateJob
createJob_userMetadata = (CreateJob -> Maybe (HashMap Text Text))
-> (CreateJob -> Maybe (HashMap Text Text) -> CreateJob)
-> Lens
CreateJob
CreateJob
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe (HashMap Text Text)
userMetadata :: Maybe (HashMap Text Text)
$sel:userMetadata:CreateJob' :: CreateJob -> Maybe (HashMap Text Text)
userMetadata} -> Maybe (HashMap Text Text)
userMetadata) (\s :: CreateJob
s@CreateJob' {} Maybe (HashMap Text Text)
a -> CreateJob
s {$sel:userMetadata:CreateJob' :: Maybe (HashMap Text Text)
userMetadata = Maybe (HashMap Text Text)
a} :: CreateJob) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateJob -> f CreateJob)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateJob
-> f CreateJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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 AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createJob_billingTagsSource :: Lens.Lens' CreateJob (Prelude.Maybe BillingTagsSource)
createJob_billingTagsSource :: (Maybe BillingTagsSource -> f (Maybe BillingTagsSource))
-> CreateJob -> f CreateJob
createJob_billingTagsSource = (CreateJob -> Maybe BillingTagsSource)
-> (CreateJob -> Maybe BillingTagsSource -> CreateJob)
-> Lens
CreateJob
CreateJob
(Maybe BillingTagsSource)
(Maybe BillingTagsSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe BillingTagsSource
billingTagsSource :: Maybe BillingTagsSource
$sel:billingTagsSource:CreateJob' :: CreateJob -> Maybe BillingTagsSource
billingTagsSource} -> Maybe BillingTagsSource
billingTagsSource) (\s :: CreateJob
s@CreateJob' {} Maybe BillingTagsSource
a -> CreateJob
s {$sel:billingTagsSource:CreateJob' :: Maybe BillingTagsSource
billingTagsSource = Maybe BillingTagsSource
a} :: CreateJob)
createJob_clientRequestToken :: Lens.Lens' CreateJob (Prelude.Maybe Prelude.Text)
createJob_clientRequestToken :: (Maybe Text -> f (Maybe Text)) -> CreateJob -> f CreateJob
createJob_clientRequestToken = (CreateJob -> Maybe Text)
-> (CreateJob -> Maybe Text -> CreateJob)
-> Lens CreateJob CreateJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:CreateJob' :: CreateJob -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: CreateJob
s@CreateJob' {} Maybe Text
a -> CreateJob
s {$sel:clientRequestToken:CreateJob' :: Maybe Text
clientRequestToken = Maybe Text
a} :: CreateJob)
createJob_tags :: Lens.Lens' CreateJob (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createJob_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateJob -> f CreateJob
createJob_tags = (CreateJob -> Maybe (HashMap Text Text))
-> (CreateJob -> Maybe (HashMap Text Text) -> CreateJob)
-> Lens
CreateJob
CreateJob
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateJob' :: CreateJob -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateJob
s@CreateJob' {} Maybe (HashMap Text Text)
a -> CreateJob
s {$sel:tags:CreateJob' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateJob) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateJob -> f CreateJob)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateJob
-> f CreateJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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 AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createJob_role :: Lens.Lens' CreateJob Prelude.Text
createJob_role :: (Text -> f Text) -> CreateJob -> f CreateJob
createJob_role = (CreateJob -> Text)
-> (CreateJob -> Text -> CreateJob)
-> Lens CreateJob CreateJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Text
role' :: Text
$sel:role':CreateJob' :: CreateJob -> Text
role'} -> Text
role') (\s :: CreateJob
s@CreateJob' {} Text
a -> CreateJob
s {$sel:role':CreateJob' :: Text
role' = Text
a} :: CreateJob)
createJob_settings :: Lens.Lens' CreateJob JobSettings
createJob_settings :: (JobSettings -> f JobSettings) -> CreateJob -> f CreateJob
createJob_settings = (CreateJob -> JobSettings)
-> (CreateJob -> JobSettings -> CreateJob)
-> Lens CreateJob CreateJob JobSettings JobSettings
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {JobSettings
settings :: JobSettings
$sel:settings:CreateJob' :: CreateJob -> JobSettings
settings} -> JobSettings
settings) (\s :: CreateJob
s@CreateJob' {} JobSettings
a -> CreateJob
s {$sel:settings:CreateJob' :: JobSettings
settings = JobSettings
a} :: CreateJob)
instance Core.AWSRequest CreateJob where
type AWSResponse CreateJob = CreateJobResponse
request :: CreateJob -> Request CreateJob
request = Service -> CreateJob -> Request CreateJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateJob)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateJob))
-> Logger
-> Service
-> Proxy CreateJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateJob)))
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 Job -> Int -> CreateJobResponse
CreateJobResponse'
(Maybe Job -> Int -> CreateJobResponse)
-> Either String (Maybe Job)
-> Either String (Int -> CreateJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Job)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"job")
Either String (Int -> CreateJobResponse)
-> Either String Int -> Either String CreateJobResponse
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 CreateJob
instance Prelude.NFData CreateJob
instance Core.ToHeaders CreateJob where
toHeaders :: CreateJob -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateJob -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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 CreateJob where
toJSON :: CreateJob -> Value
toJSON CreateJob' {Maybe Int
Maybe [HopDestination]
Maybe Text
Maybe (HashMap Text Text)
Maybe AccelerationSettings
Maybe BillingTagsSource
Maybe SimulateReservedQueue
Maybe StatusUpdateInterval
Text
JobSettings
settings :: JobSettings
role' :: Text
tags :: Maybe (HashMap Text Text)
clientRequestToken :: Maybe Text
billingTagsSource :: Maybe BillingTagsSource
userMetadata :: Maybe (HashMap Text Text)
queue :: Maybe Text
simulateReservedQueue :: Maybe SimulateReservedQueue
hopDestinations :: Maybe [HopDestination]
statusUpdateInterval :: Maybe StatusUpdateInterval
priority :: Maybe Int
accelerationSettings :: Maybe AccelerationSettings
jobTemplate :: Maybe Text
$sel:settings:CreateJob' :: CreateJob -> JobSettings
$sel:role':CreateJob' :: CreateJob -> Text
$sel:tags:CreateJob' :: CreateJob -> Maybe (HashMap Text Text)
$sel:clientRequestToken:CreateJob' :: CreateJob -> Maybe Text
$sel:billingTagsSource:CreateJob' :: CreateJob -> Maybe BillingTagsSource
$sel:userMetadata:CreateJob' :: CreateJob -> Maybe (HashMap Text Text)
$sel:queue:CreateJob' :: CreateJob -> Maybe Text
$sel:simulateReservedQueue:CreateJob' :: CreateJob -> Maybe SimulateReservedQueue
$sel:hopDestinations:CreateJob' :: CreateJob -> Maybe [HopDestination]
$sel:statusUpdateInterval:CreateJob' :: CreateJob -> Maybe StatusUpdateInterval
$sel:priority:CreateJob' :: CreateJob -> Maybe Int
$sel:accelerationSettings:CreateJob' :: CreateJob -> Maybe AccelerationSettings
$sel:jobTemplate:CreateJob' :: CreateJob -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"jobTemplate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
jobTemplate,
(Text
"accelerationSettings" Text -> AccelerationSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(AccelerationSettings -> Pair)
-> Maybe AccelerationSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AccelerationSettings
accelerationSettings,
(Text
"priority" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
priority,
(Text
"statusUpdateInterval" Text -> StatusUpdateInterval -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(StatusUpdateInterval -> Pair)
-> Maybe StatusUpdateInterval -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StatusUpdateInterval
statusUpdateInterval,
(Text
"hopDestinations" Text -> [HopDestination] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([HopDestination] -> Pair) -> Maybe [HopDestination] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [HopDestination]
hopDestinations,
(Text
"simulateReservedQueue" Text -> SimulateReservedQueue -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(SimulateReservedQueue -> Pair)
-> Maybe SimulateReservedQueue -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SimulateReservedQueue
simulateReservedQueue,
(Text
"queue" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
queue,
(Text
"userMetadata" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
userMetadata,
(Text
"billingTagsSource" Text -> BillingTagsSource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(BillingTagsSource -> Pair)
-> Maybe BillingTagsSource -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BillingTagsSource
billingTagsSource,
(Text
"clientRequestToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientRequestToken,
(Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"role" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
role'),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"settings" Text -> JobSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= JobSettings
settings)
]
)
instance Core.ToPath CreateJob where
toPath :: CreateJob -> ByteString
toPath = ByteString -> CreateJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2017-08-29/jobs"
instance Core.ToQuery CreateJob where
toQuery :: CreateJob -> QueryString
toQuery = QueryString -> CreateJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateJobResponse = CreateJobResponse'
{
CreateJobResponse -> Maybe Job
job :: Prelude.Maybe Job,
CreateJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateJobResponse -> CreateJobResponse -> Bool
(CreateJobResponse -> CreateJobResponse -> Bool)
-> (CreateJobResponse -> CreateJobResponse -> Bool)
-> Eq CreateJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateJobResponse -> CreateJobResponse -> Bool
$c/= :: CreateJobResponse -> CreateJobResponse -> Bool
== :: CreateJobResponse -> CreateJobResponse -> Bool
$c== :: CreateJobResponse -> CreateJobResponse -> Bool
Prelude.Eq, ReadPrec [CreateJobResponse]
ReadPrec CreateJobResponse
Int -> ReadS CreateJobResponse
ReadS [CreateJobResponse]
(Int -> ReadS CreateJobResponse)
-> ReadS [CreateJobResponse]
-> ReadPrec CreateJobResponse
-> ReadPrec [CreateJobResponse]
-> Read CreateJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateJobResponse]
$creadListPrec :: ReadPrec [CreateJobResponse]
readPrec :: ReadPrec CreateJobResponse
$creadPrec :: ReadPrec CreateJobResponse
readList :: ReadS [CreateJobResponse]
$creadList :: ReadS [CreateJobResponse]
readsPrec :: Int -> ReadS CreateJobResponse
$creadsPrec :: Int -> ReadS CreateJobResponse
Prelude.Read, Int -> CreateJobResponse -> ShowS
[CreateJobResponse] -> ShowS
CreateJobResponse -> String
(Int -> CreateJobResponse -> ShowS)
-> (CreateJobResponse -> String)
-> ([CreateJobResponse] -> ShowS)
-> Show CreateJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateJobResponse] -> ShowS
$cshowList :: [CreateJobResponse] -> ShowS
show :: CreateJobResponse -> String
$cshow :: CreateJobResponse -> String
showsPrec :: Int -> CreateJobResponse -> ShowS
$cshowsPrec :: Int -> CreateJobResponse -> ShowS
Prelude.Show, (forall x. CreateJobResponse -> Rep CreateJobResponse x)
-> (forall x. Rep CreateJobResponse x -> CreateJobResponse)
-> Generic CreateJobResponse
forall x. Rep CreateJobResponse x -> CreateJobResponse
forall x. CreateJobResponse -> Rep CreateJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateJobResponse x -> CreateJobResponse
$cfrom :: forall x. CreateJobResponse -> Rep CreateJobResponse x
Prelude.Generic)
newCreateJobResponse ::
Prelude.Int ->
CreateJobResponse
newCreateJobResponse :: Int -> CreateJobResponse
newCreateJobResponse Int
pHttpStatus_ =
CreateJobResponse' :: Maybe Job -> Int -> CreateJobResponse
CreateJobResponse'
{ $sel:job:CreateJobResponse' :: Maybe Job
job = Maybe Job
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createJobResponse_job :: Lens.Lens' CreateJobResponse (Prelude.Maybe Job)
createJobResponse_job :: (Maybe Job -> f (Maybe Job))
-> CreateJobResponse -> f CreateJobResponse
createJobResponse_job = (CreateJobResponse -> Maybe Job)
-> (CreateJobResponse -> Maybe Job -> CreateJobResponse)
-> Lens CreateJobResponse CreateJobResponse (Maybe Job) (Maybe Job)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobResponse' {Maybe Job
job :: Maybe Job
$sel:job:CreateJobResponse' :: CreateJobResponse -> Maybe Job
job} -> Maybe Job
job) (\s :: CreateJobResponse
s@CreateJobResponse' {} Maybe Job
a -> CreateJobResponse
s {$sel:job:CreateJobResponse' :: Maybe Job
job = Maybe Job
a} :: CreateJobResponse)
createJobResponse_httpStatus :: Lens.Lens' CreateJobResponse Prelude.Int
createJobResponse_httpStatus :: (Int -> f Int) -> CreateJobResponse -> f CreateJobResponse
createJobResponse_httpStatus = (CreateJobResponse -> Int)
-> (CreateJobResponse -> Int -> CreateJobResponse)
-> Lens CreateJobResponse CreateJobResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateJobResponse' :: CreateJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateJobResponse
s@CreateJobResponse' {} Int
a -> CreateJobResponse
s {$sel:httpStatus:CreateJobResponse' :: Int
httpStatus = Int
a} :: CreateJobResponse)
instance Prelude.NFData CreateJobResponse