{-# 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.DirectConnect.AllocatePublicVirtualInterface
(
AllocatePublicVirtualInterface (..),
newAllocatePublicVirtualInterface,
allocatePublicVirtualInterface_connectionId,
allocatePublicVirtualInterface_ownerAccount,
allocatePublicVirtualInterface_newPublicVirtualInterfaceAllocation,
VirtualInterface (..),
newVirtualInterface,
virtualInterface_addressFamily,
virtualInterface_amazonAddress,
virtualInterface_amazonSideAsn,
virtualInterface_asn,
virtualInterface_authKey,
virtualInterface_awsDeviceV2,
virtualInterface_awsLogicalDeviceId,
virtualInterface_bgpPeers,
virtualInterface_connectionId,
virtualInterface_customerAddress,
virtualInterface_customerRouterConfig,
virtualInterface_directConnectGatewayId,
virtualInterface_jumboFrameCapable,
virtualInterface_location,
virtualInterface_mtu,
virtualInterface_ownerAccount,
virtualInterface_region,
virtualInterface_routeFilterPrefixes,
virtualInterface_siteLinkEnabled,
virtualInterface_tags,
virtualInterface_virtualGatewayId,
virtualInterface_virtualInterfaceId,
virtualInterface_virtualInterfaceName,
virtualInterface_virtualInterfaceState,
virtualInterface_virtualInterfaceType,
virtualInterface_vlan,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DirectConnect.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data AllocatePublicVirtualInterface = AllocatePublicVirtualInterface'
{
AllocatePublicVirtualInterface -> Text
connectionId :: Prelude.Text,
AllocatePublicVirtualInterface -> Text
ownerAccount :: Prelude.Text,
AllocatePublicVirtualInterface
-> NewPublicVirtualInterfaceAllocation
newPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation
}
deriving (AllocatePublicVirtualInterface
-> AllocatePublicVirtualInterface -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AllocatePublicVirtualInterface
-> AllocatePublicVirtualInterface -> Bool
$c/= :: AllocatePublicVirtualInterface
-> AllocatePublicVirtualInterface -> Bool
== :: AllocatePublicVirtualInterface
-> AllocatePublicVirtualInterface -> Bool
$c== :: AllocatePublicVirtualInterface
-> AllocatePublicVirtualInterface -> Bool
Prelude.Eq, ReadPrec [AllocatePublicVirtualInterface]
ReadPrec AllocatePublicVirtualInterface
Int -> ReadS AllocatePublicVirtualInterface
ReadS [AllocatePublicVirtualInterface]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AllocatePublicVirtualInterface]
$creadListPrec :: ReadPrec [AllocatePublicVirtualInterface]
readPrec :: ReadPrec AllocatePublicVirtualInterface
$creadPrec :: ReadPrec AllocatePublicVirtualInterface
readList :: ReadS [AllocatePublicVirtualInterface]
$creadList :: ReadS [AllocatePublicVirtualInterface]
readsPrec :: Int -> ReadS AllocatePublicVirtualInterface
$creadsPrec :: Int -> ReadS AllocatePublicVirtualInterface
Prelude.Read, Int -> AllocatePublicVirtualInterface -> ShowS
[AllocatePublicVirtualInterface] -> ShowS
AllocatePublicVirtualInterface -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AllocatePublicVirtualInterface] -> ShowS
$cshowList :: [AllocatePublicVirtualInterface] -> ShowS
show :: AllocatePublicVirtualInterface -> String
$cshow :: AllocatePublicVirtualInterface -> String
showsPrec :: Int -> AllocatePublicVirtualInterface -> ShowS
$cshowsPrec :: Int -> AllocatePublicVirtualInterface -> ShowS
Prelude.Show, forall x.
Rep AllocatePublicVirtualInterface x
-> AllocatePublicVirtualInterface
forall x.
AllocatePublicVirtualInterface
-> Rep AllocatePublicVirtualInterface x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AllocatePublicVirtualInterface x
-> AllocatePublicVirtualInterface
$cfrom :: forall x.
AllocatePublicVirtualInterface
-> Rep AllocatePublicVirtualInterface x
Prelude.Generic)
newAllocatePublicVirtualInterface ::
Prelude.Text ->
Prelude.Text ->
NewPublicVirtualInterfaceAllocation ->
AllocatePublicVirtualInterface
newAllocatePublicVirtualInterface :: Text
-> Text
-> NewPublicVirtualInterfaceAllocation
-> AllocatePublicVirtualInterface
newAllocatePublicVirtualInterface
Text
pConnectionId_
Text
pOwnerAccount_
NewPublicVirtualInterfaceAllocation
pNewPublicVirtualInterfaceAllocation_ =
AllocatePublicVirtualInterface'
{ $sel:connectionId:AllocatePublicVirtualInterface' :: Text
connectionId =
Text
pConnectionId_,
$sel:ownerAccount:AllocatePublicVirtualInterface' :: Text
ownerAccount = Text
pOwnerAccount_,
$sel:newPublicVirtualInterfaceAllocation':AllocatePublicVirtualInterface' :: NewPublicVirtualInterfaceAllocation
newPublicVirtualInterfaceAllocation' =
NewPublicVirtualInterfaceAllocation
pNewPublicVirtualInterfaceAllocation_
}
allocatePublicVirtualInterface_connectionId :: Lens.Lens' AllocatePublicVirtualInterface Prelude.Text
allocatePublicVirtualInterface_connectionId :: Lens' AllocatePublicVirtualInterface Text
allocatePublicVirtualInterface_connectionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AllocatePublicVirtualInterface' {Text
connectionId :: Text
$sel:connectionId:AllocatePublicVirtualInterface' :: AllocatePublicVirtualInterface -> Text
connectionId} -> Text
connectionId) (\s :: AllocatePublicVirtualInterface
s@AllocatePublicVirtualInterface' {} Text
a -> AllocatePublicVirtualInterface
s {$sel:connectionId:AllocatePublicVirtualInterface' :: Text
connectionId = Text
a} :: AllocatePublicVirtualInterface)
allocatePublicVirtualInterface_ownerAccount :: Lens.Lens' AllocatePublicVirtualInterface Prelude.Text
allocatePublicVirtualInterface_ownerAccount :: Lens' AllocatePublicVirtualInterface Text
allocatePublicVirtualInterface_ownerAccount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AllocatePublicVirtualInterface' {Text
ownerAccount :: Text
$sel:ownerAccount:AllocatePublicVirtualInterface' :: AllocatePublicVirtualInterface -> Text
ownerAccount} -> Text
ownerAccount) (\s :: AllocatePublicVirtualInterface
s@AllocatePublicVirtualInterface' {} Text
a -> AllocatePublicVirtualInterface
s {$sel:ownerAccount:AllocatePublicVirtualInterface' :: Text
ownerAccount = Text
a} :: AllocatePublicVirtualInterface)
allocatePublicVirtualInterface_newPublicVirtualInterfaceAllocation :: Lens.Lens' AllocatePublicVirtualInterface NewPublicVirtualInterfaceAllocation
allocatePublicVirtualInterface_newPublicVirtualInterfaceAllocation :: Lens'
AllocatePublicVirtualInterface NewPublicVirtualInterfaceAllocation
allocatePublicVirtualInterface_newPublicVirtualInterfaceAllocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AllocatePublicVirtualInterface' {NewPublicVirtualInterfaceAllocation
newPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation
$sel:newPublicVirtualInterfaceAllocation':AllocatePublicVirtualInterface' :: AllocatePublicVirtualInterface
-> NewPublicVirtualInterfaceAllocation
newPublicVirtualInterfaceAllocation'} -> NewPublicVirtualInterfaceAllocation
newPublicVirtualInterfaceAllocation') (\s :: AllocatePublicVirtualInterface
s@AllocatePublicVirtualInterface' {} NewPublicVirtualInterfaceAllocation
a -> AllocatePublicVirtualInterface
s {$sel:newPublicVirtualInterfaceAllocation':AllocatePublicVirtualInterface' :: NewPublicVirtualInterfaceAllocation
newPublicVirtualInterfaceAllocation' = NewPublicVirtualInterfaceAllocation
a} :: AllocatePublicVirtualInterface)
instance
Core.AWSRequest
AllocatePublicVirtualInterface
where
type
AWSResponse AllocatePublicVirtualInterface =
VirtualInterface
request :: (Service -> Service)
-> AllocatePublicVirtualInterface
-> Request AllocatePublicVirtualInterface
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy AllocatePublicVirtualInterface
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AllocatePublicVirtualInterface)))
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 -> forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)
instance
Prelude.Hashable
AllocatePublicVirtualInterface
where
hashWithSalt :: Int -> AllocatePublicVirtualInterface -> Int
hashWithSalt
Int
_salt
AllocatePublicVirtualInterface' {Text
NewPublicVirtualInterfaceAllocation
newPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation
ownerAccount :: Text
connectionId :: Text
$sel:newPublicVirtualInterfaceAllocation':AllocatePublicVirtualInterface' :: AllocatePublicVirtualInterface
-> NewPublicVirtualInterfaceAllocation
$sel:ownerAccount:AllocatePublicVirtualInterface' :: AllocatePublicVirtualInterface -> Text
$sel:connectionId:AllocatePublicVirtualInterface' :: AllocatePublicVirtualInterface -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
connectionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ownerAccount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NewPublicVirtualInterfaceAllocation
newPublicVirtualInterfaceAllocation'
instance
Prelude.NFData
AllocatePublicVirtualInterface
where
rnf :: AllocatePublicVirtualInterface -> ()
rnf AllocatePublicVirtualInterface' {Text
NewPublicVirtualInterfaceAllocation
newPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation
ownerAccount :: Text
connectionId :: Text
$sel:newPublicVirtualInterfaceAllocation':AllocatePublicVirtualInterface' :: AllocatePublicVirtualInterface
-> NewPublicVirtualInterfaceAllocation
$sel:ownerAccount:AllocatePublicVirtualInterface' :: AllocatePublicVirtualInterface -> Text
$sel:connectionId:AllocatePublicVirtualInterface' :: AllocatePublicVirtualInterface -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
connectionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ownerAccount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NewPublicVirtualInterfaceAllocation
newPublicVirtualInterfaceAllocation'
instance
Data.ToHeaders
AllocatePublicVirtualInterface
where
toHeaders :: AllocatePublicVirtualInterface -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"OvertureService.AllocatePublicVirtualInterface" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON AllocatePublicVirtualInterface where
toJSON :: AllocatePublicVirtualInterface -> Value
toJSON AllocatePublicVirtualInterface' {Text
NewPublicVirtualInterfaceAllocation
newPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation
ownerAccount :: Text
connectionId :: Text
$sel:newPublicVirtualInterfaceAllocation':AllocatePublicVirtualInterface' :: AllocatePublicVirtualInterface
-> NewPublicVirtualInterfaceAllocation
$sel:ownerAccount:AllocatePublicVirtualInterface' :: AllocatePublicVirtualInterface -> Text
$sel:connectionId:AllocatePublicVirtualInterface' :: AllocatePublicVirtualInterface -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"connectionId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
connectionId),
forall a. a -> Maybe a
Prelude.Just (Key
"ownerAccount" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
ownerAccount),
forall a. a -> Maybe a
Prelude.Just
( Key
"newPublicVirtualInterfaceAllocation"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NewPublicVirtualInterfaceAllocation
newPublicVirtualInterfaceAllocation'
)
]
)
instance Data.ToPath AllocatePublicVirtualInterface where
toPath :: AllocatePublicVirtualInterface -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery AllocatePublicVirtualInterface where
toQuery :: AllocatePublicVirtualInterface -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty