{-# 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.StepFunctions.DeleteStateMachine
(
DeleteStateMachine (..),
newDeleteStateMachine,
deleteStateMachine_stateMachineArn,
DeleteStateMachineResponse (..),
newDeleteStateMachineResponse,
deleteStateMachineResponse_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.StepFunctions.Types
data DeleteStateMachine = DeleteStateMachine'
{
DeleteStateMachine -> Text
stateMachineArn :: Prelude.Text
}
deriving (DeleteStateMachine -> DeleteStateMachine -> Bool
(DeleteStateMachine -> DeleteStateMachine -> Bool)
-> (DeleteStateMachine -> DeleteStateMachine -> Bool)
-> Eq DeleteStateMachine
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteStateMachine -> DeleteStateMachine -> Bool
$c/= :: DeleteStateMachine -> DeleteStateMachine -> Bool
== :: DeleteStateMachine -> DeleteStateMachine -> Bool
$c== :: DeleteStateMachine -> DeleteStateMachine -> Bool
Prelude.Eq, ReadPrec [DeleteStateMachine]
ReadPrec DeleteStateMachine
Int -> ReadS DeleteStateMachine
ReadS [DeleteStateMachine]
(Int -> ReadS DeleteStateMachine)
-> ReadS [DeleteStateMachine]
-> ReadPrec DeleteStateMachine
-> ReadPrec [DeleteStateMachine]
-> Read DeleteStateMachine
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteStateMachine]
$creadListPrec :: ReadPrec [DeleteStateMachine]
readPrec :: ReadPrec DeleteStateMachine
$creadPrec :: ReadPrec DeleteStateMachine
readList :: ReadS [DeleteStateMachine]
$creadList :: ReadS [DeleteStateMachine]
readsPrec :: Int -> ReadS DeleteStateMachine
$creadsPrec :: Int -> ReadS DeleteStateMachine
Prelude.Read, Int -> DeleteStateMachine -> ShowS
[DeleteStateMachine] -> ShowS
DeleteStateMachine -> String
(Int -> DeleteStateMachine -> ShowS)
-> (DeleteStateMachine -> String)
-> ([DeleteStateMachine] -> ShowS)
-> Show DeleteStateMachine
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteStateMachine] -> ShowS
$cshowList :: [DeleteStateMachine] -> ShowS
show :: DeleteStateMachine -> String
$cshow :: DeleteStateMachine -> String
showsPrec :: Int -> DeleteStateMachine -> ShowS
$cshowsPrec :: Int -> DeleteStateMachine -> ShowS
Prelude.Show, (forall x. DeleteStateMachine -> Rep DeleteStateMachine x)
-> (forall x. Rep DeleteStateMachine x -> DeleteStateMachine)
-> Generic DeleteStateMachine
forall x. Rep DeleteStateMachine x -> DeleteStateMachine
forall x. DeleteStateMachine -> Rep DeleteStateMachine x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteStateMachine x -> DeleteStateMachine
$cfrom :: forall x. DeleteStateMachine -> Rep DeleteStateMachine x
Prelude.Generic)
newDeleteStateMachine ::
Prelude.Text ->
DeleteStateMachine
newDeleteStateMachine :: Text -> DeleteStateMachine
newDeleteStateMachine Text
pStateMachineArn_ =
DeleteStateMachine' :: Text -> DeleteStateMachine
DeleteStateMachine'
{ $sel:stateMachineArn:DeleteStateMachine' :: Text
stateMachineArn =
Text
pStateMachineArn_
}
deleteStateMachine_stateMachineArn :: Lens.Lens' DeleteStateMachine Prelude.Text
deleteStateMachine_stateMachineArn :: (Text -> f Text) -> DeleteStateMachine -> f DeleteStateMachine
deleteStateMachine_stateMachineArn = (DeleteStateMachine -> Text)
-> (DeleteStateMachine -> Text -> DeleteStateMachine)
-> Lens DeleteStateMachine DeleteStateMachine Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteStateMachine' {Text
stateMachineArn :: Text
$sel:stateMachineArn:DeleteStateMachine' :: DeleteStateMachine -> Text
stateMachineArn} -> Text
stateMachineArn) (\s :: DeleteStateMachine
s@DeleteStateMachine' {} Text
a -> DeleteStateMachine
s {$sel:stateMachineArn:DeleteStateMachine' :: Text
stateMachineArn = Text
a} :: DeleteStateMachine)
instance Core.AWSRequest DeleteStateMachine where
type
AWSResponse DeleteStateMachine =
DeleteStateMachineResponse
request :: DeleteStateMachine -> Request DeleteStateMachine
request = Service -> DeleteStateMachine -> Request DeleteStateMachine
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteStateMachine
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteStateMachine)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteStateMachine))
-> Logger
-> Service
-> Proxy DeleteStateMachine
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteStateMachine)))
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 -> DeleteStateMachineResponse
DeleteStateMachineResponse'
(Int -> DeleteStateMachineResponse)
-> Either String Int -> Either String DeleteStateMachineResponse
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 DeleteStateMachine
instance Prelude.NFData DeleteStateMachine
instance Core.ToHeaders DeleteStateMachine where
toHeaders :: DeleteStateMachine -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteStateMachine -> 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
"AWSStepFunctions.DeleteStateMachine" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DeleteStateMachine where
toJSON :: DeleteStateMachine -> Value
toJSON DeleteStateMachine' {Text
stateMachineArn :: Text
$sel:stateMachineArn:DeleteStateMachine' :: DeleteStateMachine -> 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
"stateMachineArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
stateMachineArn)
]
)
instance Core.ToPath DeleteStateMachine where
toPath :: DeleteStateMachine -> ByteString
toPath = ByteString -> DeleteStateMachine -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteStateMachine where
toQuery :: DeleteStateMachine -> QueryString
toQuery = QueryString -> DeleteStateMachine -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteStateMachineResponse = DeleteStateMachineResponse'
{
DeleteStateMachineResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteStateMachineResponse -> DeleteStateMachineResponse -> Bool
(DeleteStateMachineResponse -> DeleteStateMachineResponse -> Bool)
-> (DeleteStateMachineResponse
-> DeleteStateMachineResponse -> Bool)
-> Eq DeleteStateMachineResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteStateMachineResponse -> DeleteStateMachineResponse -> Bool
$c/= :: DeleteStateMachineResponse -> DeleteStateMachineResponse -> Bool
== :: DeleteStateMachineResponse -> DeleteStateMachineResponse -> Bool
$c== :: DeleteStateMachineResponse -> DeleteStateMachineResponse -> Bool
Prelude.Eq, ReadPrec [DeleteStateMachineResponse]
ReadPrec DeleteStateMachineResponse
Int -> ReadS DeleteStateMachineResponse
ReadS [DeleteStateMachineResponse]
(Int -> ReadS DeleteStateMachineResponse)
-> ReadS [DeleteStateMachineResponse]
-> ReadPrec DeleteStateMachineResponse
-> ReadPrec [DeleteStateMachineResponse]
-> Read DeleteStateMachineResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteStateMachineResponse]
$creadListPrec :: ReadPrec [DeleteStateMachineResponse]
readPrec :: ReadPrec DeleteStateMachineResponse
$creadPrec :: ReadPrec DeleteStateMachineResponse
readList :: ReadS [DeleteStateMachineResponse]
$creadList :: ReadS [DeleteStateMachineResponse]
readsPrec :: Int -> ReadS DeleteStateMachineResponse
$creadsPrec :: Int -> ReadS DeleteStateMachineResponse
Prelude.Read, Int -> DeleteStateMachineResponse -> ShowS
[DeleteStateMachineResponse] -> ShowS
DeleteStateMachineResponse -> String
(Int -> DeleteStateMachineResponse -> ShowS)
-> (DeleteStateMachineResponse -> String)
-> ([DeleteStateMachineResponse] -> ShowS)
-> Show DeleteStateMachineResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteStateMachineResponse] -> ShowS
$cshowList :: [DeleteStateMachineResponse] -> ShowS
show :: DeleteStateMachineResponse -> String
$cshow :: DeleteStateMachineResponse -> String
showsPrec :: Int -> DeleteStateMachineResponse -> ShowS
$cshowsPrec :: Int -> DeleteStateMachineResponse -> ShowS
Prelude.Show, (forall x.
DeleteStateMachineResponse -> Rep DeleteStateMachineResponse x)
-> (forall x.
Rep DeleteStateMachineResponse x -> DeleteStateMachineResponse)
-> Generic DeleteStateMachineResponse
forall x.
Rep DeleteStateMachineResponse x -> DeleteStateMachineResponse
forall x.
DeleteStateMachineResponse -> Rep DeleteStateMachineResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteStateMachineResponse x -> DeleteStateMachineResponse
$cfrom :: forall x.
DeleteStateMachineResponse -> Rep DeleteStateMachineResponse x
Prelude.Generic)
newDeleteStateMachineResponse ::
Prelude.Int ->
DeleteStateMachineResponse
newDeleteStateMachineResponse :: Int -> DeleteStateMachineResponse
newDeleteStateMachineResponse Int
pHttpStatus_ =
DeleteStateMachineResponse' :: Int -> DeleteStateMachineResponse
DeleteStateMachineResponse'
{ $sel:httpStatus:DeleteStateMachineResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteStateMachineResponse_httpStatus :: Lens.Lens' DeleteStateMachineResponse Prelude.Int
deleteStateMachineResponse_httpStatus :: (Int -> f Int)
-> DeleteStateMachineResponse -> f DeleteStateMachineResponse
deleteStateMachineResponse_httpStatus = (DeleteStateMachineResponse -> Int)
-> (DeleteStateMachineResponse
-> Int -> DeleteStateMachineResponse)
-> Lens
DeleteStateMachineResponse DeleteStateMachineResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteStateMachineResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteStateMachineResponse' :: DeleteStateMachineResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteStateMachineResponse
s@DeleteStateMachineResponse' {} Int
a -> DeleteStateMachineResponse
s {$sel:httpStatus:DeleteStateMachineResponse' :: Int
httpStatus = Int
a} :: DeleteStateMachineResponse)
instance Prelude.NFData DeleteStateMachineResponse