{-# 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.RegisterJobDefinition
(
RegisterJobDefinition (..),
newRegisterJobDefinition,
registerJobDefinition_propagateTags,
registerJobDefinition_retryStrategy,
registerJobDefinition_platformCapabilities,
registerJobDefinition_parameters,
registerJobDefinition_timeout,
registerJobDefinition_containerProperties,
registerJobDefinition_nodeProperties,
registerJobDefinition_tags,
registerJobDefinition_jobDefinitionName,
registerJobDefinition_type,
RegisterJobDefinitionResponse (..),
newRegisterJobDefinitionResponse,
registerJobDefinitionResponse_httpStatus,
registerJobDefinitionResponse_jobDefinitionName,
registerJobDefinitionResponse_jobDefinitionArn,
registerJobDefinitionResponse_revision,
)
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 RegisterJobDefinition = RegisterJobDefinition'
{
RegisterJobDefinition -> Maybe Bool
propagateTags :: Prelude.Maybe Prelude.Bool,
RegisterJobDefinition -> Maybe RetryStrategy
retryStrategy :: Prelude.Maybe RetryStrategy,
RegisterJobDefinition -> Maybe [PlatformCapability]
platformCapabilities :: Prelude.Maybe [PlatformCapability],
RegisterJobDefinition -> Maybe (HashMap Text Text)
parameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
RegisterJobDefinition -> Maybe JobTimeout
timeout :: Prelude.Maybe JobTimeout,
RegisterJobDefinition -> Maybe ContainerProperties
containerProperties :: Prelude.Maybe ContainerProperties,
RegisterJobDefinition -> Maybe NodeProperties
nodeProperties :: Prelude.Maybe NodeProperties,
RegisterJobDefinition -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
RegisterJobDefinition -> Text
jobDefinitionName :: Prelude.Text,
RegisterJobDefinition -> JobDefinitionType
type' :: JobDefinitionType
}
deriving (RegisterJobDefinition -> RegisterJobDefinition -> Bool
(RegisterJobDefinition -> RegisterJobDefinition -> Bool)
-> (RegisterJobDefinition -> RegisterJobDefinition -> Bool)
-> Eq RegisterJobDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterJobDefinition -> RegisterJobDefinition -> Bool
$c/= :: RegisterJobDefinition -> RegisterJobDefinition -> Bool
== :: RegisterJobDefinition -> RegisterJobDefinition -> Bool
$c== :: RegisterJobDefinition -> RegisterJobDefinition -> Bool
Prelude.Eq, ReadPrec [RegisterJobDefinition]
ReadPrec RegisterJobDefinition
Int -> ReadS RegisterJobDefinition
ReadS [RegisterJobDefinition]
(Int -> ReadS RegisterJobDefinition)
-> ReadS [RegisterJobDefinition]
-> ReadPrec RegisterJobDefinition
-> ReadPrec [RegisterJobDefinition]
-> Read RegisterJobDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterJobDefinition]
$creadListPrec :: ReadPrec [RegisterJobDefinition]
readPrec :: ReadPrec RegisterJobDefinition
$creadPrec :: ReadPrec RegisterJobDefinition
readList :: ReadS [RegisterJobDefinition]
$creadList :: ReadS [RegisterJobDefinition]
readsPrec :: Int -> ReadS RegisterJobDefinition
$creadsPrec :: Int -> ReadS RegisterJobDefinition
Prelude.Read, Int -> RegisterJobDefinition -> ShowS
[RegisterJobDefinition] -> ShowS
RegisterJobDefinition -> String
(Int -> RegisterJobDefinition -> ShowS)
-> (RegisterJobDefinition -> String)
-> ([RegisterJobDefinition] -> ShowS)
-> Show RegisterJobDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterJobDefinition] -> ShowS
$cshowList :: [RegisterJobDefinition] -> ShowS
show :: RegisterJobDefinition -> String
$cshow :: RegisterJobDefinition -> String
showsPrec :: Int -> RegisterJobDefinition -> ShowS
$cshowsPrec :: Int -> RegisterJobDefinition -> ShowS
Prelude.Show, (forall x. RegisterJobDefinition -> Rep RegisterJobDefinition x)
-> (forall x. Rep RegisterJobDefinition x -> RegisterJobDefinition)
-> Generic RegisterJobDefinition
forall x. Rep RegisterJobDefinition x -> RegisterJobDefinition
forall x. RegisterJobDefinition -> Rep RegisterJobDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegisterJobDefinition x -> RegisterJobDefinition
$cfrom :: forall x. RegisterJobDefinition -> Rep RegisterJobDefinition x
Prelude.Generic)
newRegisterJobDefinition ::
Prelude.Text ->
JobDefinitionType ->
RegisterJobDefinition
newRegisterJobDefinition :: Text -> JobDefinitionType -> RegisterJobDefinition
newRegisterJobDefinition Text
pJobDefinitionName_ JobDefinitionType
pType_ =
RegisterJobDefinition' :: Maybe Bool
-> Maybe RetryStrategy
-> Maybe [PlatformCapability]
-> Maybe (HashMap Text Text)
-> Maybe JobTimeout
-> Maybe ContainerProperties
-> Maybe NodeProperties
-> Maybe (HashMap Text Text)
-> Text
-> JobDefinitionType
-> RegisterJobDefinition
RegisterJobDefinition'
{ $sel:propagateTags:RegisterJobDefinition' :: Maybe Bool
propagateTags =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:retryStrategy:RegisterJobDefinition' :: Maybe RetryStrategy
retryStrategy = Maybe RetryStrategy
forall a. Maybe a
Prelude.Nothing,
$sel:platformCapabilities:RegisterJobDefinition' :: Maybe [PlatformCapability]
platformCapabilities = Maybe [PlatformCapability]
forall a. Maybe a
Prelude.Nothing,
$sel:parameters:RegisterJobDefinition' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:timeout:RegisterJobDefinition' :: Maybe JobTimeout
timeout = Maybe JobTimeout
forall a. Maybe a
Prelude.Nothing,
$sel:containerProperties:RegisterJobDefinition' :: Maybe ContainerProperties
containerProperties = Maybe ContainerProperties
forall a. Maybe a
Prelude.Nothing,
$sel:nodeProperties:RegisterJobDefinition' :: Maybe NodeProperties
nodeProperties = Maybe NodeProperties
forall a. Maybe a
Prelude.Nothing,
$sel:tags:RegisterJobDefinition' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:jobDefinitionName:RegisterJobDefinition' :: Text
jobDefinitionName = Text
pJobDefinitionName_,
$sel:type':RegisterJobDefinition' :: JobDefinitionType
type' = JobDefinitionType
pType_
}
registerJobDefinition_propagateTags :: Lens.Lens' RegisterJobDefinition (Prelude.Maybe Prelude.Bool)
registerJobDefinition_propagateTags :: (Maybe Bool -> f (Maybe Bool))
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_propagateTags = (RegisterJobDefinition -> Maybe Bool)
-> (RegisterJobDefinition -> Maybe Bool -> RegisterJobDefinition)
-> Lens
RegisterJobDefinition
RegisterJobDefinition
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinition' {Maybe Bool
propagateTags :: Maybe Bool
$sel:propagateTags:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe Bool
propagateTags} -> Maybe Bool
propagateTags) (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} Maybe Bool
a -> RegisterJobDefinition
s {$sel:propagateTags:RegisterJobDefinition' :: Maybe Bool
propagateTags = Maybe Bool
a} :: RegisterJobDefinition)
registerJobDefinition_retryStrategy :: Lens.Lens' RegisterJobDefinition (Prelude.Maybe RetryStrategy)
registerJobDefinition_retryStrategy :: (Maybe RetryStrategy -> f (Maybe RetryStrategy))
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_retryStrategy = (RegisterJobDefinition -> Maybe RetryStrategy)
-> (RegisterJobDefinition
-> Maybe RetryStrategy -> RegisterJobDefinition)
-> Lens
RegisterJobDefinition
RegisterJobDefinition
(Maybe RetryStrategy)
(Maybe RetryStrategy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinition' {Maybe RetryStrategy
retryStrategy :: Maybe RetryStrategy
$sel:retryStrategy:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe RetryStrategy
retryStrategy} -> Maybe RetryStrategy
retryStrategy) (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} Maybe RetryStrategy
a -> RegisterJobDefinition
s {$sel:retryStrategy:RegisterJobDefinition' :: Maybe RetryStrategy
retryStrategy = Maybe RetryStrategy
a} :: RegisterJobDefinition)
registerJobDefinition_platformCapabilities :: Lens.Lens' RegisterJobDefinition (Prelude.Maybe [PlatformCapability])
registerJobDefinition_platformCapabilities :: (Maybe [PlatformCapability] -> f (Maybe [PlatformCapability]))
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_platformCapabilities = (RegisterJobDefinition -> Maybe [PlatformCapability])
-> (RegisterJobDefinition
-> Maybe [PlatformCapability] -> RegisterJobDefinition)
-> Lens
RegisterJobDefinition
RegisterJobDefinition
(Maybe [PlatformCapability])
(Maybe [PlatformCapability])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinition' {Maybe [PlatformCapability]
platformCapabilities :: Maybe [PlatformCapability]
$sel:platformCapabilities:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe [PlatformCapability]
platformCapabilities} -> Maybe [PlatformCapability]
platformCapabilities) (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} Maybe [PlatformCapability]
a -> RegisterJobDefinition
s {$sel:platformCapabilities:RegisterJobDefinition' :: Maybe [PlatformCapability]
platformCapabilities = Maybe [PlatformCapability]
a} :: RegisterJobDefinition) ((Maybe [PlatformCapability] -> f (Maybe [PlatformCapability]))
-> RegisterJobDefinition -> f RegisterJobDefinition)
-> ((Maybe [PlatformCapability] -> f (Maybe [PlatformCapability]))
-> Maybe [PlatformCapability] -> f (Maybe [PlatformCapability]))
-> (Maybe [PlatformCapability] -> f (Maybe [PlatformCapability]))
-> RegisterJobDefinition
-> f RegisterJobDefinition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[PlatformCapability]
[PlatformCapability]
[PlatformCapability]
[PlatformCapability]
-> Iso
(Maybe [PlatformCapability])
(Maybe [PlatformCapability])
(Maybe [PlatformCapability])
(Maybe [PlatformCapability])
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
[PlatformCapability]
[PlatformCapability]
[PlatformCapability]
[PlatformCapability]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
registerJobDefinition_parameters :: Lens.Lens' RegisterJobDefinition (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
registerJobDefinition_parameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_parameters = (RegisterJobDefinition -> Maybe (HashMap Text Text))
-> (RegisterJobDefinition
-> Maybe (HashMap Text Text) -> RegisterJobDefinition)
-> Lens
RegisterJobDefinition
RegisterJobDefinition
(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 (\RegisterJobDefinition' {Maybe (HashMap Text Text)
parameters :: Maybe (HashMap Text Text)
$sel:parameters:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe (HashMap Text Text)
parameters} -> Maybe (HashMap Text Text)
parameters) (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} Maybe (HashMap Text Text)
a -> RegisterJobDefinition
s {$sel:parameters:RegisterJobDefinition' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
a} :: RegisterJobDefinition) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> RegisterJobDefinition -> f RegisterJobDefinition)
-> ((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)))
-> RegisterJobDefinition
-> f RegisterJobDefinition
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
registerJobDefinition_timeout :: Lens.Lens' RegisterJobDefinition (Prelude.Maybe JobTimeout)
registerJobDefinition_timeout :: (Maybe JobTimeout -> f (Maybe JobTimeout))
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_timeout = (RegisterJobDefinition -> Maybe JobTimeout)
-> (RegisterJobDefinition
-> Maybe JobTimeout -> RegisterJobDefinition)
-> Lens
RegisterJobDefinition
RegisterJobDefinition
(Maybe JobTimeout)
(Maybe JobTimeout)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinition' {Maybe JobTimeout
timeout :: Maybe JobTimeout
$sel:timeout:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe JobTimeout
timeout} -> Maybe JobTimeout
timeout) (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} Maybe JobTimeout
a -> RegisterJobDefinition
s {$sel:timeout:RegisterJobDefinition' :: Maybe JobTimeout
timeout = Maybe JobTimeout
a} :: RegisterJobDefinition)
registerJobDefinition_containerProperties :: Lens.Lens' RegisterJobDefinition (Prelude.Maybe ContainerProperties)
registerJobDefinition_containerProperties :: (Maybe ContainerProperties -> f (Maybe ContainerProperties))
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_containerProperties = (RegisterJobDefinition -> Maybe ContainerProperties)
-> (RegisterJobDefinition
-> Maybe ContainerProperties -> RegisterJobDefinition)
-> Lens
RegisterJobDefinition
RegisterJobDefinition
(Maybe ContainerProperties)
(Maybe ContainerProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinition' {Maybe ContainerProperties
containerProperties :: Maybe ContainerProperties
$sel:containerProperties:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe ContainerProperties
containerProperties} -> Maybe ContainerProperties
containerProperties) (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} Maybe ContainerProperties
a -> RegisterJobDefinition
s {$sel:containerProperties:RegisterJobDefinition' :: Maybe ContainerProperties
containerProperties = Maybe ContainerProperties
a} :: RegisterJobDefinition)
registerJobDefinition_nodeProperties :: Lens.Lens' RegisterJobDefinition (Prelude.Maybe NodeProperties)
registerJobDefinition_nodeProperties :: (Maybe NodeProperties -> f (Maybe NodeProperties))
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_nodeProperties = (RegisterJobDefinition -> Maybe NodeProperties)
-> (RegisterJobDefinition
-> Maybe NodeProperties -> RegisterJobDefinition)
-> Lens
RegisterJobDefinition
RegisterJobDefinition
(Maybe NodeProperties)
(Maybe NodeProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinition' {Maybe NodeProperties
nodeProperties :: Maybe NodeProperties
$sel:nodeProperties:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe NodeProperties
nodeProperties} -> Maybe NodeProperties
nodeProperties) (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} Maybe NodeProperties
a -> RegisterJobDefinition
s {$sel:nodeProperties:RegisterJobDefinition' :: Maybe NodeProperties
nodeProperties = Maybe NodeProperties
a} :: RegisterJobDefinition)
registerJobDefinition_tags :: Lens.Lens' RegisterJobDefinition (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
registerJobDefinition_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_tags = (RegisterJobDefinition -> Maybe (HashMap Text Text))
-> (RegisterJobDefinition
-> Maybe (HashMap Text Text) -> RegisterJobDefinition)
-> Lens
RegisterJobDefinition
RegisterJobDefinition
(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 (\RegisterJobDefinition' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} Maybe (HashMap Text Text)
a -> RegisterJobDefinition
s {$sel:tags:RegisterJobDefinition' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: RegisterJobDefinition) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> RegisterJobDefinition -> f RegisterJobDefinition)
-> ((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)))
-> RegisterJobDefinition
-> f RegisterJobDefinition
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
registerJobDefinition_jobDefinitionName :: Lens.Lens' RegisterJobDefinition Prelude.Text
registerJobDefinition_jobDefinitionName :: (Text -> f Text)
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_jobDefinitionName = (RegisterJobDefinition -> Text)
-> (RegisterJobDefinition -> Text -> RegisterJobDefinition)
-> Lens RegisterJobDefinition RegisterJobDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinition' {Text
jobDefinitionName :: Text
$sel:jobDefinitionName:RegisterJobDefinition' :: RegisterJobDefinition -> Text
jobDefinitionName} -> Text
jobDefinitionName) (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} Text
a -> RegisterJobDefinition
s {$sel:jobDefinitionName:RegisterJobDefinition' :: Text
jobDefinitionName = Text
a} :: RegisterJobDefinition)
registerJobDefinition_type :: Lens.Lens' RegisterJobDefinition JobDefinitionType
registerJobDefinition_type :: (JobDefinitionType -> f JobDefinitionType)
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_type = (RegisterJobDefinition -> JobDefinitionType)
-> (RegisterJobDefinition
-> JobDefinitionType -> RegisterJobDefinition)
-> Lens
RegisterJobDefinition
RegisterJobDefinition
JobDefinitionType
JobDefinitionType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinition' {JobDefinitionType
type' :: JobDefinitionType
$sel:type':RegisterJobDefinition' :: RegisterJobDefinition -> JobDefinitionType
type'} -> JobDefinitionType
type') (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} JobDefinitionType
a -> RegisterJobDefinition
s {$sel:type':RegisterJobDefinition' :: JobDefinitionType
type' = JobDefinitionType
a} :: RegisterJobDefinition)
instance Core.AWSRequest RegisterJobDefinition where
type
AWSResponse RegisterJobDefinition =
RegisterJobDefinitionResponse
request :: RegisterJobDefinition -> Request RegisterJobDefinition
request = Service -> RegisterJobDefinition -> Request RegisterJobDefinition
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RegisterJobDefinition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RegisterJobDefinition)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse RegisterJobDefinition))
-> Logger
-> Service
-> Proxy RegisterJobDefinition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RegisterJobDefinition)))
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 ->
Int -> Text -> Text -> Int -> RegisterJobDefinitionResponse
RegisterJobDefinitionResponse'
(Int -> Text -> Text -> Int -> RegisterJobDefinitionResponse)
-> Either String Int
-> Either
String (Text -> Text -> Int -> RegisterJobDefinitionResponse)
forall (f :: * -> *) a b. Functor 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 -> Int -> RegisterJobDefinitionResponse)
-> Either String Text
-> Either String (Text -> Int -> RegisterJobDefinitionResponse)
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
"jobDefinitionName")
Either String (Text -> Int -> RegisterJobDefinitionResponse)
-> Either String Text
-> Either String (Int -> RegisterJobDefinitionResponse)
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
"jobDefinitionArn")
Either String (Int -> RegisterJobDefinitionResponse)
-> Either String Int -> Either String RegisterJobDefinitionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Int
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"revision")
)
instance Prelude.Hashable RegisterJobDefinition
instance Prelude.NFData RegisterJobDefinition
instance Core.ToHeaders RegisterJobDefinition where
toHeaders :: RegisterJobDefinition -> ResponseHeaders
toHeaders =
ResponseHeaders -> RegisterJobDefinition -> 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 RegisterJobDefinition where
toJSON :: RegisterJobDefinition -> Value
toJSON RegisterJobDefinition' {Maybe Bool
Maybe [PlatformCapability]
Maybe (HashMap Text Text)
Maybe JobTimeout
Maybe RetryStrategy
Maybe ContainerProperties
Maybe NodeProperties
Text
JobDefinitionType
type' :: JobDefinitionType
jobDefinitionName :: Text
tags :: Maybe (HashMap Text Text)
nodeProperties :: Maybe NodeProperties
containerProperties :: Maybe ContainerProperties
timeout :: Maybe JobTimeout
parameters :: Maybe (HashMap Text Text)
platformCapabilities :: Maybe [PlatformCapability]
retryStrategy :: Maybe RetryStrategy
propagateTags :: Maybe Bool
$sel:type':RegisterJobDefinition' :: RegisterJobDefinition -> JobDefinitionType
$sel:jobDefinitionName:RegisterJobDefinition' :: RegisterJobDefinition -> Text
$sel:tags:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe (HashMap Text Text)
$sel:nodeProperties:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe NodeProperties
$sel:containerProperties:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe ContainerProperties
$sel:timeout:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe JobTimeout
$sel:parameters:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe (HashMap Text Text)
$sel:platformCapabilities:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe [PlatformCapability]
$sel:retryStrategy:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe RetryStrategy
$sel:propagateTags:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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
"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
"platformCapabilities" Text -> [PlatformCapability] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([PlatformCapability] -> Pair)
-> Maybe [PlatformCapability] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PlatformCapability]
platformCapabilities,
(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
"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
"containerProperties" Text -> ContainerProperties -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ContainerProperties -> Pair)
-> Maybe ContainerProperties -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ContainerProperties
containerProperties,
(Text
"nodeProperties" Text -> NodeProperties -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NodeProperties -> Pair) -> Maybe NodeProperties -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NodeProperties
nodeProperties,
(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
"jobDefinitionName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
jobDefinitionName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"type" Text -> JobDefinitionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= JobDefinitionType
type')
]
)
instance Core.ToPath RegisterJobDefinition where
toPath :: RegisterJobDefinition -> ByteString
toPath = ByteString -> RegisterJobDefinition -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/registerjobdefinition"
instance Core.ToQuery RegisterJobDefinition where
toQuery :: RegisterJobDefinition -> QueryString
toQuery = QueryString -> RegisterJobDefinition -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RegisterJobDefinitionResponse = RegisterJobDefinitionResponse'
{
RegisterJobDefinitionResponse -> Int
httpStatus :: Prelude.Int,
RegisterJobDefinitionResponse -> Text
jobDefinitionName :: Prelude.Text,
RegisterJobDefinitionResponse -> Text
jobDefinitionArn :: Prelude.Text,
RegisterJobDefinitionResponse -> Int
revision :: Prelude.Int
}
deriving (RegisterJobDefinitionResponse
-> RegisterJobDefinitionResponse -> Bool
(RegisterJobDefinitionResponse
-> RegisterJobDefinitionResponse -> Bool)
-> (RegisterJobDefinitionResponse
-> RegisterJobDefinitionResponse -> Bool)
-> Eq RegisterJobDefinitionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterJobDefinitionResponse
-> RegisterJobDefinitionResponse -> Bool
$c/= :: RegisterJobDefinitionResponse
-> RegisterJobDefinitionResponse -> Bool
== :: RegisterJobDefinitionResponse
-> RegisterJobDefinitionResponse -> Bool
$c== :: RegisterJobDefinitionResponse
-> RegisterJobDefinitionResponse -> Bool
Prelude.Eq, ReadPrec [RegisterJobDefinitionResponse]
ReadPrec RegisterJobDefinitionResponse
Int -> ReadS RegisterJobDefinitionResponse
ReadS [RegisterJobDefinitionResponse]
(Int -> ReadS RegisterJobDefinitionResponse)
-> ReadS [RegisterJobDefinitionResponse]
-> ReadPrec RegisterJobDefinitionResponse
-> ReadPrec [RegisterJobDefinitionResponse]
-> Read RegisterJobDefinitionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterJobDefinitionResponse]
$creadListPrec :: ReadPrec [RegisterJobDefinitionResponse]
readPrec :: ReadPrec RegisterJobDefinitionResponse
$creadPrec :: ReadPrec RegisterJobDefinitionResponse
readList :: ReadS [RegisterJobDefinitionResponse]
$creadList :: ReadS [RegisterJobDefinitionResponse]
readsPrec :: Int -> ReadS RegisterJobDefinitionResponse
$creadsPrec :: Int -> ReadS RegisterJobDefinitionResponse
Prelude.Read, Int -> RegisterJobDefinitionResponse -> ShowS
[RegisterJobDefinitionResponse] -> ShowS
RegisterJobDefinitionResponse -> String
(Int -> RegisterJobDefinitionResponse -> ShowS)
-> (RegisterJobDefinitionResponse -> String)
-> ([RegisterJobDefinitionResponse] -> ShowS)
-> Show RegisterJobDefinitionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterJobDefinitionResponse] -> ShowS
$cshowList :: [RegisterJobDefinitionResponse] -> ShowS
show :: RegisterJobDefinitionResponse -> String
$cshow :: RegisterJobDefinitionResponse -> String
showsPrec :: Int -> RegisterJobDefinitionResponse -> ShowS
$cshowsPrec :: Int -> RegisterJobDefinitionResponse -> ShowS
Prelude.Show, (forall x.
RegisterJobDefinitionResponse
-> Rep RegisterJobDefinitionResponse x)
-> (forall x.
Rep RegisterJobDefinitionResponse x
-> RegisterJobDefinitionResponse)
-> Generic RegisterJobDefinitionResponse
forall x.
Rep RegisterJobDefinitionResponse x
-> RegisterJobDefinitionResponse
forall x.
RegisterJobDefinitionResponse
-> Rep RegisterJobDefinitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RegisterJobDefinitionResponse x
-> RegisterJobDefinitionResponse
$cfrom :: forall x.
RegisterJobDefinitionResponse
-> Rep RegisterJobDefinitionResponse x
Prelude.Generic)
newRegisterJobDefinitionResponse ::
Prelude.Int ->
Prelude.Text ->
Prelude.Text ->
Prelude.Int ->
RegisterJobDefinitionResponse
newRegisterJobDefinitionResponse :: Int -> Text -> Text -> Int -> RegisterJobDefinitionResponse
newRegisterJobDefinitionResponse
Int
pHttpStatus_
Text
pJobDefinitionName_
Text
pJobDefinitionArn_
Int
pRevision_ =
RegisterJobDefinitionResponse' :: Int -> Text -> Text -> Int -> RegisterJobDefinitionResponse
RegisterJobDefinitionResponse'
{ $sel:httpStatus:RegisterJobDefinitionResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:jobDefinitionName:RegisterJobDefinitionResponse' :: Text
jobDefinitionName = Text
pJobDefinitionName_,
$sel:jobDefinitionArn:RegisterJobDefinitionResponse' :: Text
jobDefinitionArn = Text
pJobDefinitionArn_,
$sel:revision:RegisterJobDefinitionResponse' :: Int
revision = Int
pRevision_
}
registerJobDefinitionResponse_httpStatus :: Lens.Lens' RegisterJobDefinitionResponse Prelude.Int
registerJobDefinitionResponse_httpStatus :: (Int -> f Int)
-> RegisterJobDefinitionResponse -> f RegisterJobDefinitionResponse
registerJobDefinitionResponse_httpStatus = (RegisterJobDefinitionResponse -> Int)
-> (RegisterJobDefinitionResponse
-> Int -> RegisterJobDefinitionResponse)
-> Lens
RegisterJobDefinitionResponse RegisterJobDefinitionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:RegisterJobDefinitionResponse' :: RegisterJobDefinitionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RegisterJobDefinitionResponse
s@RegisterJobDefinitionResponse' {} Int
a -> RegisterJobDefinitionResponse
s {$sel:httpStatus:RegisterJobDefinitionResponse' :: Int
httpStatus = Int
a} :: RegisterJobDefinitionResponse)
registerJobDefinitionResponse_jobDefinitionName :: Lens.Lens' RegisterJobDefinitionResponse Prelude.Text
registerJobDefinitionResponse_jobDefinitionName :: (Text -> f Text)
-> RegisterJobDefinitionResponse -> f RegisterJobDefinitionResponse
registerJobDefinitionResponse_jobDefinitionName = (RegisterJobDefinitionResponse -> Text)
-> (RegisterJobDefinitionResponse
-> Text -> RegisterJobDefinitionResponse)
-> Lens
RegisterJobDefinitionResponse
RegisterJobDefinitionResponse
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinitionResponse' {Text
jobDefinitionName :: Text
$sel:jobDefinitionName:RegisterJobDefinitionResponse' :: RegisterJobDefinitionResponse -> Text
jobDefinitionName} -> Text
jobDefinitionName) (\s :: RegisterJobDefinitionResponse
s@RegisterJobDefinitionResponse' {} Text
a -> RegisterJobDefinitionResponse
s {$sel:jobDefinitionName:RegisterJobDefinitionResponse' :: Text
jobDefinitionName = Text
a} :: RegisterJobDefinitionResponse)
registerJobDefinitionResponse_jobDefinitionArn :: Lens.Lens' RegisterJobDefinitionResponse Prelude.Text
registerJobDefinitionResponse_jobDefinitionArn :: (Text -> f Text)
-> RegisterJobDefinitionResponse -> f RegisterJobDefinitionResponse
registerJobDefinitionResponse_jobDefinitionArn = (RegisterJobDefinitionResponse -> Text)
-> (RegisterJobDefinitionResponse
-> Text -> RegisterJobDefinitionResponse)
-> Lens
RegisterJobDefinitionResponse
RegisterJobDefinitionResponse
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinitionResponse' {Text
jobDefinitionArn :: Text
$sel:jobDefinitionArn:RegisterJobDefinitionResponse' :: RegisterJobDefinitionResponse -> Text
jobDefinitionArn} -> Text
jobDefinitionArn) (\s :: RegisterJobDefinitionResponse
s@RegisterJobDefinitionResponse' {} Text
a -> RegisterJobDefinitionResponse
s {$sel:jobDefinitionArn:RegisterJobDefinitionResponse' :: Text
jobDefinitionArn = Text
a} :: RegisterJobDefinitionResponse)
registerJobDefinitionResponse_revision :: Lens.Lens' RegisterJobDefinitionResponse Prelude.Int
registerJobDefinitionResponse_revision :: (Int -> f Int)
-> RegisterJobDefinitionResponse -> f RegisterJobDefinitionResponse
registerJobDefinitionResponse_revision = (RegisterJobDefinitionResponse -> Int)
-> (RegisterJobDefinitionResponse
-> Int -> RegisterJobDefinitionResponse)
-> Lens
RegisterJobDefinitionResponse RegisterJobDefinitionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinitionResponse' {Int
revision :: Int
$sel:revision:RegisterJobDefinitionResponse' :: RegisterJobDefinitionResponse -> Int
revision} -> Int
revision) (\s :: RegisterJobDefinitionResponse
s@RegisterJobDefinitionResponse' {} Int
a -> RegisterJobDefinitionResponse
s {$sel:revision:RegisterJobDefinitionResponse' :: Int
revision = Int
a} :: RegisterJobDefinitionResponse)
instance Prelude.NFData RegisterJobDefinitionResponse