{-# 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.CreateJob
(
CreateJob (..),
newCreateJob,
createJob_jobExecutionsRolloutConfig,
createJob_documentSource,
createJob_abortConfig,
createJob_namespaceId,
createJob_presignedUrlConfig,
createJob_document,
createJob_jobTemplateArn,
createJob_description,
createJob_targetSelection,
createJob_timeoutConfig,
createJob_tags,
createJob_jobId,
createJob_targets,
CreateJobResponse (..),
newCreateJobResponse,
createJobResponse_jobId,
createJobResponse_jobArn,
createJobResponse_description,
createJobResponse_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 CreateJob = CreateJob'
{
CreateJob -> Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig :: Prelude.Maybe JobExecutionsRolloutConfig,
CreateJob -> Maybe Text
documentSource :: Prelude.Maybe Prelude.Text,
CreateJob -> Maybe AbortConfig
abortConfig :: Prelude.Maybe AbortConfig,
CreateJob -> Maybe Text
namespaceId :: Prelude.Maybe Prelude.Text,
CreateJob -> Maybe PresignedUrlConfig
presignedUrlConfig :: Prelude.Maybe PresignedUrlConfig,
CreateJob -> Maybe Text
document :: Prelude.Maybe Prelude.Text,
CreateJob -> Maybe Text
jobTemplateArn :: Prelude.Maybe Prelude.Text,
CreateJob -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
CreateJob -> Maybe TargetSelection
targetSelection :: Prelude.Maybe TargetSelection,
CreateJob -> Maybe TimeoutConfig
timeoutConfig :: Prelude.Maybe TimeoutConfig,
CreateJob -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateJob -> Text
jobId :: Prelude.Text,
CreateJob -> NonEmpty Text
targets :: Prelude.NonEmpty Prelude.Text
}
deriving (CreateJob -> CreateJob -> Bool
(CreateJob -> CreateJob -> Bool)
-> (CreateJob -> CreateJob -> Bool) -> Eq CreateJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateJob -> CreateJob -> Bool
$c/= :: CreateJob -> CreateJob -> Bool
== :: CreateJob -> CreateJob -> Bool
$c== :: CreateJob -> CreateJob -> Bool
Prelude.Eq, ReadPrec [CreateJob]
ReadPrec CreateJob
Int -> ReadS CreateJob
ReadS [CreateJob]
(Int -> ReadS CreateJob)
-> ReadS [CreateJob]
-> ReadPrec CreateJob
-> ReadPrec [CreateJob]
-> Read CreateJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateJob]
$creadListPrec :: ReadPrec [CreateJob]
readPrec :: ReadPrec CreateJob
$creadPrec :: ReadPrec CreateJob
readList :: ReadS [CreateJob]
$creadList :: ReadS [CreateJob]
readsPrec :: Int -> ReadS CreateJob
$creadsPrec :: Int -> ReadS CreateJob
Prelude.Read, Int -> CreateJob -> ShowS
[CreateJob] -> ShowS
CreateJob -> String
(Int -> CreateJob -> ShowS)
-> (CreateJob -> String)
-> ([CreateJob] -> ShowS)
-> Show CreateJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateJob] -> ShowS
$cshowList :: [CreateJob] -> ShowS
show :: CreateJob -> String
$cshow :: CreateJob -> String
showsPrec :: Int -> CreateJob -> ShowS
$cshowsPrec :: Int -> CreateJob -> ShowS
Prelude.Show, (forall x. CreateJob -> Rep CreateJob x)
-> (forall x. Rep CreateJob x -> CreateJob) -> Generic CreateJob
forall x. Rep CreateJob x -> CreateJob
forall x. CreateJob -> Rep CreateJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateJob x -> CreateJob
$cfrom :: forall x. CreateJob -> Rep CreateJob x
Prelude.Generic)
newCreateJob ::
Prelude.Text ->
Prelude.NonEmpty Prelude.Text ->
CreateJob
newCreateJob :: Text -> NonEmpty Text -> CreateJob
newCreateJob Text
pJobId_ NonEmpty Text
pTargets_ =
CreateJob' :: Maybe JobExecutionsRolloutConfig
-> Maybe Text
-> Maybe AbortConfig
-> Maybe Text
-> Maybe PresignedUrlConfig
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe TargetSelection
-> Maybe TimeoutConfig
-> Maybe [Tag]
-> Text
-> NonEmpty Text
-> CreateJob
CreateJob'
{ $sel:jobExecutionsRolloutConfig:CreateJob' :: Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig =
Maybe JobExecutionsRolloutConfig
forall a. Maybe a
Prelude.Nothing,
$sel:documentSource:CreateJob' :: Maybe Text
documentSource = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:abortConfig:CreateJob' :: Maybe AbortConfig
abortConfig = Maybe AbortConfig
forall a. Maybe a
Prelude.Nothing,
$sel:namespaceId:CreateJob' :: Maybe Text
namespaceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:presignedUrlConfig:CreateJob' :: Maybe PresignedUrlConfig
presignedUrlConfig = Maybe PresignedUrlConfig
forall a. Maybe a
Prelude.Nothing,
$sel:document:CreateJob' :: Maybe Text
document = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:jobTemplateArn:CreateJob' :: Maybe Text
jobTemplateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:CreateJob' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:targetSelection:CreateJob' :: Maybe TargetSelection
targetSelection = Maybe TargetSelection
forall a. Maybe a
Prelude.Nothing,
$sel:timeoutConfig:CreateJob' :: Maybe TimeoutConfig
timeoutConfig = Maybe TimeoutConfig
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateJob' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:jobId:CreateJob' :: Text
jobId = Text
pJobId_,
$sel:targets:CreateJob' :: NonEmpty Text
targets = Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pTargets_
}
createJob_jobExecutionsRolloutConfig :: Lens.Lens' CreateJob (Prelude.Maybe JobExecutionsRolloutConfig)
createJob_jobExecutionsRolloutConfig :: (Maybe JobExecutionsRolloutConfig
-> f (Maybe JobExecutionsRolloutConfig))
-> CreateJob -> f CreateJob
createJob_jobExecutionsRolloutConfig = (CreateJob -> Maybe JobExecutionsRolloutConfig)
-> (CreateJob -> Maybe JobExecutionsRolloutConfig -> CreateJob)
-> Lens
CreateJob
CreateJob
(Maybe JobExecutionsRolloutConfig)
(Maybe JobExecutionsRolloutConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig :: Maybe JobExecutionsRolloutConfig
$sel:jobExecutionsRolloutConfig:CreateJob' :: CreateJob -> Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig} -> Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig) (\s :: CreateJob
s@CreateJob' {} Maybe JobExecutionsRolloutConfig
a -> CreateJob
s {$sel:jobExecutionsRolloutConfig:CreateJob' :: Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig = Maybe JobExecutionsRolloutConfig
a} :: CreateJob)
createJob_documentSource :: Lens.Lens' CreateJob (Prelude.Maybe Prelude.Text)
createJob_documentSource :: (Maybe Text -> f (Maybe Text)) -> CreateJob -> f CreateJob
createJob_documentSource = (CreateJob -> Maybe Text)
-> (CreateJob -> Maybe Text -> CreateJob)
-> Lens CreateJob CreateJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe Text
documentSource :: Maybe Text
$sel:documentSource:CreateJob' :: CreateJob -> Maybe Text
documentSource} -> Maybe Text
documentSource) (\s :: CreateJob
s@CreateJob' {} Maybe Text
a -> CreateJob
s {$sel:documentSource:CreateJob' :: Maybe Text
documentSource = Maybe Text
a} :: CreateJob)
createJob_abortConfig :: Lens.Lens' CreateJob (Prelude.Maybe AbortConfig)
createJob_abortConfig :: (Maybe AbortConfig -> f (Maybe AbortConfig))
-> CreateJob -> f CreateJob
createJob_abortConfig = (CreateJob -> Maybe AbortConfig)
-> (CreateJob -> Maybe AbortConfig -> CreateJob)
-> Lens CreateJob CreateJob (Maybe AbortConfig) (Maybe AbortConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe AbortConfig
abortConfig :: Maybe AbortConfig
$sel:abortConfig:CreateJob' :: CreateJob -> Maybe AbortConfig
abortConfig} -> Maybe AbortConfig
abortConfig) (\s :: CreateJob
s@CreateJob' {} Maybe AbortConfig
a -> CreateJob
s {$sel:abortConfig:CreateJob' :: Maybe AbortConfig
abortConfig = Maybe AbortConfig
a} :: CreateJob)
createJob_namespaceId :: Lens.Lens' CreateJob (Prelude.Maybe Prelude.Text)
createJob_namespaceId :: (Maybe Text -> f (Maybe Text)) -> CreateJob -> f CreateJob
createJob_namespaceId = (CreateJob -> Maybe Text)
-> (CreateJob -> Maybe Text -> CreateJob)
-> Lens CreateJob CreateJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe Text
namespaceId :: Maybe Text
$sel:namespaceId:CreateJob' :: CreateJob -> Maybe Text
namespaceId} -> Maybe Text
namespaceId) (\s :: CreateJob
s@CreateJob' {} Maybe Text
a -> CreateJob
s {$sel:namespaceId:CreateJob' :: Maybe Text
namespaceId = Maybe Text
a} :: CreateJob)
createJob_presignedUrlConfig :: Lens.Lens' CreateJob (Prelude.Maybe PresignedUrlConfig)
createJob_presignedUrlConfig :: (Maybe PresignedUrlConfig -> f (Maybe PresignedUrlConfig))
-> CreateJob -> f CreateJob
createJob_presignedUrlConfig = (CreateJob -> Maybe PresignedUrlConfig)
-> (CreateJob -> Maybe PresignedUrlConfig -> CreateJob)
-> Lens
CreateJob
CreateJob
(Maybe PresignedUrlConfig)
(Maybe PresignedUrlConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe PresignedUrlConfig
presignedUrlConfig :: Maybe PresignedUrlConfig
$sel:presignedUrlConfig:CreateJob' :: CreateJob -> Maybe PresignedUrlConfig
presignedUrlConfig} -> Maybe PresignedUrlConfig
presignedUrlConfig) (\s :: CreateJob
s@CreateJob' {} Maybe PresignedUrlConfig
a -> CreateJob
s {$sel:presignedUrlConfig:CreateJob' :: Maybe PresignedUrlConfig
presignedUrlConfig = Maybe PresignedUrlConfig
a} :: CreateJob)
createJob_document :: Lens.Lens' CreateJob (Prelude.Maybe Prelude.Text)
createJob_document :: (Maybe Text -> f (Maybe Text)) -> CreateJob -> f CreateJob
createJob_document = (CreateJob -> Maybe Text)
-> (CreateJob -> Maybe Text -> CreateJob)
-> Lens CreateJob CreateJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe Text
document :: Maybe Text
$sel:document:CreateJob' :: CreateJob -> Maybe Text
document} -> Maybe Text
document) (\s :: CreateJob
s@CreateJob' {} Maybe Text
a -> CreateJob
s {$sel:document:CreateJob' :: Maybe Text
document = Maybe Text
a} :: CreateJob)
createJob_jobTemplateArn :: Lens.Lens' CreateJob (Prelude.Maybe Prelude.Text)
createJob_jobTemplateArn :: (Maybe Text -> f (Maybe Text)) -> CreateJob -> f CreateJob
createJob_jobTemplateArn = (CreateJob -> Maybe Text)
-> (CreateJob -> Maybe Text -> CreateJob)
-> Lens CreateJob CreateJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe Text
jobTemplateArn :: Maybe Text
$sel:jobTemplateArn:CreateJob' :: CreateJob -> Maybe Text
jobTemplateArn} -> Maybe Text
jobTemplateArn) (\s :: CreateJob
s@CreateJob' {} Maybe Text
a -> CreateJob
s {$sel:jobTemplateArn:CreateJob' :: Maybe Text
jobTemplateArn = Maybe Text
a} :: CreateJob)
createJob_description :: Lens.Lens' CreateJob (Prelude.Maybe Prelude.Text)
createJob_description :: (Maybe Text -> f (Maybe Text)) -> CreateJob -> f CreateJob
createJob_description = (CreateJob -> Maybe Text)
-> (CreateJob -> Maybe Text -> CreateJob)
-> Lens CreateJob CreateJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe Text
description :: Maybe Text
$sel:description:CreateJob' :: CreateJob -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateJob
s@CreateJob' {} Maybe Text
a -> CreateJob
s {$sel:description:CreateJob' :: Maybe Text
description = Maybe Text
a} :: CreateJob)
createJob_targetSelection :: Lens.Lens' CreateJob (Prelude.Maybe TargetSelection)
createJob_targetSelection :: (Maybe TargetSelection -> f (Maybe TargetSelection))
-> CreateJob -> f CreateJob
createJob_targetSelection = (CreateJob -> Maybe TargetSelection)
-> (CreateJob -> Maybe TargetSelection -> CreateJob)
-> Lens
CreateJob CreateJob (Maybe TargetSelection) (Maybe TargetSelection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe TargetSelection
targetSelection :: Maybe TargetSelection
$sel:targetSelection:CreateJob' :: CreateJob -> Maybe TargetSelection
targetSelection} -> Maybe TargetSelection
targetSelection) (\s :: CreateJob
s@CreateJob' {} Maybe TargetSelection
a -> CreateJob
s {$sel:targetSelection:CreateJob' :: Maybe TargetSelection
targetSelection = Maybe TargetSelection
a} :: CreateJob)
createJob_timeoutConfig :: Lens.Lens' CreateJob (Prelude.Maybe TimeoutConfig)
createJob_timeoutConfig :: (Maybe TimeoutConfig -> f (Maybe TimeoutConfig))
-> CreateJob -> f CreateJob
createJob_timeoutConfig = (CreateJob -> Maybe TimeoutConfig)
-> (CreateJob -> Maybe TimeoutConfig -> CreateJob)
-> Lens
CreateJob CreateJob (Maybe TimeoutConfig) (Maybe TimeoutConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe TimeoutConfig
timeoutConfig :: Maybe TimeoutConfig
$sel:timeoutConfig:CreateJob' :: CreateJob -> Maybe TimeoutConfig
timeoutConfig} -> Maybe TimeoutConfig
timeoutConfig) (\s :: CreateJob
s@CreateJob' {} Maybe TimeoutConfig
a -> CreateJob
s {$sel:timeoutConfig:CreateJob' :: Maybe TimeoutConfig
timeoutConfig = Maybe TimeoutConfig
a} :: CreateJob)
createJob_tags :: Lens.Lens' CreateJob (Prelude.Maybe [Tag])
createJob_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> CreateJob -> f CreateJob
createJob_tags = (CreateJob -> Maybe [Tag])
-> (CreateJob -> Maybe [Tag] -> CreateJob)
-> Lens CreateJob CreateJob (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateJob' :: CreateJob -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateJob
s@CreateJob' {} Maybe [Tag]
a -> CreateJob
s {$sel:tags:CreateJob' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateJob) ((Maybe [Tag] -> f (Maybe [Tag])) -> CreateJob -> f CreateJob)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateJob
-> f CreateJob
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
createJob_jobId :: Lens.Lens' CreateJob Prelude.Text
createJob_jobId :: (Text -> f Text) -> CreateJob -> f CreateJob
createJob_jobId = (CreateJob -> Text)
-> (CreateJob -> Text -> CreateJob)
-> Lens CreateJob CreateJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Text
jobId :: Text
$sel:jobId:CreateJob' :: CreateJob -> Text
jobId} -> Text
jobId) (\s :: CreateJob
s@CreateJob' {} Text
a -> CreateJob
s {$sel:jobId:CreateJob' :: Text
jobId = Text
a} :: CreateJob)
createJob_targets :: Lens.Lens' CreateJob (Prelude.NonEmpty Prelude.Text)
createJob_targets :: (NonEmpty Text -> f (NonEmpty Text)) -> CreateJob -> f CreateJob
createJob_targets = (CreateJob -> NonEmpty Text)
-> (CreateJob -> NonEmpty Text -> CreateJob)
-> Lens CreateJob CreateJob (NonEmpty Text) (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {NonEmpty Text
targets :: NonEmpty Text
$sel:targets:CreateJob' :: CreateJob -> NonEmpty Text
targets} -> NonEmpty Text
targets) (\s :: CreateJob
s@CreateJob' {} NonEmpty Text
a -> CreateJob
s {$sel:targets:CreateJob' :: NonEmpty Text
targets = NonEmpty Text
a} :: CreateJob) ((NonEmpty Text -> f (NonEmpty Text)) -> CreateJob -> f CreateJob)
-> ((NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> CreateJob
-> f CreateJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest CreateJob where
type AWSResponse CreateJob = CreateJobResponse
request :: CreateJob -> Request CreateJob
request = Service -> CreateJob -> Request CreateJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateJob)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateJob))
-> Logger
-> Service
-> Proxy CreateJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateJob)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> Int -> CreateJobResponse
CreateJobResponse'
(Maybe Text
-> Maybe Text -> Maybe Text -> Int -> CreateJobResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Maybe Text -> Int -> CreateJobResponse)
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
"jobId")
Either
String (Maybe Text -> Maybe Text -> Int -> CreateJobResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateJobResponse)
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
"jobArn")
Either String (Maybe Text -> Int -> CreateJobResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateJobResponse)
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
"description")
Either String (Int -> CreateJobResponse)
-> Either String Int -> Either String CreateJobResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateJob
instance Prelude.NFData CreateJob
instance Core.ToHeaders CreateJob where
toHeaders :: CreateJob -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateJob -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON CreateJob where
toJSON :: CreateJob -> Value
toJSON CreateJob' {Maybe [Tag]
Maybe Text
Maybe AbortConfig
Maybe PresignedUrlConfig
Maybe JobExecutionsRolloutConfig
Maybe TargetSelection
Maybe TimeoutConfig
NonEmpty Text
Text
targets :: NonEmpty Text
jobId :: Text
tags :: Maybe [Tag]
timeoutConfig :: Maybe TimeoutConfig
targetSelection :: Maybe TargetSelection
description :: Maybe Text
jobTemplateArn :: Maybe Text
document :: Maybe Text
presignedUrlConfig :: Maybe PresignedUrlConfig
namespaceId :: Maybe Text
abortConfig :: Maybe AbortConfig
documentSource :: Maybe Text
jobExecutionsRolloutConfig :: Maybe JobExecutionsRolloutConfig
$sel:targets:CreateJob' :: CreateJob -> NonEmpty Text
$sel:jobId:CreateJob' :: CreateJob -> Text
$sel:tags:CreateJob' :: CreateJob -> Maybe [Tag]
$sel:timeoutConfig:CreateJob' :: CreateJob -> Maybe TimeoutConfig
$sel:targetSelection:CreateJob' :: CreateJob -> Maybe TargetSelection
$sel:description:CreateJob' :: CreateJob -> Maybe Text
$sel:jobTemplateArn:CreateJob' :: CreateJob -> Maybe Text
$sel:document:CreateJob' :: CreateJob -> Maybe Text
$sel:presignedUrlConfig:CreateJob' :: CreateJob -> Maybe PresignedUrlConfig
$sel:namespaceId:CreateJob' :: CreateJob -> Maybe Text
$sel:abortConfig:CreateJob' :: CreateJob -> Maybe AbortConfig
$sel:documentSource:CreateJob' :: CreateJob -> Maybe Text
$sel:jobExecutionsRolloutConfig:CreateJob' :: CreateJob -> 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
"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
"namespaceId" 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
namespaceId,
(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
"jobTemplateArn" 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
jobTemplateArn,
(Text
"description" 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
description,
(Text
"targetSelection" Text -> TargetSelection -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(TargetSelection -> Pair) -> Maybe TargetSelection -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TargetSelection
targetSelection,
(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
"targets" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
targets)
]
)
instance Core.ToPath CreateJob where
toPath :: CreateJob -> ByteString
toPath CreateJob' {Maybe [Tag]
Maybe Text
Maybe AbortConfig
Maybe PresignedUrlConfig
Maybe JobExecutionsRolloutConfig
Maybe TargetSelection
Maybe TimeoutConfig
NonEmpty Text
Text
targets :: NonEmpty Text
jobId :: Text
tags :: Maybe [Tag]
timeoutConfig :: Maybe TimeoutConfig
targetSelection :: Maybe TargetSelection
description :: Maybe Text
jobTemplateArn :: Maybe Text
document :: Maybe Text
presignedUrlConfig :: Maybe PresignedUrlConfig
namespaceId :: Maybe Text
abortConfig :: Maybe AbortConfig
documentSource :: Maybe Text
jobExecutionsRolloutConfig :: Maybe JobExecutionsRolloutConfig
$sel:targets:CreateJob' :: CreateJob -> NonEmpty Text
$sel:jobId:CreateJob' :: CreateJob -> Text
$sel:tags:CreateJob' :: CreateJob -> Maybe [Tag]
$sel:timeoutConfig:CreateJob' :: CreateJob -> Maybe TimeoutConfig
$sel:targetSelection:CreateJob' :: CreateJob -> Maybe TargetSelection
$sel:description:CreateJob' :: CreateJob -> Maybe Text
$sel:jobTemplateArn:CreateJob' :: CreateJob -> Maybe Text
$sel:document:CreateJob' :: CreateJob -> Maybe Text
$sel:presignedUrlConfig:CreateJob' :: CreateJob -> Maybe PresignedUrlConfig
$sel:namespaceId:CreateJob' :: CreateJob -> Maybe Text
$sel:abortConfig:CreateJob' :: CreateJob -> Maybe AbortConfig
$sel:documentSource:CreateJob' :: CreateJob -> Maybe Text
$sel:jobExecutionsRolloutConfig:CreateJob' :: CreateJob -> Maybe JobExecutionsRolloutConfig
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/jobs/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
jobId]
instance Core.ToQuery CreateJob where
toQuery :: CreateJob -> QueryString
toQuery = QueryString -> CreateJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateJobResponse = CreateJobResponse'
{
CreateJobResponse -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
CreateJobResponse -> Maybe Text
jobArn :: Prelude.Maybe Prelude.Text,
CreateJobResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
CreateJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateJobResponse -> CreateJobResponse -> Bool
(CreateJobResponse -> CreateJobResponse -> Bool)
-> (CreateJobResponse -> CreateJobResponse -> Bool)
-> Eq CreateJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateJobResponse -> CreateJobResponse -> Bool
$c/= :: CreateJobResponse -> CreateJobResponse -> Bool
== :: CreateJobResponse -> CreateJobResponse -> Bool
$c== :: CreateJobResponse -> CreateJobResponse -> Bool
Prelude.Eq, ReadPrec [CreateJobResponse]
ReadPrec CreateJobResponse
Int -> ReadS CreateJobResponse
ReadS [CreateJobResponse]
(Int -> ReadS CreateJobResponse)
-> ReadS [CreateJobResponse]
-> ReadPrec CreateJobResponse
-> ReadPrec [CreateJobResponse]
-> Read CreateJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateJobResponse]
$creadListPrec :: ReadPrec [CreateJobResponse]
readPrec :: ReadPrec CreateJobResponse
$creadPrec :: ReadPrec CreateJobResponse
readList :: ReadS [CreateJobResponse]
$creadList :: ReadS [CreateJobResponse]
readsPrec :: Int -> ReadS CreateJobResponse
$creadsPrec :: Int -> ReadS CreateJobResponse
Prelude.Read, Int -> CreateJobResponse -> ShowS
[CreateJobResponse] -> ShowS
CreateJobResponse -> String
(Int -> CreateJobResponse -> ShowS)
-> (CreateJobResponse -> String)
-> ([CreateJobResponse] -> ShowS)
-> Show CreateJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateJobResponse] -> ShowS
$cshowList :: [CreateJobResponse] -> ShowS
show :: CreateJobResponse -> String
$cshow :: CreateJobResponse -> String
showsPrec :: Int -> CreateJobResponse -> ShowS
$cshowsPrec :: Int -> CreateJobResponse -> ShowS
Prelude.Show, (forall x. CreateJobResponse -> Rep CreateJobResponse x)
-> (forall x. Rep CreateJobResponse x -> CreateJobResponse)
-> Generic CreateJobResponse
forall x. Rep CreateJobResponse x -> CreateJobResponse
forall x. CreateJobResponse -> Rep CreateJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateJobResponse x -> CreateJobResponse
$cfrom :: forall x. CreateJobResponse -> Rep CreateJobResponse x
Prelude.Generic)
newCreateJobResponse ::
Prelude.Int ->
CreateJobResponse
newCreateJobResponse :: Int -> CreateJobResponse
newCreateJobResponse Int
pHttpStatus_ =
CreateJobResponse' :: Maybe Text -> Maybe Text -> Maybe Text -> Int -> CreateJobResponse
CreateJobResponse'
{ $sel:jobId:CreateJobResponse' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:jobArn:CreateJobResponse' :: Maybe Text
jobArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:CreateJobResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createJobResponse_jobId :: Lens.Lens' CreateJobResponse (Prelude.Maybe Prelude.Text)
createJobResponse_jobId :: (Maybe Text -> f (Maybe Text))
-> CreateJobResponse -> f CreateJobResponse
createJobResponse_jobId = (CreateJobResponse -> Maybe Text)
-> (CreateJobResponse -> Maybe Text -> CreateJobResponse)
-> Lens
CreateJobResponse CreateJobResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobResponse' {Maybe Text
jobId :: Maybe Text
$sel:jobId:CreateJobResponse' :: CreateJobResponse -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: CreateJobResponse
s@CreateJobResponse' {} Maybe Text
a -> CreateJobResponse
s {$sel:jobId:CreateJobResponse' :: Maybe Text
jobId = Maybe Text
a} :: CreateJobResponse)
createJobResponse_jobArn :: Lens.Lens' CreateJobResponse (Prelude.Maybe Prelude.Text)
createJobResponse_jobArn :: (Maybe Text -> f (Maybe Text))
-> CreateJobResponse -> f CreateJobResponse
createJobResponse_jobArn = (CreateJobResponse -> Maybe Text)
-> (CreateJobResponse -> Maybe Text -> CreateJobResponse)
-> Lens
CreateJobResponse CreateJobResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobResponse' {Maybe Text
jobArn :: Maybe Text
$sel:jobArn:CreateJobResponse' :: CreateJobResponse -> Maybe Text
jobArn} -> Maybe Text
jobArn) (\s :: CreateJobResponse
s@CreateJobResponse' {} Maybe Text
a -> CreateJobResponse
s {$sel:jobArn:CreateJobResponse' :: Maybe Text
jobArn = Maybe Text
a} :: CreateJobResponse)
createJobResponse_description :: Lens.Lens' CreateJobResponse (Prelude.Maybe Prelude.Text)
createJobResponse_description :: (Maybe Text -> f (Maybe Text))
-> CreateJobResponse -> f CreateJobResponse
createJobResponse_description = (CreateJobResponse -> Maybe Text)
-> (CreateJobResponse -> Maybe Text -> CreateJobResponse)
-> Lens
CreateJobResponse CreateJobResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobResponse' {Maybe Text
description :: Maybe Text
$sel:description:CreateJobResponse' :: CreateJobResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateJobResponse
s@CreateJobResponse' {} Maybe Text
a -> CreateJobResponse
s {$sel:description:CreateJobResponse' :: Maybe Text
description = Maybe Text
a} :: CreateJobResponse)
createJobResponse_httpStatus :: Lens.Lens' CreateJobResponse Prelude.Int
createJobResponse_httpStatus :: (Int -> f Int) -> CreateJobResponse -> f CreateJobResponse
createJobResponse_httpStatus = (CreateJobResponse -> Int)
-> (CreateJobResponse -> Int -> CreateJobResponse)
-> Lens CreateJobResponse CreateJobResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateJobResponse' :: CreateJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateJobResponse
s@CreateJobResponse' {} Int
a -> CreateJobResponse
s {$sel:httpStatus:CreateJobResponse' :: Int
httpStatus = Int
a} :: CreateJobResponse)
instance Prelude.NFData CreateJobResponse