{-# 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.NetworkManager.DisassociateCustomerGateway
(
DisassociateCustomerGateway (..),
newDisassociateCustomerGateway,
disassociateCustomerGateway_globalNetworkId,
disassociateCustomerGateway_customerGatewayArn,
DisassociateCustomerGatewayResponse (..),
newDisassociateCustomerGatewayResponse,
disassociateCustomerGatewayResponse_customerGatewayAssociation,
disassociateCustomerGatewayResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.NetworkManager.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DisassociateCustomerGateway = DisassociateCustomerGateway'
{
DisassociateCustomerGateway -> Text
globalNetworkId :: Prelude.Text,
DisassociateCustomerGateway -> Text
customerGatewayArn :: Prelude.Text
}
deriving (DisassociateCustomerGateway -> DisassociateCustomerGateway -> Bool
(DisassociateCustomerGateway
-> DisassociateCustomerGateway -> Bool)
-> (DisassociateCustomerGateway
-> DisassociateCustomerGateway -> Bool)
-> Eq DisassociateCustomerGateway
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateCustomerGateway -> DisassociateCustomerGateway -> Bool
$c/= :: DisassociateCustomerGateway -> DisassociateCustomerGateway -> Bool
== :: DisassociateCustomerGateway -> DisassociateCustomerGateway -> Bool
$c== :: DisassociateCustomerGateway -> DisassociateCustomerGateway -> Bool
Prelude.Eq, ReadPrec [DisassociateCustomerGateway]
ReadPrec DisassociateCustomerGateway
Int -> ReadS DisassociateCustomerGateway
ReadS [DisassociateCustomerGateway]
(Int -> ReadS DisassociateCustomerGateway)
-> ReadS [DisassociateCustomerGateway]
-> ReadPrec DisassociateCustomerGateway
-> ReadPrec [DisassociateCustomerGateway]
-> Read DisassociateCustomerGateway
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateCustomerGateway]
$creadListPrec :: ReadPrec [DisassociateCustomerGateway]
readPrec :: ReadPrec DisassociateCustomerGateway
$creadPrec :: ReadPrec DisassociateCustomerGateway
readList :: ReadS [DisassociateCustomerGateway]
$creadList :: ReadS [DisassociateCustomerGateway]
readsPrec :: Int -> ReadS DisassociateCustomerGateway
$creadsPrec :: Int -> ReadS DisassociateCustomerGateway
Prelude.Read, Int -> DisassociateCustomerGateway -> ShowS
[DisassociateCustomerGateway] -> ShowS
DisassociateCustomerGateway -> String
(Int -> DisassociateCustomerGateway -> ShowS)
-> (DisassociateCustomerGateway -> String)
-> ([DisassociateCustomerGateway] -> ShowS)
-> Show DisassociateCustomerGateway
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateCustomerGateway] -> ShowS
$cshowList :: [DisassociateCustomerGateway] -> ShowS
show :: DisassociateCustomerGateway -> String
$cshow :: DisassociateCustomerGateway -> String
showsPrec :: Int -> DisassociateCustomerGateway -> ShowS
$cshowsPrec :: Int -> DisassociateCustomerGateway -> ShowS
Prelude.Show, (forall x.
DisassociateCustomerGateway -> Rep DisassociateCustomerGateway x)
-> (forall x.
Rep DisassociateCustomerGateway x -> DisassociateCustomerGateway)
-> Generic DisassociateCustomerGateway
forall x.
Rep DisassociateCustomerGateway x -> DisassociateCustomerGateway
forall x.
DisassociateCustomerGateway -> Rep DisassociateCustomerGateway x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateCustomerGateway x -> DisassociateCustomerGateway
$cfrom :: forall x.
DisassociateCustomerGateway -> Rep DisassociateCustomerGateway x
Prelude.Generic)
newDisassociateCustomerGateway ::
Prelude.Text ->
Prelude.Text ->
DisassociateCustomerGateway
newDisassociateCustomerGateway :: Text -> Text -> DisassociateCustomerGateway
newDisassociateCustomerGateway
Text
pGlobalNetworkId_
Text
pCustomerGatewayArn_ =
DisassociateCustomerGateway' :: Text -> Text -> DisassociateCustomerGateway
DisassociateCustomerGateway'
{ $sel:globalNetworkId:DisassociateCustomerGateway' :: Text
globalNetworkId =
Text
pGlobalNetworkId_,
$sel:customerGatewayArn:DisassociateCustomerGateway' :: Text
customerGatewayArn = Text
pCustomerGatewayArn_
}
disassociateCustomerGateway_globalNetworkId :: Lens.Lens' DisassociateCustomerGateway Prelude.Text
disassociateCustomerGateway_globalNetworkId :: (Text -> f Text)
-> DisassociateCustomerGateway -> f DisassociateCustomerGateway
disassociateCustomerGateway_globalNetworkId = (DisassociateCustomerGateway -> Text)
-> (DisassociateCustomerGateway
-> Text -> DisassociateCustomerGateway)
-> Lens
DisassociateCustomerGateway DisassociateCustomerGateway Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateCustomerGateway' {Text
globalNetworkId :: Text
$sel:globalNetworkId:DisassociateCustomerGateway' :: DisassociateCustomerGateway -> Text
globalNetworkId} -> Text
globalNetworkId) (\s :: DisassociateCustomerGateway
s@DisassociateCustomerGateway' {} Text
a -> DisassociateCustomerGateway
s {$sel:globalNetworkId:DisassociateCustomerGateway' :: Text
globalNetworkId = Text
a} :: DisassociateCustomerGateway)
disassociateCustomerGateway_customerGatewayArn :: Lens.Lens' DisassociateCustomerGateway Prelude.Text
disassociateCustomerGateway_customerGatewayArn :: (Text -> f Text)
-> DisassociateCustomerGateway -> f DisassociateCustomerGateway
disassociateCustomerGateway_customerGatewayArn = (DisassociateCustomerGateway -> Text)
-> (DisassociateCustomerGateway
-> Text -> DisassociateCustomerGateway)
-> Lens
DisassociateCustomerGateway DisassociateCustomerGateway Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateCustomerGateway' {Text
customerGatewayArn :: Text
$sel:customerGatewayArn:DisassociateCustomerGateway' :: DisassociateCustomerGateway -> Text
customerGatewayArn} -> Text
customerGatewayArn) (\s :: DisassociateCustomerGateway
s@DisassociateCustomerGateway' {} Text
a -> DisassociateCustomerGateway
s {$sel:customerGatewayArn:DisassociateCustomerGateway' :: Text
customerGatewayArn = Text
a} :: DisassociateCustomerGateway)
instance Core.AWSRequest DisassociateCustomerGateway where
type
AWSResponse DisassociateCustomerGateway =
DisassociateCustomerGatewayResponse
request :: DisassociateCustomerGateway -> Request DisassociateCustomerGateway
request = Service
-> DisassociateCustomerGateway
-> Request DisassociateCustomerGateway
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DisassociateCustomerGateway
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateCustomerGateway)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DisassociateCustomerGateway))
-> Logger
-> Service
-> Proxy DisassociateCustomerGateway
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateCustomerGateway)))
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 ->
Maybe CustomerGatewayAssociation
-> Int -> DisassociateCustomerGatewayResponse
DisassociateCustomerGatewayResponse'
(Maybe CustomerGatewayAssociation
-> Int -> DisassociateCustomerGatewayResponse)
-> Either String (Maybe CustomerGatewayAssociation)
-> Either String (Int -> DisassociateCustomerGatewayResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe CustomerGatewayAssociation)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CustomerGatewayAssociation")
Either String (Int -> DisassociateCustomerGatewayResponse)
-> Either String Int
-> Either String DisassociateCustomerGatewayResponse
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable DisassociateCustomerGateway
instance Prelude.NFData DisassociateCustomerGateway
instance Core.ToHeaders DisassociateCustomerGateway where
toHeaders :: DisassociateCustomerGateway -> ResponseHeaders
toHeaders =
ResponseHeaders -> DisassociateCustomerGateway -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath DisassociateCustomerGateway where
toPath :: DisassociateCustomerGateway -> ByteString
toPath DisassociateCustomerGateway' {Text
customerGatewayArn :: Text
globalNetworkId :: Text
$sel:customerGatewayArn:DisassociateCustomerGateway' :: DisassociateCustomerGateway -> Text
$sel:globalNetworkId:DisassociateCustomerGateway' :: DisassociateCustomerGateway -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/global-networks/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
globalNetworkId,
ByteString
"/customer-gateway-associations/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
customerGatewayArn
]
instance Core.ToQuery DisassociateCustomerGateway where
toQuery :: DisassociateCustomerGateway -> QueryString
toQuery = QueryString -> DisassociateCustomerGateway -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DisassociateCustomerGatewayResponse = DisassociateCustomerGatewayResponse'
{
DisassociateCustomerGatewayResponse
-> Maybe CustomerGatewayAssociation
customerGatewayAssociation :: Prelude.Maybe CustomerGatewayAssociation,
DisassociateCustomerGatewayResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DisassociateCustomerGatewayResponse
-> DisassociateCustomerGatewayResponse -> Bool
(DisassociateCustomerGatewayResponse
-> DisassociateCustomerGatewayResponse -> Bool)
-> (DisassociateCustomerGatewayResponse
-> DisassociateCustomerGatewayResponse -> Bool)
-> Eq DisassociateCustomerGatewayResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateCustomerGatewayResponse
-> DisassociateCustomerGatewayResponse -> Bool
$c/= :: DisassociateCustomerGatewayResponse
-> DisassociateCustomerGatewayResponse -> Bool
== :: DisassociateCustomerGatewayResponse
-> DisassociateCustomerGatewayResponse -> Bool
$c== :: DisassociateCustomerGatewayResponse
-> DisassociateCustomerGatewayResponse -> Bool
Prelude.Eq, ReadPrec [DisassociateCustomerGatewayResponse]
ReadPrec DisassociateCustomerGatewayResponse
Int -> ReadS DisassociateCustomerGatewayResponse
ReadS [DisassociateCustomerGatewayResponse]
(Int -> ReadS DisassociateCustomerGatewayResponse)
-> ReadS [DisassociateCustomerGatewayResponse]
-> ReadPrec DisassociateCustomerGatewayResponse
-> ReadPrec [DisassociateCustomerGatewayResponse]
-> Read DisassociateCustomerGatewayResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateCustomerGatewayResponse]
$creadListPrec :: ReadPrec [DisassociateCustomerGatewayResponse]
readPrec :: ReadPrec DisassociateCustomerGatewayResponse
$creadPrec :: ReadPrec DisassociateCustomerGatewayResponse
readList :: ReadS [DisassociateCustomerGatewayResponse]
$creadList :: ReadS [DisassociateCustomerGatewayResponse]
readsPrec :: Int -> ReadS DisassociateCustomerGatewayResponse
$creadsPrec :: Int -> ReadS DisassociateCustomerGatewayResponse
Prelude.Read, Int -> DisassociateCustomerGatewayResponse -> ShowS
[DisassociateCustomerGatewayResponse] -> ShowS
DisassociateCustomerGatewayResponse -> String
(Int -> DisassociateCustomerGatewayResponse -> ShowS)
-> (DisassociateCustomerGatewayResponse -> String)
-> ([DisassociateCustomerGatewayResponse] -> ShowS)
-> Show DisassociateCustomerGatewayResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateCustomerGatewayResponse] -> ShowS
$cshowList :: [DisassociateCustomerGatewayResponse] -> ShowS
show :: DisassociateCustomerGatewayResponse -> String
$cshow :: DisassociateCustomerGatewayResponse -> String
showsPrec :: Int -> DisassociateCustomerGatewayResponse -> ShowS
$cshowsPrec :: Int -> DisassociateCustomerGatewayResponse -> ShowS
Prelude.Show, (forall x.
DisassociateCustomerGatewayResponse
-> Rep DisassociateCustomerGatewayResponse x)
-> (forall x.
Rep DisassociateCustomerGatewayResponse x
-> DisassociateCustomerGatewayResponse)
-> Generic DisassociateCustomerGatewayResponse
forall x.
Rep DisassociateCustomerGatewayResponse x
-> DisassociateCustomerGatewayResponse
forall x.
DisassociateCustomerGatewayResponse
-> Rep DisassociateCustomerGatewayResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateCustomerGatewayResponse x
-> DisassociateCustomerGatewayResponse
$cfrom :: forall x.
DisassociateCustomerGatewayResponse
-> Rep DisassociateCustomerGatewayResponse x
Prelude.Generic)
newDisassociateCustomerGatewayResponse ::
Prelude.Int ->
DisassociateCustomerGatewayResponse
newDisassociateCustomerGatewayResponse :: Int -> DisassociateCustomerGatewayResponse
newDisassociateCustomerGatewayResponse Int
pHttpStatus_ =
DisassociateCustomerGatewayResponse' :: Maybe CustomerGatewayAssociation
-> Int -> DisassociateCustomerGatewayResponse
DisassociateCustomerGatewayResponse'
{ $sel:customerGatewayAssociation:DisassociateCustomerGatewayResponse' :: Maybe CustomerGatewayAssociation
customerGatewayAssociation =
Maybe CustomerGatewayAssociation
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DisassociateCustomerGatewayResponse' :: Int
httpStatus = Int
pHttpStatus_
}
disassociateCustomerGatewayResponse_customerGatewayAssociation :: Lens.Lens' DisassociateCustomerGatewayResponse (Prelude.Maybe CustomerGatewayAssociation)
disassociateCustomerGatewayResponse_customerGatewayAssociation :: (Maybe CustomerGatewayAssociation
-> f (Maybe CustomerGatewayAssociation))
-> DisassociateCustomerGatewayResponse
-> f DisassociateCustomerGatewayResponse
disassociateCustomerGatewayResponse_customerGatewayAssociation = (DisassociateCustomerGatewayResponse
-> Maybe CustomerGatewayAssociation)
-> (DisassociateCustomerGatewayResponse
-> Maybe CustomerGatewayAssociation
-> DisassociateCustomerGatewayResponse)
-> Lens
DisassociateCustomerGatewayResponse
DisassociateCustomerGatewayResponse
(Maybe CustomerGatewayAssociation)
(Maybe CustomerGatewayAssociation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateCustomerGatewayResponse' {Maybe CustomerGatewayAssociation
customerGatewayAssociation :: Maybe CustomerGatewayAssociation
$sel:customerGatewayAssociation:DisassociateCustomerGatewayResponse' :: DisassociateCustomerGatewayResponse
-> Maybe CustomerGatewayAssociation
customerGatewayAssociation} -> Maybe CustomerGatewayAssociation
customerGatewayAssociation) (\s :: DisassociateCustomerGatewayResponse
s@DisassociateCustomerGatewayResponse' {} Maybe CustomerGatewayAssociation
a -> DisassociateCustomerGatewayResponse
s {$sel:customerGatewayAssociation:DisassociateCustomerGatewayResponse' :: Maybe CustomerGatewayAssociation
customerGatewayAssociation = Maybe CustomerGatewayAssociation
a} :: DisassociateCustomerGatewayResponse)
disassociateCustomerGatewayResponse_httpStatus :: Lens.Lens' DisassociateCustomerGatewayResponse Prelude.Int
disassociateCustomerGatewayResponse_httpStatus :: (Int -> f Int)
-> DisassociateCustomerGatewayResponse
-> f DisassociateCustomerGatewayResponse
disassociateCustomerGatewayResponse_httpStatus = (DisassociateCustomerGatewayResponse -> Int)
-> (DisassociateCustomerGatewayResponse
-> Int -> DisassociateCustomerGatewayResponse)
-> Lens
DisassociateCustomerGatewayResponse
DisassociateCustomerGatewayResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateCustomerGatewayResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateCustomerGatewayResponse' :: DisassociateCustomerGatewayResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisassociateCustomerGatewayResponse
s@DisassociateCustomerGatewayResponse' {} Int
a -> DisassociateCustomerGatewayResponse
s {$sel:httpStatus:DisassociateCustomerGatewayResponse' :: Int
httpStatus = Int
a} :: DisassociateCustomerGatewayResponse)
instance
Prelude.NFData
DisassociateCustomerGatewayResponse