{-# 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.CancelServicePipelineDeployment
(
CancelServicePipelineDeployment (..),
newCancelServicePipelineDeployment,
cancelServicePipelineDeployment_serviceName,
CancelServicePipelineDeploymentResponse (..),
newCancelServicePipelineDeploymentResponse,
cancelServicePipelineDeploymentResponse_httpStatus,
cancelServicePipelineDeploymentResponse_pipeline,
)
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 CancelServicePipelineDeployment = CancelServicePipelineDeployment'
{
CancelServicePipelineDeployment -> Text
serviceName :: Prelude.Text
}
deriving (CancelServicePipelineDeployment
-> CancelServicePipelineDeployment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelServicePipelineDeployment
-> CancelServicePipelineDeployment -> Bool
$c/= :: CancelServicePipelineDeployment
-> CancelServicePipelineDeployment -> Bool
== :: CancelServicePipelineDeployment
-> CancelServicePipelineDeployment -> Bool
$c== :: CancelServicePipelineDeployment
-> CancelServicePipelineDeployment -> Bool
Prelude.Eq, ReadPrec [CancelServicePipelineDeployment]
ReadPrec CancelServicePipelineDeployment
Int -> ReadS CancelServicePipelineDeployment
ReadS [CancelServicePipelineDeployment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelServicePipelineDeployment]
$creadListPrec :: ReadPrec [CancelServicePipelineDeployment]
readPrec :: ReadPrec CancelServicePipelineDeployment
$creadPrec :: ReadPrec CancelServicePipelineDeployment
readList :: ReadS [CancelServicePipelineDeployment]
$creadList :: ReadS [CancelServicePipelineDeployment]
readsPrec :: Int -> ReadS CancelServicePipelineDeployment
$creadsPrec :: Int -> ReadS CancelServicePipelineDeployment
Prelude.Read, Int -> CancelServicePipelineDeployment -> ShowS
[CancelServicePipelineDeployment] -> ShowS
CancelServicePipelineDeployment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelServicePipelineDeployment] -> ShowS
$cshowList :: [CancelServicePipelineDeployment] -> ShowS
show :: CancelServicePipelineDeployment -> String
$cshow :: CancelServicePipelineDeployment -> String
showsPrec :: Int -> CancelServicePipelineDeployment -> ShowS
$cshowsPrec :: Int -> CancelServicePipelineDeployment -> ShowS
Prelude.Show, forall x.
Rep CancelServicePipelineDeployment x
-> CancelServicePipelineDeployment
forall x.
CancelServicePipelineDeployment
-> Rep CancelServicePipelineDeployment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelServicePipelineDeployment x
-> CancelServicePipelineDeployment
$cfrom :: forall x.
CancelServicePipelineDeployment
-> Rep CancelServicePipelineDeployment x
Prelude.Generic)
newCancelServicePipelineDeployment ::
Prelude.Text ->
CancelServicePipelineDeployment
newCancelServicePipelineDeployment :: Text -> CancelServicePipelineDeployment
newCancelServicePipelineDeployment Text
pServiceName_ =
CancelServicePipelineDeployment'
{ $sel:serviceName:CancelServicePipelineDeployment' :: Text
serviceName =
Text
pServiceName_
}
cancelServicePipelineDeployment_serviceName :: Lens.Lens' CancelServicePipelineDeployment Prelude.Text
cancelServicePipelineDeployment_serviceName :: Lens' CancelServicePipelineDeployment Text
cancelServicePipelineDeployment_serviceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelServicePipelineDeployment' {Text
serviceName :: Text
$sel:serviceName:CancelServicePipelineDeployment' :: CancelServicePipelineDeployment -> Text
serviceName} -> Text
serviceName) (\s :: CancelServicePipelineDeployment
s@CancelServicePipelineDeployment' {} Text
a -> CancelServicePipelineDeployment
s {$sel:serviceName:CancelServicePipelineDeployment' :: Text
serviceName = Text
a} :: CancelServicePipelineDeployment)
instance
Core.AWSRequest
CancelServicePipelineDeployment
where
type
AWSResponse CancelServicePipelineDeployment =
CancelServicePipelineDeploymentResponse
request :: (Service -> Service)
-> CancelServicePipelineDeployment
-> Request CancelServicePipelineDeployment
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 CancelServicePipelineDeployment
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse CancelServicePipelineDeployment)))
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 -> ServicePipeline -> CancelServicePipelineDeploymentResponse
CancelServicePipelineDeploymentResponse'
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
"pipeline")
)
instance
Prelude.Hashable
CancelServicePipelineDeployment
where
hashWithSalt :: Int -> CancelServicePipelineDeployment -> Int
hashWithSalt
Int
_salt
CancelServicePipelineDeployment' {Text
serviceName :: Text
$sel:serviceName:CancelServicePipelineDeployment' :: CancelServicePipelineDeployment -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serviceName
instance
Prelude.NFData
CancelServicePipelineDeployment
where
rnf :: CancelServicePipelineDeployment -> ()
rnf CancelServicePipelineDeployment' {Text
serviceName :: Text
$sel:serviceName:CancelServicePipelineDeployment' :: CancelServicePipelineDeployment -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
serviceName
instance
Data.ToHeaders
CancelServicePipelineDeployment
where
toHeaders :: CancelServicePipelineDeployment -> 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.CancelServicePipelineDeployment" ::
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 CancelServicePipelineDeployment where
toJSON :: CancelServicePipelineDeployment -> Value
toJSON CancelServicePipelineDeployment' {Text
serviceName :: Text
$sel:serviceName:CancelServicePipelineDeployment' :: CancelServicePipelineDeployment -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"serviceName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
serviceName)]
)
instance Data.ToPath CancelServicePipelineDeployment where
toPath :: CancelServicePipelineDeployment -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CancelServicePipelineDeployment where
toQuery :: CancelServicePipelineDeployment -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CancelServicePipelineDeploymentResponse = CancelServicePipelineDeploymentResponse'
{
CancelServicePipelineDeploymentResponse -> Int
httpStatus :: Prelude.Int,
CancelServicePipelineDeploymentResponse -> ServicePipeline
pipeline :: ServicePipeline
}
deriving (CancelServicePipelineDeploymentResponse
-> CancelServicePipelineDeploymentResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelServicePipelineDeploymentResponse
-> CancelServicePipelineDeploymentResponse -> Bool
$c/= :: CancelServicePipelineDeploymentResponse
-> CancelServicePipelineDeploymentResponse -> Bool
== :: CancelServicePipelineDeploymentResponse
-> CancelServicePipelineDeploymentResponse -> Bool
$c== :: CancelServicePipelineDeploymentResponse
-> CancelServicePipelineDeploymentResponse -> Bool
Prelude.Eq, Int -> CancelServicePipelineDeploymentResponse -> ShowS
[CancelServicePipelineDeploymentResponse] -> ShowS
CancelServicePipelineDeploymentResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelServicePipelineDeploymentResponse] -> ShowS
$cshowList :: [CancelServicePipelineDeploymentResponse] -> ShowS
show :: CancelServicePipelineDeploymentResponse -> String
$cshow :: CancelServicePipelineDeploymentResponse -> String
showsPrec :: Int -> CancelServicePipelineDeploymentResponse -> ShowS
$cshowsPrec :: Int -> CancelServicePipelineDeploymentResponse -> ShowS
Prelude.Show, forall x.
Rep CancelServicePipelineDeploymentResponse x
-> CancelServicePipelineDeploymentResponse
forall x.
CancelServicePipelineDeploymentResponse
-> Rep CancelServicePipelineDeploymentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelServicePipelineDeploymentResponse x
-> CancelServicePipelineDeploymentResponse
$cfrom :: forall x.
CancelServicePipelineDeploymentResponse
-> Rep CancelServicePipelineDeploymentResponse x
Prelude.Generic)
newCancelServicePipelineDeploymentResponse ::
Prelude.Int ->
ServicePipeline ->
CancelServicePipelineDeploymentResponse
newCancelServicePipelineDeploymentResponse :: Int -> ServicePipeline -> CancelServicePipelineDeploymentResponse
newCancelServicePipelineDeploymentResponse
Int
pHttpStatus_
ServicePipeline
pPipeline_ =
CancelServicePipelineDeploymentResponse'
{ $sel:httpStatus:CancelServicePipelineDeploymentResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:pipeline:CancelServicePipelineDeploymentResponse' :: ServicePipeline
pipeline = ServicePipeline
pPipeline_
}
cancelServicePipelineDeploymentResponse_httpStatus :: Lens.Lens' CancelServicePipelineDeploymentResponse Prelude.Int
cancelServicePipelineDeploymentResponse_httpStatus :: Lens' CancelServicePipelineDeploymentResponse Int
cancelServicePipelineDeploymentResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelServicePipelineDeploymentResponse' {Int
httpStatus :: Int
$sel:httpStatus:CancelServicePipelineDeploymentResponse' :: CancelServicePipelineDeploymentResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CancelServicePipelineDeploymentResponse
s@CancelServicePipelineDeploymentResponse' {} Int
a -> CancelServicePipelineDeploymentResponse
s {$sel:httpStatus:CancelServicePipelineDeploymentResponse' :: Int
httpStatus = Int
a} :: CancelServicePipelineDeploymentResponse)
cancelServicePipelineDeploymentResponse_pipeline :: Lens.Lens' CancelServicePipelineDeploymentResponse ServicePipeline
cancelServicePipelineDeploymentResponse_pipeline :: Lens' CancelServicePipelineDeploymentResponse ServicePipeline
cancelServicePipelineDeploymentResponse_pipeline = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelServicePipelineDeploymentResponse' {ServicePipeline
pipeline :: ServicePipeline
$sel:pipeline:CancelServicePipelineDeploymentResponse' :: CancelServicePipelineDeploymentResponse -> ServicePipeline
pipeline} -> ServicePipeline
pipeline) (\s :: CancelServicePipelineDeploymentResponse
s@CancelServicePipelineDeploymentResponse' {} ServicePipeline
a -> CancelServicePipelineDeploymentResponse
s {$sel:pipeline:CancelServicePipelineDeploymentResponse' :: ServicePipeline
pipeline = ServicePipeline
a} :: CancelServicePipelineDeploymentResponse)
instance
Prelude.NFData
CancelServicePipelineDeploymentResponse
where
rnf :: CancelServicePipelineDeploymentResponse -> ()
rnf CancelServicePipelineDeploymentResponse' {Int
ServicePipeline
pipeline :: ServicePipeline
httpStatus :: Int
$sel:pipeline:CancelServicePipelineDeploymentResponse' :: CancelServicePipelineDeploymentResponse -> ServicePipeline
$sel:httpStatus:CancelServicePipelineDeploymentResponse' :: CancelServicePipelineDeploymentResponse -> 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 ServicePipeline
pipeline