{-# 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.Transfer.SendWorkflowStepState
(
SendWorkflowStepState (..),
newSendWorkflowStepState,
sendWorkflowStepState_workflowId,
sendWorkflowStepState_executionId,
sendWorkflowStepState_token,
sendWorkflowStepState_status,
SendWorkflowStepStateResponse (..),
newSendWorkflowStepStateResponse,
sendWorkflowStepStateResponse_httpStatus,
)
where
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
import Amazonka.Transfer.Types
data SendWorkflowStepState = SendWorkflowStepState'
{
SendWorkflowStepState -> Text
workflowId :: Prelude.Text,
SendWorkflowStepState -> Text
executionId :: Prelude.Text,
SendWorkflowStepState -> Text
token :: Prelude.Text,
SendWorkflowStepState -> CustomStepStatus
status :: CustomStepStatus
}
deriving (SendWorkflowStepState -> SendWorkflowStepState -> Bool
(SendWorkflowStepState -> SendWorkflowStepState -> Bool)
-> (SendWorkflowStepState -> SendWorkflowStepState -> Bool)
-> Eq SendWorkflowStepState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendWorkflowStepState -> SendWorkflowStepState -> Bool
$c/= :: SendWorkflowStepState -> SendWorkflowStepState -> Bool
== :: SendWorkflowStepState -> SendWorkflowStepState -> Bool
$c== :: SendWorkflowStepState -> SendWorkflowStepState -> Bool
Prelude.Eq, ReadPrec [SendWorkflowStepState]
ReadPrec SendWorkflowStepState
Int -> ReadS SendWorkflowStepState
ReadS [SendWorkflowStepState]
(Int -> ReadS SendWorkflowStepState)
-> ReadS [SendWorkflowStepState]
-> ReadPrec SendWorkflowStepState
-> ReadPrec [SendWorkflowStepState]
-> Read SendWorkflowStepState
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendWorkflowStepState]
$creadListPrec :: ReadPrec [SendWorkflowStepState]
readPrec :: ReadPrec SendWorkflowStepState
$creadPrec :: ReadPrec SendWorkflowStepState
readList :: ReadS [SendWorkflowStepState]
$creadList :: ReadS [SendWorkflowStepState]
readsPrec :: Int -> ReadS SendWorkflowStepState
$creadsPrec :: Int -> ReadS SendWorkflowStepState
Prelude.Read, Int -> SendWorkflowStepState -> ShowS
[SendWorkflowStepState] -> ShowS
SendWorkflowStepState -> String
(Int -> SendWorkflowStepState -> ShowS)
-> (SendWorkflowStepState -> String)
-> ([SendWorkflowStepState] -> ShowS)
-> Show SendWorkflowStepState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendWorkflowStepState] -> ShowS
$cshowList :: [SendWorkflowStepState] -> ShowS
show :: SendWorkflowStepState -> String
$cshow :: SendWorkflowStepState -> String
showsPrec :: Int -> SendWorkflowStepState -> ShowS
$cshowsPrec :: Int -> SendWorkflowStepState -> ShowS
Prelude.Show, (forall x. SendWorkflowStepState -> Rep SendWorkflowStepState x)
-> (forall x. Rep SendWorkflowStepState x -> SendWorkflowStepState)
-> Generic SendWorkflowStepState
forall x. Rep SendWorkflowStepState x -> SendWorkflowStepState
forall x. SendWorkflowStepState -> Rep SendWorkflowStepState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendWorkflowStepState x -> SendWorkflowStepState
$cfrom :: forall x. SendWorkflowStepState -> Rep SendWorkflowStepState x
Prelude.Generic)
newSendWorkflowStepState ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
CustomStepStatus ->
SendWorkflowStepState
newSendWorkflowStepState :: Text -> Text -> Text -> CustomStepStatus -> SendWorkflowStepState
newSendWorkflowStepState
Text
pWorkflowId_
Text
pExecutionId_
Text
pToken_
CustomStepStatus
pStatus_ =
SendWorkflowStepState' :: Text -> Text -> Text -> CustomStepStatus -> SendWorkflowStepState
SendWorkflowStepState'
{ $sel:workflowId:SendWorkflowStepState' :: Text
workflowId = Text
pWorkflowId_,
$sel:executionId:SendWorkflowStepState' :: Text
executionId = Text
pExecutionId_,
$sel:token:SendWorkflowStepState' :: Text
token = Text
pToken_,
$sel:status:SendWorkflowStepState' :: CustomStepStatus
status = CustomStepStatus
pStatus_
}
sendWorkflowStepState_workflowId :: Lens.Lens' SendWorkflowStepState Prelude.Text
sendWorkflowStepState_workflowId :: (Text -> f Text)
-> SendWorkflowStepState -> f SendWorkflowStepState
sendWorkflowStepState_workflowId = (SendWorkflowStepState -> Text)
-> (SendWorkflowStepState -> Text -> SendWorkflowStepState)
-> Lens SendWorkflowStepState SendWorkflowStepState Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendWorkflowStepState' {Text
workflowId :: Text
$sel:workflowId:SendWorkflowStepState' :: SendWorkflowStepState -> Text
workflowId} -> Text
workflowId) (\s :: SendWorkflowStepState
s@SendWorkflowStepState' {} Text
a -> SendWorkflowStepState
s {$sel:workflowId:SendWorkflowStepState' :: Text
workflowId = Text
a} :: SendWorkflowStepState)
sendWorkflowStepState_executionId :: Lens.Lens' SendWorkflowStepState Prelude.Text
sendWorkflowStepState_executionId :: (Text -> f Text)
-> SendWorkflowStepState -> f SendWorkflowStepState
sendWorkflowStepState_executionId = (SendWorkflowStepState -> Text)
-> (SendWorkflowStepState -> Text -> SendWorkflowStepState)
-> Lens SendWorkflowStepState SendWorkflowStepState Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendWorkflowStepState' {Text
executionId :: Text
$sel:executionId:SendWorkflowStepState' :: SendWorkflowStepState -> Text
executionId} -> Text
executionId) (\s :: SendWorkflowStepState
s@SendWorkflowStepState' {} Text
a -> SendWorkflowStepState
s {$sel:executionId:SendWorkflowStepState' :: Text
executionId = Text
a} :: SendWorkflowStepState)
sendWorkflowStepState_token :: Lens.Lens' SendWorkflowStepState Prelude.Text
sendWorkflowStepState_token :: (Text -> f Text)
-> SendWorkflowStepState -> f SendWorkflowStepState
sendWorkflowStepState_token = (SendWorkflowStepState -> Text)
-> (SendWorkflowStepState -> Text -> SendWorkflowStepState)
-> Lens SendWorkflowStepState SendWorkflowStepState Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendWorkflowStepState' {Text
token :: Text
$sel:token:SendWorkflowStepState' :: SendWorkflowStepState -> Text
token} -> Text
token) (\s :: SendWorkflowStepState
s@SendWorkflowStepState' {} Text
a -> SendWorkflowStepState
s {$sel:token:SendWorkflowStepState' :: Text
token = Text
a} :: SendWorkflowStepState)
sendWorkflowStepState_status :: Lens.Lens' SendWorkflowStepState CustomStepStatus
sendWorkflowStepState_status :: (CustomStepStatus -> f CustomStepStatus)
-> SendWorkflowStepState -> f SendWorkflowStepState
sendWorkflowStepState_status = (SendWorkflowStepState -> CustomStepStatus)
-> (SendWorkflowStepState
-> CustomStepStatus -> SendWorkflowStepState)
-> Lens
SendWorkflowStepState
SendWorkflowStepState
CustomStepStatus
CustomStepStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendWorkflowStepState' {CustomStepStatus
status :: CustomStepStatus
$sel:status:SendWorkflowStepState' :: SendWorkflowStepState -> CustomStepStatus
status} -> CustomStepStatus
status) (\s :: SendWorkflowStepState
s@SendWorkflowStepState' {} CustomStepStatus
a -> SendWorkflowStepState
s {$sel:status:SendWorkflowStepState' :: CustomStepStatus
status = CustomStepStatus
a} :: SendWorkflowStepState)
instance Core.AWSRequest SendWorkflowStepState where
type
AWSResponse SendWorkflowStepState =
SendWorkflowStepStateResponse
request :: SendWorkflowStepState -> Request SendWorkflowStepState
request = Service -> SendWorkflowStepState -> Request SendWorkflowStepState
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SendWorkflowStepState
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SendWorkflowStepState)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse SendWorkflowStepState))
-> Logger
-> Service
-> Proxy SendWorkflowStepState
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SendWorkflowStepState)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> SendWorkflowStepStateResponse
SendWorkflowStepStateResponse'
(Int -> SendWorkflowStepStateResponse)
-> Either String Int -> Either String SendWorkflowStepStateResponse
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))
)
instance Prelude.Hashable SendWorkflowStepState
instance Prelude.NFData SendWorkflowStepState
instance Core.ToHeaders SendWorkflowStepState where
toHeaders :: SendWorkflowStepState -> ResponseHeaders
toHeaders =
ResponseHeaders -> SendWorkflowStepState -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"TransferService.SendWorkflowStepState" ::
Prelude.ByteString
),
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 SendWorkflowStepState where
toJSON :: SendWorkflowStepState -> Value
toJSON SendWorkflowStepState' {Text
CustomStepStatus
status :: CustomStepStatus
token :: Text
executionId :: Text
workflowId :: Text
$sel:status:SendWorkflowStepState' :: SendWorkflowStepState -> CustomStepStatus
$sel:token:SendWorkflowStepState' :: SendWorkflowStepState -> Text
$sel:executionId:SendWorkflowStepState' :: SendWorkflowStepState -> Text
$sel:workflowId:SendWorkflowStepState' :: SendWorkflowStepState -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"WorkflowId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
workflowId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ExecutionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
executionId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Token" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
token),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Status" Text -> CustomStepStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= CustomStepStatus
status)
]
)
instance Core.ToPath SendWorkflowStepState where
toPath :: SendWorkflowStepState -> ByteString
toPath = ByteString -> SendWorkflowStepState -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SendWorkflowStepState where
toQuery :: SendWorkflowStepState -> QueryString
toQuery = QueryString -> SendWorkflowStepState -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SendWorkflowStepStateResponse = SendWorkflowStepStateResponse'
{
SendWorkflowStepStateResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SendWorkflowStepStateResponse
-> SendWorkflowStepStateResponse -> Bool
(SendWorkflowStepStateResponse
-> SendWorkflowStepStateResponse -> Bool)
-> (SendWorkflowStepStateResponse
-> SendWorkflowStepStateResponse -> Bool)
-> Eq SendWorkflowStepStateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendWorkflowStepStateResponse
-> SendWorkflowStepStateResponse -> Bool
$c/= :: SendWorkflowStepStateResponse
-> SendWorkflowStepStateResponse -> Bool
== :: SendWorkflowStepStateResponse
-> SendWorkflowStepStateResponse -> Bool
$c== :: SendWorkflowStepStateResponse
-> SendWorkflowStepStateResponse -> Bool
Prelude.Eq, ReadPrec [SendWorkflowStepStateResponse]
ReadPrec SendWorkflowStepStateResponse
Int -> ReadS SendWorkflowStepStateResponse
ReadS [SendWorkflowStepStateResponse]
(Int -> ReadS SendWorkflowStepStateResponse)
-> ReadS [SendWorkflowStepStateResponse]
-> ReadPrec SendWorkflowStepStateResponse
-> ReadPrec [SendWorkflowStepStateResponse]
-> Read SendWorkflowStepStateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendWorkflowStepStateResponse]
$creadListPrec :: ReadPrec [SendWorkflowStepStateResponse]
readPrec :: ReadPrec SendWorkflowStepStateResponse
$creadPrec :: ReadPrec SendWorkflowStepStateResponse
readList :: ReadS [SendWorkflowStepStateResponse]
$creadList :: ReadS [SendWorkflowStepStateResponse]
readsPrec :: Int -> ReadS SendWorkflowStepStateResponse
$creadsPrec :: Int -> ReadS SendWorkflowStepStateResponse
Prelude.Read, Int -> SendWorkflowStepStateResponse -> ShowS
[SendWorkflowStepStateResponse] -> ShowS
SendWorkflowStepStateResponse -> String
(Int -> SendWorkflowStepStateResponse -> ShowS)
-> (SendWorkflowStepStateResponse -> String)
-> ([SendWorkflowStepStateResponse] -> ShowS)
-> Show SendWorkflowStepStateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendWorkflowStepStateResponse] -> ShowS
$cshowList :: [SendWorkflowStepStateResponse] -> ShowS
show :: SendWorkflowStepStateResponse -> String
$cshow :: SendWorkflowStepStateResponse -> String
showsPrec :: Int -> SendWorkflowStepStateResponse -> ShowS
$cshowsPrec :: Int -> SendWorkflowStepStateResponse -> ShowS
Prelude.Show, (forall x.
SendWorkflowStepStateResponse
-> Rep SendWorkflowStepStateResponse x)
-> (forall x.
Rep SendWorkflowStepStateResponse x
-> SendWorkflowStepStateResponse)
-> Generic SendWorkflowStepStateResponse
forall x.
Rep SendWorkflowStepStateResponse x
-> SendWorkflowStepStateResponse
forall x.
SendWorkflowStepStateResponse
-> Rep SendWorkflowStepStateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SendWorkflowStepStateResponse x
-> SendWorkflowStepStateResponse
$cfrom :: forall x.
SendWorkflowStepStateResponse
-> Rep SendWorkflowStepStateResponse x
Prelude.Generic)
newSendWorkflowStepStateResponse ::
Prelude.Int ->
SendWorkflowStepStateResponse
newSendWorkflowStepStateResponse :: Int -> SendWorkflowStepStateResponse
newSendWorkflowStepStateResponse Int
pHttpStatus_ =
SendWorkflowStepStateResponse' :: Int -> SendWorkflowStepStateResponse
SendWorkflowStepStateResponse'
{ $sel:httpStatus:SendWorkflowStepStateResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
sendWorkflowStepStateResponse_httpStatus :: Lens.Lens' SendWorkflowStepStateResponse Prelude.Int
sendWorkflowStepStateResponse_httpStatus :: (Int -> f Int)
-> SendWorkflowStepStateResponse -> f SendWorkflowStepStateResponse
sendWorkflowStepStateResponse_httpStatus = (SendWorkflowStepStateResponse -> Int)
-> (SendWorkflowStepStateResponse
-> Int -> SendWorkflowStepStateResponse)
-> Lens
SendWorkflowStepStateResponse SendWorkflowStepStateResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendWorkflowStepStateResponse' {Int
httpStatus :: Int
$sel:httpStatus:SendWorkflowStepStateResponse' :: SendWorkflowStepStateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SendWorkflowStepStateResponse
s@SendWorkflowStepStateResponse' {} Int
a -> SendWorkflowStepStateResponse
s {$sel:httpStatus:SendWorkflowStepStateResponse' :: Int
httpStatus = Int
a} :: SendWorkflowStepStateResponse)
instance Prelude.NFData SendWorkflowStepStateResponse