{-# 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.CreateVpnGateway
(
CreateVpnGateway (..),
newCreateVpnGateway,
createVpnGateway_amazonSideAsn,
createVpnGateway_availabilityZone,
createVpnGateway_dryRun,
createVpnGateway_tagSpecifications,
createVpnGateway_type,
CreateVpnGatewayResponse (..),
newCreateVpnGatewayResponse,
createVpnGatewayResponse_vpnGateway,
createVpnGatewayResponse_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 CreateVpnGateway = CreateVpnGateway'
{
CreateVpnGateway -> Maybe Integer
amazonSideAsn :: Prelude.Maybe Prelude.Integer,
CreateVpnGateway -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
CreateVpnGateway -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
CreateVpnGateway -> Maybe [TagSpecification]
tagSpecifications :: Prelude.Maybe [TagSpecification],
CreateVpnGateway -> GatewayType
type' :: GatewayType
}
deriving (CreateVpnGateway -> CreateVpnGateway -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVpnGateway -> CreateVpnGateway -> Bool
$c/= :: CreateVpnGateway -> CreateVpnGateway -> Bool
== :: CreateVpnGateway -> CreateVpnGateway -> Bool
$c== :: CreateVpnGateway -> CreateVpnGateway -> Bool
Prelude.Eq, ReadPrec [CreateVpnGateway]
ReadPrec CreateVpnGateway
Int -> ReadS CreateVpnGateway
ReadS [CreateVpnGateway]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVpnGateway]
$creadListPrec :: ReadPrec [CreateVpnGateway]
readPrec :: ReadPrec CreateVpnGateway
$creadPrec :: ReadPrec CreateVpnGateway
readList :: ReadS [CreateVpnGateway]
$creadList :: ReadS [CreateVpnGateway]
readsPrec :: Int -> ReadS CreateVpnGateway
$creadsPrec :: Int -> ReadS CreateVpnGateway
Prelude.Read, Int -> CreateVpnGateway -> ShowS
[CreateVpnGateway] -> ShowS
CreateVpnGateway -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVpnGateway] -> ShowS
$cshowList :: [CreateVpnGateway] -> ShowS
show :: CreateVpnGateway -> String
$cshow :: CreateVpnGateway -> String
showsPrec :: Int -> CreateVpnGateway -> ShowS
$cshowsPrec :: Int -> CreateVpnGateway -> ShowS
Prelude.Show, forall x. Rep CreateVpnGateway x -> CreateVpnGateway
forall x. CreateVpnGateway -> Rep CreateVpnGateway x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateVpnGateway x -> CreateVpnGateway
$cfrom :: forall x. CreateVpnGateway -> Rep CreateVpnGateway x
Prelude.Generic)
newCreateVpnGateway ::
GatewayType ->
CreateVpnGateway
newCreateVpnGateway :: GatewayType -> CreateVpnGateway
newCreateVpnGateway GatewayType
pType_ =
CreateVpnGateway'
{ $sel:amazonSideAsn:CreateVpnGateway' :: Maybe Integer
amazonSideAsn = forall a. Maybe a
Prelude.Nothing,
$sel:availabilityZone:CreateVpnGateway' :: Maybe Text
availabilityZone = forall a. Maybe a
Prelude.Nothing,
$sel:dryRun:CreateVpnGateway' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
$sel:tagSpecifications:CreateVpnGateway' :: Maybe [TagSpecification]
tagSpecifications = forall a. Maybe a
Prelude.Nothing,
$sel:type':CreateVpnGateway' :: GatewayType
type' = GatewayType
pType_
}
createVpnGateway_amazonSideAsn :: Lens.Lens' CreateVpnGateway (Prelude.Maybe Prelude.Integer)
createVpnGateway_amazonSideAsn :: Lens' CreateVpnGateway (Maybe Integer)
createVpnGateway_amazonSideAsn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpnGateway' {Maybe Integer
amazonSideAsn :: Maybe Integer
$sel:amazonSideAsn:CreateVpnGateway' :: CreateVpnGateway -> Maybe Integer
amazonSideAsn} -> Maybe Integer
amazonSideAsn) (\s :: CreateVpnGateway
s@CreateVpnGateway' {} Maybe Integer
a -> CreateVpnGateway
s {$sel:amazonSideAsn:CreateVpnGateway' :: Maybe Integer
amazonSideAsn = Maybe Integer
a} :: CreateVpnGateway)
createVpnGateway_availabilityZone :: Lens.Lens' CreateVpnGateway (Prelude.Maybe Prelude.Text)
createVpnGateway_availabilityZone :: Lens' CreateVpnGateway (Maybe Text)
createVpnGateway_availabilityZone = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpnGateway' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:CreateVpnGateway' :: CreateVpnGateway -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: CreateVpnGateway
s@CreateVpnGateway' {} Maybe Text
a -> CreateVpnGateway
s {$sel:availabilityZone:CreateVpnGateway' :: Maybe Text
availabilityZone = Maybe Text
a} :: CreateVpnGateway)
createVpnGateway_dryRun :: Lens.Lens' CreateVpnGateway (Prelude.Maybe Prelude.Bool)
createVpnGateway_dryRun :: Lens' CreateVpnGateway (Maybe Bool)
createVpnGateway_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpnGateway' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:CreateVpnGateway' :: CreateVpnGateway -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: CreateVpnGateway
s@CreateVpnGateway' {} Maybe Bool
a -> CreateVpnGateway
s {$sel:dryRun:CreateVpnGateway' :: Maybe Bool
dryRun = Maybe Bool
a} :: CreateVpnGateway)
createVpnGateway_tagSpecifications :: Lens.Lens' CreateVpnGateway (Prelude.Maybe [TagSpecification])
createVpnGateway_tagSpecifications :: Lens' CreateVpnGateway (Maybe [TagSpecification])
createVpnGateway_tagSpecifications = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpnGateway' {Maybe [TagSpecification]
tagSpecifications :: Maybe [TagSpecification]
$sel:tagSpecifications:CreateVpnGateway' :: CreateVpnGateway -> Maybe [TagSpecification]
tagSpecifications} -> Maybe [TagSpecification]
tagSpecifications) (\s :: CreateVpnGateway
s@CreateVpnGateway' {} Maybe [TagSpecification]
a -> CreateVpnGateway
s {$sel:tagSpecifications:CreateVpnGateway' :: Maybe [TagSpecification]
tagSpecifications = Maybe [TagSpecification]
a} :: CreateVpnGateway) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createVpnGateway_type :: Lens.Lens' CreateVpnGateway GatewayType
createVpnGateway_type :: Lens' CreateVpnGateway GatewayType
createVpnGateway_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpnGateway' {GatewayType
type' :: GatewayType
$sel:type':CreateVpnGateway' :: CreateVpnGateway -> GatewayType
type'} -> GatewayType
type') (\s :: CreateVpnGateway
s@CreateVpnGateway' {} GatewayType
a -> CreateVpnGateway
s {$sel:type':CreateVpnGateway' :: GatewayType
type' = GatewayType
a} :: CreateVpnGateway)
instance Core.AWSRequest CreateVpnGateway where
type
AWSResponse CreateVpnGateway =
CreateVpnGatewayResponse
request :: (Service -> Service)
-> CreateVpnGateway -> Request CreateVpnGateway
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 CreateVpnGateway
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateVpnGateway)))
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 VpnGateway -> Int -> CreateVpnGatewayResponse
CreateVpnGatewayResponse'
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
"vpnGateway")
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 CreateVpnGateway where
hashWithSalt :: Int -> CreateVpnGateway -> Int
hashWithSalt Int
_salt CreateVpnGateway' {Maybe Bool
Maybe Integer
Maybe [TagSpecification]
Maybe Text
GatewayType
type' :: GatewayType
tagSpecifications :: Maybe [TagSpecification]
dryRun :: Maybe Bool
availabilityZone :: Maybe Text
amazonSideAsn :: Maybe Integer
$sel:type':CreateVpnGateway' :: CreateVpnGateway -> GatewayType
$sel:tagSpecifications:CreateVpnGateway' :: CreateVpnGateway -> Maybe [TagSpecification]
$sel:dryRun:CreateVpnGateway' :: CreateVpnGateway -> Maybe Bool
$sel:availabilityZone:CreateVpnGateway' :: CreateVpnGateway -> Maybe Text
$sel:amazonSideAsn:CreateVpnGateway' :: CreateVpnGateway -> Maybe Integer
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
amazonSideAsn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
availabilityZone
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [TagSpecification]
tagSpecifications
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` GatewayType
type'
instance Prelude.NFData CreateVpnGateway where
rnf :: CreateVpnGateway -> ()
rnf CreateVpnGateway' {Maybe Bool
Maybe Integer
Maybe [TagSpecification]
Maybe Text
GatewayType
type' :: GatewayType
tagSpecifications :: Maybe [TagSpecification]
dryRun :: Maybe Bool
availabilityZone :: Maybe Text
amazonSideAsn :: Maybe Integer
$sel:type':CreateVpnGateway' :: CreateVpnGateway -> GatewayType
$sel:tagSpecifications:CreateVpnGateway' :: CreateVpnGateway -> Maybe [TagSpecification]
$sel:dryRun:CreateVpnGateway' :: CreateVpnGateway -> Maybe Bool
$sel:availabilityZone:CreateVpnGateway' :: CreateVpnGateway -> Maybe Text
$sel:amazonSideAsn:CreateVpnGateway' :: CreateVpnGateway -> Maybe Integer
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
amazonSideAsn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
availabilityZone
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 [TagSpecification]
tagSpecifications
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf GatewayType
type'
instance Data.ToHeaders CreateVpnGateway where
toHeaders :: CreateVpnGateway -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath CreateVpnGateway where
toPath :: CreateVpnGateway -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateVpnGateway where
toQuery :: CreateVpnGateway -> QueryString
toQuery CreateVpnGateway' {Maybe Bool
Maybe Integer
Maybe [TagSpecification]
Maybe Text
GatewayType
type' :: GatewayType
tagSpecifications :: Maybe [TagSpecification]
dryRun :: Maybe Bool
availabilityZone :: Maybe Text
amazonSideAsn :: Maybe Integer
$sel:type':CreateVpnGateway' :: CreateVpnGateway -> GatewayType
$sel:tagSpecifications:CreateVpnGateway' :: CreateVpnGateway -> Maybe [TagSpecification]
$sel:dryRun:CreateVpnGateway' :: CreateVpnGateway -> Maybe Bool
$sel:availabilityZone:CreateVpnGateway' :: CreateVpnGateway -> Maybe Text
$sel:amazonSideAsn:CreateVpnGateway' :: CreateVpnGateway -> Maybe Integer
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"CreateVpnGateway" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
ByteString
"AmazonSideAsn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Integer
amazonSideAsn,
ByteString
"AvailabilityZone" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
availabilityZone,
ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
forall a. ToQuery a => a -> QueryString
Data.toQuery
( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"TagSpecification"
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TagSpecification]
tagSpecifications
),
ByteString
"Type" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: GatewayType
type'
]
data CreateVpnGatewayResponse = CreateVpnGatewayResponse'
{
CreateVpnGatewayResponse -> Maybe VpnGateway
vpnGateway :: Prelude.Maybe VpnGateway,
CreateVpnGatewayResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateVpnGatewayResponse -> CreateVpnGatewayResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVpnGatewayResponse -> CreateVpnGatewayResponse -> Bool
$c/= :: CreateVpnGatewayResponse -> CreateVpnGatewayResponse -> Bool
== :: CreateVpnGatewayResponse -> CreateVpnGatewayResponse -> Bool
$c== :: CreateVpnGatewayResponse -> CreateVpnGatewayResponse -> Bool
Prelude.Eq, ReadPrec [CreateVpnGatewayResponse]
ReadPrec CreateVpnGatewayResponse
Int -> ReadS CreateVpnGatewayResponse
ReadS [CreateVpnGatewayResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVpnGatewayResponse]
$creadListPrec :: ReadPrec [CreateVpnGatewayResponse]
readPrec :: ReadPrec CreateVpnGatewayResponse
$creadPrec :: ReadPrec CreateVpnGatewayResponse
readList :: ReadS [CreateVpnGatewayResponse]
$creadList :: ReadS [CreateVpnGatewayResponse]
readsPrec :: Int -> ReadS CreateVpnGatewayResponse
$creadsPrec :: Int -> ReadS CreateVpnGatewayResponse
Prelude.Read, Int -> CreateVpnGatewayResponse -> ShowS
[CreateVpnGatewayResponse] -> ShowS
CreateVpnGatewayResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVpnGatewayResponse] -> ShowS
$cshowList :: [CreateVpnGatewayResponse] -> ShowS
show :: CreateVpnGatewayResponse -> String
$cshow :: CreateVpnGatewayResponse -> String
showsPrec :: Int -> CreateVpnGatewayResponse -> ShowS
$cshowsPrec :: Int -> CreateVpnGatewayResponse -> ShowS
Prelude.Show, forall x.
Rep CreateVpnGatewayResponse x -> CreateVpnGatewayResponse
forall x.
CreateVpnGatewayResponse -> Rep CreateVpnGatewayResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateVpnGatewayResponse x -> CreateVpnGatewayResponse
$cfrom :: forall x.
CreateVpnGatewayResponse -> Rep CreateVpnGatewayResponse x
Prelude.Generic)
newCreateVpnGatewayResponse ::
Prelude.Int ->
CreateVpnGatewayResponse
newCreateVpnGatewayResponse :: Int -> CreateVpnGatewayResponse
newCreateVpnGatewayResponse Int
pHttpStatus_ =
CreateVpnGatewayResponse'
{ $sel:vpnGateway:CreateVpnGatewayResponse' :: Maybe VpnGateway
vpnGateway =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateVpnGatewayResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createVpnGatewayResponse_vpnGateway :: Lens.Lens' CreateVpnGatewayResponse (Prelude.Maybe VpnGateway)
createVpnGatewayResponse_vpnGateway :: Lens' CreateVpnGatewayResponse (Maybe VpnGateway)
createVpnGatewayResponse_vpnGateway = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpnGatewayResponse' {Maybe VpnGateway
vpnGateway :: Maybe VpnGateway
$sel:vpnGateway:CreateVpnGatewayResponse' :: CreateVpnGatewayResponse -> Maybe VpnGateway
vpnGateway} -> Maybe VpnGateway
vpnGateway) (\s :: CreateVpnGatewayResponse
s@CreateVpnGatewayResponse' {} Maybe VpnGateway
a -> CreateVpnGatewayResponse
s {$sel:vpnGateway:CreateVpnGatewayResponse' :: Maybe VpnGateway
vpnGateway = Maybe VpnGateway
a} :: CreateVpnGatewayResponse)
createVpnGatewayResponse_httpStatus :: Lens.Lens' CreateVpnGatewayResponse Prelude.Int
createVpnGatewayResponse_httpStatus :: Lens' CreateVpnGatewayResponse Int
createVpnGatewayResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpnGatewayResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateVpnGatewayResponse' :: CreateVpnGatewayResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateVpnGatewayResponse
s@CreateVpnGatewayResponse' {} Int
a -> CreateVpnGatewayResponse
s {$sel:httpStatus:CreateVpnGatewayResponse' :: Int
httpStatus = Int
a} :: CreateVpnGatewayResponse)
instance Prelude.NFData CreateVpnGatewayResponse where
rnf :: CreateVpnGatewayResponse -> ()
rnf CreateVpnGatewayResponse' {Int
Maybe VpnGateway
httpStatus :: Int
vpnGateway :: Maybe VpnGateway
$sel:httpStatus:CreateVpnGatewayResponse' :: CreateVpnGatewayResponse -> Int
$sel:vpnGateway:CreateVpnGatewayResponse' :: CreateVpnGatewayResponse -> Maybe VpnGateway
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe VpnGateway
vpnGateway
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus