{-# 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.Batch.SubmitJob
(
SubmitJob (..),
newSubmitJob,
submitJob_nodeOverrides,
submitJob_propagateTags,
submitJob_containerOverrides,
submitJob_retryStrategy,
submitJob_dependsOn,
submitJob_parameters,
submitJob_arrayProperties,
submitJob_timeout,
submitJob_tags,
submitJob_jobName,
submitJob_jobQueue,
submitJob_jobDefinition,
SubmitJobResponse (..),
newSubmitJobResponse,
submitJobResponse_jobArn,
submitJobResponse_httpStatus,
submitJobResponse_jobName,
submitJobResponse_jobId,
)
where
import Amazonka.Batch.Types
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
data SubmitJob = SubmitJob'
{
SubmitJob -> Maybe NodeOverrides
nodeOverrides :: Prelude.Maybe NodeOverrides,
SubmitJob -> Maybe Bool
propagateTags :: Prelude.Maybe Prelude.Bool,
SubmitJob -> Maybe ContainerOverrides
containerOverrides :: Prelude.Maybe ContainerOverrides,
SubmitJob -> Maybe RetryStrategy
retryStrategy :: Prelude.Maybe RetryStrategy,
SubmitJob -> Maybe [JobDependency]
dependsOn :: Prelude.Maybe [JobDependency],
SubmitJob -> Maybe (HashMap Text Text)
parameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
SubmitJob -> Maybe ArrayProperties
arrayProperties :: Prelude.Maybe ArrayProperties,
SubmitJob -> Maybe JobTimeout
timeout :: Prelude.Maybe JobTimeout,
SubmitJob -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
SubmitJob -> Text
jobName :: Prelude.Text,
SubmitJob -> Text
jobQueue :: Prelude.Text,
SubmitJob -> Text
jobDefinition :: Prelude.Text
}
deriving (SubmitJob -> SubmitJob -> Bool
(SubmitJob -> SubmitJob -> Bool)
-> (SubmitJob -> SubmitJob -> Bool) -> Eq SubmitJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SubmitJob -> SubmitJob -> Bool
$c/= :: SubmitJob -> SubmitJob -> Bool
== :: SubmitJob -> SubmitJob -> Bool
$c== :: SubmitJob -> SubmitJob -> Bool
Prelude.Eq, ReadPrec [SubmitJob]
ReadPrec SubmitJob
Int -> ReadS SubmitJob
ReadS [SubmitJob]
(Int -> ReadS SubmitJob)
-> ReadS [SubmitJob]
-> ReadPrec SubmitJob
-> ReadPrec [SubmitJob]
-> Read SubmitJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SubmitJob]
$creadListPrec :: ReadPrec [SubmitJob]
readPrec :: ReadPrec SubmitJob
$creadPrec :: ReadPrec SubmitJob
readList :: ReadS [SubmitJob]
$creadList :: ReadS [SubmitJob]
readsPrec :: Int -> ReadS SubmitJob
$creadsPrec :: Int -> ReadS SubmitJob
Prelude.Read, Int -> SubmitJob -> ShowS
[SubmitJob] -> ShowS
SubmitJob -> String
(Int -> SubmitJob -> ShowS)
-> (SubmitJob -> String)
-> ([SubmitJob] -> ShowS)
-> Show SubmitJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SubmitJob] -> ShowS
$cshowList :: [SubmitJob] -> ShowS
show :: SubmitJob -> String
$cshow :: SubmitJob -> String
showsPrec :: Int -> SubmitJob -> ShowS
$cshowsPrec :: Int -> SubmitJob -> ShowS
Prelude.Show, (forall x. SubmitJob -> Rep SubmitJob x)
-> (forall x. Rep SubmitJob x -> SubmitJob) -> Generic SubmitJob
forall x. Rep SubmitJob x -> SubmitJob
forall x. SubmitJob -> Rep SubmitJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SubmitJob x -> SubmitJob
$cfrom :: forall x. SubmitJob -> Rep SubmitJob x
Prelude.Generic)
newSubmitJob ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
SubmitJob
newSubmitJob :: Text -> Text -> Text -> SubmitJob
newSubmitJob Text
pJobName_ Text
pJobQueue_ Text
pJobDefinition_ =
SubmitJob' :: Maybe NodeOverrides
-> Maybe Bool
-> Maybe ContainerOverrides
-> Maybe RetryStrategy
-> Maybe [JobDependency]
-> Maybe (HashMap Text Text)
-> Maybe ArrayProperties
-> Maybe JobTimeout
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> SubmitJob
SubmitJob'
{ $sel:nodeOverrides:SubmitJob' :: Maybe NodeOverrides
nodeOverrides = Maybe NodeOverrides
forall a. Maybe a
Prelude.Nothing,
$sel:propagateTags:SubmitJob' :: Maybe Bool
propagateTags = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:containerOverrides:SubmitJob' :: Maybe ContainerOverrides
containerOverrides = Maybe ContainerOverrides
forall a. Maybe a
Prelude.Nothing,
$sel:retryStrategy:SubmitJob' :: Maybe RetryStrategy
retryStrategy = Maybe RetryStrategy
forall a. Maybe a
Prelude.Nothing,
$sel:dependsOn:SubmitJob' :: Maybe [JobDependency]
dependsOn = Maybe [JobDependency]
forall a. Maybe a
Prelude.Nothing,
$sel:parameters:SubmitJob' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:arrayProperties:SubmitJob' :: Maybe ArrayProperties
arrayProperties = Maybe ArrayProperties
forall a. Maybe a
Prelude.Nothing,
$sel:timeout:SubmitJob' :: Maybe JobTimeout
timeout = Maybe JobTimeout
forall a. Maybe a
Prelude.Nothing,
$sel:tags:SubmitJob' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:jobName:SubmitJob' :: Text
jobName = Text
pJobName_,
$sel:jobQueue:SubmitJob' :: Text
jobQueue = Text
pJobQueue_,
$sel:jobDefinition:SubmitJob' :: Text
jobDefinition = Text
pJobDefinition_
}
submitJob_nodeOverrides :: Lens.Lens' SubmitJob (Prelude.Maybe NodeOverrides)
submitJob_nodeOverrides :: (Maybe NodeOverrides -> f (Maybe NodeOverrides))
-> SubmitJob -> f SubmitJob
submitJob_nodeOverrides = (SubmitJob -> Maybe NodeOverrides)
-> (SubmitJob -> Maybe NodeOverrides -> SubmitJob)
-> Lens
SubmitJob SubmitJob (Maybe NodeOverrides) (Maybe NodeOverrides)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Maybe NodeOverrides
nodeOverrides :: Maybe NodeOverrides
$sel:nodeOverrides:SubmitJob' :: SubmitJob -> Maybe NodeOverrides
nodeOverrides} -> Maybe NodeOverrides
nodeOverrides) (\s :: SubmitJob
s@SubmitJob' {} Maybe NodeOverrides
a -> SubmitJob
s {$sel:nodeOverrides:SubmitJob' :: Maybe NodeOverrides
nodeOverrides = Maybe NodeOverrides
a} :: SubmitJob)
submitJob_propagateTags :: Lens.Lens' SubmitJob (Prelude.Maybe Prelude.Bool)
submitJob_propagateTags :: (Maybe Bool -> f (Maybe Bool)) -> SubmitJob -> f SubmitJob
submitJob_propagateTags = (SubmitJob -> Maybe Bool)
-> (SubmitJob -> Maybe Bool -> SubmitJob)
-> Lens SubmitJob SubmitJob (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Maybe Bool
propagateTags :: Maybe Bool
$sel:propagateTags:SubmitJob' :: SubmitJob -> Maybe Bool
propagateTags} -> Maybe Bool
propagateTags) (\s :: SubmitJob
s@SubmitJob' {} Maybe Bool
a -> SubmitJob
s {$sel:propagateTags:SubmitJob' :: Maybe Bool
propagateTags = Maybe Bool
a} :: SubmitJob)
submitJob_containerOverrides :: Lens.Lens' SubmitJob (Prelude.Maybe ContainerOverrides)
submitJob_containerOverrides :: (Maybe ContainerOverrides -> f (Maybe ContainerOverrides))
-> SubmitJob -> f SubmitJob
submitJob_containerOverrides = (SubmitJob -> Maybe ContainerOverrides)
-> (SubmitJob -> Maybe ContainerOverrides -> SubmitJob)
-> Lens
SubmitJob
SubmitJob
(Maybe ContainerOverrides)
(Maybe ContainerOverrides)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Maybe ContainerOverrides
containerOverrides :: Maybe ContainerOverrides
$sel:containerOverrides:SubmitJob' :: SubmitJob -> Maybe ContainerOverrides
containerOverrides} -> Maybe ContainerOverrides
containerOverrides) (\s :: SubmitJob
s@SubmitJob' {} Maybe ContainerOverrides
a -> SubmitJob
s {$sel:containerOverrides:SubmitJob' :: Maybe ContainerOverrides
containerOverrides = Maybe ContainerOverrides
a} :: SubmitJob)
submitJob_retryStrategy :: Lens.Lens' SubmitJob (Prelude.Maybe RetryStrategy)
submitJob_retryStrategy :: (Maybe RetryStrategy -> f (Maybe RetryStrategy))
-> SubmitJob -> f SubmitJob
submitJob_retryStrategy = (SubmitJob -> Maybe RetryStrategy)
-> (SubmitJob -> Maybe RetryStrategy -> SubmitJob)
-> Lens
SubmitJob SubmitJob (Maybe RetryStrategy) (Maybe RetryStrategy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Maybe RetryStrategy
retryStrategy :: Maybe RetryStrategy
$sel:retryStrategy:SubmitJob' :: SubmitJob -> Maybe RetryStrategy
retryStrategy} -> Maybe RetryStrategy
retryStrategy) (\s :: SubmitJob
s@SubmitJob' {} Maybe RetryStrategy
a -> SubmitJob
s {$sel:retryStrategy:SubmitJob' :: Maybe RetryStrategy
retryStrategy = Maybe RetryStrategy
a} :: SubmitJob)
submitJob_dependsOn :: Lens.Lens' SubmitJob (Prelude.Maybe [JobDependency])
submitJob_dependsOn :: (Maybe [JobDependency] -> f (Maybe [JobDependency]))
-> SubmitJob -> f SubmitJob
submitJob_dependsOn = (SubmitJob -> Maybe [JobDependency])
-> (SubmitJob -> Maybe [JobDependency] -> SubmitJob)
-> Lens
SubmitJob SubmitJob (Maybe [JobDependency]) (Maybe [JobDependency])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Maybe [JobDependency]
dependsOn :: Maybe [JobDependency]
$sel:dependsOn:SubmitJob' :: SubmitJob -> Maybe [JobDependency]
dependsOn} -> Maybe [JobDependency]
dependsOn) (\s :: SubmitJob
s@SubmitJob' {} Maybe [JobDependency]
a -> SubmitJob
s {$sel:dependsOn:SubmitJob' :: Maybe [JobDependency]
dependsOn = Maybe [JobDependency]
a} :: SubmitJob) ((Maybe [JobDependency] -> f (Maybe [JobDependency]))
-> SubmitJob -> f SubmitJob)
-> ((Maybe [JobDependency] -> f (Maybe [JobDependency]))
-> Maybe [JobDependency] -> f (Maybe [JobDependency]))
-> (Maybe [JobDependency] -> f (Maybe [JobDependency]))
-> SubmitJob
-> f SubmitJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[JobDependency] [JobDependency] [JobDependency] [JobDependency]
-> Iso
(Maybe [JobDependency])
(Maybe [JobDependency])
(Maybe [JobDependency])
(Maybe [JobDependency])
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
[JobDependency] [JobDependency] [JobDependency] [JobDependency]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
submitJob_parameters :: Lens.Lens' SubmitJob (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
submitJob_parameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SubmitJob -> f SubmitJob
submitJob_parameters = (SubmitJob -> Maybe (HashMap Text Text))
-> (SubmitJob -> Maybe (HashMap Text Text) -> SubmitJob)
-> Lens
SubmitJob
SubmitJob
(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 (\SubmitJob' {Maybe (HashMap Text Text)
parameters :: Maybe (HashMap Text Text)
$sel:parameters:SubmitJob' :: SubmitJob -> Maybe (HashMap Text Text)
parameters} -> Maybe (HashMap Text Text)
parameters) (\s :: SubmitJob
s@SubmitJob' {} Maybe (HashMap Text Text)
a -> SubmitJob
s {$sel:parameters:SubmitJob' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
a} :: SubmitJob) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SubmitJob -> f SubmitJob)
-> ((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)))
-> SubmitJob
-> f SubmitJob
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
submitJob_arrayProperties :: Lens.Lens' SubmitJob (Prelude.Maybe ArrayProperties)
submitJob_arrayProperties :: (Maybe ArrayProperties -> f (Maybe ArrayProperties))
-> SubmitJob -> f SubmitJob
submitJob_arrayProperties = (SubmitJob -> Maybe ArrayProperties)
-> (SubmitJob -> Maybe ArrayProperties -> SubmitJob)
-> Lens
SubmitJob SubmitJob (Maybe ArrayProperties) (Maybe ArrayProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Maybe ArrayProperties
arrayProperties :: Maybe ArrayProperties
$sel:arrayProperties:SubmitJob' :: SubmitJob -> Maybe ArrayProperties
arrayProperties} -> Maybe ArrayProperties
arrayProperties) (\s :: SubmitJob
s@SubmitJob' {} Maybe ArrayProperties
a -> SubmitJob
s {$sel:arrayProperties:SubmitJob' :: Maybe ArrayProperties
arrayProperties = Maybe ArrayProperties
a} :: SubmitJob)
submitJob_timeout :: Lens.Lens' SubmitJob (Prelude.Maybe JobTimeout)
submitJob_timeout :: (Maybe JobTimeout -> f (Maybe JobTimeout))
-> SubmitJob -> f SubmitJob
submitJob_timeout = (SubmitJob -> Maybe JobTimeout)
-> (SubmitJob -> Maybe JobTimeout -> SubmitJob)
-> Lens SubmitJob SubmitJob (Maybe JobTimeout) (Maybe JobTimeout)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Maybe JobTimeout
timeout :: Maybe JobTimeout
$sel:timeout:SubmitJob' :: SubmitJob -> Maybe JobTimeout
timeout} -> Maybe JobTimeout
timeout) (\s :: SubmitJob
s@SubmitJob' {} Maybe JobTimeout
a -> SubmitJob
s {$sel:timeout:SubmitJob' :: Maybe JobTimeout
timeout = Maybe JobTimeout
a} :: SubmitJob)
submitJob_tags :: Lens.Lens' SubmitJob (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
submitJob_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SubmitJob -> f SubmitJob
submitJob_tags = (SubmitJob -> Maybe (HashMap Text Text))
-> (SubmitJob -> Maybe (HashMap Text Text) -> SubmitJob)
-> Lens
SubmitJob
SubmitJob
(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 (\SubmitJob' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:SubmitJob' :: SubmitJob -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: SubmitJob
s@SubmitJob' {} Maybe (HashMap Text Text)
a -> SubmitJob
s {$sel:tags:SubmitJob' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: SubmitJob) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SubmitJob -> f SubmitJob)
-> ((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)))
-> SubmitJob
-> f SubmitJob
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
submitJob_jobName :: Lens.Lens' SubmitJob Prelude.Text
submitJob_jobName :: (Text -> f Text) -> SubmitJob -> f SubmitJob
submitJob_jobName = (SubmitJob -> Text)
-> (SubmitJob -> Text -> SubmitJob)
-> Lens SubmitJob SubmitJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Text
jobName :: Text
$sel:jobName:SubmitJob' :: SubmitJob -> Text
jobName} -> Text
jobName) (\s :: SubmitJob
s@SubmitJob' {} Text
a -> SubmitJob
s {$sel:jobName:SubmitJob' :: Text
jobName = Text
a} :: SubmitJob)
submitJob_jobQueue :: Lens.Lens' SubmitJob Prelude.Text
submitJob_jobQueue :: (Text -> f Text) -> SubmitJob -> f SubmitJob
submitJob_jobQueue = (SubmitJob -> Text)
-> (SubmitJob -> Text -> SubmitJob)
-> Lens SubmitJob SubmitJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Text
jobQueue :: Text
$sel:jobQueue:SubmitJob' :: SubmitJob -> Text
jobQueue} -> Text
jobQueue) (\s :: SubmitJob
s@SubmitJob' {} Text
a -> SubmitJob
s {$sel:jobQueue:SubmitJob' :: Text
jobQueue = Text
a} :: SubmitJob)
submitJob_jobDefinition :: Lens.Lens' SubmitJob Prelude.Text
submitJob_jobDefinition :: (Text -> f Text) -> SubmitJob -> f SubmitJob
submitJob_jobDefinition = (SubmitJob -> Text)
-> (SubmitJob -> Text -> SubmitJob)
-> Lens SubmitJob SubmitJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Text
jobDefinition :: Text
$sel:jobDefinition:SubmitJob' :: SubmitJob -> Text
jobDefinition} -> Text
jobDefinition) (\s :: SubmitJob
s@SubmitJob' {} Text
a -> SubmitJob
s {$sel:jobDefinition:SubmitJob' :: Text
jobDefinition = Text
a} :: SubmitJob)
instance Core.AWSRequest SubmitJob where
type AWSResponse SubmitJob = SubmitJobResponse
request :: SubmitJob -> Request SubmitJob
request = Service -> SubmitJob -> Request SubmitJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SubmitJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SubmitJob)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse SubmitJob))
-> Logger
-> Service
-> Proxy SubmitJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SubmitJob)))
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 Text -> Int -> Text -> Text -> SubmitJobResponse
SubmitJobResponse'
(Maybe Text -> Int -> Text -> Text -> SubmitJobResponse)
-> Either String (Maybe Text)
-> Either String (Int -> Text -> Text -> SubmitJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"jobArn")
Either String (Int -> Text -> Text -> SubmitJobResponse)
-> Either String Int
-> Either String (Text -> Text -> SubmitJobResponse)
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))
Either String (Text -> Text -> SubmitJobResponse)
-> Either String Text -> Either String (Text -> SubmitJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"jobName")
Either String (Text -> SubmitJobResponse)
-> Either String Text -> Either String SubmitJobResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"jobId")
)
instance Prelude.Hashable SubmitJob
instance Prelude.NFData SubmitJob
instance Core.ToHeaders SubmitJob where
toHeaders :: SubmitJob -> ResponseHeaders
toHeaders =
ResponseHeaders -> SubmitJob -> 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 SubmitJob where
toJSON :: SubmitJob -> Value
toJSON SubmitJob' {Maybe Bool
Maybe [JobDependency]
Maybe (HashMap Text Text)
Maybe ArrayProperties
Maybe JobTimeout
Maybe ContainerOverrides
Maybe NodeOverrides
Maybe RetryStrategy
Text
jobDefinition :: Text
jobQueue :: Text
jobName :: Text
tags :: Maybe (HashMap Text Text)
timeout :: Maybe JobTimeout
arrayProperties :: Maybe ArrayProperties
parameters :: Maybe (HashMap Text Text)
dependsOn :: Maybe [JobDependency]
retryStrategy :: Maybe RetryStrategy
containerOverrides :: Maybe ContainerOverrides
propagateTags :: Maybe Bool
nodeOverrides :: Maybe NodeOverrides
$sel:jobDefinition:SubmitJob' :: SubmitJob -> Text
$sel:jobQueue:SubmitJob' :: SubmitJob -> Text
$sel:jobName:SubmitJob' :: SubmitJob -> Text
$sel:tags:SubmitJob' :: SubmitJob -> Maybe (HashMap Text Text)
$sel:timeout:SubmitJob' :: SubmitJob -> Maybe JobTimeout
$sel:arrayProperties:SubmitJob' :: SubmitJob -> Maybe ArrayProperties
$sel:parameters:SubmitJob' :: SubmitJob -> Maybe (HashMap Text Text)
$sel:dependsOn:SubmitJob' :: SubmitJob -> Maybe [JobDependency]
$sel:retryStrategy:SubmitJob' :: SubmitJob -> Maybe RetryStrategy
$sel:containerOverrides:SubmitJob' :: SubmitJob -> Maybe ContainerOverrides
$sel:propagateTags:SubmitJob' :: SubmitJob -> Maybe Bool
$sel:nodeOverrides:SubmitJob' :: SubmitJob -> Maybe NodeOverrides
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"nodeOverrides" Text -> NodeOverrides -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NodeOverrides -> Pair) -> Maybe NodeOverrides -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NodeOverrides
nodeOverrides,
(Text
"propagateTags" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
propagateTags,
(Text
"containerOverrides" Text -> ContainerOverrides -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ContainerOverrides -> Pair)
-> Maybe ContainerOverrides -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ContainerOverrides
containerOverrides,
(Text
"retryStrategy" Text -> RetryStrategy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RetryStrategy -> Pair) -> Maybe RetryStrategy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RetryStrategy
retryStrategy,
(Text
"dependsOn" Text -> [JobDependency] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([JobDependency] -> Pair) -> Maybe [JobDependency] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [JobDependency]
dependsOn,
(Text
"parameters" 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)
parameters,
(Text
"arrayProperties" Text -> ArrayProperties -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ArrayProperties -> Pair) -> Maybe ArrayProperties -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ArrayProperties
arrayProperties,
(Text
"timeout" Text -> JobTimeout -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (JobTimeout -> Pair) -> Maybe JobTimeout -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JobTimeout
timeout,
(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
"jobName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
jobName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"jobQueue" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
jobQueue),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"jobDefinition" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
jobDefinition)
]
)
instance Core.ToPath SubmitJob where
toPath :: SubmitJob -> ByteString
toPath = ByteString -> SubmitJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/submitjob"
instance Core.ToQuery SubmitJob where
toQuery :: SubmitJob -> QueryString
toQuery = QueryString -> SubmitJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SubmitJobResponse = SubmitJobResponse'
{
SubmitJobResponse -> Maybe Text
jobArn :: Prelude.Maybe Prelude.Text,
SubmitJobResponse -> Int
httpStatus :: Prelude.Int,
SubmitJobResponse -> Text
jobName :: Prelude.Text,
SubmitJobResponse -> Text
jobId :: Prelude.Text
}
deriving (SubmitJobResponse -> SubmitJobResponse -> Bool
(SubmitJobResponse -> SubmitJobResponse -> Bool)
-> (SubmitJobResponse -> SubmitJobResponse -> Bool)
-> Eq SubmitJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SubmitJobResponse -> SubmitJobResponse -> Bool
$c/= :: SubmitJobResponse -> SubmitJobResponse -> Bool
== :: SubmitJobResponse -> SubmitJobResponse -> Bool
$c== :: SubmitJobResponse -> SubmitJobResponse -> Bool
Prelude.Eq, ReadPrec [SubmitJobResponse]
ReadPrec SubmitJobResponse
Int -> ReadS SubmitJobResponse
ReadS [SubmitJobResponse]
(Int -> ReadS SubmitJobResponse)
-> ReadS [SubmitJobResponse]
-> ReadPrec SubmitJobResponse
-> ReadPrec [SubmitJobResponse]
-> Read SubmitJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SubmitJobResponse]
$creadListPrec :: ReadPrec [SubmitJobResponse]
readPrec :: ReadPrec SubmitJobResponse
$creadPrec :: ReadPrec SubmitJobResponse
readList :: ReadS [SubmitJobResponse]
$creadList :: ReadS [SubmitJobResponse]
readsPrec :: Int -> ReadS SubmitJobResponse
$creadsPrec :: Int -> ReadS SubmitJobResponse
Prelude.Read, Int -> SubmitJobResponse -> ShowS
[SubmitJobResponse] -> ShowS
SubmitJobResponse -> String
(Int -> SubmitJobResponse -> ShowS)
-> (SubmitJobResponse -> String)
-> ([SubmitJobResponse] -> ShowS)
-> Show SubmitJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SubmitJobResponse] -> ShowS
$cshowList :: [SubmitJobResponse] -> ShowS
show :: SubmitJobResponse -> String
$cshow :: SubmitJobResponse -> String
showsPrec :: Int -> SubmitJobResponse -> ShowS
$cshowsPrec :: Int -> SubmitJobResponse -> ShowS
Prelude.Show, (forall x. SubmitJobResponse -> Rep SubmitJobResponse x)
-> (forall x. Rep SubmitJobResponse x -> SubmitJobResponse)
-> Generic SubmitJobResponse
forall x. Rep SubmitJobResponse x -> SubmitJobResponse
forall x. SubmitJobResponse -> Rep SubmitJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SubmitJobResponse x -> SubmitJobResponse
$cfrom :: forall x. SubmitJobResponse -> Rep SubmitJobResponse x
Prelude.Generic)
newSubmitJobResponse ::
Prelude.Int ->
Prelude.Text ->
Prelude.Text ->
SubmitJobResponse
newSubmitJobResponse :: Int -> Text -> Text -> SubmitJobResponse
newSubmitJobResponse Int
pHttpStatus_ Text
pJobName_ Text
pJobId_ =
SubmitJobResponse' :: Maybe Text -> Int -> Text -> Text -> SubmitJobResponse
SubmitJobResponse'
{ $sel:jobArn:SubmitJobResponse' :: Maybe Text
jobArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:SubmitJobResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:jobName:SubmitJobResponse' :: Text
jobName = Text
pJobName_,
$sel:jobId:SubmitJobResponse' :: Text
jobId = Text
pJobId_
}
submitJobResponse_jobArn :: Lens.Lens' SubmitJobResponse (Prelude.Maybe Prelude.Text)
submitJobResponse_jobArn :: (Maybe Text -> f (Maybe Text))
-> SubmitJobResponse -> f SubmitJobResponse
submitJobResponse_jobArn = (SubmitJobResponse -> Maybe Text)
-> (SubmitJobResponse -> Maybe Text -> SubmitJobResponse)
-> Lens
SubmitJobResponse SubmitJobResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJobResponse' {Maybe Text
jobArn :: Maybe Text
$sel:jobArn:SubmitJobResponse' :: SubmitJobResponse -> Maybe Text
jobArn} -> Maybe Text
jobArn) (\s :: SubmitJobResponse
s@SubmitJobResponse' {} Maybe Text
a -> SubmitJobResponse
s {$sel:jobArn:SubmitJobResponse' :: Maybe Text
jobArn = Maybe Text
a} :: SubmitJobResponse)
submitJobResponse_httpStatus :: Lens.Lens' SubmitJobResponse Prelude.Int
submitJobResponse_httpStatus :: (Int -> f Int) -> SubmitJobResponse -> f SubmitJobResponse
submitJobResponse_httpStatus = (SubmitJobResponse -> Int)
-> (SubmitJobResponse -> Int -> SubmitJobResponse)
-> Lens SubmitJobResponse SubmitJobResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:SubmitJobResponse' :: SubmitJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SubmitJobResponse
s@SubmitJobResponse' {} Int
a -> SubmitJobResponse
s {$sel:httpStatus:SubmitJobResponse' :: Int
httpStatus = Int
a} :: SubmitJobResponse)
submitJobResponse_jobName :: Lens.Lens' SubmitJobResponse Prelude.Text
submitJobResponse_jobName :: (Text -> f Text) -> SubmitJobResponse -> f SubmitJobResponse
submitJobResponse_jobName = (SubmitJobResponse -> Text)
-> (SubmitJobResponse -> Text -> SubmitJobResponse)
-> Lens SubmitJobResponse SubmitJobResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJobResponse' {Text
jobName :: Text
$sel:jobName:SubmitJobResponse' :: SubmitJobResponse -> Text
jobName} -> Text
jobName) (\s :: SubmitJobResponse
s@SubmitJobResponse' {} Text
a -> SubmitJobResponse
s {$sel:jobName:SubmitJobResponse' :: Text
jobName = Text
a} :: SubmitJobResponse)
submitJobResponse_jobId :: Lens.Lens' SubmitJobResponse Prelude.Text
submitJobResponse_jobId :: (Text -> f Text) -> SubmitJobResponse -> f SubmitJobResponse
submitJobResponse_jobId = (SubmitJobResponse -> Text)
-> (SubmitJobResponse -> Text -> SubmitJobResponse)
-> Lens SubmitJobResponse SubmitJobResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJobResponse' {Text
jobId :: Text
$sel:jobId:SubmitJobResponse' :: SubmitJobResponse -> Text
jobId} -> Text
jobId) (\s :: SubmitJobResponse
s@SubmitJobResponse' {} Text
a -> SubmitJobResponse
s {$sel:jobId:SubmitJobResponse' :: Text
jobId = Text
a} :: SubmitJobResponse)
instance Prelude.NFData SubmitJobResponse