{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DirectConnect.Types.NewTransitVirtualInterfaceAllocation where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DirectConnect.Types.AddressFamily
import Amazonka.DirectConnect.Types.Tag
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 address family for the BGP peer.
    NewTransitVirtualInterfaceAllocation -> Maybe AddressFamily
addressFamily :: Prelude.Maybe AddressFamily,
    -- | The IP address assigned to the Amazon interface.
    NewTransitVirtualInterfaceAllocation -> Maybe Text
amazonAddress :: Prelude.Maybe Prelude.Text,
    -- | 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 IP address assigned to the customer interface.
    NewTransitVirtualInterfaceAllocation -> Maybe Text
customerAddress :: Prelude.Maybe Prelude.Text,
    -- | 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 tags associated with the transitive virtual interface.
    NewTransitVirtualInterfaceAllocation -> 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 (-).
    NewTransitVirtualInterfaceAllocation -> Maybe Text
virtualInterfaceName :: Prelude.Maybe Prelude.Text,
    -- | The ID of the VLAN.
    NewTransitVirtualInterfaceAllocation -> Maybe Int
vlan :: Prelude.Maybe Prelude.Int
  }
  deriving (NewTransitVirtualInterfaceAllocation
-> NewTransitVirtualInterfaceAllocation -> Bool
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]
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
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.
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:
--
-- 'addressFamily', 'newTransitVirtualInterfaceAllocation_addressFamily' - The address family for the BGP peer.
--
-- 'amazonAddress', 'newTransitVirtualInterfaceAllocation_amazonAddress' - The IP address assigned to the Amazon interface.
--
-- '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.
--
-- 'customerAddress', 'newTransitVirtualInterfaceAllocation_customerAddress' - The IP address assigned to the customer interface.
--
-- 'mtu', 'newTransitVirtualInterfaceAllocation_mtu' - The maximum transmission unit (MTU), in bytes. The supported values are
-- 1500 and 9001. The default value is 1500.
--
-- 'tags', 'newTransitVirtualInterfaceAllocation_tags' - The tags associated with the transitive virtual interface.
--
-- '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 (-).
--
-- 'vlan', 'newTransitVirtualInterfaceAllocation_vlan' - The ID of the VLAN.
newNewTransitVirtualInterfaceAllocation ::
  NewTransitVirtualInterfaceAllocation
newNewTransitVirtualInterfaceAllocation :: NewTransitVirtualInterfaceAllocation
newNewTransitVirtualInterfaceAllocation =
  NewTransitVirtualInterfaceAllocation'
    { $sel:addressFamily:NewTransitVirtualInterfaceAllocation' :: Maybe AddressFamily
addressFamily =
        forall a. Maybe a
Prelude.Nothing,
      $sel:amazonAddress:NewTransitVirtualInterfaceAllocation' :: Maybe Text
amazonAddress = forall a. Maybe a
Prelude.Nothing,
      $sel:asn:NewTransitVirtualInterfaceAllocation' :: Maybe Int
asn = forall a. Maybe a
Prelude.Nothing,
      $sel:authKey:NewTransitVirtualInterfaceAllocation' :: Maybe Text
authKey = forall a. Maybe a
Prelude.Nothing,
      $sel:customerAddress:NewTransitVirtualInterfaceAllocation' :: Maybe Text
customerAddress = forall a. Maybe a
Prelude.Nothing,
      $sel:mtu:NewTransitVirtualInterfaceAllocation' :: Maybe Int
mtu = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:NewTransitVirtualInterfaceAllocation' :: Maybe (NonEmpty Tag)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:virtualInterfaceName:NewTransitVirtualInterfaceAllocation' :: Maybe Text
virtualInterfaceName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:vlan:NewTransitVirtualInterfaceAllocation' :: Maybe Int
vlan = forall a. Maybe a
Prelude.Nothing
    }

-- | The address family for the BGP peer.
newTransitVirtualInterfaceAllocation_addressFamily :: Lens.Lens' NewTransitVirtualInterfaceAllocation (Prelude.Maybe AddressFamily)
newTransitVirtualInterfaceAllocation_addressFamily :: Lens' NewTransitVirtualInterfaceAllocation (Maybe AddressFamily)
newTransitVirtualInterfaceAllocation_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 IP address assigned to the Amazon interface.
newTransitVirtualInterfaceAllocation_amazonAddress :: Lens.Lens' NewTransitVirtualInterfaceAllocation (Prelude.Maybe Prelude.Text)
newTransitVirtualInterfaceAllocation_amazonAddress :: Lens' NewTransitVirtualInterfaceAllocation (Maybe Text)
newTransitVirtualInterfaceAllocation_amazonAddress = 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 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 :: Lens' NewTransitVirtualInterfaceAllocation (Maybe Int)
newTransitVirtualInterfaceAllocation_asn = 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 :: Lens' NewTransitVirtualInterfaceAllocation (Maybe Text)
newTransitVirtualInterfaceAllocation_authKey = 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 IP address assigned to the customer interface.
newTransitVirtualInterfaceAllocation_customerAddress :: Lens.Lens' NewTransitVirtualInterfaceAllocation (Prelude.Maybe Prelude.Text)
newTransitVirtualInterfaceAllocation_customerAddress :: Lens' NewTransitVirtualInterfaceAllocation (Maybe Text)
newTransitVirtualInterfaceAllocation_customerAddress = 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 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 :: Lens' NewTransitVirtualInterfaceAllocation (Maybe Int)
newTransitVirtualInterfaceAllocation_mtu = 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 tags associated with the transitive virtual interface.
newTransitVirtualInterfaceAllocation_tags :: Lens.Lens' NewTransitVirtualInterfaceAllocation (Prelude.Maybe (Prelude.NonEmpty Tag))
newTransitVirtualInterfaceAllocation_tags :: Lens' NewTransitVirtualInterfaceAllocation (Maybe (NonEmpty Tag))
newTransitVirtualInterfaceAllocation_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 (-).
newTransitVirtualInterfaceAllocation_virtualInterfaceName :: Lens.Lens' NewTransitVirtualInterfaceAllocation (Prelude.Maybe Prelude.Text)
newTransitVirtualInterfaceAllocation_virtualInterfaceName :: Lens' NewTransitVirtualInterfaceAllocation (Maybe Text)
newTransitVirtualInterfaceAllocation_virtualInterfaceName = 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 ID of the VLAN.
newTransitVirtualInterfaceAllocation_vlan :: Lens.Lens' NewTransitVirtualInterfaceAllocation (Prelude.Maybe Prelude.Int)
newTransitVirtualInterfaceAllocation_vlan :: Lens' NewTransitVirtualInterfaceAllocation (Maybe Int)
newTransitVirtualInterfaceAllocation_vlan = 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)

instance
  Prelude.Hashable
    NewTransitVirtualInterfaceAllocation
  where
  hashWithSalt :: Int -> NewTransitVirtualInterfaceAllocation -> Int
hashWithSalt
    Int
_salt
    NewTransitVirtualInterfaceAllocation' {Maybe Int
Maybe (NonEmpty Tag)
Maybe Text
Maybe AddressFamily
vlan :: Maybe Int
virtualInterfaceName :: Maybe Text
tags :: Maybe (NonEmpty Tag)
mtu :: Maybe Int
customerAddress :: Maybe Text
authKey :: Maybe Text
asn :: Maybe Int
amazonAddress :: Maybe Text
addressFamily :: Maybe AddressFamily
$sel:vlan:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe Int
$sel:virtualInterfaceName:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe Text
$sel:tags:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe (NonEmpty Tag)
$sel:mtu:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe Int
$sel:customerAddress:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe Text
$sel:authKey:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe Text
$sel:asn:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe Int
$sel:amazonAddress:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe Text
$sel:addressFamily:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe AddressFamily
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AddressFamily
addressFamily
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
amazonAddress
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
asn
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
authKey
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
customerAddress
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
mtu
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Tag)
tags
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
virtualInterfaceName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
vlan

instance
  Prelude.NFData
    NewTransitVirtualInterfaceAllocation
  where
  rnf :: NewTransitVirtualInterfaceAllocation -> ()
rnf NewTransitVirtualInterfaceAllocation' {Maybe Int
Maybe (NonEmpty Tag)
Maybe Text
Maybe AddressFamily
vlan :: Maybe Int
virtualInterfaceName :: Maybe Text
tags :: Maybe (NonEmpty Tag)
mtu :: Maybe Int
customerAddress :: Maybe Text
authKey :: Maybe Text
asn :: Maybe Int
amazonAddress :: Maybe Text
addressFamily :: Maybe AddressFamily
$sel:vlan:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe Int
$sel:virtualInterfaceName:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe Text
$sel:tags:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe (NonEmpty Tag)
$sel:mtu:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe Int
$sel:customerAddress:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe Text
$sel:authKey:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe Text
$sel:asn:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe Int
$sel:amazonAddress:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe Text
$sel:addressFamily:NewTransitVirtualInterfaceAllocation' :: NewTransitVirtualInterfaceAllocation -> Maybe AddressFamily
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AddressFamily
addressFamily
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
amazonAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
asn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
customerAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
mtu
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Tag)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
virtualInterfaceName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
vlan

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