{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
{ $sel:globalNetworkId:DisassociateCustomerGateway' :: Text
globalNetworkId =
Text
pGlobalNetworkId_,
$sel:customerGatewayArn:DisassociateCustomerGateway' :: Text
customerGatewayArn = Text
pCustomerGatewayArn_
}
disassociateCustomerGateway_globalNetworkId :: Lens.Lens' DisassociateCustomerGateway Prelude.Text
disassociateCustomerGateway_globalNetworkId :: Lens' DisassociateCustomerGateway Text
disassociateCustomerGateway_globalNetworkId = 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 :: Lens' DisassociateCustomerGateway Text
disassociateCustomerGateway_customerGatewayArn = 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 :: (Service -> Service)
-> DisassociateCustomerGateway
-> Request DisassociateCustomerGateway
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DisassociateCustomerGateway
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateCustomerGateway)))
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 ->
Maybe CustomerGatewayAssociation
-> Int -> DisassociateCustomerGatewayResponse
DisassociateCustomerGatewayResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CustomerGatewayAssociation")
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable DisassociateCustomerGateway where
hashWithSalt :: Int -> DisassociateCustomerGateway -> Int
hashWithSalt Int
_salt DisassociateCustomerGateway' {Text
customerGatewayArn :: Text
globalNetworkId :: Text
$sel:customerGatewayArn:DisassociateCustomerGateway' :: DisassociateCustomerGateway -> Text
$sel:globalNetworkId:DisassociateCustomerGateway' :: DisassociateCustomerGateway -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
globalNetworkId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
customerGatewayArn
instance Prelude.NFData DisassociateCustomerGateway where
rnf :: DisassociateCustomerGateway -> ()
rnf DisassociateCustomerGateway' {Text
customerGatewayArn :: Text
globalNetworkId :: Text
$sel:customerGatewayArn:DisassociateCustomerGateway' :: DisassociateCustomerGateway -> Text
$sel:globalNetworkId:DisassociateCustomerGateway' :: DisassociateCustomerGateway -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
globalNetworkId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
customerGatewayArn
instance Data.ToHeaders DisassociateCustomerGateway where
toHeaders :: DisassociateCustomerGateway -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath DisassociateCustomerGateway where
toPath :: DisassociateCustomerGateway -> ByteString
toPath DisassociateCustomerGateway' {Text
customerGatewayArn :: Text
globalNetworkId :: Text
$sel:customerGatewayArn:DisassociateCustomerGateway' :: DisassociateCustomerGateway -> Text
$sel:globalNetworkId:DisassociateCustomerGateway' :: DisassociateCustomerGateway -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/global-networks/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
globalNetworkId,
ByteString
"/customer-gateway-associations/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
customerGatewayArn
]
instance Data.ToQuery DisassociateCustomerGateway where
toQuery :: DisassociateCustomerGateway -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
{ $sel:customerGatewayAssociation:DisassociateCustomerGatewayResponse' :: Maybe CustomerGatewayAssociation
customerGatewayAssociation =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DisassociateCustomerGatewayResponse' :: Int
httpStatus = Int
pHttpStatus_
}
disassociateCustomerGatewayResponse_customerGatewayAssociation :: Lens.Lens' DisassociateCustomerGatewayResponse (Prelude.Maybe CustomerGatewayAssociation)
disassociateCustomerGatewayResponse_customerGatewayAssociation :: Lens'
DisassociateCustomerGatewayResponse
(Maybe CustomerGatewayAssociation)
disassociateCustomerGatewayResponse_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 :: Lens' DisassociateCustomerGatewayResponse Int
disassociateCustomerGatewayResponse_httpStatus = 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
where
rnf :: DisassociateCustomerGatewayResponse -> ()
rnf DisassociateCustomerGatewayResponse' {Int
Maybe CustomerGatewayAssociation
httpStatus :: Int
customerGatewayAssociation :: Maybe CustomerGatewayAssociation
$sel:httpStatus:DisassociateCustomerGatewayResponse' :: DisassociateCustomerGatewayResponse -> Int
$sel:customerGatewayAssociation:DisassociateCustomerGatewayResponse' :: DisassociateCustomerGatewayResponse
-> Maybe CustomerGatewayAssociation
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CustomerGatewayAssociation
customerGatewayAssociation
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus