{-# 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.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 CancelServicePipelineDeployment = CancelServicePipelineDeployment'
{
CancelServicePipelineDeployment -> Text
serviceName :: Prelude.Text
}
deriving (CancelServicePipelineDeployment
-> CancelServicePipelineDeployment -> Bool
(CancelServicePipelineDeployment
-> CancelServicePipelineDeployment -> Bool)
-> (CancelServicePipelineDeployment
-> CancelServicePipelineDeployment -> Bool)
-> Eq CancelServicePipelineDeployment
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]
(Int -> ReadS CancelServicePipelineDeployment)
-> ReadS [CancelServicePipelineDeployment]
-> ReadPrec CancelServicePipelineDeployment
-> ReadPrec [CancelServicePipelineDeployment]
-> Read 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
(Int -> CancelServicePipelineDeployment -> ShowS)
-> (CancelServicePipelineDeployment -> String)
-> ([CancelServicePipelineDeployment] -> ShowS)
-> Show CancelServicePipelineDeployment
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.
CancelServicePipelineDeployment
-> Rep CancelServicePipelineDeployment x)
-> (forall x.
Rep CancelServicePipelineDeployment x
-> CancelServicePipelineDeployment)
-> Generic CancelServicePipelineDeployment
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' :: Text -> CancelServicePipelineDeployment
CancelServicePipelineDeployment'
{ $sel:serviceName:CancelServicePipelineDeployment' :: Text
serviceName =
Text
pServiceName_
}
cancelServicePipelineDeployment_serviceName :: Lens.Lens' CancelServicePipelineDeployment Prelude.Text
cancelServicePipelineDeployment_serviceName :: (Text -> f Text)
-> CancelServicePipelineDeployment
-> f CancelServicePipelineDeployment
cancelServicePipelineDeployment_serviceName = (CancelServicePipelineDeployment -> Text)
-> (CancelServicePipelineDeployment
-> Text -> CancelServicePipelineDeployment)
-> Lens
CancelServicePipelineDeployment
CancelServicePipelineDeployment
Text
Text
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 :: CancelServicePipelineDeployment
-> Request CancelServicePipelineDeployment
request = Service
-> CancelServicePipelineDeployment
-> Request CancelServicePipelineDeployment
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CancelServicePipelineDeployment
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse CancelServicePipelineDeployment)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CancelServicePipelineDeployment))
-> Logger
-> Service
-> Proxy CancelServicePipelineDeployment
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse CancelServicePipelineDeployment)))
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 -> ServicePipeline -> CancelServicePipelineDeploymentResponse
CancelServicePipelineDeploymentResponse'
(Int -> ServicePipeline -> CancelServicePipelineDeploymentResponse)
-> Either String Int
-> Either
String (ServicePipeline -> CancelServicePipelineDeploymentResponse)
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 (ServicePipeline -> CancelServicePipelineDeploymentResponse)
-> Either String ServicePipeline
-> Either String CancelServicePipelineDeploymentResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String ServicePipeline
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"pipeline")
)
instance
Prelude.Hashable
CancelServicePipelineDeployment
instance
Prelude.NFData
CancelServicePipelineDeployment
instance
Core.ToHeaders
CancelServicePipelineDeployment
where
toHeaders :: CancelServicePipelineDeployment -> ResponseHeaders
toHeaders =
ResponseHeaders
-> CancelServicePipelineDeployment -> 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.CancelServicePipelineDeployment" ::
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 CancelServicePipelineDeployment where
toJSON :: CancelServicePipelineDeployment -> Value
toJSON CancelServicePipelineDeployment' {Text
serviceName :: Text
$sel:serviceName:CancelServicePipelineDeployment' :: CancelServicePipelineDeployment -> 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
"serviceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serviceName)]
)
instance Core.ToPath CancelServicePipelineDeployment where
toPath :: CancelServicePipelineDeployment -> ByteString
toPath = ByteString -> CancelServicePipelineDeployment -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CancelServicePipelineDeployment where
toQuery :: CancelServicePipelineDeployment -> QueryString
toQuery = QueryString -> CancelServicePipelineDeployment -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CancelServicePipelineDeploymentResponse = CancelServicePipelineDeploymentResponse'
{
CancelServicePipelineDeploymentResponse -> Int
httpStatus :: Prelude.Int,
CancelServicePipelineDeploymentResponse -> ServicePipeline
pipeline :: ServicePipeline
}
deriving (CancelServicePipelineDeploymentResponse
-> CancelServicePipelineDeploymentResponse -> Bool
(CancelServicePipelineDeploymentResponse
-> CancelServicePipelineDeploymentResponse -> Bool)
-> (CancelServicePipelineDeploymentResponse
-> CancelServicePipelineDeploymentResponse -> Bool)
-> Eq CancelServicePipelineDeploymentResponse
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
(Int -> CancelServicePipelineDeploymentResponse -> ShowS)
-> (CancelServicePipelineDeploymentResponse -> String)
-> ([CancelServicePipelineDeploymentResponse] -> ShowS)
-> Show CancelServicePipelineDeploymentResponse
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.
CancelServicePipelineDeploymentResponse
-> Rep CancelServicePipelineDeploymentResponse x)
-> (forall x.
Rep CancelServicePipelineDeploymentResponse x
-> CancelServicePipelineDeploymentResponse)
-> Generic CancelServicePipelineDeploymentResponse
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' :: Int -> ServicePipeline -> CancelServicePipelineDeploymentResponse
CancelServicePipelineDeploymentResponse'
{ $sel:httpStatus:CancelServicePipelineDeploymentResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:pipeline:CancelServicePipelineDeploymentResponse' :: ServicePipeline
pipeline = ServicePipeline
pPipeline_
}
cancelServicePipelineDeploymentResponse_httpStatus :: Lens.Lens' CancelServicePipelineDeploymentResponse Prelude.Int
cancelServicePipelineDeploymentResponse_httpStatus :: (Int -> f Int)
-> CancelServicePipelineDeploymentResponse
-> f CancelServicePipelineDeploymentResponse
cancelServicePipelineDeploymentResponse_httpStatus = (CancelServicePipelineDeploymentResponse -> Int)
-> (CancelServicePipelineDeploymentResponse
-> Int -> CancelServicePipelineDeploymentResponse)
-> Lens
CancelServicePipelineDeploymentResponse
CancelServicePipelineDeploymentResponse
Int
Int
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 :: (ServicePipeline -> f ServicePipeline)
-> CancelServicePipelineDeploymentResponse
-> f CancelServicePipelineDeploymentResponse
cancelServicePipelineDeploymentResponse_pipeline = (CancelServicePipelineDeploymentResponse -> ServicePipeline)
-> (CancelServicePipelineDeploymentResponse
-> ServicePipeline -> CancelServicePipelineDeploymentResponse)
-> Lens
CancelServicePipelineDeploymentResponse
CancelServicePipelineDeploymentResponse
ServicePipeline
ServicePipeline
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