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

-- |
-- Create a value of 'NewTransitVirtualInterfaceAllocation' 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', 'newTransitVirtualInterfaceAllocation_mtu' - The maximum transmission unit (MTU), in bytes. The supported values are
-- 1500 and 9001. The default value is 1500.
--
-- 'customerAddress', 'newTransitVirtualInterfaceAllocation_customerAddress' - The IP address assigned to the customer interface.
--
-- 'vlan', 'newTransitVirtualInterfaceAllocation_vlan' - The ID of the VLAN.
--
-- 'amazonAddress', 'newTransitVirtualInterfaceAllocation_amazonAddress' - The IP address assigned to the Amazon interface.
--
-- 'addressFamily', 'newTransitVirtualInterfaceAllocation_addressFamily' - The address family for the BGP peer.
--
-- 'asn', 'newTransitVirtualInterfaceAllocation_asn' - The autonomous system (AS) number for Border Gateway Protocol (BGP)
-- configuration.
--
-- The valid values are 1-2147483647.
--
-- 'authKey', 'newTransitVirtualInterfaceAllocation_authKey' - The authentication key for BGP configuration. This string has a minimum
-- length of 6 characters and and a maximun lenth of 80 characters.
--
-- 'virtualInterfaceName', 'newTransitVirtualInterfaceAllocation_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 (-).
--
-- 'tags', 'newTransitVirtualInterfaceAllocation_tags' - The tags associated with the transitive virtual interface.
newNewTransitVirtualInterfaceAllocation ::
  NewTransitVirtualInterfaceAllocation
newNewTransitVirtualInterfaceAllocation :: NewTransitVirtualInterfaceAllocation
newNewTransitVirtualInterfaceAllocation =
  NewTransitVirtualInterfaceAllocation' :: Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe AddressFamily
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> NewTransitVirtualInterfaceAllocation
NewTransitVirtualInterfaceAllocation'
    { $sel:mtu:NewTransitVirtualInterfaceAllocation' :: Maybe Int
mtu =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:customerAddress:NewTransitVirtualInterfaceAllocation' :: Maybe Text
customerAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vlan:NewTransitVirtualInterfaceAllocation' :: Maybe Int
vlan = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:amazonAddress:NewTransitVirtualInterfaceAllocation' :: Maybe Text
amazonAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:addressFamily:NewTransitVirtualInterfaceAllocation' :: Maybe AddressFamily
addressFamily = Maybe AddressFamily
forall a. Maybe a
Prelude.Nothing,
      $sel:asn:NewTransitVirtualInterfaceAllocation' :: Maybe Int
asn = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:authKey:NewTransitVirtualInterfaceAllocation' :: Maybe Text
authKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:virtualInterfaceName:NewTransitVirtualInterfaceAllocation' :: Maybe Text
virtualInterfaceName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:NewTransitVirtualInterfaceAllocation' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

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

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

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

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

-- | 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 (-).
newTransitVirtualInterfaceAllocation_virtualInterfaceName :: Lens.Lens' NewTransitVirtualInterfaceAllocation (Prelude.Maybe Prelude.Text)
newTransitVirtualInterfaceAllocation_virtualInterfaceName :: (Maybe Text -> f (Maybe Text))
-> NewTransitVirtualInterfaceAllocation
-> f NewTransitVirtualInterfaceAllocation
newTransitVirtualInterfaceAllocation_virtualInterfaceName = (NewTransitVirtualInterfaceAllocation -> Maybe Text)
-> (NewTransitVirtualInterfaceAllocation
    -> Maybe Text -> NewTransitVirtualInterfaceAllocation)
-> Lens
     NewTransitVirtualInterfaceAllocation
     NewTransitVirtualInterfaceAllocation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewTransitVirtualInterfaceAllocation' {Maybe Text
virtualInterfaceName :: Maybe Text
$sel:virtualInterfaceName:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe Text
virtualInterfaceName} -> Maybe Text
virtualInterfaceName) (\s :: NewTransitVirtualInterfaceAllocation
s@NewTransitVirtualInterfaceAllocation' {} Maybe Text
a -> NewTransitVirtualInterfaceAllocation
s {$sel:virtualInterfaceName:NewTransitVirtualInterfaceAllocation' :: Maybe Text
virtualInterfaceName = Maybe Text
a} :: NewTransitVirtualInterfaceAllocation)

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

instance
  Prelude.Hashable
    NewTransitVirtualInterfaceAllocation

instance
  Prelude.NFData
    NewTransitVirtualInterfaceAllocation

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