{-# 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.IoT.CreateJobTemplate
(
CreateJobTemplate (..),
newCreateJobTemplate,
createJobTemplate_jobExecutionsRolloutConfig,
createJobTemplate_jobArn,
createJobTemplate_documentSource,
createJobTemplate_abortConfig,
createJobTemplate_presignedUrlConfig,
createJobTemplate_document,
createJobTemplate_timeoutConfig,
createJobTemplate_tags,
createJobTemplate_jobTemplateId,
createJobTemplate_description,
CreateJobTemplateResponse (..),
newCreateJobTemplateResponse,
createJobTemplateResponse_jobTemplateId,
createJobTemplateResponse_jobTemplateArn,
createJobTemplateResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoT.Types
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 CreateJobTemplate = CreateJobTemplate'
{ CreateJobTemplate -> Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig :: Prelude.Maybe JobExecutionsRolloutConfig,
CreateJobTemplate -> Maybe Text
jobArn :: Prelude.Maybe Prelude.Text,
CreateJobTemplate -> Maybe Text
documentSource :: Prelude.Maybe Prelude.Text,
CreateJobTemplate -> Maybe AbortConfig
abortConfig :: Prelude.Maybe AbortConfig,
CreateJobTemplate -> Maybe PresignedUrlConfig
presignedUrlConfig :: Prelude.Maybe PresignedUrlConfig,
CreateJobTemplate -> Maybe Text
document :: Prelude.Maybe Prelude.Text,
CreateJobTemplate -> Maybe TimeoutConfig
timeoutConfig :: Prelude.Maybe TimeoutConfig,
CreateJobTemplate -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateJobTemplate -> Text
jobTemplateId :: Prelude.Text,
CreateJobTemplate -> Text
description :: Prelude.Text
}
deriving (CreateJobTemplate -> CreateJobTemplate -> Bool
(CreateJobTemplate -> CreateJobTemplate -> Bool)
-> (CreateJobTemplate -> CreateJobTemplate -> Bool)
-> Eq CreateJobTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateJobTemplate -> CreateJobTemplate -> Bool
$c/= :: CreateJobTemplate -> CreateJobTemplate -> Bool
== :: CreateJobTemplate -> CreateJobTemplate -> Bool
$c== :: CreateJobTemplate -> CreateJobTemplate -> Bool
Prelude.Eq, ReadPrec [CreateJobTemplate]
ReadPrec CreateJobTemplate
Int -> ReadS CreateJobTemplate
ReadS [CreateJobTemplate]
(Int -> ReadS CreateJobTemplate)
-> ReadS [CreateJobTemplate]
-> ReadPrec CreateJobTemplate
-> ReadPrec [CreateJobTemplate]
-> Read CreateJobTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateJobTemplate]
$creadListPrec :: ReadPrec [CreateJobTemplate]
readPrec :: ReadPrec CreateJobTemplate
$creadPrec :: ReadPrec CreateJobTemplate
readList :: ReadS [CreateJobTemplate]
$creadList :: ReadS [CreateJobTemplate]
readsPrec :: Int -> ReadS CreateJobTemplate
$creadsPrec :: Int -> ReadS CreateJobTemplate
Prelude.Read, Int -> CreateJobTemplate -> ShowS
[CreateJobTemplate] -> ShowS
CreateJobTemplate -> String
(Int -> CreateJobTemplate -> ShowS)
-> (CreateJobTemplate -> String)
-> ([CreateJobTemplate] -> ShowS)
-> Show CreateJobTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateJobTemplate] -> ShowS
$cshowList :: [CreateJobTemplate] -> ShowS
show :: CreateJobTemplate -> String
$cshow :: CreateJobTemplate -> String
showsPrec :: Int -> CreateJobTemplate -> ShowS
$cshowsPrec :: Int -> CreateJobTemplate -> ShowS
Prelude.Show, (forall x. CreateJobTemplate -> Rep CreateJobTemplate x)
-> (forall x. Rep CreateJobTemplate x -> CreateJobTemplate)
-> Generic CreateJobTemplate
forall x. Rep CreateJobTemplate x -> CreateJobTemplate
forall x. CreateJobTemplate -> Rep CreateJobTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateJobTemplate x -> CreateJobTemplate
$cfrom :: forall x. CreateJobTemplate -> Rep CreateJobTemplate x
Prelude.Generic)
newCreateJobTemplate ::
Prelude.Text ->
Prelude.Text ->
CreateJobTemplate
newCreateJobTemplate :: Text -> Text -> CreateJobTemplate
newCreateJobTemplate Text
pJobTemplateId_ Text
pDescription_ =
CreateJobTemplate' :: Maybe JobExecutionsRolloutConfig
-> Maybe Text
-> Maybe Text
-> Maybe AbortConfig
-> Maybe PresignedUrlConfig
-> Maybe Text
-> Maybe TimeoutConfig
-> Maybe [Tag]
-> Text
-> Text
-> CreateJobTemplate
CreateJobTemplate'
{ $sel:jobExecutionsRolloutConfig:CreateJobTemplate' :: Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig =
Maybe JobExecutionsRolloutConfig
forall a. Maybe a
Prelude.Nothing,
$sel:jobArn:CreateJobTemplate' :: Maybe Text
jobArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:documentSource:CreateJobTemplate' :: Maybe Text
documentSource = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:abortConfig:CreateJobTemplate' :: Maybe AbortConfig
abortConfig = Maybe AbortConfig
forall a. Maybe a
Prelude.Nothing,
$sel:presignedUrlConfig:CreateJobTemplate' :: Maybe PresignedUrlConfig
presignedUrlConfig = Maybe PresignedUrlConfig
forall a. Maybe a
Prelude.Nothing,
$sel:document:CreateJobTemplate' :: Maybe Text
document = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:timeoutConfig:CreateJobTemplate' :: Maybe TimeoutConfig
timeoutConfig = Maybe TimeoutConfig
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateJobTemplate' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:jobTemplateId:CreateJobTemplate' :: Text
jobTemplateId = Text
pJobTemplateId_,
$sel:description:CreateJobTemplate' :: Text
description = Text
pDescription_
}
createJobTemplate_jobExecutionsRolloutConfig :: Lens.Lens' CreateJobTemplate (Prelude.Maybe JobExecutionsRolloutConfig)
createJobTemplate_jobExecutionsRolloutConfig :: (Maybe JobExecutionsRolloutConfig
-> f (Maybe JobExecutionsRolloutConfig))
-> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_jobExecutionsRolloutConfig = (CreateJobTemplate -> Maybe JobExecutionsRolloutConfig)
-> (CreateJobTemplate
-> Maybe JobExecutionsRolloutConfig -> CreateJobTemplate)
-> Lens
CreateJobTemplate
CreateJobTemplate
(Maybe JobExecutionsRolloutConfig)
(Maybe JobExecutionsRolloutConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig :: Maybe JobExecutionsRolloutConfig
$sel:jobExecutionsRolloutConfig:CreateJobTemplate' :: CreateJobTemplate -> Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig} -> Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Maybe JobExecutionsRolloutConfig
a -> CreateJobTemplate
s {$sel:jobExecutionsRolloutConfig:CreateJobTemplate' :: Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig = Maybe JobExecutionsRolloutConfig
a} :: CreateJobTemplate)
createJobTemplate_jobArn :: Lens.Lens' CreateJobTemplate (Prelude.Maybe Prelude.Text)
createJobTemplate_jobArn :: (Maybe Text -> f (Maybe Text))
-> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_jobArn = (CreateJobTemplate -> Maybe Text)
-> (CreateJobTemplate -> Maybe Text -> CreateJobTemplate)
-> Lens
CreateJobTemplate CreateJobTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Maybe Text
jobArn :: Maybe Text
$sel:jobArn:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
jobArn} -> Maybe Text
jobArn) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Maybe Text
a -> CreateJobTemplate
s {$sel:jobArn:CreateJobTemplate' :: Maybe Text
jobArn = Maybe Text
a} :: CreateJobTemplate)
createJobTemplate_documentSource :: Lens.Lens' CreateJobTemplate (Prelude.Maybe Prelude.Text)
createJobTemplate_documentSource :: (Maybe Text -> f (Maybe Text))
-> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_documentSource = (CreateJobTemplate -> Maybe Text)
-> (CreateJobTemplate -> Maybe Text -> CreateJobTemplate)
-> Lens
CreateJobTemplate CreateJobTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Maybe Text
documentSource :: Maybe Text
$sel:documentSource:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
documentSource} -> Maybe Text
documentSource) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Maybe Text
a -> CreateJobTemplate
s {$sel:documentSource:CreateJobTemplate' :: Maybe Text
documentSource = Maybe Text
a} :: CreateJobTemplate)
createJobTemplate_abortConfig :: Lens.Lens' CreateJobTemplate (Prelude.Maybe AbortConfig)
createJobTemplate_abortConfig :: (Maybe AbortConfig -> f (Maybe AbortConfig))
-> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_abortConfig = (CreateJobTemplate -> Maybe AbortConfig)
-> (CreateJobTemplate -> Maybe AbortConfig -> CreateJobTemplate)
-> Lens
CreateJobTemplate
CreateJobTemplate
(Maybe AbortConfig)
(Maybe AbortConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Maybe AbortConfig
abortConfig :: Maybe AbortConfig
$sel:abortConfig:CreateJobTemplate' :: CreateJobTemplate -> Maybe AbortConfig
abortConfig} -> Maybe AbortConfig
abortConfig) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Maybe AbortConfig
a -> CreateJobTemplate
s {$sel:abortConfig:CreateJobTemplate' :: Maybe AbortConfig
abortConfig = Maybe AbortConfig
a} :: CreateJobTemplate)
createJobTemplate_presignedUrlConfig :: Lens.Lens' CreateJobTemplate (Prelude.Maybe PresignedUrlConfig)
createJobTemplate_presignedUrlConfig :: (Maybe PresignedUrlConfig -> f (Maybe PresignedUrlConfig))
-> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_presignedUrlConfig = (CreateJobTemplate -> Maybe PresignedUrlConfig)
-> (CreateJobTemplate
-> Maybe PresignedUrlConfig -> CreateJobTemplate)
-> Lens
CreateJobTemplate
CreateJobTemplate
(Maybe PresignedUrlConfig)
(Maybe PresignedUrlConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Maybe PresignedUrlConfig
presignedUrlConfig :: Maybe PresignedUrlConfig
$sel:presignedUrlConfig:CreateJobTemplate' :: CreateJobTemplate -> Maybe PresignedUrlConfig
presignedUrlConfig} -> Maybe PresignedUrlConfig
presignedUrlConfig) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Maybe PresignedUrlConfig
a -> CreateJobTemplate
s {$sel:presignedUrlConfig:CreateJobTemplate' :: Maybe PresignedUrlConfig
presignedUrlConfig = Maybe PresignedUrlConfig
a} :: CreateJobTemplate)
createJobTemplate_document :: Lens.Lens' CreateJobTemplate (Prelude.Maybe Prelude.Text)
createJobTemplate_document :: (Maybe Text -> f (Maybe Text))
-> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_document = (CreateJobTemplate -> Maybe Text)
-> (CreateJobTemplate -> Maybe Text -> CreateJobTemplate)
-> Lens
CreateJobTemplate CreateJobTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Maybe Text
document :: Maybe Text
$sel:document:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
document} -> Maybe Text
document) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Maybe Text
a -> CreateJobTemplate
s {$sel:document:CreateJobTemplate' :: Maybe Text
document = Maybe Text
a} :: CreateJobTemplate)
createJobTemplate_timeoutConfig :: Lens.Lens' CreateJobTemplate (Prelude.Maybe TimeoutConfig)
createJobTemplate_timeoutConfig :: (Maybe TimeoutConfig -> f (Maybe TimeoutConfig))
-> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_timeoutConfig = (CreateJobTemplate -> Maybe TimeoutConfig)
-> (CreateJobTemplate -> Maybe TimeoutConfig -> CreateJobTemplate)
-> Lens
CreateJobTemplate
CreateJobTemplate
(Maybe TimeoutConfig)
(Maybe TimeoutConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Maybe TimeoutConfig
timeoutConfig :: Maybe TimeoutConfig
$sel:timeoutConfig:CreateJobTemplate' :: CreateJobTemplate -> Maybe TimeoutConfig
timeoutConfig} -> Maybe TimeoutConfig
timeoutConfig) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Maybe TimeoutConfig
a -> CreateJobTemplate
s {$sel:timeoutConfig:CreateJobTemplate' :: Maybe TimeoutConfig
timeoutConfig = Maybe TimeoutConfig
a} :: CreateJobTemplate)
createJobTemplate_tags :: Lens.Lens' CreateJobTemplate (Prelude.Maybe [Tag])
createJobTemplate_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_tags = (CreateJobTemplate -> Maybe [Tag])
-> (CreateJobTemplate -> Maybe [Tag] -> CreateJobTemplate)
-> Lens
CreateJobTemplate CreateJobTemplate (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateJobTemplate' :: CreateJobTemplate -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Maybe [Tag]
a -> CreateJobTemplate
s {$sel:tags:CreateJobTemplate' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateJobTemplate) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateJobTemplate -> f CreateJobTemplate)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateJobTemplate
-> f CreateJobTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createJobTemplate_jobTemplateId :: Lens.Lens' CreateJobTemplate Prelude.Text
createJobTemplate_jobTemplateId :: (Text -> f Text) -> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_jobTemplateId = (CreateJobTemplate -> Text)
-> (CreateJobTemplate -> Text -> CreateJobTemplate)
-> Lens CreateJobTemplate CreateJobTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Text
jobTemplateId :: Text
$sel:jobTemplateId:CreateJobTemplate' :: CreateJobTemplate -> Text
jobTemplateId} -> Text
jobTemplateId) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Text
a -> CreateJobTemplate
s {$sel:jobTemplateId:CreateJobTemplate' :: Text
jobTemplateId = Text
a} :: CreateJobTemplate)
createJobTemplate_description :: Lens.Lens' CreateJobTemplate Prelude.Text
createJobTemplate_description :: (Text -> f Text) -> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_description = (CreateJobTemplate -> Text)
-> (CreateJobTemplate -> Text -> CreateJobTemplate)
-> Lens CreateJobTemplate CreateJobTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Text
description :: Text
$sel:description:CreateJobTemplate' :: CreateJobTemplate -> Text
description} -> Text
description) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Text
a -> CreateJobTemplate
s {$sel:description:CreateJobTemplate' :: Text
description = Text
a} :: CreateJobTemplate)
instance Core.AWSRequest CreateJobTemplate where
type
AWSResponse CreateJobTemplate =
CreateJobTemplateResponse
request :: CreateJobTemplate -> Request CreateJobTemplate
request = Service -> CreateJobTemplate -> Request CreateJobTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateJobTemplate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateJobTemplate)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateJobTemplate))
-> Logger
-> Service
-> Proxy CreateJobTemplate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateJobTemplate)))
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 -> Maybe Text -> Int -> CreateJobTemplateResponse
CreateJobTemplateResponse'
(Maybe Text -> Maybe Text -> Int -> CreateJobTemplateResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateJobTemplateResponse)
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
"jobTemplateId")
Either String (Maybe Text -> Int -> CreateJobTemplateResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateJobTemplateResponse)
forall (f :: * -> *) a b. Applicative f => 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
"jobTemplateArn")
Either String (Int -> CreateJobTemplateResponse)
-> Either String Int -> Either String CreateJobTemplateResponse
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 CreateJobTemplate
instance Prelude.NFData CreateJobTemplate
instance Core.ToHeaders CreateJobTemplate where
toHeaders :: CreateJobTemplate -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateJobTemplate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON CreateJobTemplate where
toJSON :: CreateJobTemplate -> Value
toJSON CreateJobTemplate' {Maybe [Tag]
Maybe Text
Maybe AbortConfig
Maybe PresignedUrlConfig
Maybe JobExecutionsRolloutConfig
Maybe TimeoutConfig
Text
description :: Text
jobTemplateId :: Text
tags :: Maybe [Tag]
timeoutConfig :: Maybe TimeoutConfig
document :: Maybe Text
presignedUrlConfig :: Maybe PresignedUrlConfig
abortConfig :: Maybe AbortConfig
documentSource :: Maybe Text
jobArn :: Maybe Text
jobExecutionsRolloutConfig :: Maybe JobExecutionsRolloutConfig
$sel:description:CreateJobTemplate' :: CreateJobTemplate -> Text
$sel:jobTemplateId:CreateJobTemplate' :: CreateJobTemplate -> Text
$sel:tags:CreateJobTemplate' :: CreateJobTemplate -> Maybe [Tag]
$sel:timeoutConfig:CreateJobTemplate' :: CreateJobTemplate -> Maybe TimeoutConfig
$sel:document:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
$sel:presignedUrlConfig:CreateJobTemplate' :: CreateJobTemplate -> Maybe PresignedUrlConfig
$sel:abortConfig:CreateJobTemplate' :: CreateJobTemplate -> Maybe AbortConfig
$sel:documentSource:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
$sel:jobArn:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
$sel:jobExecutionsRolloutConfig:CreateJobTemplate' :: CreateJobTemplate -> Maybe JobExecutionsRolloutConfig
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"jobExecutionsRolloutConfig" Text -> JobExecutionsRolloutConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(JobExecutionsRolloutConfig -> Pair)
-> Maybe JobExecutionsRolloutConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig,
(Text
"jobArn" 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
jobArn,
(Text
"documentSource" 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
documentSource,
(Text
"abortConfig" Text -> AbortConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AbortConfig -> Pair) -> Maybe AbortConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AbortConfig
abortConfig,
(Text
"presignedUrlConfig" Text -> PresignedUrlConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(PresignedUrlConfig -> Pair)
-> Maybe PresignedUrlConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PresignedUrlConfig
presignedUrlConfig,
(Text
"document" 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
document,
(Text
"timeoutConfig" Text -> TimeoutConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TimeoutConfig -> Pair) -> Maybe TimeoutConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TimeoutConfig
timeoutConfig,
(Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
description)
]
)
instance Core.ToPath CreateJobTemplate where
toPath :: CreateJobTemplate -> ByteString
toPath CreateJobTemplate' {Maybe [Tag]
Maybe Text
Maybe AbortConfig
Maybe PresignedUrlConfig
Maybe JobExecutionsRolloutConfig
Maybe TimeoutConfig
Text
description :: Text
jobTemplateId :: Text
tags :: Maybe [Tag]
timeoutConfig :: Maybe TimeoutConfig
document :: Maybe Text
presignedUrlConfig :: Maybe PresignedUrlConfig
abortConfig :: Maybe AbortConfig
documentSource :: Maybe Text
jobArn :: Maybe Text
jobExecutionsRolloutConfig :: Maybe JobExecutionsRolloutConfig
$sel:description:CreateJobTemplate' :: CreateJobTemplate -> Text
$sel:jobTemplateId:CreateJobTemplate' :: CreateJobTemplate -> Text
$sel:tags:CreateJobTemplate' :: CreateJobTemplate -> Maybe [Tag]
$sel:timeoutConfig:CreateJobTemplate' :: CreateJobTemplate -> Maybe TimeoutConfig
$sel:document:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
$sel:presignedUrlConfig:CreateJobTemplate' :: CreateJobTemplate -> Maybe PresignedUrlConfig
$sel:abortConfig:CreateJobTemplate' :: CreateJobTemplate -> Maybe AbortConfig
$sel:documentSource:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
$sel:jobArn:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
$sel:jobExecutionsRolloutConfig:CreateJobTemplate' :: CreateJobTemplate -> Maybe JobExecutionsRolloutConfig
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/job-templates/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
jobTemplateId]
instance Core.ToQuery CreateJobTemplate where
toQuery :: CreateJobTemplate -> QueryString
toQuery = QueryString -> CreateJobTemplate -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateJobTemplateResponse = CreateJobTemplateResponse'
{
CreateJobTemplateResponse -> Maybe Text
jobTemplateId :: Prelude.Maybe Prelude.Text,
CreateJobTemplateResponse -> Maybe Text
jobTemplateArn :: Prelude.Maybe Prelude.Text,
CreateJobTemplateResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateJobTemplateResponse -> CreateJobTemplateResponse -> Bool
(CreateJobTemplateResponse -> CreateJobTemplateResponse -> Bool)
-> (CreateJobTemplateResponse -> CreateJobTemplateResponse -> Bool)
-> Eq CreateJobTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateJobTemplateResponse -> CreateJobTemplateResponse -> Bool
$c/= :: CreateJobTemplateResponse -> CreateJobTemplateResponse -> Bool
== :: CreateJobTemplateResponse -> CreateJobTemplateResponse -> Bool
$c== :: CreateJobTemplateResponse -> CreateJobTemplateResponse -> Bool
Prelude.Eq, ReadPrec [CreateJobTemplateResponse]
ReadPrec CreateJobTemplateResponse
Int -> ReadS CreateJobTemplateResponse
ReadS [CreateJobTemplateResponse]
(Int -> ReadS CreateJobTemplateResponse)
-> ReadS [CreateJobTemplateResponse]
-> ReadPrec CreateJobTemplateResponse
-> ReadPrec [CreateJobTemplateResponse]
-> Read CreateJobTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateJobTemplateResponse]
$creadListPrec :: ReadPrec [CreateJobTemplateResponse]
readPrec :: ReadPrec CreateJobTemplateResponse
$creadPrec :: ReadPrec CreateJobTemplateResponse
readList :: ReadS [CreateJobTemplateResponse]
$creadList :: ReadS [CreateJobTemplateResponse]
readsPrec :: Int -> ReadS CreateJobTemplateResponse
$creadsPrec :: Int -> ReadS CreateJobTemplateResponse
Prelude.Read, Int -> CreateJobTemplateResponse -> ShowS
[CreateJobTemplateResponse] -> ShowS
CreateJobTemplateResponse -> String
(Int -> CreateJobTemplateResponse -> ShowS)
-> (CreateJobTemplateResponse -> String)
-> ([CreateJobTemplateResponse] -> ShowS)
-> Show CreateJobTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateJobTemplateResponse] -> ShowS
$cshowList :: [CreateJobTemplateResponse] -> ShowS
show :: CreateJobTemplateResponse -> String
$cshow :: CreateJobTemplateResponse -> String
showsPrec :: Int -> CreateJobTemplateResponse -> ShowS
$cshowsPrec :: Int -> CreateJobTemplateResponse -> ShowS
Prelude.Show, (forall x.
CreateJobTemplateResponse -> Rep CreateJobTemplateResponse x)
-> (forall x.
Rep CreateJobTemplateResponse x -> CreateJobTemplateResponse)
-> Generic CreateJobTemplateResponse
forall x.
Rep CreateJobTemplateResponse x -> CreateJobTemplateResponse
forall x.
CreateJobTemplateResponse -> Rep CreateJobTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateJobTemplateResponse x -> CreateJobTemplateResponse
$cfrom :: forall x.
CreateJobTemplateResponse -> Rep CreateJobTemplateResponse x
Prelude.Generic)
newCreateJobTemplateResponse ::
Prelude.Int ->
CreateJobTemplateResponse
newCreateJobTemplateResponse :: Int -> CreateJobTemplateResponse
newCreateJobTemplateResponse Int
pHttpStatus_ =
CreateJobTemplateResponse' :: Maybe Text -> Maybe Text -> Int -> CreateJobTemplateResponse
CreateJobTemplateResponse'
{ $sel:jobTemplateId:CreateJobTemplateResponse' :: Maybe Text
jobTemplateId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:jobTemplateArn:CreateJobTemplateResponse' :: Maybe Text
jobTemplateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateJobTemplateResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createJobTemplateResponse_jobTemplateId :: Lens.Lens' CreateJobTemplateResponse (Prelude.Maybe Prelude.Text)
createJobTemplateResponse_jobTemplateId :: (Maybe Text -> f (Maybe Text))
-> CreateJobTemplateResponse -> f CreateJobTemplateResponse
createJobTemplateResponse_jobTemplateId = (CreateJobTemplateResponse -> Maybe Text)
-> (CreateJobTemplateResponse
-> Maybe Text -> CreateJobTemplateResponse)
-> Lens
CreateJobTemplateResponse
CreateJobTemplateResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplateResponse' {Maybe Text
jobTemplateId :: Maybe Text
$sel:jobTemplateId:CreateJobTemplateResponse' :: CreateJobTemplateResponse -> Maybe Text
jobTemplateId} -> Maybe Text
jobTemplateId) (\s :: CreateJobTemplateResponse
s@CreateJobTemplateResponse' {} Maybe Text
a -> CreateJobTemplateResponse
s {$sel:jobTemplateId:CreateJobTemplateResponse' :: Maybe Text
jobTemplateId = Maybe Text
a} :: CreateJobTemplateResponse)
createJobTemplateResponse_jobTemplateArn :: Lens.Lens' CreateJobTemplateResponse (Prelude.Maybe Prelude.Text)
createJobTemplateResponse_jobTemplateArn :: (Maybe Text -> f (Maybe Text))
-> CreateJobTemplateResponse -> f CreateJobTemplateResponse
createJobTemplateResponse_jobTemplateArn = (CreateJobTemplateResponse -> Maybe Text)
-> (CreateJobTemplateResponse
-> Maybe Text -> CreateJobTemplateResponse)
-> Lens
CreateJobTemplateResponse
CreateJobTemplateResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplateResponse' {Maybe Text
jobTemplateArn :: Maybe Text
$sel:jobTemplateArn:CreateJobTemplateResponse' :: CreateJobTemplateResponse -> Maybe Text
jobTemplateArn} -> Maybe Text
jobTemplateArn) (\s :: CreateJobTemplateResponse
s@CreateJobTemplateResponse' {} Maybe Text
a -> CreateJobTemplateResponse
s {$sel:jobTemplateArn:CreateJobTemplateResponse' :: Maybe Text
jobTemplateArn = Maybe Text
a} :: CreateJobTemplateResponse)
createJobTemplateResponse_httpStatus :: Lens.Lens' CreateJobTemplateResponse Prelude.Int
createJobTemplateResponse_httpStatus :: (Int -> f Int)
-> CreateJobTemplateResponse -> f CreateJobTemplateResponse
createJobTemplateResponse_httpStatus = (CreateJobTemplateResponse -> Int)
-> (CreateJobTemplateResponse -> Int -> CreateJobTemplateResponse)
-> Lens CreateJobTemplateResponse CreateJobTemplateResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateJobTemplateResponse' :: CreateJobTemplateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateJobTemplateResponse
s@CreateJobTemplateResponse' {} Int
a -> CreateJobTemplateResponse
s {$sel:httpStatus:CreateJobTemplateResponse' :: Int
httpStatus = Int
a} :: CreateJobTemplateResponse)
instance Prelude.NFData CreateJobTemplateResponse