{-# 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.IoTJobsData.UpdateJobExecution
(
UpdateJobExecution (..),
newUpdateJobExecution,
updateJobExecution_includeJobDocument,
updateJobExecution_stepTimeoutInMinutes,
updateJobExecution_statusDetails,
updateJobExecution_executionNumber,
updateJobExecution_expectedVersion,
updateJobExecution_includeJobExecutionState,
updateJobExecution_jobId,
updateJobExecution_thingName,
updateJobExecution_status,
UpdateJobExecutionResponse (..),
newUpdateJobExecutionResponse,
updateJobExecutionResponse_jobDocument,
updateJobExecutionResponse_executionState,
updateJobExecutionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoTJobsData.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 UpdateJobExecution = UpdateJobExecution'
{
UpdateJobExecution -> Maybe Bool
includeJobDocument :: Prelude.Maybe Prelude.Bool,
UpdateJobExecution -> Maybe Integer
stepTimeoutInMinutes :: Prelude.Maybe Prelude.Integer,
UpdateJobExecution -> Maybe (HashMap Text Text)
statusDetails :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
UpdateJobExecution -> Maybe Integer
executionNumber :: Prelude.Maybe Prelude.Integer,
UpdateJobExecution -> Maybe Integer
expectedVersion :: Prelude.Maybe Prelude.Integer,
UpdateJobExecution -> Maybe Bool
includeJobExecutionState :: Prelude.Maybe Prelude.Bool,
UpdateJobExecution -> Text
jobId :: Prelude.Text,
UpdateJobExecution -> Text
thingName :: Prelude.Text,
UpdateJobExecution -> JobExecutionStatus
status :: JobExecutionStatus
}
deriving (UpdateJobExecution -> UpdateJobExecution -> Bool
(UpdateJobExecution -> UpdateJobExecution -> Bool)
-> (UpdateJobExecution -> UpdateJobExecution -> Bool)
-> Eq UpdateJobExecution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateJobExecution -> UpdateJobExecution -> Bool
$c/= :: UpdateJobExecution -> UpdateJobExecution -> Bool
== :: UpdateJobExecution -> UpdateJobExecution -> Bool
$c== :: UpdateJobExecution -> UpdateJobExecution -> Bool
Prelude.Eq, ReadPrec [UpdateJobExecution]
ReadPrec UpdateJobExecution
Int -> ReadS UpdateJobExecution
ReadS [UpdateJobExecution]
(Int -> ReadS UpdateJobExecution)
-> ReadS [UpdateJobExecution]
-> ReadPrec UpdateJobExecution
-> ReadPrec [UpdateJobExecution]
-> Read UpdateJobExecution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateJobExecution]
$creadListPrec :: ReadPrec [UpdateJobExecution]
readPrec :: ReadPrec UpdateJobExecution
$creadPrec :: ReadPrec UpdateJobExecution
readList :: ReadS [UpdateJobExecution]
$creadList :: ReadS [UpdateJobExecution]
readsPrec :: Int -> ReadS UpdateJobExecution
$creadsPrec :: Int -> ReadS UpdateJobExecution
Prelude.Read, Int -> UpdateJobExecution -> ShowS
[UpdateJobExecution] -> ShowS
UpdateJobExecution -> String
(Int -> UpdateJobExecution -> ShowS)
-> (UpdateJobExecution -> String)
-> ([UpdateJobExecution] -> ShowS)
-> Show UpdateJobExecution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateJobExecution] -> ShowS
$cshowList :: [UpdateJobExecution] -> ShowS
show :: UpdateJobExecution -> String
$cshow :: UpdateJobExecution -> String
showsPrec :: Int -> UpdateJobExecution -> ShowS
$cshowsPrec :: Int -> UpdateJobExecution -> ShowS
Prelude.Show, (forall x. UpdateJobExecution -> Rep UpdateJobExecution x)
-> (forall x. Rep UpdateJobExecution x -> UpdateJobExecution)
-> Generic UpdateJobExecution
forall x. Rep UpdateJobExecution x -> UpdateJobExecution
forall x. UpdateJobExecution -> Rep UpdateJobExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateJobExecution x -> UpdateJobExecution
$cfrom :: forall x. UpdateJobExecution -> Rep UpdateJobExecution x
Prelude.Generic)
newUpdateJobExecution ::
Prelude.Text ->
Prelude.Text ->
JobExecutionStatus ->
UpdateJobExecution
newUpdateJobExecution :: Text -> Text -> JobExecutionStatus -> UpdateJobExecution
newUpdateJobExecution Text
pJobId_ Text
pThingName_ JobExecutionStatus
pStatus_ =
UpdateJobExecution' :: Maybe Bool
-> Maybe Integer
-> Maybe (HashMap Text Text)
-> Maybe Integer
-> Maybe Integer
-> Maybe Bool
-> Text
-> Text
-> JobExecutionStatus
-> UpdateJobExecution
UpdateJobExecution'
{ $sel:includeJobDocument:UpdateJobExecution' :: Maybe Bool
includeJobDocument =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:stepTimeoutInMinutes:UpdateJobExecution' :: Maybe Integer
stepTimeoutInMinutes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:statusDetails:UpdateJobExecution' :: Maybe (HashMap Text Text)
statusDetails = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:executionNumber:UpdateJobExecution' :: Maybe Integer
executionNumber = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:expectedVersion:UpdateJobExecution' :: Maybe Integer
expectedVersion = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:includeJobExecutionState:UpdateJobExecution' :: Maybe Bool
includeJobExecutionState = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:jobId:UpdateJobExecution' :: Text
jobId = Text
pJobId_,
$sel:thingName:UpdateJobExecution' :: Text
thingName = Text
pThingName_,
$sel:status:UpdateJobExecution' :: JobExecutionStatus
status = JobExecutionStatus
pStatus_
}
updateJobExecution_includeJobDocument :: Lens.Lens' UpdateJobExecution (Prelude.Maybe Prelude.Bool)
updateJobExecution_includeJobDocument :: (Maybe Bool -> f (Maybe Bool))
-> UpdateJobExecution -> f UpdateJobExecution
updateJobExecution_includeJobDocument = (UpdateJobExecution -> Maybe Bool)
-> (UpdateJobExecution -> Maybe Bool -> UpdateJobExecution)
-> Lens
UpdateJobExecution UpdateJobExecution (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobExecution' {Maybe Bool
includeJobDocument :: Maybe Bool
$sel:includeJobDocument:UpdateJobExecution' :: UpdateJobExecution -> Maybe Bool
includeJobDocument} -> Maybe Bool
includeJobDocument) (\s :: UpdateJobExecution
s@UpdateJobExecution' {} Maybe Bool
a -> UpdateJobExecution
s {$sel:includeJobDocument:UpdateJobExecution' :: Maybe Bool
includeJobDocument = Maybe Bool
a} :: UpdateJobExecution)
updateJobExecution_stepTimeoutInMinutes :: Lens.Lens' UpdateJobExecution (Prelude.Maybe Prelude.Integer)
updateJobExecution_stepTimeoutInMinutes :: (Maybe Integer -> f (Maybe Integer))
-> UpdateJobExecution -> f UpdateJobExecution
updateJobExecution_stepTimeoutInMinutes = (UpdateJobExecution -> Maybe Integer)
-> (UpdateJobExecution -> Maybe Integer -> UpdateJobExecution)
-> Lens
UpdateJobExecution
UpdateJobExecution
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobExecution' {Maybe Integer
stepTimeoutInMinutes :: Maybe Integer
$sel:stepTimeoutInMinutes:UpdateJobExecution' :: UpdateJobExecution -> Maybe Integer
stepTimeoutInMinutes} -> Maybe Integer
stepTimeoutInMinutes) (\s :: UpdateJobExecution
s@UpdateJobExecution' {} Maybe Integer
a -> UpdateJobExecution
s {$sel:stepTimeoutInMinutes:UpdateJobExecution' :: Maybe Integer
stepTimeoutInMinutes = Maybe Integer
a} :: UpdateJobExecution)
updateJobExecution_statusDetails :: Lens.Lens' UpdateJobExecution (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateJobExecution_statusDetails :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateJobExecution -> f UpdateJobExecution
updateJobExecution_statusDetails = (UpdateJobExecution -> Maybe (HashMap Text Text))
-> (UpdateJobExecution
-> Maybe (HashMap Text Text) -> UpdateJobExecution)
-> Lens
UpdateJobExecution
UpdateJobExecution
(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 (\UpdateJobExecution' {Maybe (HashMap Text Text)
statusDetails :: Maybe (HashMap Text Text)
$sel:statusDetails:UpdateJobExecution' :: UpdateJobExecution -> Maybe (HashMap Text Text)
statusDetails} -> Maybe (HashMap Text Text)
statusDetails) (\s :: UpdateJobExecution
s@UpdateJobExecution' {} Maybe (HashMap Text Text)
a -> UpdateJobExecution
s {$sel:statusDetails:UpdateJobExecution' :: Maybe (HashMap Text Text)
statusDetails = Maybe (HashMap Text Text)
a} :: UpdateJobExecution) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateJobExecution -> f UpdateJobExecution)
-> ((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)))
-> UpdateJobExecution
-> f UpdateJobExecution
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
updateJobExecution_executionNumber :: Lens.Lens' UpdateJobExecution (Prelude.Maybe Prelude.Integer)
updateJobExecution_executionNumber :: (Maybe Integer -> f (Maybe Integer))
-> UpdateJobExecution -> f UpdateJobExecution
updateJobExecution_executionNumber = (UpdateJobExecution -> Maybe Integer)
-> (UpdateJobExecution -> Maybe Integer -> UpdateJobExecution)
-> Lens
UpdateJobExecution
UpdateJobExecution
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobExecution' {Maybe Integer
executionNumber :: Maybe Integer
$sel:executionNumber:UpdateJobExecution' :: UpdateJobExecution -> Maybe Integer
executionNumber} -> Maybe Integer
executionNumber) (\s :: UpdateJobExecution
s@UpdateJobExecution' {} Maybe Integer
a -> UpdateJobExecution
s {$sel:executionNumber:UpdateJobExecution' :: Maybe Integer
executionNumber = Maybe Integer
a} :: UpdateJobExecution)
updateJobExecution_expectedVersion :: Lens.Lens' UpdateJobExecution (Prelude.Maybe Prelude.Integer)
updateJobExecution_expectedVersion :: (Maybe Integer -> f (Maybe Integer))
-> UpdateJobExecution -> f UpdateJobExecution
updateJobExecution_expectedVersion = (UpdateJobExecution -> Maybe Integer)
-> (UpdateJobExecution -> Maybe Integer -> UpdateJobExecution)
-> Lens
UpdateJobExecution
UpdateJobExecution
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobExecution' {Maybe Integer
expectedVersion :: Maybe Integer
$sel:expectedVersion:UpdateJobExecution' :: UpdateJobExecution -> Maybe Integer
expectedVersion} -> Maybe Integer
expectedVersion) (\s :: UpdateJobExecution
s@UpdateJobExecution' {} Maybe Integer
a -> UpdateJobExecution
s {$sel:expectedVersion:UpdateJobExecution' :: Maybe Integer
expectedVersion = Maybe Integer
a} :: UpdateJobExecution)
updateJobExecution_includeJobExecutionState :: Lens.Lens' UpdateJobExecution (Prelude.Maybe Prelude.Bool)
updateJobExecution_includeJobExecutionState :: (Maybe Bool -> f (Maybe Bool))
-> UpdateJobExecution -> f UpdateJobExecution
updateJobExecution_includeJobExecutionState = (UpdateJobExecution -> Maybe Bool)
-> (UpdateJobExecution -> Maybe Bool -> UpdateJobExecution)
-> Lens
UpdateJobExecution UpdateJobExecution (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobExecution' {Maybe Bool
includeJobExecutionState :: Maybe Bool
$sel:includeJobExecutionState:UpdateJobExecution' :: UpdateJobExecution -> Maybe Bool
includeJobExecutionState} -> Maybe Bool
includeJobExecutionState) (\s :: UpdateJobExecution
s@UpdateJobExecution' {} Maybe Bool
a -> UpdateJobExecution
s {$sel:includeJobExecutionState:UpdateJobExecution' :: Maybe Bool
includeJobExecutionState = Maybe Bool
a} :: UpdateJobExecution)
updateJobExecution_jobId :: Lens.Lens' UpdateJobExecution Prelude.Text
updateJobExecution_jobId :: (Text -> f Text) -> UpdateJobExecution -> f UpdateJobExecution
updateJobExecution_jobId = (UpdateJobExecution -> Text)
-> (UpdateJobExecution -> Text -> UpdateJobExecution)
-> Lens UpdateJobExecution UpdateJobExecution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobExecution' {Text
jobId :: Text
$sel:jobId:UpdateJobExecution' :: UpdateJobExecution -> Text
jobId} -> Text
jobId) (\s :: UpdateJobExecution
s@UpdateJobExecution' {} Text
a -> UpdateJobExecution
s {$sel:jobId:UpdateJobExecution' :: Text
jobId = Text
a} :: UpdateJobExecution)
updateJobExecution_thingName :: Lens.Lens' UpdateJobExecution Prelude.Text
updateJobExecution_thingName :: (Text -> f Text) -> UpdateJobExecution -> f UpdateJobExecution
updateJobExecution_thingName = (UpdateJobExecution -> Text)
-> (UpdateJobExecution -> Text -> UpdateJobExecution)
-> Lens UpdateJobExecution UpdateJobExecution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobExecution' {Text
thingName :: Text
$sel:thingName:UpdateJobExecution' :: UpdateJobExecution -> Text
thingName} -> Text
thingName) (\s :: UpdateJobExecution
s@UpdateJobExecution' {} Text
a -> UpdateJobExecution
s {$sel:thingName:UpdateJobExecution' :: Text
thingName = Text
a} :: UpdateJobExecution)
updateJobExecution_status :: Lens.Lens' UpdateJobExecution JobExecutionStatus
updateJobExecution_status :: (JobExecutionStatus -> f JobExecutionStatus)
-> UpdateJobExecution -> f UpdateJobExecution
updateJobExecution_status = (UpdateJobExecution -> JobExecutionStatus)
-> (UpdateJobExecution -> JobExecutionStatus -> UpdateJobExecution)
-> Lens
UpdateJobExecution
UpdateJobExecution
JobExecutionStatus
JobExecutionStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobExecution' {JobExecutionStatus
status :: JobExecutionStatus
$sel:status:UpdateJobExecution' :: UpdateJobExecution -> JobExecutionStatus
status} -> JobExecutionStatus
status) (\s :: UpdateJobExecution
s@UpdateJobExecution' {} JobExecutionStatus
a -> UpdateJobExecution
s {$sel:status:UpdateJobExecution' :: JobExecutionStatus
status = JobExecutionStatus
a} :: UpdateJobExecution)
instance Core.AWSRequest UpdateJobExecution where
type
AWSResponse UpdateJobExecution =
UpdateJobExecutionResponse
request :: UpdateJobExecution -> Request UpdateJobExecution
request = Service -> UpdateJobExecution -> Request UpdateJobExecution
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateJobExecution
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateJobExecution)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateJobExecution))
-> Logger
-> Service
-> Proxy UpdateJobExecution
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateJobExecution)))
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 JobExecutionState -> Int -> UpdateJobExecutionResponse
UpdateJobExecutionResponse'
(Maybe Text
-> Maybe JobExecutionState -> Int -> UpdateJobExecutionResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe JobExecutionState -> Int -> UpdateJobExecutionResponse)
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
"jobDocument")
Either
String
(Maybe JobExecutionState -> Int -> UpdateJobExecutionResponse)
-> Either String (Maybe JobExecutionState)
-> Either String (Int -> UpdateJobExecutionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe JobExecutionState)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"executionState")
Either String (Int -> UpdateJobExecutionResponse)
-> Either String Int -> Either String UpdateJobExecutionResponse
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 UpdateJobExecution
instance Prelude.NFData UpdateJobExecution
instance Core.ToHeaders UpdateJobExecution where
toHeaders :: UpdateJobExecution -> ResponseHeaders
toHeaders = ResponseHeaders -> UpdateJobExecution -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON UpdateJobExecution where
toJSON :: UpdateJobExecution -> Value
toJSON UpdateJobExecution' {Maybe Bool
Maybe Integer
Maybe (HashMap Text Text)
Text
JobExecutionStatus
status :: JobExecutionStatus
thingName :: Text
jobId :: Text
includeJobExecutionState :: Maybe Bool
expectedVersion :: Maybe Integer
executionNumber :: Maybe Integer
statusDetails :: Maybe (HashMap Text Text)
stepTimeoutInMinutes :: Maybe Integer
includeJobDocument :: Maybe Bool
$sel:status:UpdateJobExecution' :: UpdateJobExecution -> JobExecutionStatus
$sel:thingName:UpdateJobExecution' :: UpdateJobExecution -> Text
$sel:jobId:UpdateJobExecution' :: UpdateJobExecution -> Text
$sel:includeJobExecutionState:UpdateJobExecution' :: UpdateJobExecution -> Maybe Bool
$sel:expectedVersion:UpdateJobExecution' :: UpdateJobExecution -> Maybe Integer
$sel:executionNumber:UpdateJobExecution' :: UpdateJobExecution -> Maybe Integer
$sel:statusDetails:UpdateJobExecution' :: UpdateJobExecution -> Maybe (HashMap Text Text)
$sel:stepTimeoutInMinutes:UpdateJobExecution' :: UpdateJobExecution -> Maybe Integer
$sel:includeJobDocument:UpdateJobExecution' :: UpdateJobExecution -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"includeJobDocument" 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
includeJobDocument,
(Text
"stepTimeoutInMinutes" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
stepTimeoutInMinutes,
(Text
"statusDetails" 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)
statusDetails,
(Text
"executionNumber" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
executionNumber,
(Text
"expectedVersion" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
expectedVersion,
(Text
"includeJobExecutionState" 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
includeJobExecutionState,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"status" Text -> JobExecutionStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= JobExecutionStatus
status)
]
)
instance Core.ToPath UpdateJobExecution where
toPath :: UpdateJobExecution -> ByteString
toPath UpdateJobExecution' {Maybe Bool
Maybe Integer
Maybe (HashMap Text Text)
Text
JobExecutionStatus
status :: JobExecutionStatus
thingName :: Text
jobId :: Text
includeJobExecutionState :: Maybe Bool
expectedVersion :: Maybe Integer
executionNumber :: Maybe Integer
statusDetails :: Maybe (HashMap Text Text)
stepTimeoutInMinutes :: Maybe Integer
includeJobDocument :: Maybe Bool
$sel:status:UpdateJobExecution' :: UpdateJobExecution -> JobExecutionStatus
$sel:thingName:UpdateJobExecution' :: UpdateJobExecution -> Text
$sel:jobId:UpdateJobExecution' :: UpdateJobExecution -> Text
$sel:includeJobExecutionState:UpdateJobExecution' :: UpdateJobExecution -> Maybe Bool
$sel:expectedVersion:UpdateJobExecution' :: UpdateJobExecution -> Maybe Integer
$sel:executionNumber:UpdateJobExecution' :: UpdateJobExecution -> Maybe Integer
$sel:statusDetails:UpdateJobExecution' :: UpdateJobExecution -> Maybe (HashMap Text Text)
$sel:stepTimeoutInMinutes:UpdateJobExecution' :: UpdateJobExecution -> Maybe Integer
$sel:includeJobDocument:UpdateJobExecution' :: UpdateJobExecution -> Maybe Bool
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/things/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
thingName,
ByteString
"/jobs/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
jobId
]
instance Core.ToQuery UpdateJobExecution where
toQuery :: UpdateJobExecution -> QueryString
toQuery = QueryString -> UpdateJobExecution -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateJobExecutionResponse = UpdateJobExecutionResponse'
{
UpdateJobExecutionResponse -> Maybe Text
jobDocument :: Prelude.Maybe Prelude.Text,
UpdateJobExecutionResponse -> Maybe JobExecutionState
executionState :: Prelude.Maybe JobExecutionState,
UpdateJobExecutionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateJobExecutionResponse -> UpdateJobExecutionResponse -> Bool
(UpdateJobExecutionResponse -> UpdateJobExecutionResponse -> Bool)
-> (UpdateJobExecutionResponse
-> UpdateJobExecutionResponse -> Bool)
-> Eq UpdateJobExecutionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateJobExecutionResponse -> UpdateJobExecutionResponse -> Bool
$c/= :: UpdateJobExecutionResponse -> UpdateJobExecutionResponse -> Bool
== :: UpdateJobExecutionResponse -> UpdateJobExecutionResponse -> Bool
$c== :: UpdateJobExecutionResponse -> UpdateJobExecutionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateJobExecutionResponse]
ReadPrec UpdateJobExecutionResponse
Int -> ReadS UpdateJobExecutionResponse
ReadS [UpdateJobExecutionResponse]
(Int -> ReadS UpdateJobExecutionResponse)
-> ReadS [UpdateJobExecutionResponse]
-> ReadPrec UpdateJobExecutionResponse
-> ReadPrec [UpdateJobExecutionResponse]
-> Read UpdateJobExecutionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateJobExecutionResponse]
$creadListPrec :: ReadPrec [UpdateJobExecutionResponse]
readPrec :: ReadPrec UpdateJobExecutionResponse
$creadPrec :: ReadPrec UpdateJobExecutionResponse
readList :: ReadS [UpdateJobExecutionResponse]
$creadList :: ReadS [UpdateJobExecutionResponse]
readsPrec :: Int -> ReadS UpdateJobExecutionResponse
$creadsPrec :: Int -> ReadS UpdateJobExecutionResponse
Prelude.Read, Int -> UpdateJobExecutionResponse -> ShowS
[UpdateJobExecutionResponse] -> ShowS
UpdateJobExecutionResponse -> String
(Int -> UpdateJobExecutionResponse -> ShowS)
-> (UpdateJobExecutionResponse -> String)
-> ([UpdateJobExecutionResponse] -> ShowS)
-> Show UpdateJobExecutionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateJobExecutionResponse] -> ShowS
$cshowList :: [UpdateJobExecutionResponse] -> ShowS
show :: UpdateJobExecutionResponse -> String
$cshow :: UpdateJobExecutionResponse -> String
showsPrec :: Int -> UpdateJobExecutionResponse -> ShowS
$cshowsPrec :: Int -> UpdateJobExecutionResponse -> ShowS
Prelude.Show, (forall x.
UpdateJobExecutionResponse -> Rep UpdateJobExecutionResponse x)
-> (forall x.
Rep UpdateJobExecutionResponse x -> UpdateJobExecutionResponse)
-> Generic UpdateJobExecutionResponse
forall x.
Rep UpdateJobExecutionResponse x -> UpdateJobExecutionResponse
forall x.
UpdateJobExecutionResponse -> Rep UpdateJobExecutionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateJobExecutionResponse x -> UpdateJobExecutionResponse
$cfrom :: forall x.
UpdateJobExecutionResponse -> Rep UpdateJobExecutionResponse x
Prelude.Generic)
newUpdateJobExecutionResponse ::
Prelude.Int ->
UpdateJobExecutionResponse
newUpdateJobExecutionResponse :: Int -> UpdateJobExecutionResponse
newUpdateJobExecutionResponse Int
pHttpStatus_ =
UpdateJobExecutionResponse' :: Maybe Text
-> Maybe JobExecutionState -> Int -> UpdateJobExecutionResponse
UpdateJobExecutionResponse'
{ $sel:jobDocument:UpdateJobExecutionResponse' :: Maybe Text
jobDocument =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:executionState:UpdateJobExecutionResponse' :: Maybe JobExecutionState
executionState = Maybe JobExecutionState
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateJobExecutionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateJobExecutionResponse_jobDocument :: Lens.Lens' UpdateJobExecutionResponse (Prelude.Maybe Prelude.Text)
updateJobExecutionResponse_jobDocument :: (Maybe Text -> f (Maybe Text))
-> UpdateJobExecutionResponse -> f UpdateJobExecutionResponse
updateJobExecutionResponse_jobDocument = (UpdateJobExecutionResponse -> Maybe Text)
-> (UpdateJobExecutionResponse
-> Maybe Text -> UpdateJobExecutionResponse)
-> Lens
UpdateJobExecutionResponse
UpdateJobExecutionResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobExecutionResponse' {Maybe Text
jobDocument :: Maybe Text
$sel:jobDocument:UpdateJobExecutionResponse' :: UpdateJobExecutionResponse -> Maybe Text
jobDocument} -> Maybe Text
jobDocument) (\s :: UpdateJobExecutionResponse
s@UpdateJobExecutionResponse' {} Maybe Text
a -> UpdateJobExecutionResponse
s {$sel:jobDocument:UpdateJobExecutionResponse' :: Maybe Text
jobDocument = Maybe Text
a} :: UpdateJobExecutionResponse)
updateJobExecutionResponse_executionState :: Lens.Lens' UpdateJobExecutionResponse (Prelude.Maybe JobExecutionState)
updateJobExecutionResponse_executionState :: (Maybe JobExecutionState -> f (Maybe JobExecutionState))
-> UpdateJobExecutionResponse -> f UpdateJobExecutionResponse
updateJobExecutionResponse_executionState = (UpdateJobExecutionResponse -> Maybe JobExecutionState)
-> (UpdateJobExecutionResponse
-> Maybe JobExecutionState -> UpdateJobExecutionResponse)
-> Lens
UpdateJobExecutionResponse
UpdateJobExecutionResponse
(Maybe JobExecutionState)
(Maybe JobExecutionState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobExecutionResponse' {Maybe JobExecutionState
executionState :: Maybe JobExecutionState
$sel:executionState:UpdateJobExecutionResponse' :: UpdateJobExecutionResponse -> Maybe JobExecutionState
executionState} -> Maybe JobExecutionState
executionState) (\s :: UpdateJobExecutionResponse
s@UpdateJobExecutionResponse' {} Maybe JobExecutionState
a -> UpdateJobExecutionResponse
s {$sel:executionState:UpdateJobExecutionResponse' :: Maybe JobExecutionState
executionState = Maybe JobExecutionState
a} :: UpdateJobExecutionResponse)
updateJobExecutionResponse_httpStatus :: Lens.Lens' UpdateJobExecutionResponse Prelude.Int
updateJobExecutionResponse_httpStatus :: (Int -> f Int)
-> UpdateJobExecutionResponse -> f UpdateJobExecutionResponse
updateJobExecutionResponse_httpStatus = (UpdateJobExecutionResponse -> Int)
-> (UpdateJobExecutionResponse
-> Int -> UpdateJobExecutionResponse)
-> Lens
UpdateJobExecutionResponse UpdateJobExecutionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobExecutionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateJobExecutionResponse' :: UpdateJobExecutionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateJobExecutionResponse
s@UpdateJobExecutionResponse' {} Int
a -> UpdateJobExecutionResponse
s {$sel:httpStatus:UpdateJobExecutionResponse' :: Int
httpStatus = Int
a} :: UpdateJobExecutionResponse)
instance Prelude.NFData UpdateJobExecutionResponse