{-# 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.CancelComponentDeployment
(
CancelComponentDeployment (..),
newCancelComponentDeployment,
cancelComponentDeployment_componentName,
CancelComponentDeploymentResponse (..),
newCancelComponentDeploymentResponse,
cancelComponentDeploymentResponse_httpStatus,
cancelComponentDeploymentResponse_component,
)
where
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 Amazonka.Proton.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CancelComponentDeployment = CancelComponentDeployment'
{
CancelComponentDeployment -> Text
componentName :: Prelude.Text
}
deriving (CancelComponentDeployment -> CancelComponentDeployment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelComponentDeployment -> CancelComponentDeployment -> Bool
$c/= :: CancelComponentDeployment -> CancelComponentDeployment -> Bool
== :: CancelComponentDeployment -> CancelComponentDeployment -> Bool
$c== :: CancelComponentDeployment -> CancelComponentDeployment -> Bool
Prelude.Eq, ReadPrec [CancelComponentDeployment]
ReadPrec CancelComponentDeployment
Int -> ReadS CancelComponentDeployment
ReadS [CancelComponentDeployment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelComponentDeployment]
$creadListPrec :: ReadPrec [CancelComponentDeployment]
readPrec :: ReadPrec CancelComponentDeployment
$creadPrec :: ReadPrec CancelComponentDeployment
readList :: ReadS [CancelComponentDeployment]
$creadList :: ReadS [CancelComponentDeployment]
readsPrec :: Int -> ReadS CancelComponentDeployment
$creadsPrec :: Int -> ReadS CancelComponentDeployment
Prelude.Read, Int -> CancelComponentDeployment -> ShowS
[CancelComponentDeployment] -> ShowS
CancelComponentDeployment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelComponentDeployment] -> ShowS
$cshowList :: [CancelComponentDeployment] -> ShowS
show :: CancelComponentDeployment -> String
$cshow :: CancelComponentDeployment -> String
showsPrec :: Int -> CancelComponentDeployment -> ShowS
$cshowsPrec :: Int -> CancelComponentDeployment -> ShowS
Prelude.Show, forall x.
Rep CancelComponentDeployment x -> CancelComponentDeployment
forall x.
CancelComponentDeployment -> Rep CancelComponentDeployment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelComponentDeployment x -> CancelComponentDeployment
$cfrom :: forall x.
CancelComponentDeployment -> Rep CancelComponentDeployment x
Prelude.Generic)
newCancelComponentDeployment ::
Prelude.Text ->
CancelComponentDeployment
newCancelComponentDeployment :: Text -> CancelComponentDeployment
newCancelComponentDeployment Text
pComponentName_ =
CancelComponentDeployment'
{ $sel:componentName:CancelComponentDeployment' :: Text
componentName =
Text
pComponentName_
}
cancelComponentDeployment_componentName :: Lens.Lens' CancelComponentDeployment Prelude.Text
cancelComponentDeployment_componentName :: Lens' CancelComponentDeployment Text
cancelComponentDeployment_componentName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelComponentDeployment' {Text
componentName :: Text
$sel:componentName:CancelComponentDeployment' :: CancelComponentDeployment -> Text
componentName} -> Text
componentName) (\s :: CancelComponentDeployment
s@CancelComponentDeployment' {} Text
a -> CancelComponentDeployment
s {$sel:componentName:CancelComponentDeployment' :: Text
componentName = Text
a} :: CancelComponentDeployment)
instance Core.AWSRequest CancelComponentDeployment where
type
AWSResponse CancelComponentDeployment =
CancelComponentDeploymentResponse
request :: (Service -> Service)
-> CancelComponentDeployment -> Request CancelComponentDeployment
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 CancelComponentDeployment
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CancelComponentDeployment)))
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 ->
Int -> Component -> CancelComponentDeploymentResponse
CancelComponentDeploymentResponse'
forall (f :: * -> *) a b. Functor 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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"component")
)
instance Prelude.Hashable CancelComponentDeployment where
hashWithSalt :: Int -> CancelComponentDeployment -> Int
hashWithSalt Int
_salt CancelComponentDeployment' {Text
componentName :: Text
$sel:componentName:CancelComponentDeployment' :: CancelComponentDeployment -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
componentName
instance Prelude.NFData CancelComponentDeployment where
rnf :: CancelComponentDeployment -> ()
rnf CancelComponentDeployment' {Text
componentName :: Text
$sel:componentName:CancelComponentDeployment' :: CancelComponentDeployment -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
componentName
instance Data.ToHeaders CancelComponentDeployment where
toHeaders :: CancelComponentDeployment -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AwsProton20200720.CancelComponentDeployment" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON CancelComponentDeployment where
toJSON :: CancelComponentDeployment -> Value
toJSON CancelComponentDeployment' {Text
componentName :: Text
$sel:componentName:CancelComponentDeployment' :: CancelComponentDeployment -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"componentName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
componentName)
]
)
instance Data.ToPath CancelComponentDeployment where
toPath :: CancelComponentDeployment -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CancelComponentDeployment where
toQuery :: CancelComponentDeployment -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CancelComponentDeploymentResponse = CancelComponentDeploymentResponse'
{
CancelComponentDeploymentResponse -> Int
httpStatus :: Prelude.Int,
CancelComponentDeploymentResponse -> Component
component :: Component
}
deriving (CancelComponentDeploymentResponse
-> CancelComponentDeploymentResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelComponentDeploymentResponse
-> CancelComponentDeploymentResponse -> Bool
$c/= :: CancelComponentDeploymentResponse
-> CancelComponentDeploymentResponse -> Bool
== :: CancelComponentDeploymentResponse
-> CancelComponentDeploymentResponse -> Bool
$c== :: CancelComponentDeploymentResponse
-> CancelComponentDeploymentResponse -> Bool
Prelude.Eq, Int -> CancelComponentDeploymentResponse -> ShowS
[CancelComponentDeploymentResponse] -> ShowS
CancelComponentDeploymentResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelComponentDeploymentResponse] -> ShowS
$cshowList :: [CancelComponentDeploymentResponse] -> ShowS
show :: CancelComponentDeploymentResponse -> String
$cshow :: CancelComponentDeploymentResponse -> String
showsPrec :: Int -> CancelComponentDeploymentResponse -> ShowS
$cshowsPrec :: Int -> CancelComponentDeploymentResponse -> ShowS
Prelude.Show, forall x.
Rep CancelComponentDeploymentResponse x
-> CancelComponentDeploymentResponse
forall x.
CancelComponentDeploymentResponse
-> Rep CancelComponentDeploymentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelComponentDeploymentResponse x
-> CancelComponentDeploymentResponse
$cfrom :: forall x.
CancelComponentDeploymentResponse
-> Rep CancelComponentDeploymentResponse x
Prelude.Generic)
newCancelComponentDeploymentResponse ::
Prelude.Int ->
Component ->
CancelComponentDeploymentResponse
newCancelComponentDeploymentResponse :: Int -> Component -> CancelComponentDeploymentResponse
newCancelComponentDeploymentResponse
Int
pHttpStatus_
Component
pComponent_ =
CancelComponentDeploymentResponse'
{ $sel:httpStatus:CancelComponentDeploymentResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:component:CancelComponentDeploymentResponse' :: Component
component = Component
pComponent_
}
cancelComponentDeploymentResponse_httpStatus :: Lens.Lens' CancelComponentDeploymentResponse Prelude.Int
cancelComponentDeploymentResponse_httpStatus :: Lens' CancelComponentDeploymentResponse Int
cancelComponentDeploymentResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelComponentDeploymentResponse' {Int
httpStatus :: Int
$sel:httpStatus:CancelComponentDeploymentResponse' :: CancelComponentDeploymentResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CancelComponentDeploymentResponse
s@CancelComponentDeploymentResponse' {} Int
a -> CancelComponentDeploymentResponse
s {$sel:httpStatus:CancelComponentDeploymentResponse' :: Int
httpStatus = Int
a} :: CancelComponentDeploymentResponse)
cancelComponentDeploymentResponse_component :: Lens.Lens' CancelComponentDeploymentResponse Component
cancelComponentDeploymentResponse_component :: Lens' CancelComponentDeploymentResponse Component
cancelComponentDeploymentResponse_component = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelComponentDeploymentResponse' {Component
component :: Component
$sel:component:CancelComponentDeploymentResponse' :: CancelComponentDeploymentResponse -> Component
component} -> Component
component) (\s :: CancelComponentDeploymentResponse
s@CancelComponentDeploymentResponse' {} Component
a -> CancelComponentDeploymentResponse
s {$sel:component:CancelComponentDeploymentResponse' :: Component
component = Component
a} :: CancelComponentDeploymentResponse)
instance
Prelude.NFData
CancelComponentDeploymentResponse
where
rnf :: CancelComponentDeploymentResponse -> ()
rnf CancelComponentDeploymentResponse' {Int
Component
component :: Component
httpStatus :: Int
$sel:component:CancelComponentDeploymentResponse' :: CancelComponentDeploymentResponse -> Component
$sel:httpStatus:CancelComponentDeploymentResponse' :: CancelComponentDeploymentResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Component
component