{-# 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.NewPublicVirtualInterfaceAllocation
-- 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.NewPublicVirtualInterfaceAllocation where

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

-- | Information about a public virtual interface to be provisioned on a
-- connection.
--
-- /See:/ 'newNewPublicVirtualInterfaceAllocation' smart constructor.
data NewPublicVirtualInterfaceAllocation = NewPublicVirtualInterfaceAllocation'
  { -- | The routes to be advertised to the Amazon Web Services network in this
    -- Region. Applies to public virtual interfaces.
    NewPublicVirtualInterfaceAllocation -> Maybe [RouteFilterPrefix]
routeFilterPrefixes :: Prelude.Maybe [RouteFilterPrefix],
    -- | The IP address assigned to the customer interface.
    NewPublicVirtualInterfaceAllocation -> Maybe Text
customerAddress :: Prelude.Maybe Prelude.Text,
    -- | The IP address assigned to the Amazon interface.
    NewPublicVirtualInterfaceAllocation -> Maybe Text
amazonAddress :: Prelude.Maybe Prelude.Text,
    -- | The address family for the BGP peer.
    NewPublicVirtualInterfaceAllocation -> 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.
    NewPublicVirtualInterfaceAllocation -> Maybe Text
authKey :: Prelude.Maybe Prelude.Text,
    -- | The tags associated with the public virtual interface.
    NewPublicVirtualInterfaceAllocation -> 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 (-).
    NewPublicVirtualInterfaceAllocation -> Text
virtualInterfaceName :: Prelude.Text,
    -- | The ID of the VLAN.
    NewPublicVirtualInterfaceAllocation -> Int
vlan :: Prelude.Int,
    -- | The autonomous system (AS) number for Border Gateway Protocol (BGP)
    -- configuration.
    --
    -- The valid values are 1-2147483647.
    NewPublicVirtualInterfaceAllocation -> Int
asn :: Prelude.Int
  }
  deriving (NewPublicVirtualInterfaceAllocation
-> NewPublicVirtualInterfaceAllocation -> Bool
(NewPublicVirtualInterfaceAllocation
 -> NewPublicVirtualInterfaceAllocation -> Bool)
-> (NewPublicVirtualInterfaceAllocation
    -> NewPublicVirtualInterfaceAllocation -> Bool)
-> Eq NewPublicVirtualInterfaceAllocation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NewPublicVirtualInterfaceAllocation
-> NewPublicVirtualInterfaceAllocation -> Bool
$c/= :: NewPublicVirtualInterfaceAllocation
-> NewPublicVirtualInterfaceAllocation -> Bool
== :: NewPublicVirtualInterfaceAllocation
-> NewPublicVirtualInterfaceAllocation -> Bool
$c== :: NewPublicVirtualInterfaceAllocation
-> NewPublicVirtualInterfaceAllocation -> Bool
Prelude.Eq, ReadPrec [NewPublicVirtualInterfaceAllocation]
ReadPrec NewPublicVirtualInterfaceAllocation
Int -> ReadS NewPublicVirtualInterfaceAllocation
ReadS [NewPublicVirtualInterfaceAllocation]
(Int -> ReadS NewPublicVirtualInterfaceAllocation)
-> ReadS [NewPublicVirtualInterfaceAllocation]
-> ReadPrec NewPublicVirtualInterfaceAllocation
-> ReadPrec [NewPublicVirtualInterfaceAllocation]
-> Read NewPublicVirtualInterfaceAllocation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NewPublicVirtualInterfaceAllocation]
$creadListPrec :: ReadPrec [NewPublicVirtualInterfaceAllocation]
readPrec :: ReadPrec NewPublicVirtualInterfaceAllocation
$creadPrec :: ReadPrec NewPublicVirtualInterfaceAllocation
readList :: ReadS [NewPublicVirtualInterfaceAllocation]
$creadList :: ReadS [NewPublicVirtualInterfaceAllocation]
readsPrec :: Int -> ReadS NewPublicVirtualInterfaceAllocation
$creadsPrec :: Int -> ReadS NewPublicVirtualInterfaceAllocation
Prelude.Read, Int -> NewPublicVirtualInterfaceAllocation -> ShowS
[NewPublicVirtualInterfaceAllocation] -> ShowS
NewPublicVirtualInterfaceAllocation -> String
(Int -> NewPublicVirtualInterfaceAllocation -> ShowS)
-> (NewPublicVirtualInterfaceAllocation -> String)
-> ([NewPublicVirtualInterfaceAllocation] -> ShowS)
-> Show NewPublicVirtualInterfaceAllocation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NewPublicVirtualInterfaceAllocation] -> ShowS
$cshowList :: [NewPublicVirtualInterfaceAllocation] -> ShowS
show :: NewPublicVirtualInterfaceAllocation -> String
$cshow :: NewPublicVirtualInterfaceAllocation -> String
showsPrec :: Int -> NewPublicVirtualInterfaceAllocation -> ShowS
$cshowsPrec :: Int -> NewPublicVirtualInterfaceAllocation -> ShowS
Prelude.Show, (forall x.
 NewPublicVirtualInterfaceAllocation
 -> Rep NewPublicVirtualInterfaceAllocation x)
-> (forall x.
    Rep NewPublicVirtualInterfaceAllocation x
    -> NewPublicVirtualInterfaceAllocation)
-> Generic NewPublicVirtualInterfaceAllocation
forall x.
Rep NewPublicVirtualInterfaceAllocation x
-> NewPublicVirtualInterfaceAllocation
forall x.
NewPublicVirtualInterfaceAllocation
-> Rep NewPublicVirtualInterfaceAllocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NewPublicVirtualInterfaceAllocation x
-> NewPublicVirtualInterfaceAllocation
$cfrom :: forall x.
NewPublicVirtualInterfaceAllocation
-> Rep NewPublicVirtualInterfaceAllocation x
Prelude.Generic)

-- |
-- Create a value of 'NewPublicVirtualInterfaceAllocation' 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:
--
-- 'routeFilterPrefixes', 'newPublicVirtualInterfaceAllocation_routeFilterPrefixes' - The routes to be advertised to the Amazon Web Services network in this
-- Region. Applies to public virtual interfaces.
--
-- 'customerAddress', 'newPublicVirtualInterfaceAllocation_customerAddress' - The IP address assigned to the customer interface.
--
-- 'amazonAddress', 'newPublicVirtualInterfaceAllocation_amazonAddress' - The IP address assigned to the Amazon interface.
--
-- 'addressFamily', 'newPublicVirtualInterfaceAllocation_addressFamily' - The address family for the BGP peer.
--
-- 'authKey', 'newPublicVirtualInterfaceAllocation_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', 'newPublicVirtualInterfaceAllocation_tags' - The tags associated with the public virtual interface.
--
-- 'virtualInterfaceName', 'newPublicVirtualInterfaceAllocation_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', 'newPublicVirtualInterfaceAllocation_vlan' - The ID of the VLAN.
--
-- 'asn', 'newPublicVirtualInterfaceAllocation_asn' - The autonomous system (AS) number for Border Gateway Protocol (BGP)
-- configuration.
--
-- The valid values are 1-2147483647.
newNewPublicVirtualInterfaceAllocation ::
  -- | 'virtualInterfaceName'
  Prelude.Text ->
  -- | 'vlan'
  Prelude.Int ->
  -- | 'asn'
  Prelude.Int ->
  NewPublicVirtualInterfaceAllocation
newNewPublicVirtualInterfaceAllocation :: Text -> Int -> Int -> NewPublicVirtualInterfaceAllocation
newNewPublicVirtualInterfaceAllocation
  Text
pVirtualInterfaceName_
  Int
pVlan_
  Int
pAsn_ =
    NewPublicVirtualInterfaceAllocation' :: Maybe [RouteFilterPrefix]
-> Maybe Text
-> Maybe Text
-> Maybe AddressFamily
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Text
-> Int
-> Int
-> NewPublicVirtualInterfaceAllocation
NewPublicVirtualInterfaceAllocation'
      { $sel:routeFilterPrefixes:NewPublicVirtualInterfaceAllocation' :: Maybe [RouteFilterPrefix]
routeFilterPrefixes =
          Maybe [RouteFilterPrefix]
forall a. Maybe a
Prelude.Nothing,
        $sel:customerAddress:NewPublicVirtualInterfaceAllocation' :: Maybe Text
customerAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:amazonAddress:NewPublicVirtualInterfaceAllocation' :: Maybe Text
amazonAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:addressFamily:NewPublicVirtualInterfaceAllocation' :: Maybe AddressFamily
addressFamily = Maybe AddressFamily
forall a. Maybe a
Prelude.Nothing,
        $sel:authKey:NewPublicVirtualInterfaceAllocation' :: Maybe Text
authKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:NewPublicVirtualInterfaceAllocation' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
        $sel:virtualInterfaceName:NewPublicVirtualInterfaceAllocation' :: Text
virtualInterfaceName =
          Text
pVirtualInterfaceName_,
        $sel:vlan:NewPublicVirtualInterfaceAllocation' :: Int
vlan = Int
pVlan_,
        $sel:asn:NewPublicVirtualInterfaceAllocation' :: Int
asn = Int
pAsn_
      }

-- | The routes to be advertised to the Amazon Web Services network in this
-- Region. Applies to public virtual interfaces.
newPublicVirtualInterfaceAllocation_routeFilterPrefixes :: Lens.Lens' NewPublicVirtualInterfaceAllocation (Prelude.Maybe [RouteFilterPrefix])
newPublicVirtualInterfaceAllocation_routeFilterPrefixes :: (Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> NewPublicVirtualInterfaceAllocation
-> f NewPublicVirtualInterfaceAllocation
newPublicVirtualInterfaceAllocation_routeFilterPrefixes = (NewPublicVirtualInterfaceAllocation -> Maybe [RouteFilterPrefix])
-> (NewPublicVirtualInterfaceAllocation
    -> Maybe [RouteFilterPrefix]
    -> NewPublicVirtualInterfaceAllocation)
-> Lens
     NewPublicVirtualInterfaceAllocation
     NewPublicVirtualInterfaceAllocation
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewPublicVirtualInterfaceAllocation' {Maybe [RouteFilterPrefix]
routeFilterPrefixes :: Maybe [RouteFilterPrefix]
$sel:routeFilterPrefixes:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe [RouteFilterPrefix]
routeFilterPrefixes} -> Maybe [RouteFilterPrefix]
routeFilterPrefixes) (\s :: NewPublicVirtualInterfaceAllocation
s@NewPublicVirtualInterfaceAllocation' {} Maybe [RouteFilterPrefix]
a -> NewPublicVirtualInterfaceAllocation
s {$sel:routeFilterPrefixes:NewPublicVirtualInterfaceAllocation' :: Maybe [RouteFilterPrefix]
routeFilterPrefixes = Maybe [RouteFilterPrefix]
a} :: NewPublicVirtualInterfaceAllocation) ((Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
 -> NewPublicVirtualInterfaceAllocation
 -> f NewPublicVirtualInterfaceAllocation)
-> ((Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
    -> Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> (Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> NewPublicVirtualInterfaceAllocation
-> f NewPublicVirtualInterfaceAllocation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
-> Iso
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
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
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

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

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

-- | The tags associated with the public virtual interface.
newPublicVirtualInterfaceAllocation_tags :: Lens.Lens' NewPublicVirtualInterfaceAllocation (Prelude.Maybe (Prelude.NonEmpty Tag))
newPublicVirtualInterfaceAllocation_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> NewPublicVirtualInterfaceAllocation
-> f NewPublicVirtualInterfaceAllocation
newPublicVirtualInterfaceAllocation_tags = (NewPublicVirtualInterfaceAllocation -> Maybe (NonEmpty Tag))
-> (NewPublicVirtualInterfaceAllocation
    -> Maybe (NonEmpty Tag) -> NewPublicVirtualInterfaceAllocation)
-> Lens
     NewPublicVirtualInterfaceAllocation
     NewPublicVirtualInterfaceAllocation
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewPublicVirtualInterfaceAllocation' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: NewPublicVirtualInterfaceAllocation
s@NewPublicVirtualInterfaceAllocation' {} Maybe (NonEmpty Tag)
a -> NewPublicVirtualInterfaceAllocation
s {$sel:tags:NewPublicVirtualInterfaceAllocation' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: NewPublicVirtualInterfaceAllocation) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> NewPublicVirtualInterfaceAllocation
 -> f NewPublicVirtualInterfaceAllocation)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> NewPublicVirtualInterfaceAllocation
-> f NewPublicVirtualInterfaceAllocation
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 (-).
newPublicVirtualInterfaceAllocation_virtualInterfaceName :: Lens.Lens' NewPublicVirtualInterfaceAllocation Prelude.Text
newPublicVirtualInterfaceAllocation_virtualInterfaceName :: (Text -> f Text)
-> NewPublicVirtualInterfaceAllocation
-> f NewPublicVirtualInterfaceAllocation
newPublicVirtualInterfaceAllocation_virtualInterfaceName = (NewPublicVirtualInterfaceAllocation -> Text)
-> (NewPublicVirtualInterfaceAllocation
    -> Text -> NewPublicVirtualInterfaceAllocation)
-> Lens
     NewPublicVirtualInterfaceAllocation
     NewPublicVirtualInterfaceAllocation
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewPublicVirtualInterfaceAllocation' {Text
virtualInterfaceName :: Text
$sel:virtualInterfaceName:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Text
virtualInterfaceName} -> Text
virtualInterfaceName) (\s :: NewPublicVirtualInterfaceAllocation
s@NewPublicVirtualInterfaceAllocation' {} Text
a -> NewPublicVirtualInterfaceAllocation
s {$sel:virtualInterfaceName:NewPublicVirtualInterfaceAllocation' :: Text
virtualInterfaceName = Text
a} :: NewPublicVirtualInterfaceAllocation)

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

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

instance
  Prelude.Hashable
    NewPublicVirtualInterfaceAllocation

instance
  Prelude.NFData
    NewPublicVirtualInterfaceAllocation

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