{-# 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.MigrationHubOrchestrator.StopWorkflow
(
StopWorkflow (..),
newStopWorkflow,
stopWorkflow_id,
StopWorkflowResponse (..),
newStopWorkflowResponse,
stopWorkflowResponse_arn,
stopWorkflowResponse_id,
stopWorkflowResponse_lastStopTime,
stopWorkflowResponse_status,
stopWorkflowResponse_statusMessage,
stopWorkflowResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MigrationHubOrchestrator.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data StopWorkflow = StopWorkflow'
{
StopWorkflow -> Text
id :: Prelude.Text
}
deriving (StopWorkflow -> StopWorkflow -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopWorkflow -> StopWorkflow -> Bool
$c/= :: StopWorkflow -> StopWorkflow -> Bool
== :: StopWorkflow -> StopWorkflow -> Bool
$c== :: StopWorkflow -> StopWorkflow -> Bool
Prelude.Eq, ReadPrec [StopWorkflow]
ReadPrec StopWorkflow
Int -> ReadS StopWorkflow
ReadS [StopWorkflow]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopWorkflow]
$creadListPrec :: ReadPrec [StopWorkflow]
readPrec :: ReadPrec StopWorkflow
$creadPrec :: ReadPrec StopWorkflow
readList :: ReadS [StopWorkflow]
$creadList :: ReadS [StopWorkflow]
readsPrec :: Int -> ReadS StopWorkflow
$creadsPrec :: Int -> ReadS StopWorkflow
Prelude.Read, Int -> StopWorkflow -> ShowS
[StopWorkflow] -> ShowS
StopWorkflow -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopWorkflow] -> ShowS
$cshowList :: [StopWorkflow] -> ShowS
show :: StopWorkflow -> String
$cshow :: StopWorkflow -> String
showsPrec :: Int -> StopWorkflow -> ShowS
$cshowsPrec :: Int -> StopWorkflow -> ShowS
Prelude.Show, forall x. Rep StopWorkflow x -> StopWorkflow
forall x. StopWorkflow -> Rep StopWorkflow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopWorkflow x -> StopWorkflow
$cfrom :: forall x. StopWorkflow -> Rep StopWorkflow x
Prelude.Generic)
newStopWorkflow ::
Prelude.Text ->
StopWorkflow
newStopWorkflow :: Text -> StopWorkflow
newStopWorkflow Text
pId_ = StopWorkflow' {$sel:id:StopWorkflow' :: Text
id = Text
pId_}
stopWorkflow_id :: Lens.Lens' StopWorkflow Prelude.Text
stopWorkflow_id :: Lens' StopWorkflow Text
stopWorkflow_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopWorkflow' {Text
id :: Text
$sel:id:StopWorkflow' :: StopWorkflow -> Text
id} -> Text
id) (\s :: StopWorkflow
s@StopWorkflow' {} Text
a -> StopWorkflow
s {$sel:id:StopWorkflow' :: Text
id = Text
a} :: StopWorkflow)
instance Core.AWSRequest StopWorkflow where
type AWSResponse StopWorkflow = StopWorkflowResponse
request :: (Service -> Service) -> StopWorkflow -> Request StopWorkflow
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StopWorkflow
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopWorkflow)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe MigrationWorkflowStatusEnum
-> Maybe Text
-> Int
-> StopWorkflowResponse
StopWorkflowResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"id")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"lastStopTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"status")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"statusMessage")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable StopWorkflow where
hashWithSalt :: Int -> StopWorkflow -> Int
hashWithSalt Int
_salt StopWorkflow' {Text
id :: Text
$sel:id:StopWorkflow' :: StopWorkflow -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
instance Prelude.NFData StopWorkflow where
rnf :: StopWorkflow -> ()
rnf StopWorkflow' {Text
id :: Text
$sel:id:StopWorkflow' :: StopWorkflow -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
id
instance Data.ToHeaders StopWorkflow where
toHeaders :: StopWorkflow -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON StopWorkflow where
toJSON :: StopWorkflow -> Value
toJSON = forall a b. a -> b -> a
Prelude.const (Object -> Value
Data.Object forall a. Monoid a => a
Prelude.mempty)
instance Data.ToPath StopWorkflow where
toPath :: StopWorkflow -> ByteString
toPath StopWorkflow' {Text
id :: Text
$sel:id:StopWorkflow' :: StopWorkflow -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/migrationworkflow/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
id, ByteString
"/stop"]
instance Data.ToQuery StopWorkflow where
toQuery :: StopWorkflow -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StopWorkflowResponse = StopWorkflowResponse'
{
StopWorkflowResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
StopWorkflowResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
StopWorkflowResponse -> Maybe POSIX
lastStopTime :: Prelude.Maybe Data.POSIX,
StopWorkflowResponse -> Maybe MigrationWorkflowStatusEnum
status :: Prelude.Maybe MigrationWorkflowStatusEnum,
StopWorkflowResponse -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
StopWorkflowResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopWorkflowResponse -> StopWorkflowResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopWorkflowResponse -> StopWorkflowResponse -> Bool
$c/= :: StopWorkflowResponse -> StopWorkflowResponse -> Bool
== :: StopWorkflowResponse -> StopWorkflowResponse -> Bool
$c== :: StopWorkflowResponse -> StopWorkflowResponse -> Bool
Prelude.Eq, ReadPrec [StopWorkflowResponse]
ReadPrec StopWorkflowResponse
Int -> ReadS StopWorkflowResponse
ReadS [StopWorkflowResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopWorkflowResponse]
$creadListPrec :: ReadPrec [StopWorkflowResponse]
readPrec :: ReadPrec StopWorkflowResponse
$creadPrec :: ReadPrec StopWorkflowResponse
readList :: ReadS [StopWorkflowResponse]
$creadList :: ReadS [StopWorkflowResponse]
readsPrec :: Int -> ReadS StopWorkflowResponse
$creadsPrec :: Int -> ReadS StopWorkflowResponse
Prelude.Read, Int -> StopWorkflowResponse -> ShowS
[StopWorkflowResponse] -> ShowS
StopWorkflowResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopWorkflowResponse] -> ShowS
$cshowList :: [StopWorkflowResponse] -> ShowS
show :: StopWorkflowResponse -> String
$cshow :: StopWorkflowResponse -> String
showsPrec :: Int -> StopWorkflowResponse -> ShowS
$cshowsPrec :: Int -> StopWorkflowResponse -> ShowS
Prelude.Show, forall x. Rep StopWorkflowResponse x -> StopWorkflowResponse
forall x. StopWorkflowResponse -> Rep StopWorkflowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopWorkflowResponse x -> StopWorkflowResponse
$cfrom :: forall x. StopWorkflowResponse -> Rep StopWorkflowResponse x
Prelude.Generic)
newStopWorkflowResponse ::
Prelude.Int ->
StopWorkflowResponse
newStopWorkflowResponse :: Int -> StopWorkflowResponse
newStopWorkflowResponse Int
pHttpStatus_ =
StopWorkflowResponse'
{ $sel:arn:StopWorkflowResponse' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:id:StopWorkflowResponse' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
$sel:lastStopTime:StopWorkflowResponse' :: Maybe POSIX
lastStopTime = forall a. Maybe a
Prelude.Nothing,
$sel:status:StopWorkflowResponse' :: Maybe MigrationWorkflowStatusEnum
status = forall a. Maybe a
Prelude.Nothing,
$sel:statusMessage:StopWorkflowResponse' :: Maybe Text
statusMessage = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopWorkflowResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopWorkflowResponse_arn :: Lens.Lens' StopWorkflowResponse (Prelude.Maybe Prelude.Text)
stopWorkflowResponse_arn :: Lens' StopWorkflowResponse (Maybe Text)
stopWorkflowResponse_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopWorkflowResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:StopWorkflowResponse' :: StopWorkflowResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: StopWorkflowResponse
s@StopWorkflowResponse' {} Maybe Text
a -> StopWorkflowResponse
s {$sel:arn:StopWorkflowResponse' :: Maybe Text
arn = Maybe Text
a} :: StopWorkflowResponse)
stopWorkflowResponse_id :: Lens.Lens' StopWorkflowResponse (Prelude.Maybe Prelude.Text)
stopWorkflowResponse_id :: Lens' StopWorkflowResponse (Maybe Text)
stopWorkflowResponse_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopWorkflowResponse' {Maybe Text
id :: Maybe Text
$sel:id:StopWorkflowResponse' :: StopWorkflowResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: StopWorkflowResponse
s@StopWorkflowResponse' {} Maybe Text
a -> StopWorkflowResponse
s {$sel:id:StopWorkflowResponse' :: Maybe Text
id = Maybe Text
a} :: StopWorkflowResponse)
stopWorkflowResponse_lastStopTime :: Lens.Lens' StopWorkflowResponse (Prelude.Maybe Prelude.UTCTime)
stopWorkflowResponse_lastStopTime :: Lens' StopWorkflowResponse (Maybe UTCTime)
stopWorkflowResponse_lastStopTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopWorkflowResponse' {Maybe POSIX
lastStopTime :: Maybe POSIX
$sel:lastStopTime:StopWorkflowResponse' :: StopWorkflowResponse -> Maybe POSIX
lastStopTime} -> Maybe POSIX
lastStopTime) (\s :: StopWorkflowResponse
s@StopWorkflowResponse' {} Maybe POSIX
a -> StopWorkflowResponse
s {$sel:lastStopTime:StopWorkflowResponse' :: Maybe POSIX
lastStopTime = Maybe POSIX
a} :: StopWorkflowResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
stopWorkflowResponse_status :: Lens.Lens' StopWorkflowResponse (Prelude.Maybe MigrationWorkflowStatusEnum)
stopWorkflowResponse_status :: Lens' StopWorkflowResponse (Maybe MigrationWorkflowStatusEnum)
stopWorkflowResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopWorkflowResponse' {Maybe MigrationWorkflowStatusEnum
status :: Maybe MigrationWorkflowStatusEnum
$sel:status:StopWorkflowResponse' :: StopWorkflowResponse -> Maybe MigrationWorkflowStatusEnum
status} -> Maybe MigrationWorkflowStatusEnum
status) (\s :: StopWorkflowResponse
s@StopWorkflowResponse' {} Maybe MigrationWorkflowStatusEnum
a -> StopWorkflowResponse
s {$sel:status:StopWorkflowResponse' :: Maybe MigrationWorkflowStatusEnum
status = Maybe MigrationWorkflowStatusEnum
a} :: StopWorkflowResponse)
stopWorkflowResponse_statusMessage :: Lens.Lens' StopWorkflowResponse (Prelude.Maybe Prelude.Text)
stopWorkflowResponse_statusMessage :: Lens' StopWorkflowResponse (Maybe Text)
stopWorkflowResponse_statusMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopWorkflowResponse' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:StopWorkflowResponse' :: StopWorkflowResponse -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: StopWorkflowResponse
s@StopWorkflowResponse' {} Maybe Text
a -> StopWorkflowResponse
s {$sel:statusMessage:StopWorkflowResponse' :: Maybe Text
statusMessage = Maybe Text
a} :: StopWorkflowResponse)
stopWorkflowResponse_httpStatus :: Lens.Lens' StopWorkflowResponse Prelude.Int
stopWorkflowResponse_httpStatus :: Lens' StopWorkflowResponse Int
stopWorkflowResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopWorkflowResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopWorkflowResponse' :: StopWorkflowResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopWorkflowResponse
s@StopWorkflowResponse' {} Int
a -> StopWorkflowResponse
s {$sel:httpStatus:StopWorkflowResponse' :: Int
httpStatus = Int
a} :: StopWorkflowResponse)
instance Prelude.NFData StopWorkflowResponse where
rnf :: StopWorkflowResponse -> ()
rnf StopWorkflowResponse' {Int
Maybe Text
Maybe POSIX
Maybe MigrationWorkflowStatusEnum
httpStatus :: Int
statusMessage :: Maybe Text
status :: Maybe MigrationWorkflowStatusEnum
lastStopTime :: Maybe POSIX
id :: Maybe Text
arn :: Maybe Text
$sel:httpStatus:StopWorkflowResponse' :: StopWorkflowResponse -> Int
$sel:statusMessage:StopWorkflowResponse' :: StopWorkflowResponse -> Maybe Text
$sel:status:StopWorkflowResponse' :: StopWorkflowResponse -> Maybe MigrationWorkflowStatusEnum
$sel:lastStopTime:StopWorkflowResponse' :: StopWorkflowResponse -> Maybe POSIX
$sel:id:StopWorkflowResponse' :: StopWorkflowResponse -> Maybe Text
$sel:arn:StopWorkflowResponse' :: StopWorkflowResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastStopTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MigrationWorkflowStatusEnum
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusMessage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus