{-# 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_bgpPeers,
virtualInterface_virtualGatewayId,
virtualInterface_mtu,
virtualInterface_routeFilterPrefixes,
virtualInterface_customerAddress,
virtualInterface_vlan,
virtualInterface_location,
virtualInterface_amazonAddress,
virtualInterface_addressFamily,
virtualInterface_virtualInterfaceState,
virtualInterface_connectionId,
virtualInterface_awsLogicalDeviceId,
virtualInterface_directConnectGatewayId,
virtualInterface_amazonSideAsn,
virtualInterface_virtualInterfaceType,
virtualInterface_asn,
virtualInterface_authKey,
virtualInterface_jumboFrameCapable,
virtualInterface_customerRouterConfig,
virtualInterface_ownerAccount,
virtualInterface_region,
virtualInterface_virtualInterfaceName,
virtualInterface_awsDeviceV2,
virtualInterface_virtualInterfaceId,
virtualInterface_tags,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DirectConnect.Types
import qualified Amazonka.Lens as Lens
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
(AllocatePublicVirtualInterface
-> AllocatePublicVirtualInterface -> Bool)
-> (AllocatePublicVirtualInterface
-> AllocatePublicVirtualInterface -> Bool)
-> Eq AllocatePublicVirtualInterface
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]
(Int -> ReadS AllocatePublicVirtualInterface)
-> ReadS [AllocatePublicVirtualInterface]
-> ReadPrec AllocatePublicVirtualInterface
-> ReadPrec [AllocatePublicVirtualInterface]
-> Read 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
(Int -> AllocatePublicVirtualInterface -> ShowS)
-> (AllocatePublicVirtualInterface -> String)
-> ([AllocatePublicVirtualInterface] -> ShowS)
-> Show AllocatePublicVirtualInterface
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.
AllocatePublicVirtualInterface
-> Rep AllocatePublicVirtualInterface x)
-> (forall x.
Rep AllocatePublicVirtualInterface x
-> AllocatePublicVirtualInterface)
-> Generic AllocatePublicVirtualInterface
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' :: Text
-> Text
-> NewPublicVirtualInterfaceAllocation
-> AllocatePublicVirtualInterface
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 :: (Text -> f Text)
-> AllocatePublicVirtualInterface
-> f AllocatePublicVirtualInterface
allocatePublicVirtualInterface_connectionId = (AllocatePublicVirtualInterface -> Text)
-> (AllocatePublicVirtualInterface
-> Text -> AllocatePublicVirtualInterface)
-> Lens
AllocatePublicVirtualInterface
AllocatePublicVirtualInterface
Text
Text
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 :: (Text -> f Text)
-> AllocatePublicVirtualInterface
-> f AllocatePublicVirtualInterface
allocatePublicVirtualInterface_ownerAccount = (AllocatePublicVirtualInterface -> Text)
-> (AllocatePublicVirtualInterface
-> Text -> AllocatePublicVirtualInterface)
-> Lens
AllocatePublicVirtualInterface
AllocatePublicVirtualInterface
Text
Text
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 :: (NewPublicVirtualInterfaceAllocation
-> f NewPublicVirtualInterfaceAllocation)
-> AllocatePublicVirtualInterface
-> f AllocatePublicVirtualInterface
allocatePublicVirtualInterface_newPublicVirtualInterfaceAllocation = (AllocatePublicVirtualInterface
-> NewPublicVirtualInterfaceAllocation)
-> (AllocatePublicVirtualInterface
-> NewPublicVirtualInterfaceAllocation
-> AllocatePublicVirtualInterface)
-> Lens
AllocatePublicVirtualInterface
AllocatePublicVirtualInterface
NewPublicVirtualInterfaceAllocation
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 :: AllocatePublicVirtualInterface
-> Request AllocatePublicVirtualInterface
request = Service
-> AllocatePublicVirtualInterface
-> Request AllocatePublicVirtualInterface
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AllocatePublicVirtualInterface
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AllocatePublicVirtualInterface)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse AllocatePublicVirtualInterface))
-> Logger
-> Service
-> Proxy AllocatePublicVirtualInterface
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AllocatePublicVirtualInterface)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
(\Int
s ResponseHeaders
h Object
x -> Object -> Either String VirtualInterface
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance
Prelude.Hashable
AllocatePublicVirtualInterface
instance
Prelude.NFData
AllocatePublicVirtualInterface
instance
Core.ToHeaders
AllocatePublicVirtualInterface
where
toHeaders :: AllocatePublicVirtualInterface -> ResponseHeaders
toHeaders =
ResponseHeaders
-> AllocatePublicVirtualInterface -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"OvertureService.AllocatePublicVirtualInterface" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"connectionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
connectionId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ownerAccount" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
ownerAccount),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"newPublicVirtualInterfaceAllocation"
Text -> NewPublicVirtualInterfaceAllocation -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NewPublicVirtualInterfaceAllocation
newPublicVirtualInterfaceAllocation'
)
]
)
instance Core.ToPath AllocatePublicVirtualInterface where
toPath :: AllocatePublicVirtualInterface -> ByteString
toPath = ByteString -> AllocatePublicVirtualInterface -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AllocatePublicVirtualInterface where
toQuery :: AllocatePublicVirtualInterface -> QueryString
toQuery = QueryString -> AllocatePublicVirtualInterface -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty