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

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

-- | The routes to be advertised to the Amazon Web Services network in this
-- Region. Applies to public virtual interfaces.
newPublicVirtualInterface_routeFilterPrefixes :: Lens.Lens' NewPublicVirtualInterface (Prelude.Maybe [RouteFilterPrefix])
newPublicVirtualInterface_routeFilterPrefixes :: (Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> NewPublicVirtualInterface -> f NewPublicVirtualInterface
newPublicVirtualInterface_routeFilterPrefixes = (NewPublicVirtualInterface -> Maybe [RouteFilterPrefix])
-> (NewPublicVirtualInterface
    -> Maybe [RouteFilterPrefix] -> NewPublicVirtualInterface)
-> Lens
     NewPublicVirtualInterface
     NewPublicVirtualInterface
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewPublicVirtualInterface' {Maybe [RouteFilterPrefix]
routeFilterPrefixes :: Maybe [RouteFilterPrefix]
$sel:routeFilterPrefixes:NewPublicVirtualInterface' :: NewPublicVirtualInterface -> Maybe [RouteFilterPrefix]
routeFilterPrefixes} -> Maybe [RouteFilterPrefix]
routeFilterPrefixes) (\s :: NewPublicVirtualInterface
s@NewPublicVirtualInterface' {} Maybe [RouteFilterPrefix]
a -> NewPublicVirtualInterface
s {$sel:routeFilterPrefixes:NewPublicVirtualInterface' :: Maybe [RouteFilterPrefix]
routeFilterPrefixes = Maybe [RouteFilterPrefix]
a} :: NewPublicVirtualInterface) ((Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
 -> NewPublicVirtualInterface -> f NewPublicVirtualInterface)
-> ((Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
    -> Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> (Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> NewPublicVirtualInterface
-> f NewPublicVirtualInterface
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.
newPublicVirtualInterface_customerAddress :: Lens.Lens' NewPublicVirtualInterface (Prelude.Maybe Prelude.Text)
newPublicVirtualInterface_customerAddress :: (Maybe Text -> f (Maybe Text))
-> NewPublicVirtualInterface -> f NewPublicVirtualInterface
newPublicVirtualInterface_customerAddress = (NewPublicVirtualInterface -> Maybe Text)
-> (NewPublicVirtualInterface
    -> Maybe Text -> NewPublicVirtualInterface)
-> Lens
     NewPublicVirtualInterface
     NewPublicVirtualInterface
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewPublicVirtualInterface' {Maybe Text
customerAddress :: Maybe Text
$sel:customerAddress:NewPublicVirtualInterface' :: NewPublicVirtualInterface -> Maybe Text
customerAddress} -> Maybe Text
customerAddress) (\s :: NewPublicVirtualInterface
s@NewPublicVirtualInterface' {} Maybe Text
a -> NewPublicVirtualInterface
s {$sel:customerAddress:NewPublicVirtualInterface' :: Maybe Text
customerAddress = Maybe Text
a} :: NewPublicVirtualInterface)

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

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

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

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

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

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

instance Prelude.Hashable NewPublicVirtualInterface

instance Prelude.NFData NewPublicVirtualInterface

instance Core.ToJSON NewPublicVirtualInterface where
  toJSON :: NewPublicVirtualInterface -> Value
toJSON NewPublicVirtualInterface' {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:NewPublicVirtualInterface' :: NewPublicVirtualInterface -> Int
$sel:vlan:NewPublicVirtualInterface' :: NewPublicVirtualInterface -> Int
$sel:virtualInterfaceName:NewPublicVirtualInterface' :: NewPublicVirtualInterface -> Text
$sel:tags:NewPublicVirtualInterface' :: NewPublicVirtualInterface -> Maybe (NonEmpty Tag)
$sel:authKey:NewPublicVirtualInterface' :: NewPublicVirtualInterface -> Maybe Text
$sel:addressFamily:NewPublicVirtualInterface' :: NewPublicVirtualInterface -> Maybe AddressFamily
$sel:amazonAddress:NewPublicVirtualInterface' :: NewPublicVirtualInterface -> Maybe Text
$sel:customerAddress:NewPublicVirtualInterface' :: NewPublicVirtualInterface -> Maybe Text
$sel:routeFilterPrefixes:NewPublicVirtualInterface' :: NewPublicVirtualInterface -> 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)
          ]
      )