{-# 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.AppFlow.StopFlow
(
StopFlow (..),
newStopFlow,
stopFlow_flowName,
StopFlowResponse (..),
newStopFlowResponse,
stopFlowResponse_flowArn,
stopFlowResponse_flowStatus,
stopFlowResponse_httpStatus,
)
where
import Amazonka.AppFlow.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data StopFlow = StopFlow'
{
StopFlow -> Text
flowName :: Prelude.Text
}
deriving (StopFlow -> StopFlow -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopFlow -> StopFlow -> Bool
$c/= :: StopFlow -> StopFlow -> Bool
== :: StopFlow -> StopFlow -> Bool
$c== :: StopFlow -> StopFlow -> Bool
Prelude.Eq, ReadPrec [StopFlow]
ReadPrec StopFlow
Int -> ReadS StopFlow
ReadS [StopFlow]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopFlow]
$creadListPrec :: ReadPrec [StopFlow]
readPrec :: ReadPrec StopFlow
$creadPrec :: ReadPrec StopFlow
readList :: ReadS [StopFlow]
$creadList :: ReadS [StopFlow]
readsPrec :: Int -> ReadS StopFlow
$creadsPrec :: Int -> ReadS StopFlow
Prelude.Read, Int -> StopFlow -> ShowS
[StopFlow] -> ShowS
StopFlow -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopFlow] -> ShowS
$cshowList :: [StopFlow] -> ShowS
show :: StopFlow -> String
$cshow :: StopFlow -> String
showsPrec :: Int -> StopFlow -> ShowS
$cshowsPrec :: Int -> StopFlow -> ShowS
Prelude.Show, forall x. Rep StopFlow x -> StopFlow
forall x. StopFlow -> Rep StopFlow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopFlow x -> StopFlow
$cfrom :: forall x. StopFlow -> Rep StopFlow x
Prelude.Generic)
newStopFlow ::
Prelude.Text ->
StopFlow
newStopFlow :: Text -> StopFlow
newStopFlow Text
pFlowName_ =
StopFlow' {$sel:flowName:StopFlow' :: Text
flowName = Text
pFlowName_}
stopFlow_flowName :: Lens.Lens' StopFlow Prelude.Text
stopFlow_flowName :: Lens' StopFlow Text
stopFlow_flowName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopFlow' {Text
flowName :: Text
$sel:flowName:StopFlow' :: StopFlow -> Text
flowName} -> Text
flowName) (\s :: StopFlow
s@StopFlow' {} Text
a -> StopFlow
s {$sel:flowName:StopFlow' :: Text
flowName = Text
a} :: StopFlow)
instance Core.AWSRequest StopFlow where
type AWSResponse StopFlow = StopFlowResponse
request :: (Service -> Service) -> StopFlow -> Request StopFlow
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 StopFlow
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopFlow)))
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 FlowStatus -> Int -> StopFlowResponse
StopFlowResponse'
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
"flowArn")
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
"flowStatus")
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 StopFlow where
hashWithSalt :: Int -> StopFlow -> Int
hashWithSalt Int
_salt StopFlow' {Text
flowName :: Text
$sel:flowName:StopFlow' :: StopFlow -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
flowName
instance Prelude.NFData StopFlow where
rnf :: StopFlow -> ()
rnf StopFlow' {Text
flowName :: Text
$sel:flowName:StopFlow' :: StopFlow -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
flowName
instance Data.ToHeaders StopFlow where
toHeaders :: StopFlow -> 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 StopFlow where
toJSON :: StopFlow -> Value
toJSON StopFlow' {Text
flowName :: Text
$sel:flowName:StopFlow' :: StopFlow -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"flowName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
flowName)]
)
instance Data.ToPath StopFlow where
toPath :: StopFlow -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/stop-flow"
instance Data.ToQuery StopFlow where
toQuery :: StopFlow -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StopFlowResponse = StopFlowResponse'
{
StopFlowResponse -> Maybe Text
flowArn :: Prelude.Maybe Prelude.Text,
StopFlowResponse -> Maybe FlowStatus
flowStatus :: Prelude.Maybe FlowStatus,
StopFlowResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopFlowResponse -> StopFlowResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopFlowResponse -> StopFlowResponse -> Bool
$c/= :: StopFlowResponse -> StopFlowResponse -> Bool
== :: StopFlowResponse -> StopFlowResponse -> Bool
$c== :: StopFlowResponse -> StopFlowResponse -> Bool
Prelude.Eq, ReadPrec [StopFlowResponse]
ReadPrec StopFlowResponse
Int -> ReadS StopFlowResponse
ReadS [StopFlowResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopFlowResponse]
$creadListPrec :: ReadPrec [StopFlowResponse]
readPrec :: ReadPrec StopFlowResponse
$creadPrec :: ReadPrec StopFlowResponse
readList :: ReadS [StopFlowResponse]
$creadList :: ReadS [StopFlowResponse]
readsPrec :: Int -> ReadS StopFlowResponse
$creadsPrec :: Int -> ReadS StopFlowResponse
Prelude.Read, Int -> StopFlowResponse -> ShowS
[StopFlowResponse] -> ShowS
StopFlowResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopFlowResponse] -> ShowS
$cshowList :: [StopFlowResponse] -> ShowS
show :: StopFlowResponse -> String
$cshow :: StopFlowResponse -> String
showsPrec :: Int -> StopFlowResponse -> ShowS
$cshowsPrec :: Int -> StopFlowResponse -> ShowS
Prelude.Show, forall x. Rep StopFlowResponse x -> StopFlowResponse
forall x. StopFlowResponse -> Rep StopFlowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopFlowResponse x -> StopFlowResponse
$cfrom :: forall x. StopFlowResponse -> Rep StopFlowResponse x
Prelude.Generic)
newStopFlowResponse ::
Prelude.Int ->
StopFlowResponse
newStopFlowResponse :: Int -> StopFlowResponse
newStopFlowResponse Int
pHttpStatus_ =
StopFlowResponse'
{ $sel:flowArn:StopFlowResponse' :: Maybe Text
flowArn = forall a. Maybe a
Prelude.Nothing,
$sel:flowStatus:StopFlowResponse' :: Maybe FlowStatus
flowStatus = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopFlowResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopFlowResponse_flowArn :: Lens.Lens' StopFlowResponse (Prelude.Maybe Prelude.Text)
stopFlowResponse_flowArn :: Lens' StopFlowResponse (Maybe Text)
stopFlowResponse_flowArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopFlowResponse' {Maybe Text
flowArn :: Maybe Text
$sel:flowArn:StopFlowResponse' :: StopFlowResponse -> Maybe Text
flowArn} -> Maybe Text
flowArn) (\s :: StopFlowResponse
s@StopFlowResponse' {} Maybe Text
a -> StopFlowResponse
s {$sel:flowArn:StopFlowResponse' :: Maybe Text
flowArn = Maybe Text
a} :: StopFlowResponse)
stopFlowResponse_flowStatus :: Lens.Lens' StopFlowResponse (Prelude.Maybe FlowStatus)
stopFlowResponse_flowStatus :: Lens' StopFlowResponse (Maybe FlowStatus)
stopFlowResponse_flowStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopFlowResponse' {Maybe FlowStatus
flowStatus :: Maybe FlowStatus
$sel:flowStatus:StopFlowResponse' :: StopFlowResponse -> Maybe FlowStatus
flowStatus} -> Maybe FlowStatus
flowStatus) (\s :: StopFlowResponse
s@StopFlowResponse' {} Maybe FlowStatus
a -> StopFlowResponse
s {$sel:flowStatus:StopFlowResponse' :: Maybe FlowStatus
flowStatus = Maybe FlowStatus
a} :: StopFlowResponse)
stopFlowResponse_httpStatus :: Lens.Lens' StopFlowResponse Prelude.Int
stopFlowResponse_httpStatus :: Lens' StopFlowResponse Int
stopFlowResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopFlowResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopFlowResponse' :: StopFlowResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopFlowResponse
s@StopFlowResponse' {} Int
a -> StopFlowResponse
s {$sel:httpStatus:StopFlowResponse' :: Int
httpStatus = Int
a} :: StopFlowResponse)
instance Prelude.NFData StopFlowResponse where
rnf :: StopFlowResponse -> ()
rnf StopFlowResponse' {Int
Maybe Text
Maybe FlowStatus
httpStatus :: Int
flowStatus :: Maybe FlowStatus
flowArn :: Maybe Text
$sel:httpStatus:StopFlowResponse' :: StopFlowResponse -> Int
$sel:flowStatus:StopFlowResponse' :: StopFlowResponse -> Maybe FlowStatus
$sel:flowArn:StopFlowResponse' :: StopFlowResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
flowArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FlowStatus
flowStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus