{-# 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.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 CancelServiceInstanceDeployment = CancelServiceInstanceDeployment'
{
CancelServiceInstanceDeployment -> Text
serviceInstanceName :: Prelude.Text,
CancelServiceInstanceDeployment -> Text
serviceName :: Prelude.Text
}
deriving (CancelServiceInstanceDeployment
-> CancelServiceInstanceDeployment -> Bool
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]
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
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.
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'
{ $sel:serviceInstanceName:CancelServiceInstanceDeployment' :: Text
serviceInstanceName =
Text
pServiceInstanceName_,
$sel:serviceName:CancelServiceInstanceDeployment' :: Text
serviceName = Text
pServiceName_
}
cancelServiceInstanceDeployment_serviceInstanceName :: Lens.Lens' CancelServiceInstanceDeployment Prelude.Text
cancelServiceInstanceDeployment_serviceInstanceName :: Lens' CancelServiceInstanceDeployment Text
cancelServiceInstanceDeployment_serviceInstanceName = 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 :: Lens' CancelServiceInstanceDeployment Text
cancelServiceInstanceDeployment_serviceName = 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 :: (Service -> Service)
-> CancelServiceInstanceDeployment
-> Request CancelServiceInstanceDeployment
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 CancelServiceInstanceDeployment
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse CancelServiceInstanceDeployment)))
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 -> ServiceInstance -> CancelServiceInstanceDeploymentResponse
CancelServiceInstanceDeploymentResponse'
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
"serviceInstance")
)
instance
Prelude.Hashable
CancelServiceInstanceDeployment
where
hashWithSalt :: Int -> CancelServiceInstanceDeployment -> Int
hashWithSalt
Int
_salt
CancelServiceInstanceDeployment' {Text
serviceName :: Text
serviceInstanceName :: Text
$sel:serviceName:CancelServiceInstanceDeployment' :: CancelServiceInstanceDeployment -> Text
$sel:serviceInstanceName:CancelServiceInstanceDeployment' :: CancelServiceInstanceDeployment -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serviceInstanceName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serviceName
instance
Prelude.NFData
CancelServiceInstanceDeployment
where
rnf :: CancelServiceInstanceDeployment -> ()
rnf CancelServiceInstanceDeployment' {Text
serviceName :: Text
serviceInstanceName :: Text
$sel:serviceName:CancelServiceInstanceDeployment' :: CancelServiceInstanceDeployment -> Text
$sel:serviceInstanceName:CancelServiceInstanceDeployment' :: CancelServiceInstanceDeployment -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
serviceInstanceName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serviceName
instance
Data.ToHeaders
CancelServiceInstanceDeployment
where
toHeaders :: CancelServiceInstanceDeployment -> 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.CancelServiceInstanceDeployment" ::
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 CancelServiceInstanceDeployment where
toJSON :: CancelServiceInstanceDeployment -> Value
toJSON CancelServiceInstanceDeployment' {Text
serviceName :: Text
serviceInstanceName :: Text
$sel:serviceName:CancelServiceInstanceDeployment' :: CancelServiceInstanceDeployment -> Text
$sel:serviceInstanceName:CancelServiceInstanceDeployment' :: CancelServiceInstanceDeployment -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"serviceInstanceName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
serviceInstanceName),
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 CancelServiceInstanceDeployment where
toPath :: CancelServiceInstanceDeployment -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CancelServiceInstanceDeployment where
toQuery :: CancelServiceInstanceDeployment -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CancelServiceInstanceDeploymentResponse = CancelServiceInstanceDeploymentResponse'
{
CancelServiceInstanceDeploymentResponse -> Int
httpStatus :: Prelude.Int,
CancelServiceInstanceDeploymentResponse -> ServiceInstance
serviceInstance :: ServiceInstance
}
deriving (CancelServiceInstanceDeploymentResponse
-> CancelServiceInstanceDeploymentResponse -> Bool
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
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.
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'
{ $sel:httpStatus:CancelServiceInstanceDeploymentResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:serviceInstance:CancelServiceInstanceDeploymentResponse' :: ServiceInstance
serviceInstance =
ServiceInstance
pServiceInstance_
}
cancelServiceInstanceDeploymentResponse_httpStatus :: Lens.Lens' CancelServiceInstanceDeploymentResponse Prelude.Int
cancelServiceInstanceDeploymentResponse_httpStatus :: Lens' CancelServiceInstanceDeploymentResponse Int
cancelServiceInstanceDeploymentResponse_httpStatus = 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 :: Lens' CancelServiceInstanceDeploymentResponse ServiceInstance
cancelServiceInstanceDeploymentResponse_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
where
rnf :: CancelServiceInstanceDeploymentResponse -> ()
rnf CancelServiceInstanceDeploymentResponse' {Int
ServiceInstance
serviceInstance :: ServiceInstance
httpStatus :: Int
$sel:serviceInstance:CancelServiceInstanceDeploymentResponse' :: CancelServiceInstanceDeploymentResponse -> ServiceInstance
$sel:httpStatus:CancelServiceInstanceDeploymentResponse' :: CancelServiceInstanceDeploymentResponse -> 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 ServiceInstance
serviceInstance