{-# 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.EC2.DetachVpnGateway
(
DetachVpnGateway (..),
newDetachVpnGateway,
detachVpnGateway_dryRun,
detachVpnGateway_vpcId,
detachVpnGateway_vpnGatewayId,
DetachVpnGatewayResponse (..),
newDetachVpnGatewayResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DetachVpnGateway = DetachVpnGateway'
{
DetachVpnGateway -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
DetachVpnGateway -> Text
vpcId :: Prelude.Text,
DetachVpnGateway -> Text
vpnGatewayId :: Prelude.Text
}
deriving (DetachVpnGateway -> DetachVpnGateway -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetachVpnGateway -> DetachVpnGateway -> Bool
$c/= :: DetachVpnGateway -> DetachVpnGateway -> Bool
== :: DetachVpnGateway -> DetachVpnGateway -> Bool
$c== :: DetachVpnGateway -> DetachVpnGateway -> Bool
Prelude.Eq, ReadPrec [DetachVpnGateway]
ReadPrec DetachVpnGateway
Int -> ReadS DetachVpnGateway
ReadS [DetachVpnGateway]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetachVpnGateway]
$creadListPrec :: ReadPrec [DetachVpnGateway]
readPrec :: ReadPrec DetachVpnGateway
$creadPrec :: ReadPrec DetachVpnGateway
readList :: ReadS [DetachVpnGateway]
$creadList :: ReadS [DetachVpnGateway]
readsPrec :: Int -> ReadS DetachVpnGateway
$creadsPrec :: Int -> ReadS DetachVpnGateway
Prelude.Read, Int -> DetachVpnGateway -> ShowS
[DetachVpnGateway] -> ShowS
DetachVpnGateway -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetachVpnGateway] -> ShowS
$cshowList :: [DetachVpnGateway] -> ShowS
show :: DetachVpnGateway -> String
$cshow :: DetachVpnGateway -> String
showsPrec :: Int -> DetachVpnGateway -> ShowS
$cshowsPrec :: Int -> DetachVpnGateway -> ShowS
Prelude.Show, forall x. Rep DetachVpnGateway x -> DetachVpnGateway
forall x. DetachVpnGateway -> Rep DetachVpnGateway x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DetachVpnGateway x -> DetachVpnGateway
$cfrom :: forall x. DetachVpnGateway -> Rep DetachVpnGateway x
Prelude.Generic)
newDetachVpnGateway ::
Prelude.Text ->
Prelude.Text ->
DetachVpnGateway
newDetachVpnGateway :: Text -> Text -> DetachVpnGateway
newDetachVpnGateway Text
pVpcId_ Text
pVpnGatewayId_ =
DetachVpnGateway'
{ $sel:dryRun:DetachVpnGateway' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
$sel:vpcId:DetachVpnGateway' :: Text
vpcId = Text
pVpcId_,
$sel:vpnGatewayId:DetachVpnGateway' :: Text
vpnGatewayId = Text
pVpnGatewayId_
}
detachVpnGateway_dryRun :: Lens.Lens' DetachVpnGateway (Prelude.Maybe Prelude.Bool)
detachVpnGateway_dryRun :: Lens' DetachVpnGateway (Maybe Bool)
detachVpnGateway_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetachVpnGateway' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DetachVpnGateway' :: DetachVpnGateway -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DetachVpnGateway
s@DetachVpnGateway' {} Maybe Bool
a -> DetachVpnGateway
s {$sel:dryRun:DetachVpnGateway' :: Maybe Bool
dryRun = Maybe Bool
a} :: DetachVpnGateway)
detachVpnGateway_vpcId :: Lens.Lens' DetachVpnGateway Prelude.Text
detachVpnGateway_vpcId :: Lens' DetachVpnGateway Text
detachVpnGateway_vpcId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetachVpnGateway' {Text
vpcId :: Text
$sel:vpcId:DetachVpnGateway' :: DetachVpnGateway -> Text
vpcId} -> Text
vpcId) (\s :: DetachVpnGateway
s@DetachVpnGateway' {} Text
a -> DetachVpnGateway
s {$sel:vpcId:DetachVpnGateway' :: Text
vpcId = Text
a} :: DetachVpnGateway)
detachVpnGateway_vpnGatewayId :: Lens.Lens' DetachVpnGateway Prelude.Text
detachVpnGateway_vpnGatewayId :: Lens' DetachVpnGateway Text
detachVpnGateway_vpnGatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetachVpnGateway' {Text
vpnGatewayId :: Text
$sel:vpnGatewayId:DetachVpnGateway' :: DetachVpnGateway -> Text
vpnGatewayId} -> Text
vpnGatewayId) (\s :: DetachVpnGateway
s@DetachVpnGateway' {} Text
a -> DetachVpnGateway
s {$sel:vpnGatewayId:DetachVpnGateway' :: Text
vpnGatewayId = Text
a} :: DetachVpnGateway)
instance Core.AWSRequest DetachVpnGateway where
type
AWSResponse DetachVpnGateway =
DetachVpnGatewayResponse
request :: (Service -> Service)
-> DetachVpnGateway -> Request DetachVpnGateway
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DetachVpnGateway
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DetachVpnGateway)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DetachVpnGatewayResponse
DetachVpnGatewayResponse'
instance Prelude.Hashable DetachVpnGateway where
hashWithSalt :: Int -> DetachVpnGateway -> Int
hashWithSalt Int
_salt DetachVpnGateway' {Maybe Bool
Text
vpnGatewayId :: Text
vpcId :: Text
dryRun :: Maybe Bool
$sel:vpnGatewayId:DetachVpnGateway' :: DetachVpnGateway -> Text
$sel:vpcId:DetachVpnGateway' :: DetachVpnGateway -> Text
$sel:dryRun:DetachVpnGateway' :: DetachVpnGateway -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vpcId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vpnGatewayId
instance Prelude.NFData DetachVpnGateway where
rnf :: DetachVpnGateway -> ()
rnf DetachVpnGateway' {Maybe Bool
Text
vpnGatewayId :: Text
vpcId :: Text
dryRun :: Maybe Bool
$sel:vpnGatewayId:DetachVpnGateway' :: DetachVpnGateway -> Text
$sel:vpcId:DetachVpnGateway' :: DetachVpnGateway -> Text
$sel:dryRun:DetachVpnGateway' :: DetachVpnGateway -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
vpcId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
vpnGatewayId
instance Data.ToHeaders DetachVpnGateway where
toHeaders :: DetachVpnGateway -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath DetachVpnGateway where
toPath :: DetachVpnGateway -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DetachVpnGateway where
toQuery :: DetachVpnGateway -> QueryString
toQuery DetachVpnGateway' {Maybe Bool
Text
vpnGatewayId :: Text
vpcId :: Text
dryRun :: Maybe Bool
$sel:vpnGatewayId:DetachVpnGateway' :: DetachVpnGateway -> Text
$sel:vpcId:DetachVpnGateway' :: DetachVpnGateway -> Text
$sel:dryRun:DetachVpnGateway' :: DetachVpnGateway -> Maybe Bool
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DetachVpnGateway" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
ByteString
"VpcId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
vpcId,
ByteString
"VpnGatewayId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
vpnGatewayId
]
data DetachVpnGatewayResponse = DetachVpnGatewayResponse'
{
}
deriving (DetachVpnGatewayResponse -> DetachVpnGatewayResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetachVpnGatewayResponse -> DetachVpnGatewayResponse -> Bool
$c/= :: DetachVpnGatewayResponse -> DetachVpnGatewayResponse -> Bool
== :: DetachVpnGatewayResponse -> DetachVpnGatewayResponse -> Bool
$c== :: DetachVpnGatewayResponse -> DetachVpnGatewayResponse -> Bool
Prelude.Eq, ReadPrec [DetachVpnGatewayResponse]
ReadPrec DetachVpnGatewayResponse
Int -> ReadS DetachVpnGatewayResponse
ReadS [DetachVpnGatewayResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetachVpnGatewayResponse]
$creadListPrec :: ReadPrec [DetachVpnGatewayResponse]
readPrec :: ReadPrec DetachVpnGatewayResponse
$creadPrec :: ReadPrec DetachVpnGatewayResponse
readList :: ReadS [DetachVpnGatewayResponse]
$creadList :: ReadS [DetachVpnGatewayResponse]
readsPrec :: Int -> ReadS DetachVpnGatewayResponse
$creadsPrec :: Int -> ReadS DetachVpnGatewayResponse
Prelude.Read, Int -> DetachVpnGatewayResponse -> ShowS
[DetachVpnGatewayResponse] -> ShowS
DetachVpnGatewayResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetachVpnGatewayResponse] -> ShowS
$cshowList :: [DetachVpnGatewayResponse] -> ShowS
show :: DetachVpnGatewayResponse -> String
$cshow :: DetachVpnGatewayResponse -> String
showsPrec :: Int -> DetachVpnGatewayResponse -> ShowS
$cshowsPrec :: Int -> DetachVpnGatewayResponse -> ShowS
Prelude.Show, forall x.
Rep DetachVpnGatewayResponse x -> DetachVpnGatewayResponse
forall x.
DetachVpnGatewayResponse -> Rep DetachVpnGatewayResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DetachVpnGatewayResponse x -> DetachVpnGatewayResponse
$cfrom :: forall x.
DetachVpnGatewayResponse -> Rep DetachVpnGatewayResponse x
Prelude.Generic)
newDetachVpnGatewayResponse ::
DetachVpnGatewayResponse
newDetachVpnGatewayResponse :: DetachVpnGatewayResponse
newDetachVpnGatewayResponse =
DetachVpnGatewayResponse
DetachVpnGatewayResponse'
instance Prelude.NFData DetachVpnGatewayResponse where
rnf :: DetachVpnGatewayResponse -> ()
rnf DetachVpnGatewayResponse
_ = ()