{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.DirectConnect.Types.NewPrivateVirtualInterfaceAllocation
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DirectConnect.Types.NewPrivateVirtualInterfaceAllocation where

import qualified Amazonka.Core as Core
import Amazonka.DirectConnect.Types.AddressFamily
import Amazonka.DirectConnect.Types.Tag
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about a private virtual interface to be provisioned on a
-- connection.
--
-- /See:/ 'newNewPrivateVirtualInterfaceAllocation' smart constructor.
data NewPrivateVirtualInterfaceAllocation = NewPrivateVirtualInterfaceAllocation'
  { -- | The maximum transmission unit (MTU), in bytes. The supported values are
    -- 1500 and 9001. The default value is 1500.
    NewPrivateVirtualInterfaceAllocation -> Maybe Int
mtu :: Prelude.Maybe Prelude.Int,
    -- | The IP address assigned to the customer interface.
    NewPrivateVirtualInterfaceAllocation -> Maybe Text
customerAddress :: Prelude.Maybe Prelude.Text,
    -- | The IP address assigned to the Amazon interface.
    NewPrivateVirtualInterfaceAllocation -> Maybe Text
amazonAddress :: Prelude.Maybe Prelude.Text,
    -- | The address family for the BGP peer.
    NewPrivateVirtualInterfaceAllocation -> Maybe AddressFamily
addressFamily :: Prelude.Maybe AddressFamily,
    -- | The authentication key for BGP configuration. This string has a minimum
    -- length of 6 characters and and a maximun lenth of 80 characters.
    NewPrivateVirtualInterfaceAllocation -> Maybe Text
authKey :: Prelude.Maybe Prelude.Text,
    -- | The tags associated with the private virtual interface.
    NewPrivateVirtualInterfaceAllocation -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | The name of the virtual interface assigned by the customer network. The
    -- name has a maximum of 100 characters. The following are valid
    -- characters: a-z, 0-9 and a hyphen (-).
    NewPrivateVirtualInterfaceAllocation -> Text
virtualInterfaceName :: Prelude.Text,
    -- | The ID of the VLAN.
    NewPrivateVirtualInterfaceAllocation -> Int
vlan :: Prelude.Int,
    -- | The autonomous system (AS) number for Border Gateway Protocol (BGP)
    -- configuration.
    --
    -- The valid values are 1-2147483647.
    NewPrivateVirtualInterfaceAllocation -> Int
asn :: Prelude.Int
  }
  deriving (NewPrivateVirtualInterfaceAllocation
-> NewPrivateVirtualInterfaceAllocation -> Bool
(NewPrivateVirtualInterfaceAllocation
 -> NewPrivateVirtualInterfaceAllocation -> Bool)
-> (NewPrivateVirtualInterfaceAllocation
    -> NewPrivateVirtualInterfaceAllocation -> Bool)
-> Eq NewPrivateVirtualInterfaceAllocation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NewPrivateVirtualInterfaceAllocation
-> NewPrivateVirtualInterfaceAllocation -> Bool
$c/= :: NewPrivateVirtualInterfaceAllocation
-> NewPrivateVirtualInterfaceAllocation -> Bool
== :: NewPrivateVirtualInterfaceAllocation
-> NewPrivateVirtualInterfaceAllocation -> Bool
$c== :: NewPrivateVirtualInterfaceAllocation
-> NewPrivateVirtualInterfaceAllocation -> Bool
Prelude.Eq, ReadPrec [NewPrivateVirtualInterfaceAllocation]
ReadPrec NewPrivateVirtualInterfaceAllocation
Int -> ReadS NewPrivateVirtualInterfaceAllocation
ReadS [NewPrivateVirtualInterfaceAllocation]
(Int -> ReadS NewPrivateVirtualInterfaceAllocation)
-> ReadS [NewPrivateVirtualInterfaceAllocation]
-> ReadPrec NewPrivateVirtualInterfaceAllocation
-> ReadPrec [NewPrivateVirtualInterfaceAllocation]
-> Read NewPrivateVirtualInterfaceAllocation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NewPrivateVirtualInterfaceAllocation]
$creadListPrec :: ReadPrec [NewPrivateVirtualInterfaceAllocation]
readPrec :: ReadPrec NewPrivateVirtualInterfaceAllocation
$creadPrec :: ReadPrec NewPrivateVirtualInterfaceAllocation
readList :: ReadS [NewPrivateVirtualInterfaceAllocation]
$creadList :: ReadS [NewPrivateVirtualInterfaceAllocation]
readsPrec :: Int -> ReadS NewPrivateVirtualInterfaceAllocation
$creadsPrec :: Int -> ReadS NewPrivateVirtualInterfaceAllocation
Prelude.Read, Int -> NewPrivateVirtualInterfaceAllocation -> ShowS
[NewPrivateVirtualInterfaceAllocation] -> ShowS
NewPrivateVirtualInterfaceAllocation -> String
(Int -> NewPrivateVirtualInterfaceAllocation -> ShowS)
-> (NewPrivateVirtualInterfaceAllocation -> String)
-> ([NewPrivateVirtualInterfaceAllocation] -> ShowS)
-> Show NewPrivateVirtualInterfaceAllocation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NewPrivateVirtualInterfaceAllocation] -> ShowS
$cshowList :: [NewPrivateVirtualInterfaceAllocation] -> ShowS
show :: NewPrivateVirtualInterfaceAllocation -> String
$cshow :: NewPrivateVirtualInterfaceAllocation -> String
showsPrec :: Int -> NewPrivateVirtualInterfaceAllocation -> ShowS
$cshowsPrec :: Int -> NewPrivateVirtualInterfaceAllocation -> ShowS
Prelude.Show, (forall x.
 NewPrivateVirtualInterfaceAllocation
 -> Rep NewPrivateVirtualInterfaceAllocation x)
-> (forall x.
    Rep NewPrivateVirtualInterfaceAllocation x
    -> NewPrivateVirtualInterfaceAllocation)
-> Generic NewPrivateVirtualInterfaceAllocation
forall x.
Rep NewPrivateVirtualInterfaceAllocation x
-> NewPrivateVirtualInterfaceAllocation
forall x.
NewPrivateVirtualInterfaceAllocation
-> Rep NewPrivateVirtualInterfaceAllocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NewPrivateVirtualInterfaceAllocation x
-> NewPrivateVirtualInterfaceAllocation
$cfrom :: forall x.
NewPrivateVirtualInterfaceAllocation
-> Rep NewPrivateVirtualInterfaceAllocation x
Prelude.Generic)

-- |
-- Create a value of 'NewPrivateVirtualInterfaceAllocation' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'mtu', 'newPrivateVirtualInterfaceAllocation_mtu' - The maximum transmission unit (MTU), in bytes. The supported values are
-- 1500 and 9001. The default value is 1500.
--
-- 'customerAddress', 'newPrivateVirtualInterfaceAllocation_customerAddress' - The IP address assigned to the customer interface.
--
-- 'amazonAddress', 'newPrivateVirtualInterfaceAllocation_amazonAddress' - The IP address assigned to the Amazon interface.
--
-- 'addressFamily', 'newPrivateVirtualInterfaceAllocation_addressFamily' - The address family for the BGP peer.
--
-- 'authKey', 'newPrivateVirtualInterfaceAllocation_authKey' - The authentication key for BGP configuration. This string has a minimum
-- length of 6 characters and and a maximun lenth of 80 characters.
--
-- 'tags', 'newPrivateVirtualInterfaceAllocation_tags' - The tags associated with the private virtual interface.
--
-- 'virtualInterfaceName', 'newPrivateVirtualInterfaceAllocation_virtualInterfaceName' - The name of the virtual interface assigned by the customer network. The
-- name has a maximum of 100 characters. The following are valid
-- characters: a-z, 0-9 and a hyphen (-).
--
-- 'vlan', 'newPrivateVirtualInterfaceAllocation_vlan' - The ID of the VLAN.
--
-- 'asn', 'newPrivateVirtualInterfaceAllocation_asn' - The autonomous system (AS) number for Border Gateway Protocol (BGP)
-- configuration.
--
-- The valid values are 1-2147483647.
newNewPrivateVirtualInterfaceAllocation ::
  -- | 'virtualInterfaceName'
  Prelude.Text ->
  -- | 'vlan'
  Prelude.Int ->
  -- | 'asn'
  Prelude.Int ->
  NewPrivateVirtualInterfaceAllocation
newNewPrivateVirtualInterfaceAllocation :: Text -> Int -> Int -> NewPrivateVirtualInterfaceAllocation
newNewPrivateVirtualInterfaceAllocation
  Text
pVirtualInterfaceName_
  Int
pVlan_
  Int
pAsn_ =
    NewPrivateVirtualInterfaceAllocation' :: Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe AddressFamily
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Text
-> Int
-> Int
-> NewPrivateVirtualInterfaceAllocation
NewPrivateVirtualInterfaceAllocation'
      { $sel:mtu:NewPrivateVirtualInterfaceAllocation' :: Maybe Int
mtu =
          Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:customerAddress:NewPrivateVirtualInterfaceAllocation' :: Maybe Text
customerAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:amazonAddress:NewPrivateVirtualInterfaceAllocation' :: Maybe Text
amazonAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:addressFamily:NewPrivateVirtualInterfaceAllocation' :: Maybe AddressFamily
addressFamily = Maybe AddressFamily
forall a. Maybe a
Prelude.Nothing,
        $sel:authKey:NewPrivateVirtualInterfaceAllocation' :: Maybe Text
authKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:NewPrivateVirtualInterfaceAllocation' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
        $sel:virtualInterfaceName:NewPrivateVirtualInterfaceAllocation' :: Text
virtualInterfaceName =
          Text
pVirtualInterfaceName_,
        $sel:vlan:NewPrivateVirtualInterfaceAllocation' :: Int
vlan = Int
pVlan_,
        $sel:asn:NewPrivateVirtualInterfaceAllocation' :: Int
asn = Int
pAsn_
      }

-- | The maximum transmission unit (MTU), in bytes. The supported values are
-- 1500 and 9001. The default value is 1500.
newPrivateVirtualInterfaceAllocation_mtu :: Lens.Lens' NewPrivateVirtualInterfaceAllocation (Prelude.Maybe Prelude.Int)
newPrivateVirtualInterfaceAllocation_mtu :: (Maybe Int -> f (Maybe Int))
-> NewPrivateVirtualInterfaceAllocation
-> f NewPrivateVirtualInterfaceAllocation
newPrivateVirtualInterfaceAllocation_mtu = (NewPrivateVirtualInterfaceAllocation -> Maybe Int)
-> (NewPrivateVirtualInterfaceAllocation
    -> Maybe Int -> NewPrivateVirtualInterfaceAllocation)
-> Lens
     NewPrivateVirtualInterfaceAllocation
     NewPrivateVirtualInterfaceAllocation
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewPrivateVirtualInterfaceAllocation' {Maybe Int
mtu :: Maybe Int
$sel:mtu:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe Int
mtu} -> Maybe Int
mtu) (\s :: NewPrivateVirtualInterfaceAllocation
s@NewPrivateVirtualInterfaceAllocation' {} Maybe Int
a -> NewPrivateVirtualInterfaceAllocation
s {$sel:mtu:NewPrivateVirtualInterfaceAllocation' :: Maybe Int
mtu = Maybe Int
a} :: NewPrivateVirtualInterfaceAllocation)

-- | The IP address assigned to the customer interface.
newPrivateVirtualInterfaceAllocation_customerAddress :: Lens.Lens' NewPrivateVirtualInterfaceAllocation (Prelude.Maybe Prelude.Text)
newPrivateVirtualInterfaceAllocation_customerAddress :: (Maybe Text -> f (Maybe Text))
-> NewPrivateVirtualInterfaceAllocation
-> f NewPrivateVirtualInterfaceAllocation
newPrivateVirtualInterfaceAllocation_customerAddress = (NewPrivateVirtualInterfaceAllocation -> Maybe Text)
-> (NewPrivateVirtualInterfaceAllocation
    -> Maybe Text -> NewPrivateVirtualInterfaceAllocation)
-> Lens
     NewPrivateVirtualInterfaceAllocation
     NewPrivateVirtualInterfaceAllocation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewPrivateVirtualInterfaceAllocation' {Maybe Text
customerAddress :: Maybe Text
$sel:customerAddress:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe Text
customerAddress} -> Maybe Text
customerAddress) (\s :: NewPrivateVirtualInterfaceAllocation
s@NewPrivateVirtualInterfaceAllocation' {} Maybe Text
a -> NewPrivateVirtualInterfaceAllocation
s {$sel:customerAddress:NewPrivateVirtualInterfaceAllocation' :: Maybe Text
customerAddress = Maybe Text
a} :: NewPrivateVirtualInterfaceAllocation)

-- | The IP address assigned to the Amazon interface.
newPrivateVirtualInterfaceAllocation_amazonAddress :: Lens.Lens' NewPrivateVirtualInterfaceAllocation (Prelude.Maybe Prelude.Text)
newPrivateVirtualInterfaceAllocation_amazonAddress :: (Maybe Text -> f (Maybe Text))
-> NewPrivateVirtualInterfaceAllocation
-> f NewPrivateVirtualInterfaceAllocation
newPrivateVirtualInterfaceAllocation_amazonAddress = (NewPrivateVirtualInterfaceAllocation -> Maybe Text)
-> (NewPrivateVirtualInterfaceAllocation
    -> Maybe Text -> NewPrivateVirtualInterfaceAllocation)
-> Lens
     NewPrivateVirtualInterfaceAllocation
     NewPrivateVirtualInterfaceAllocation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewPrivateVirtualInterfaceAllocation' {Maybe Text
amazonAddress :: Maybe Text
$sel:amazonAddress:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe Text
amazonAddress} -> Maybe Text
amazonAddress) (\s :: NewPrivateVirtualInterfaceAllocation
s@NewPrivateVirtualInterfaceAllocation' {} Maybe Text
a -> NewPrivateVirtualInterfaceAllocation
s {$sel:amazonAddress:NewPrivateVirtualInterfaceAllocation' :: Maybe Text
amazonAddress = Maybe Text
a} :: NewPrivateVirtualInterfaceAllocation)

-- | The address family for the BGP peer.
newPrivateVirtualInterfaceAllocation_addressFamily :: Lens.Lens' NewPrivateVirtualInterfaceAllocation (Prelude.Maybe AddressFamily)
newPrivateVirtualInterfaceAllocation_addressFamily :: (Maybe AddressFamily -> f (Maybe AddressFamily))
-> NewPrivateVirtualInterfaceAllocation
-> f NewPrivateVirtualInterfaceAllocation
newPrivateVirtualInterfaceAllocation_addressFamily = (NewPrivateVirtualInterfaceAllocation -> Maybe AddressFamily)
-> (NewPrivateVirtualInterfaceAllocation
    -> Maybe AddressFamily -> NewPrivateVirtualInterfaceAllocation)
-> Lens
     NewPrivateVirtualInterfaceAllocation
     NewPrivateVirtualInterfaceAllocation
     (Maybe AddressFamily)
     (Maybe AddressFamily)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewPrivateVirtualInterfaceAllocation' {Maybe AddressFamily
addressFamily :: Maybe AddressFamily
$sel:addressFamily:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe AddressFamily
addressFamily} -> Maybe AddressFamily
addressFamily) (\s :: NewPrivateVirtualInterfaceAllocation
s@NewPrivateVirtualInterfaceAllocation' {} Maybe AddressFamily
a -> NewPrivateVirtualInterfaceAllocation
s {$sel:addressFamily:NewPrivateVirtualInterfaceAllocation' :: Maybe AddressFamily
addressFamily = Maybe AddressFamily
a} :: NewPrivateVirtualInterfaceAllocation)

-- | The authentication key for BGP configuration. This string has a minimum
-- length of 6 characters and and a maximun lenth of 80 characters.
newPrivateVirtualInterfaceAllocation_authKey :: Lens.Lens' NewPrivateVirtualInterfaceAllocation (Prelude.Maybe Prelude.Text)
newPrivateVirtualInterfaceAllocation_authKey :: (Maybe Text -> f (Maybe Text))
-> NewPrivateVirtualInterfaceAllocation
-> f NewPrivateVirtualInterfaceAllocation
newPrivateVirtualInterfaceAllocation_authKey = (NewPrivateVirtualInterfaceAllocation -> Maybe Text)
-> (NewPrivateVirtualInterfaceAllocation
    -> Maybe Text -> NewPrivateVirtualInterfaceAllocation)
-> Lens
     NewPrivateVirtualInterfaceAllocation
     NewPrivateVirtualInterfaceAllocation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewPrivateVirtualInterfaceAllocation' {Maybe Text
authKey :: Maybe Text
$sel:authKey:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe Text
authKey} -> Maybe Text
authKey) (\s :: NewPrivateVirtualInterfaceAllocation
s@NewPrivateVirtualInterfaceAllocation' {} Maybe Text
a -> NewPrivateVirtualInterfaceAllocation
s {$sel:authKey:NewPrivateVirtualInterfaceAllocation' :: Maybe Text
authKey = Maybe Text
a} :: NewPrivateVirtualInterfaceAllocation)

-- | The tags associated with the private virtual interface.
newPrivateVirtualInterfaceAllocation_tags :: Lens.Lens' NewPrivateVirtualInterfaceAllocation (Prelude.Maybe (Prelude.NonEmpty Tag))
newPrivateVirtualInterfaceAllocation_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> NewPrivateVirtualInterfaceAllocation
-> f NewPrivateVirtualInterfaceAllocation
newPrivateVirtualInterfaceAllocation_tags = (NewPrivateVirtualInterfaceAllocation -> Maybe (NonEmpty Tag))
-> (NewPrivateVirtualInterfaceAllocation
    -> Maybe (NonEmpty Tag) -> NewPrivateVirtualInterfaceAllocation)
-> Lens
     NewPrivateVirtualInterfaceAllocation
     NewPrivateVirtualInterfaceAllocation
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewPrivateVirtualInterfaceAllocation' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: NewPrivateVirtualInterfaceAllocation
s@NewPrivateVirtualInterfaceAllocation' {} Maybe (NonEmpty Tag)
a -> NewPrivateVirtualInterfaceAllocation
s {$sel:tags:NewPrivateVirtualInterfaceAllocation' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: NewPrivateVirtualInterfaceAllocation) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> NewPrivateVirtualInterfaceAllocation
 -> f NewPrivateVirtualInterfaceAllocation)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> NewPrivateVirtualInterfaceAllocation
-> f NewPrivateVirtualInterfaceAllocation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
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 AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the virtual interface assigned by the customer network. The
-- name has a maximum of 100 characters. The following are valid
-- characters: a-z, 0-9 and a hyphen (-).
newPrivateVirtualInterfaceAllocation_virtualInterfaceName :: Lens.Lens' NewPrivateVirtualInterfaceAllocation Prelude.Text
newPrivateVirtualInterfaceAllocation_virtualInterfaceName :: (Text -> f Text)
-> NewPrivateVirtualInterfaceAllocation
-> f NewPrivateVirtualInterfaceAllocation
newPrivateVirtualInterfaceAllocation_virtualInterfaceName = (NewPrivateVirtualInterfaceAllocation -> Text)
-> (NewPrivateVirtualInterfaceAllocation
    -> Text -> NewPrivateVirtualInterfaceAllocation)
-> Lens
     NewPrivateVirtualInterfaceAllocation
     NewPrivateVirtualInterfaceAllocation
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewPrivateVirtualInterfaceAllocation' {Text
virtualInterfaceName :: Text
$sel:virtualInterfaceName:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Text
virtualInterfaceName} -> Text
virtualInterfaceName) (\s :: NewPrivateVirtualInterfaceAllocation
s@NewPrivateVirtualInterfaceAllocation' {} Text
a -> NewPrivateVirtualInterfaceAllocation
s {$sel:virtualInterfaceName:NewPrivateVirtualInterfaceAllocation' :: Text
virtualInterfaceName = Text
a} :: NewPrivateVirtualInterfaceAllocation)

-- | The ID of the VLAN.
newPrivateVirtualInterfaceAllocation_vlan :: Lens.Lens' NewPrivateVirtualInterfaceAllocation Prelude.Int
newPrivateVirtualInterfaceAllocation_vlan :: (Int -> f Int)
-> NewPrivateVirtualInterfaceAllocation
-> f NewPrivateVirtualInterfaceAllocation
newPrivateVirtualInterfaceAllocation_vlan = (NewPrivateVirtualInterfaceAllocation -> Int)
-> (NewPrivateVirtualInterfaceAllocation
    -> Int -> NewPrivateVirtualInterfaceAllocation)
-> Lens
     NewPrivateVirtualInterfaceAllocation
     NewPrivateVirtualInterfaceAllocation
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewPrivateVirtualInterfaceAllocation' {Int
vlan :: Int
$sel:vlan:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Int
vlan} -> Int
vlan) (\s :: NewPrivateVirtualInterfaceAllocation
s@NewPrivateVirtualInterfaceAllocation' {} Int
a -> NewPrivateVirtualInterfaceAllocation
s {$sel:vlan:NewPrivateVirtualInterfaceAllocation' :: Int
vlan = Int
a} :: NewPrivateVirtualInterfaceAllocation)

-- | The autonomous system (AS) number for Border Gateway Protocol (BGP)
-- configuration.
--
-- The valid values are 1-2147483647.
newPrivateVirtualInterfaceAllocation_asn :: Lens.Lens' NewPrivateVirtualInterfaceAllocation Prelude.Int
newPrivateVirtualInterfaceAllocation_asn :: (Int -> f Int)
-> NewPrivateVirtualInterfaceAllocation
-> f NewPrivateVirtualInterfaceAllocation
newPrivateVirtualInterfaceAllocation_asn = (NewPrivateVirtualInterfaceAllocation -> Int)
-> (NewPrivateVirtualInterfaceAllocation
    -> Int -> NewPrivateVirtualInterfaceAllocation)
-> Lens
     NewPrivateVirtualInterfaceAllocation
     NewPrivateVirtualInterfaceAllocation
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewPrivateVirtualInterfaceAllocation' {Int
asn :: Int
$sel:asn:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Int
asn} -> Int
asn) (\s :: NewPrivateVirtualInterfaceAllocation
s@NewPrivateVirtualInterfaceAllocation' {} Int
a -> NewPrivateVirtualInterfaceAllocation
s {$sel:asn:NewPrivateVirtualInterfaceAllocation' :: Int
asn = Int
a} :: NewPrivateVirtualInterfaceAllocation)

instance
  Prelude.Hashable
    NewPrivateVirtualInterfaceAllocation

instance
  Prelude.NFData
    NewPrivateVirtualInterfaceAllocation

instance
  Core.ToJSON
    NewPrivateVirtualInterfaceAllocation
  where
  toJSON :: NewPrivateVirtualInterfaceAllocation -> Value
toJSON NewPrivateVirtualInterfaceAllocation' {Int
Maybe Int
Maybe (NonEmpty Tag)
Maybe Text
Maybe AddressFamily
Text
asn :: Int
vlan :: Int
virtualInterfaceName :: Text
tags :: Maybe (NonEmpty Tag)
authKey :: Maybe Text
addressFamily :: Maybe AddressFamily
amazonAddress :: Maybe Text
customerAddress :: Maybe Text
mtu :: Maybe Int
$sel:asn:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Int
$sel:vlan:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Int
$sel:virtualInterfaceName:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Text
$sel:tags:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe (NonEmpty Tag)
$sel:authKey:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe Text
$sel:addressFamily:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe AddressFamily
$sel:amazonAddress:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe Text
$sel:customerAddress:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe Text
$sel:mtu:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe Int
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"mtu" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
mtu,
            (Text
"customerAddress" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
customerAddress,
            (Text
"amazonAddress" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
amazonAddress,
            (Text
"addressFamily" Text -> AddressFamily -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AddressFamily -> Pair) -> Maybe AddressFamily -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AddressFamily
addressFamily,
            (Text
"authKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
authKey,
            (Text
"tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"virtualInterfaceName"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
virtualInterfaceName
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"vlan" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
vlan),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"asn" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
asn)
          ]
      )