{-# 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.ModifyVpnConnection
(
ModifyVpnConnection (..),
newModifyVpnConnection,
modifyVpnConnection_customerGatewayId,
modifyVpnConnection_dryRun,
modifyVpnConnection_transitGatewayId,
modifyVpnConnection_vpnGatewayId,
modifyVpnConnection_vpnConnectionId,
ModifyVpnConnectionResponse (..),
newModifyVpnConnectionResponse,
modifyVpnConnectionResponse_vpnConnection,
modifyVpnConnectionResponse_httpStatus,
)
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 ModifyVpnConnection = ModifyVpnConnection'
{
ModifyVpnConnection -> Maybe Text
customerGatewayId :: Prelude.Maybe Prelude.Text,
ModifyVpnConnection -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
ModifyVpnConnection -> Maybe Text
transitGatewayId :: Prelude.Maybe Prelude.Text,
ModifyVpnConnection -> Maybe Text
vpnGatewayId :: Prelude.Maybe Prelude.Text,
ModifyVpnConnection -> Text
vpnConnectionId :: Prelude.Text
}
deriving (ModifyVpnConnection -> ModifyVpnConnection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyVpnConnection -> ModifyVpnConnection -> Bool
$c/= :: ModifyVpnConnection -> ModifyVpnConnection -> Bool
== :: ModifyVpnConnection -> ModifyVpnConnection -> Bool
$c== :: ModifyVpnConnection -> ModifyVpnConnection -> Bool
Prelude.Eq, ReadPrec [ModifyVpnConnection]
ReadPrec ModifyVpnConnection
Int -> ReadS ModifyVpnConnection
ReadS [ModifyVpnConnection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyVpnConnection]
$creadListPrec :: ReadPrec [ModifyVpnConnection]
readPrec :: ReadPrec ModifyVpnConnection
$creadPrec :: ReadPrec ModifyVpnConnection
readList :: ReadS [ModifyVpnConnection]
$creadList :: ReadS [ModifyVpnConnection]
readsPrec :: Int -> ReadS ModifyVpnConnection
$creadsPrec :: Int -> ReadS ModifyVpnConnection
Prelude.Read, Int -> ModifyVpnConnection -> ShowS
[ModifyVpnConnection] -> ShowS
ModifyVpnConnection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyVpnConnection] -> ShowS
$cshowList :: [ModifyVpnConnection] -> ShowS
show :: ModifyVpnConnection -> String
$cshow :: ModifyVpnConnection -> String
showsPrec :: Int -> ModifyVpnConnection -> ShowS
$cshowsPrec :: Int -> ModifyVpnConnection -> ShowS
Prelude.Show, forall x. Rep ModifyVpnConnection x -> ModifyVpnConnection
forall x. ModifyVpnConnection -> Rep ModifyVpnConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyVpnConnection x -> ModifyVpnConnection
$cfrom :: forall x. ModifyVpnConnection -> Rep ModifyVpnConnection x
Prelude.Generic)
newModifyVpnConnection ::
Prelude.Text ->
ModifyVpnConnection
newModifyVpnConnection :: Text -> ModifyVpnConnection
newModifyVpnConnection Text
pVpnConnectionId_ =
ModifyVpnConnection'
{ $sel:customerGatewayId:ModifyVpnConnection' :: Maybe Text
customerGatewayId =
forall a. Maybe a
Prelude.Nothing,
$sel:dryRun:ModifyVpnConnection' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
$sel:transitGatewayId:ModifyVpnConnection' :: Maybe Text
transitGatewayId = forall a. Maybe a
Prelude.Nothing,
$sel:vpnGatewayId:ModifyVpnConnection' :: Maybe Text
vpnGatewayId = forall a. Maybe a
Prelude.Nothing,
$sel:vpnConnectionId:ModifyVpnConnection' :: Text
vpnConnectionId = Text
pVpnConnectionId_
}
modifyVpnConnection_customerGatewayId :: Lens.Lens' ModifyVpnConnection (Prelude.Maybe Prelude.Text)
modifyVpnConnection_customerGatewayId :: Lens' ModifyVpnConnection (Maybe Text)
modifyVpnConnection_customerGatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyVpnConnection' {Maybe Text
customerGatewayId :: Maybe Text
$sel:customerGatewayId:ModifyVpnConnection' :: ModifyVpnConnection -> Maybe Text
customerGatewayId} -> Maybe Text
customerGatewayId) (\s :: ModifyVpnConnection
s@ModifyVpnConnection' {} Maybe Text
a -> ModifyVpnConnection
s {$sel:customerGatewayId:ModifyVpnConnection' :: Maybe Text
customerGatewayId = Maybe Text
a} :: ModifyVpnConnection)
modifyVpnConnection_dryRun :: Lens.Lens' ModifyVpnConnection (Prelude.Maybe Prelude.Bool)
modifyVpnConnection_dryRun :: Lens' ModifyVpnConnection (Maybe Bool)
modifyVpnConnection_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyVpnConnection' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:ModifyVpnConnection' :: ModifyVpnConnection -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: ModifyVpnConnection
s@ModifyVpnConnection' {} Maybe Bool
a -> ModifyVpnConnection
s {$sel:dryRun:ModifyVpnConnection' :: Maybe Bool
dryRun = Maybe Bool
a} :: ModifyVpnConnection)
modifyVpnConnection_transitGatewayId :: Lens.Lens' ModifyVpnConnection (Prelude.Maybe Prelude.Text)
modifyVpnConnection_transitGatewayId :: Lens' ModifyVpnConnection (Maybe Text)
modifyVpnConnection_transitGatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyVpnConnection' {Maybe Text
transitGatewayId :: Maybe Text
$sel:transitGatewayId:ModifyVpnConnection' :: ModifyVpnConnection -> Maybe Text
transitGatewayId} -> Maybe Text
transitGatewayId) (\s :: ModifyVpnConnection
s@ModifyVpnConnection' {} Maybe Text
a -> ModifyVpnConnection
s {$sel:transitGatewayId:ModifyVpnConnection' :: Maybe Text
transitGatewayId = Maybe Text
a} :: ModifyVpnConnection)
modifyVpnConnection_vpnGatewayId :: Lens.Lens' ModifyVpnConnection (Prelude.Maybe Prelude.Text)
modifyVpnConnection_vpnGatewayId :: Lens' ModifyVpnConnection (Maybe Text)
modifyVpnConnection_vpnGatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyVpnConnection' {Maybe Text
vpnGatewayId :: Maybe Text
$sel:vpnGatewayId:ModifyVpnConnection' :: ModifyVpnConnection -> Maybe Text
vpnGatewayId} -> Maybe Text
vpnGatewayId) (\s :: ModifyVpnConnection
s@ModifyVpnConnection' {} Maybe Text
a -> ModifyVpnConnection
s {$sel:vpnGatewayId:ModifyVpnConnection' :: Maybe Text
vpnGatewayId = Maybe Text
a} :: ModifyVpnConnection)
modifyVpnConnection_vpnConnectionId :: Lens.Lens' ModifyVpnConnection Prelude.Text
modifyVpnConnection_vpnConnectionId :: Lens' ModifyVpnConnection Text
modifyVpnConnection_vpnConnectionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyVpnConnection' {Text
vpnConnectionId :: Text
$sel:vpnConnectionId:ModifyVpnConnection' :: ModifyVpnConnection -> Text
vpnConnectionId} -> Text
vpnConnectionId) (\s :: ModifyVpnConnection
s@ModifyVpnConnection' {} Text
a -> ModifyVpnConnection
s {$sel:vpnConnectionId:ModifyVpnConnection' :: Text
vpnConnectionId = Text
a} :: ModifyVpnConnection)
instance Core.AWSRequest ModifyVpnConnection where
type
AWSResponse ModifyVpnConnection =
ModifyVpnConnectionResponse
request :: (Service -> Service)
-> ModifyVpnConnection -> Request ModifyVpnConnection
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 ModifyVpnConnection
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifyVpnConnection)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe VpnConnection -> Int -> ModifyVpnConnectionResponse
ModifyVpnConnectionResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"vpnConnection")
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 ModifyVpnConnection where
hashWithSalt :: Int -> ModifyVpnConnection -> Int
hashWithSalt Int
_salt ModifyVpnConnection' {Maybe Bool
Maybe Text
Text
vpnConnectionId :: Text
vpnGatewayId :: Maybe Text
transitGatewayId :: Maybe Text
dryRun :: Maybe Bool
customerGatewayId :: Maybe Text
$sel:vpnConnectionId:ModifyVpnConnection' :: ModifyVpnConnection -> Text
$sel:vpnGatewayId:ModifyVpnConnection' :: ModifyVpnConnection -> Maybe Text
$sel:transitGatewayId:ModifyVpnConnection' :: ModifyVpnConnection -> Maybe Text
$sel:dryRun:ModifyVpnConnection' :: ModifyVpnConnection -> Maybe Bool
$sel:customerGatewayId:ModifyVpnConnection' :: ModifyVpnConnection -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
customerGatewayId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
transitGatewayId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpnGatewayId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vpnConnectionId
instance Prelude.NFData ModifyVpnConnection where
rnf :: ModifyVpnConnection -> ()
rnf ModifyVpnConnection' {Maybe Bool
Maybe Text
Text
vpnConnectionId :: Text
vpnGatewayId :: Maybe Text
transitGatewayId :: Maybe Text
dryRun :: Maybe Bool
customerGatewayId :: Maybe Text
$sel:vpnConnectionId:ModifyVpnConnection' :: ModifyVpnConnection -> Text
$sel:vpnGatewayId:ModifyVpnConnection' :: ModifyVpnConnection -> Maybe Text
$sel:transitGatewayId:ModifyVpnConnection' :: ModifyVpnConnection -> Maybe Text
$sel:dryRun:ModifyVpnConnection' :: ModifyVpnConnection -> Maybe Bool
$sel:customerGatewayId:ModifyVpnConnection' :: ModifyVpnConnection -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
customerGatewayId
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Maybe Text
transitGatewayId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpnGatewayId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
vpnConnectionId
instance Data.ToHeaders ModifyVpnConnection where
toHeaders :: ModifyVpnConnection -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ModifyVpnConnection where
toPath :: ModifyVpnConnection -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ModifyVpnConnection where
toQuery :: ModifyVpnConnection -> QueryString
toQuery ModifyVpnConnection' {Maybe Bool
Maybe Text
Text
vpnConnectionId :: Text
vpnGatewayId :: Maybe Text
transitGatewayId :: Maybe Text
dryRun :: Maybe Bool
customerGatewayId :: Maybe Text
$sel:vpnConnectionId:ModifyVpnConnection' :: ModifyVpnConnection -> Text
$sel:vpnGatewayId:ModifyVpnConnection' :: ModifyVpnConnection -> Maybe Text
$sel:transitGatewayId:ModifyVpnConnection' :: ModifyVpnConnection -> Maybe Text
$sel:dryRun:ModifyVpnConnection' :: ModifyVpnConnection -> Maybe Bool
$sel:customerGatewayId:ModifyVpnConnection' :: ModifyVpnConnection -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ModifyVpnConnection" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
ByteString
"CustomerGatewayId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
customerGatewayId,
ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
ByteString
"TransitGatewayId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
transitGatewayId,
ByteString
"VpnGatewayId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
vpnGatewayId,
ByteString
"VpnConnectionId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
vpnConnectionId
]
data ModifyVpnConnectionResponse = ModifyVpnConnectionResponse'
{
ModifyVpnConnectionResponse -> Maybe VpnConnection
vpnConnection :: Prelude.Maybe VpnConnection,
ModifyVpnConnectionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ModifyVpnConnectionResponse -> ModifyVpnConnectionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyVpnConnectionResponse -> ModifyVpnConnectionResponse -> Bool
$c/= :: ModifyVpnConnectionResponse -> ModifyVpnConnectionResponse -> Bool
== :: ModifyVpnConnectionResponse -> ModifyVpnConnectionResponse -> Bool
$c== :: ModifyVpnConnectionResponse -> ModifyVpnConnectionResponse -> Bool
Prelude.Eq, ReadPrec [ModifyVpnConnectionResponse]
ReadPrec ModifyVpnConnectionResponse
Int -> ReadS ModifyVpnConnectionResponse
ReadS [ModifyVpnConnectionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyVpnConnectionResponse]
$creadListPrec :: ReadPrec [ModifyVpnConnectionResponse]
readPrec :: ReadPrec ModifyVpnConnectionResponse
$creadPrec :: ReadPrec ModifyVpnConnectionResponse
readList :: ReadS [ModifyVpnConnectionResponse]
$creadList :: ReadS [ModifyVpnConnectionResponse]
readsPrec :: Int -> ReadS ModifyVpnConnectionResponse
$creadsPrec :: Int -> ReadS ModifyVpnConnectionResponse
Prelude.Read, Int -> ModifyVpnConnectionResponse -> ShowS
[ModifyVpnConnectionResponse] -> ShowS
ModifyVpnConnectionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyVpnConnectionResponse] -> ShowS
$cshowList :: [ModifyVpnConnectionResponse] -> ShowS
show :: ModifyVpnConnectionResponse -> String
$cshow :: ModifyVpnConnectionResponse -> String
showsPrec :: Int -> ModifyVpnConnectionResponse -> ShowS
$cshowsPrec :: Int -> ModifyVpnConnectionResponse -> ShowS
Prelude.Show, forall x.
Rep ModifyVpnConnectionResponse x -> ModifyVpnConnectionResponse
forall x.
ModifyVpnConnectionResponse -> Rep ModifyVpnConnectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyVpnConnectionResponse x -> ModifyVpnConnectionResponse
$cfrom :: forall x.
ModifyVpnConnectionResponse -> Rep ModifyVpnConnectionResponse x
Prelude.Generic)
newModifyVpnConnectionResponse ::
Prelude.Int ->
ModifyVpnConnectionResponse
newModifyVpnConnectionResponse :: Int -> ModifyVpnConnectionResponse
newModifyVpnConnectionResponse Int
pHttpStatus_ =
ModifyVpnConnectionResponse'
{ $sel:vpnConnection:ModifyVpnConnectionResponse' :: Maybe VpnConnection
vpnConnection =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ModifyVpnConnectionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
modifyVpnConnectionResponse_vpnConnection :: Lens.Lens' ModifyVpnConnectionResponse (Prelude.Maybe VpnConnection)
modifyVpnConnectionResponse_vpnConnection :: Lens' ModifyVpnConnectionResponse (Maybe VpnConnection)
modifyVpnConnectionResponse_vpnConnection = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyVpnConnectionResponse' {Maybe VpnConnection
vpnConnection :: Maybe VpnConnection
$sel:vpnConnection:ModifyVpnConnectionResponse' :: ModifyVpnConnectionResponse -> Maybe VpnConnection
vpnConnection} -> Maybe VpnConnection
vpnConnection) (\s :: ModifyVpnConnectionResponse
s@ModifyVpnConnectionResponse' {} Maybe VpnConnection
a -> ModifyVpnConnectionResponse
s {$sel:vpnConnection:ModifyVpnConnectionResponse' :: Maybe VpnConnection
vpnConnection = Maybe VpnConnection
a} :: ModifyVpnConnectionResponse)
modifyVpnConnectionResponse_httpStatus :: Lens.Lens' ModifyVpnConnectionResponse Prelude.Int
modifyVpnConnectionResponse_httpStatus :: Lens' ModifyVpnConnectionResponse Int
modifyVpnConnectionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyVpnConnectionResponse' {Int
httpStatus :: Int
$sel:httpStatus:ModifyVpnConnectionResponse' :: ModifyVpnConnectionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ModifyVpnConnectionResponse
s@ModifyVpnConnectionResponse' {} Int
a -> ModifyVpnConnectionResponse
s {$sel:httpStatus:ModifyVpnConnectionResponse' :: Int
httpStatus = Int
a} :: ModifyVpnConnectionResponse)
instance Prelude.NFData ModifyVpnConnectionResponse where
rnf :: ModifyVpnConnectionResponse -> ()
rnf ModifyVpnConnectionResponse' {Int
Maybe VpnConnection
httpStatus :: Int
vpnConnection :: Maybe VpnConnection
$sel:httpStatus:ModifyVpnConnectionResponse' :: ModifyVpnConnectionResponse -> Int
$sel:vpnConnection:ModifyVpnConnectionResponse' :: ModifyVpnConnectionResponse -> Maybe VpnConnection
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe VpnConnection
vpnConnection
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus