{-# 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.Proton.CancelEnvironmentDeployment
(
CancelEnvironmentDeployment (..),
newCancelEnvironmentDeployment,
cancelEnvironmentDeployment_environmentName,
CancelEnvironmentDeploymentResponse (..),
newCancelEnvironmentDeploymentResponse,
cancelEnvironmentDeploymentResponse_httpStatus,
cancelEnvironmentDeploymentResponse_environment,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Proton.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CancelEnvironmentDeployment = CancelEnvironmentDeployment'
{
CancelEnvironmentDeployment -> Text
environmentName :: Prelude.Text
}
deriving (CancelEnvironmentDeployment -> CancelEnvironmentDeployment -> Bool
(CancelEnvironmentDeployment
-> CancelEnvironmentDeployment -> Bool)
-> (CancelEnvironmentDeployment
-> CancelEnvironmentDeployment -> Bool)
-> Eq CancelEnvironmentDeployment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelEnvironmentDeployment -> CancelEnvironmentDeployment -> Bool
$c/= :: CancelEnvironmentDeployment -> CancelEnvironmentDeployment -> Bool
== :: CancelEnvironmentDeployment -> CancelEnvironmentDeployment -> Bool
$c== :: CancelEnvironmentDeployment -> CancelEnvironmentDeployment -> Bool
Prelude.Eq, ReadPrec [CancelEnvironmentDeployment]
ReadPrec CancelEnvironmentDeployment
Int -> ReadS CancelEnvironmentDeployment
ReadS [CancelEnvironmentDeployment]
(Int -> ReadS CancelEnvironmentDeployment)
-> ReadS [CancelEnvironmentDeployment]
-> ReadPrec CancelEnvironmentDeployment
-> ReadPrec [CancelEnvironmentDeployment]
-> Read CancelEnvironmentDeployment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelEnvironmentDeployment]
$creadListPrec :: ReadPrec [CancelEnvironmentDeployment]
readPrec :: ReadPrec CancelEnvironmentDeployment
$creadPrec :: ReadPrec CancelEnvironmentDeployment
readList :: ReadS [CancelEnvironmentDeployment]
$creadList :: ReadS [CancelEnvironmentDeployment]
readsPrec :: Int -> ReadS CancelEnvironmentDeployment
$creadsPrec :: Int -> ReadS CancelEnvironmentDeployment
Prelude.Read, Int -> CancelEnvironmentDeployment -> ShowS
[CancelEnvironmentDeployment] -> ShowS
CancelEnvironmentDeployment -> String
(Int -> CancelEnvironmentDeployment -> ShowS)
-> (CancelEnvironmentDeployment -> String)
-> ([CancelEnvironmentDeployment] -> ShowS)
-> Show CancelEnvironmentDeployment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelEnvironmentDeployment] -> ShowS
$cshowList :: [CancelEnvironmentDeployment] -> ShowS
show :: CancelEnvironmentDeployment -> String
$cshow :: CancelEnvironmentDeployment -> String
showsPrec :: Int -> CancelEnvironmentDeployment -> ShowS
$cshowsPrec :: Int -> CancelEnvironmentDeployment -> ShowS
Prelude.Show, (forall x.
CancelEnvironmentDeployment -> Rep CancelEnvironmentDeployment x)
-> (forall x.
Rep CancelEnvironmentDeployment x -> CancelEnvironmentDeployment)
-> Generic CancelEnvironmentDeployment
forall x.
Rep CancelEnvironmentDeployment x -> CancelEnvironmentDeployment
forall x.
CancelEnvironmentDeployment -> Rep CancelEnvironmentDeployment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelEnvironmentDeployment x -> CancelEnvironmentDeployment
$cfrom :: forall x.
CancelEnvironmentDeployment -> Rep CancelEnvironmentDeployment x
Prelude.Generic)
newCancelEnvironmentDeployment ::
Prelude.Text ->
CancelEnvironmentDeployment
newCancelEnvironmentDeployment :: Text -> CancelEnvironmentDeployment
newCancelEnvironmentDeployment Text
pEnvironmentName_ =
CancelEnvironmentDeployment' :: Text -> CancelEnvironmentDeployment
CancelEnvironmentDeployment'
{ $sel:environmentName:CancelEnvironmentDeployment' :: Text
environmentName =
Text
pEnvironmentName_
}
cancelEnvironmentDeployment_environmentName :: Lens.Lens' CancelEnvironmentDeployment Prelude.Text
cancelEnvironmentDeployment_environmentName :: (Text -> f Text)
-> CancelEnvironmentDeployment -> f CancelEnvironmentDeployment
cancelEnvironmentDeployment_environmentName = (CancelEnvironmentDeployment -> Text)
-> (CancelEnvironmentDeployment
-> Text -> CancelEnvironmentDeployment)
-> Lens
CancelEnvironmentDeployment CancelEnvironmentDeployment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelEnvironmentDeployment' {Text
environmentName :: Text
$sel:environmentName:CancelEnvironmentDeployment' :: CancelEnvironmentDeployment -> Text
environmentName} -> Text
environmentName) (\s :: CancelEnvironmentDeployment
s@CancelEnvironmentDeployment' {} Text
a -> CancelEnvironmentDeployment
s {$sel:environmentName:CancelEnvironmentDeployment' :: Text
environmentName = Text
a} :: CancelEnvironmentDeployment)
instance Core.AWSRequest CancelEnvironmentDeployment where
type
AWSResponse CancelEnvironmentDeployment =
CancelEnvironmentDeploymentResponse
request :: CancelEnvironmentDeployment -> Request CancelEnvironmentDeployment
request = Service
-> CancelEnvironmentDeployment
-> Request CancelEnvironmentDeployment
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CancelEnvironmentDeployment
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CancelEnvironmentDeployment)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CancelEnvironmentDeployment))
-> Logger
-> Service
-> Proxy CancelEnvironmentDeployment
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CancelEnvironmentDeployment)))
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 ->
Int -> Environment -> CancelEnvironmentDeploymentResponse
CancelEnvironmentDeploymentResponse'
(Int -> Environment -> CancelEnvironmentDeploymentResponse)
-> Either String Int
-> Either
String (Environment -> CancelEnvironmentDeploymentResponse)
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))
Either String (Environment -> CancelEnvironmentDeploymentResponse)
-> Either String Environment
-> Either String CancelEnvironmentDeploymentResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Environment
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"environment")
)
instance Prelude.Hashable CancelEnvironmentDeployment
instance Prelude.NFData CancelEnvironmentDeployment
instance Core.ToHeaders CancelEnvironmentDeployment where
toHeaders :: CancelEnvironmentDeployment -> ResponseHeaders
toHeaders =
ResponseHeaders -> CancelEnvironmentDeployment -> 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
"AwsProton20200720.CancelEnvironmentDeployment" ::
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 CancelEnvironmentDeployment where
toJSON :: CancelEnvironmentDeployment -> Value
toJSON CancelEnvironmentDeployment' {Text
environmentName :: Text
$sel:environmentName:CancelEnvironmentDeployment' :: CancelEnvironmentDeployment -> 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
"environmentName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
environmentName)
]
)
instance Core.ToPath CancelEnvironmentDeployment where
toPath :: CancelEnvironmentDeployment -> ByteString
toPath = ByteString -> CancelEnvironmentDeployment -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CancelEnvironmentDeployment where
toQuery :: CancelEnvironmentDeployment -> QueryString
toQuery = QueryString -> CancelEnvironmentDeployment -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CancelEnvironmentDeploymentResponse = CancelEnvironmentDeploymentResponse'
{
CancelEnvironmentDeploymentResponse -> Int
httpStatus :: Prelude.Int,
CancelEnvironmentDeploymentResponse -> Environment
environment :: Environment
}
deriving (CancelEnvironmentDeploymentResponse
-> CancelEnvironmentDeploymentResponse -> Bool
(CancelEnvironmentDeploymentResponse
-> CancelEnvironmentDeploymentResponse -> Bool)
-> (CancelEnvironmentDeploymentResponse
-> CancelEnvironmentDeploymentResponse -> Bool)
-> Eq CancelEnvironmentDeploymentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelEnvironmentDeploymentResponse
-> CancelEnvironmentDeploymentResponse -> Bool
$c/= :: CancelEnvironmentDeploymentResponse
-> CancelEnvironmentDeploymentResponse -> Bool
== :: CancelEnvironmentDeploymentResponse
-> CancelEnvironmentDeploymentResponse -> Bool
$c== :: CancelEnvironmentDeploymentResponse
-> CancelEnvironmentDeploymentResponse -> Bool
Prelude.Eq, Int -> CancelEnvironmentDeploymentResponse -> ShowS
[CancelEnvironmentDeploymentResponse] -> ShowS
CancelEnvironmentDeploymentResponse -> String
(Int -> CancelEnvironmentDeploymentResponse -> ShowS)
-> (CancelEnvironmentDeploymentResponse -> String)
-> ([CancelEnvironmentDeploymentResponse] -> ShowS)
-> Show CancelEnvironmentDeploymentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelEnvironmentDeploymentResponse] -> ShowS
$cshowList :: [CancelEnvironmentDeploymentResponse] -> ShowS
show :: CancelEnvironmentDeploymentResponse -> String
$cshow :: CancelEnvironmentDeploymentResponse -> String
showsPrec :: Int -> CancelEnvironmentDeploymentResponse -> ShowS
$cshowsPrec :: Int -> CancelEnvironmentDeploymentResponse -> ShowS
Prelude.Show, (forall x.
CancelEnvironmentDeploymentResponse
-> Rep CancelEnvironmentDeploymentResponse x)
-> (forall x.
Rep CancelEnvironmentDeploymentResponse x
-> CancelEnvironmentDeploymentResponse)
-> Generic CancelEnvironmentDeploymentResponse
forall x.
Rep CancelEnvironmentDeploymentResponse x
-> CancelEnvironmentDeploymentResponse
forall x.
CancelEnvironmentDeploymentResponse
-> Rep CancelEnvironmentDeploymentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelEnvironmentDeploymentResponse x
-> CancelEnvironmentDeploymentResponse
$cfrom :: forall x.
CancelEnvironmentDeploymentResponse
-> Rep CancelEnvironmentDeploymentResponse x
Prelude.Generic)
newCancelEnvironmentDeploymentResponse ::
Prelude.Int ->
Environment ->
CancelEnvironmentDeploymentResponse
newCancelEnvironmentDeploymentResponse :: Int -> Environment -> CancelEnvironmentDeploymentResponse
newCancelEnvironmentDeploymentResponse
Int
pHttpStatus_
Environment
pEnvironment_ =
CancelEnvironmentDeploymentResponse' :: Int -> Environment -> CancelEnvironmentDeploymentResponse
CancelEnvironmentDeploymentResponse'
{ $sel:httpStatus:CancelEnvironmentDeploymentResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:environment:CancelEnvironmentDeploymentResponse' :: Environment
environment = Environment
pEnvironment_
}
cancelEnvironmentDeploymentResponse_httpStatus :: Lens.Lens' CancelEnvironmentDeploymentResponse Prelude.Int
cancelEnvironmentDeploymentResponse_httpStatus :: (Int -> f Int)
-> CancelEnvironmentDeploymentResponse
-> f CancelEnvironmentDeploymentResponse
cancelEnvironmentDeploymentResponse_httpStatus = (CancelEnvironmentDeploymentResponse -> Int)
-> (CancelEnvironmentDeploymentResponse
-> Int -> CancelEnvironmentDeploymentResponse)
-> Lens
CancelEnvironmentDeploymentResponse
CancelEnvironmentDeploymentResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelEnvironmentDeploymentResponse' {Int
httpStatus :: Int
$sel:httpStatus:CancelEnvironmentDeploymentResponse' :: CancelEnvironmentDeploymentResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CancelEnvironmentDeploymentResponse
s@CancelEnvironmentDeploymentResponse' {} Int
a -> CancelEnvironmentDeploymentResponse
s {$sel:httpStatus:CancelEnvironmentDeploymentResponse' :: Int
httpStatus = Int
a} :: CancelEnvironmentDeploymentResponse)
cancelEnvironmentDeploymentResponse_environment :: Lens.Lens' CancelEnvironmentDeploymentResponse Environment
cancelEnvironmentDeploymentResponse_environment :: (Environment -> f Environment)
-> CancelEnvironmentDeploymentResponse
-> f CancelEnvironmentDeploymentResponse
cancelEnvironmentDeploymentResponse_environment = (CancelEnvironmentDeploymentResponse -> Environment)
-> (CancelEnvironmentDeploymentResponse
-> Environment -> CancelEnvironmentDeploymentResponse)
-> Lens
CancelEnvironmentDeploymentResponse
CancelEnvironmentDeploymentResponse
Environment
Environment
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelEnvironmentDeploymentResponse' {Environment
environment :: Environment
$sel:environment:CancelEnvironmentDeploymentResponse' :: CancelEnvironmentDeploymentResponse -> Environment
environment} -> Environment
environment) (\s :: CancelEnvironmentDeploymentResponse
s@CancelEnvironmentDeploymentResponse' {} Environment
a -> CancelEnvironmentDeploymentResponse
s {$sel:environment:CancelEnvironmentDeploymentResponse' :: Environment
environment = Environment
a} :: CancelEnvironmentDeploymentResponse)
instance
Prelude.NFData
CancelEnvironmentDeploymentResponse