{-# 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.CancelServiceInstanceDeployment
(
CancelServiceInstanceDeployment (..),
newCancelServiceInstanceDeployment,
cancelServiceInstanceDeployment_serviceInstanceName,
cancelServiceInstanceDeployment_serviceName,
CancelServiceInstanceDeploymentResponse (..),
newCancelServiceInstanceDeploymentResponse,
cancelServiceInstanceDeploymentResponse_httpStatus,
cancelServiceInstanceDeploymentResponse_serviceInstance,
)
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 CancelServiceInstanceDeployment = CancelServiceInstanceDeployment'
{
CancelServiceInstanceDeployment -> Text
serviceInstanceName :: Prelude.Text,
CancelServiceInstanceDeployment -> Text
serviceName :: Prelude.Text
}
deriving (CancelServiceInstanceDeployment
-> CancelServiceInstanceDeployment -> Bool
(CancelServiceInstanceDeployment
-> CancelServiceInstanceDeployment -> Bool)
-> (CancelServiceInstanceDeployment
-> CancelServiceInstanceDeployment -> Bool)
-> Eq CancelServiceInstanceDeployment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelServiceInstanceDeployment
-> CancelServiceInstanceDeployment -> Bool
$c/= :: CancelServiceInstanceDeployment
-> CancelServiceInstanceDeployment -> Bool
== :: CancelServiceInstanceDeployment
-> CancelServiceInstanceDeployment -> Bool
$c== :: CancelServiceInstanceDeployment
-> CancelServiceInstanceDeployment -> Bool
Prelude.Eq, ReadPrec [CancelServiceInstanceDeployment]
ReadPrec CancelServiceInstanceDeployment
Int -> ReadS CancelServiceInstanceDeployment
ReadS [CancelServiceInstanceDeployment]
(Int -> ReadS CancelServiceInstanceDeployment)
-> ReadS [CancelServiceInstanceDeployment]
-> ReadPrec CancelServiceInstanceDeployment
-> ReadPrec [CancelServiceInstanceDeployment]
-> Read CancelServiceInstanceDeployment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelServiceInstanceDeployment]
$creadListPrec :: ReadPrec [CancelServiceInstanceDeployment]
readPrec :: ReadPrec CancelServiceInstanceDeployment
$creadPrec :: ReadPrec CancelServiceInstanceDeployment
readList :: ReadS [CancelServiceInstanceDeployment]
$creadList :: ReadS [CancelServiceInstanceDeployment]
readsPrec :: Int -> ReadS CancelServiceInstanceDeployment
$creadsPrec :: Int -> ReadS CancelServiceInstanceDeployment
Prelude.Read, Int -> CancelServiceInstanceDeployment -> ShowS
[CancelServiceInstanceDeployment] -> ShowS
CancelServiceInstanceDeployment -> String
(Int -> CancelServiceInstanceDeployment -> ShowS)
-> (CancelServiceInstanceDeployment -> String)
-> ([CancelServiceInstanceDeployment] -> ShowS)
-> Show CancelServiceInstanceDeployment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelServiceInstanceDeployment] -> ShowS
$cshowList :: [CancelServiceInstanceDeployment] -> ShowS
show :: CancelServiceInstanceDeployment -> String
$cshow :: CancelServiceInstanceDeployment -> String
showsPrec :: Int -> CancelServiceInstanceDeployment -> ShowS
$cshowsPrec :: Int -> CancelServiceInstanceDeployment -> ShowS
Prelude.Show, (forall x.
CancelServiceInstanceDeployment
-> Rep CancelServiceInstanceDeployment x)
-> (forall x.
Rep CancelServiceInstanceDeployment x
-> CancelServiceInstanceDeployment)
-> Generic CancelServiceInstanceDeployment
forall x.
Rep CancelServiceInstanceDeployment x
-> CancelServiceInstanceDeployment
forall x.
CancelServiceInstanceDeployment
-> Rep CancelServiceInstanceDeployment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelServiceInstanceDeployment x
-> CancelServiceInstanceDeployment
$cfrom :: forall x.
CancelServiceInstanceDeployment
-> Rep CancelServiceInstanceDeployment x
Prelude.Generic)
newCancelServiceInstanceDeployment ::
Prelude.Text ->
Prelude.Text ->
CancelServiceInstanceDeployment
newCancelServiceInstanceDeployment :: Text -> Text -> CancelServiceInstanceDeployment
newCancelServiceInstanceDeployment
Text
pServiceInstanceName_
Text
pServiceName_ =
CancelServiceInstanceDeployment' :: Text -> Text -> CancelServiceInstanceDeployment
CancelServiceInstanceDeployment'
{ $sel:serviceInstanceName:CancelServiceInstanceDeployment' :: Text
serviceInstanceName =
Text
pServiceInstanceName_,
$sel:serviceName:CancelServiceInstanceDeployment' :: Text
serviceName = Text
pServiceName_
}
cancelServiceInstanceDeployment_serviceInstanceName :: Lens.Lens' CancelServiceInstanceDeployment Prelude.Text
cancelServiceInstanceDeployment_serviceInstanceName :: (Text -> f Text)
-> CancelServiceInstanceDeployment
-> f CancelServiceInstanceDeployment
cancelServiceInstanceDeployment_serviceInstanceName = (CancelServiceInstanceDeployment -> Text)
-> (CancelServiceInstanceDeployment
-> Text -> CancelServiceInstanceDeployment)
-> Lens
CancelServiceInstanceDeployment
CancelServiceInstanceDeployment
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelServiceInstanceDeployment' {Text
serviceInstanceName :: Text
$sel:serviceInstanceName:CancelServiceInstanceDeployment' :: CancelServiceInstanceDeployment -> Text
serviceInstanceName} -> Text
serviceInstanceName) (\s :: CancelServiceInstanceDeployment
s@CancelServiceInstanceDeployment' {} Text
a -> CancelServiceInstanceDeployment
s {$sel:serviceInstanceName:CancelServiceInstanceDeployment' :: Text
serviceInstanceName = Text
a} :: CancelServiceInstanceDeployment)
cancelServiceInstanceDeployment_serviceName :: Lens.Lens' CancelServiceInstanceDeployment Prelude.Text
cancelServiceInstanceDeployment_serviceName :: (Text -> f Text)
-> CancelServiceInstanceDeployment
-> f CancelServiceInstanceDeployment
cancelServiceInstanceDeployment_serviceName = (CancelServiceInstanceDeployment -> Text)
-> (CancelServiceInstanceDeployment
-> Text -> CancelServiceInstanceDeployment)
-> Lens
CancelServiceInstanceDeployment
CancelServiceInstanceDeployment
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelServiceInstanceDeployment' {Text
serviceName :: Text
$sel:serviceName:CancelServiceInstanceDeployment' :: CancelServiceInstanceDeployment -> Text
serviceName} -> Text
serviceName) (\s :: CancelServiceInstanceDeployment
s@CancelServiceInstanceDeployment' {} Text
a -> CancelServiceInstanceDeployment
s {$sel:serviceName:CancelServiceInstanceDeployment' :: Text
serviceName = Text
a} :: CancelServiceInstanceDeployment)
instance
Core.AWSRequest
CancelServiceInstanceDeployment
where
type
AWSResponse CancelServiceInstanceDeployment =
CancelServiceInstanceDeploymentResponse
request :: CancelServiceInstanceDeployment
-> Request CancelServiceInstanceDeployment
request = Service
-> CancelServiceInstanceDeployment
-> Request CancelServiceInstanceDeployment
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CancelServiceInstanceDeployment
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse CancelServiceInstanceDeployment)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CancelServiceInstanceDeployment))
-> Logger
-> Service
-> Proxy CancelServiceInstanceDeployment
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse CancelServiceInstanceDeployment)))
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 -> ServiceInstance -> CancelServiceInstanceDeploymentResponse
CancelServiceInstanceDeploymentResponse'
(Int -> ServiceInstance -> CancelServiceInstanceDeploymentResponse)
-> Either String Int
-> Either
String (ServiceInstance -> CancelServiceInstanceDeploymentResponse)
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 (ServiceInstance -> CancelServiceInstanceDeploymentResponse)
-> Either String ServiceInstance
-> Either String CancelServiceInstanceDeploymentResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String ServiceInstance
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"serviceInstance")
)
instance
Prelude.Hashable
CancelServiceInstanceDeployment
instance
Prelude.NFData
CancelServiceInstanceDeployment
instance
Core.ToHeaders
CancelServiceInstanceDeployment
where
toHeaders :: CancelServiceInstanceDeployment -> ResponseHeaders
toHeaders =
ResponseHeaders
-> CancelServiceInstanceDeployment -> 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.CancelServiceInstanceDeployment" ::
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 CancelServiceInstanceDeployment where
toJSON :: CancelServiceInstanceDeployment -> Value
toJSON CancelServiceInstanceDeployment' {Text
serviceName :: Text
serviceInstanceName :: Text
$sel:serviceName:CancelServiceInstanceDeployment' :: CancelServiceInstanceDeployment -> Text
$sel:serviceInstanceName:CancelServiceInstanceDeployment' :: CancelServiceInstanceDeployment -> 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
"serviceInstanceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serviceInstanceName),
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 CancelServiceInstanceDeployment where
toPath :: CancelServiceInstanceDeployment -> ByteString
toPath = ByteString -> CancelServiceInstanceDeployment -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CancelServiceInstanceDeployment where
toQuery :: CancelServiceInstanceDeployment -> QueryString
toQuery = QueryString -> CancelServiceInstanceDeployment -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CancelServiceInstanceDeploymentResponse = CancelServiceInstanceDeploymentResponse'
{
CancelServiceInstanceDeploymentResponse -> Int
httpStatus :: Prelude.Int,
CancelServiceInstanceDeploymentResponse -> ServiceInstance
serviceInstance :: ServiceInstance
}
deriving (CancelServiceInstanceDeploymentResponse
-> CancelServiceInstanceDeploymentResponse -> Bool
(CancelServiceInstanceDeploymentResponse
-> CancelServiceInstanceDeploymentResponse -> Bool)
-> (CancelServiceInstanceDeploymentResponse
-> CancelServiceInstanceDeploymentResponse -> Bool)
-> Eq CancelServiceInstanceDeploymentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelServiceInstanceDeploymentResponse
-> CancelServiceInstanceDeploymentResponse -> Bool
$c/= :: CancelServiceInstanceDeploymentResponse
-> CancelServiceInstanceDeploymentResponse -> Bool
== :: CancelServiceInstanceDeploymentResponse
-> CancelServiceInstanceDeploymentResponse -> Bool
$c== :: CancelServiceInstanceDeploymentResponse
-> CancelServiceInstanceDeploymentResponse -> Bool
Prelude.Eq, Int -> CancelServiceInstanceDeploymentResponse -> ShowS
[CancelServiceInstanceDeploymentResponse] -> ShowS
CancelServiceInstanceDeploymentResponse -> String
(Int -> CancelServiceInstanceDeploymentResponse -> ShowS)
-> (CancelServiceInstanceDeploymentResponse -> String)
-> ([CancelServiceInstanceDeploymentResponse] -> ShowS)
-> Show CancelServiceInstanceDeploymentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelServiceInstanceDeploymentResponse] -> ShowS
$cshowList :: [CancelServiceInstanceDeploymentResponse] -> ShowS
show :: CancelServiceInstanceDeploymentResponse -> String
$cshow :: CancelServiceInstanceDeploymentResponse -> String
showsPrec :: Int -> CancelServiceInstanceDeploymentResponse -> ShowS
$cshowsPrec :: Int -> CancelServiceInstanceDeploymentResponse -> ShowS
Prelude.Show, (forall x.
CancelServiceInstanceDeploymentResponse
-> Rep CancelServiceInstanceDeploymentResponse x)
-> (forall x.
Rep CancelServiceInstanceDeploymentResponse x
-> CancelServiceInstanceDeploymentResponse)
-> Generic CancelServiceInstanceDeploymentResponse
forall x.
Rep CancelServiceInstanceDeploymentResponse x
-> CancelServiceInstanceDeploymentResponse
forall x.
CancelServiceInstanceDeploymentResponse
-> Rep CancelServiceInstanceDeploymentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelServiceInstanceDeploymentResponse x
-> CancelServiceInstanceDeploymentResponse
$cfrom :: forall x.
CancelServiceInstanceDeploymentResponse
-> Rep CancelServiceInstanceDeploymentResponse x
Prelude.Generic)
newCancelServiceInstanceDeploymentResponse ::
Prelude.Int ->
ServiceInstance ->
CancelServiceInstanceDeploymentResponse
newCancelServiceInstanceDeploymentResponse :: Int -> ServiceInstance -> CancelServiceInstanceDeploymentResponse
newCancelServiceInstanceDeploymentResponse
Int
pHttpStatus_
ServiceInstance
pServiceInstance_ =
CancelServiceInstanceDeploymentResponse' :: Int -> ServiceInstance -> CancelServiceInstanceDeploymentResponse
CancelServiceInstanceDeploymentResponse'
{ $sel:httpStatus:CancelServiceInstanceDeploymentResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:serviceInstance:CancelServiceInstanceDeploymentResponse' :: ServiceInstance
serviceInstance =
ServiceInstance
pServiceInstance_
}
cancelServiceInstanceDeploymentResponse_httpStatus :: Lens.Lens' CancelServiceInstanceDeploymentResponse Prelude.Int
cancelServiceInstanceDeploymentResponse_httpStatus :: (Int -> f Int)
-> CancelServiceInstanceDeploymentResponse
-> f CancelServiceInstanceDeploymentResponse
cancelServiceInstanceDeploymentResponse_httpStatus = (CancelServiceInstanceDeploymentResponse -> Int)
-> (CancelServiceInstanceDeploymentResponse
-> Int -> CancelServiceInstanceDeploymentResponse)
-> Lens
CancelServiceInstanceDeploymentResponse
CancelServiceInstanceDeploymentResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelServiceInstanceDeploymentResponse' {Int
httpStatus :: Int
$sel:httpStatus:CancelServiceInstanceDeploymentResponse' :: CancelServiceInstanceDeploymentResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CancelServiceInstanceDeploymentResponse
s@CancelServiceInstanceDeploymentResponse' {} Int
a -> CancelServiceInstanceDeploymentResponse
s {$sel:httpStatus:CancelServiceInstanceDeploymentResponse' :: Int
httpStatus = Int
a} :: CancelServiceInstanceDeploymentResponse)
cancelServiceInstanceDeploymentResponse_serviceInstance :: Lens.Lens' CancelServiceInstanceDeploymentResponse ServiceInstance
cancelServiceInstanceDeploymentResponse_serviceInstance :: (ServiceInstance -> f ServiceInstance)
-> CancelServiceInstanceDeploymentResponse
-> f CancelServiceInstanceDeploymentResponse
cancelServiceInstanceDeploymentResponse_serviceInstance = (CancelServiceInstanceDeploymentResponse -> ServiceInstance)
-> (CancelServiceInstanceDeploymentResponse
-> ServiceInstance -> CancelServiceInstanceDeploymentResponse)
-> Lens
CancelServiceInstanceDeploymentResponse
CancelServiceInstanceDeploymentResponse
ServiceInstance
ServiceInstance
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelServiceInstanceDeploymentResponse' {ServiceInstance
serviceInstance :: ServiceInstance
$sel:serviceInstance:CancelServiceInstanceDeploymentResponse' :: CancelServiceInstanceDeploymentResponse -> ServiceInstance
serviceInstance} -> ServiceInstance
serviceInstance) (\s :: CancelServiceInstanceDeploymentResponse
s@CancelServiceInstanceDeploymentResponse' {} ServiceInstance
a -> CancelServiceInstanceDeploymentResponse
s {$sel:serviceInstance:CancelServiceInstanceDeploymentResponse' :: ServiceInstance
serviceInstance = ServiceInstance
a} :: CancelServiceInstanceDeploymentResponse)
instance
Prelude.NFData
CancelServiceInstanceDeploymentResponse