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

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

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

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

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

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

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

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

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

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

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

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

instance
  Prelude.Hashable
    NewPrivateVirtualInterfaceAllocation
  where
  hashWithSalt :: Int -> NewPrivateVirtualInterfaceAllocation -> Int
hashWithSalt
    Int
_salt
    NewPrivateVirtualInterfaceAllocation' {Int
Maybe Int
Maybe (NonEmpty Tag)
Maybe Text
Maybe AddressFamily
Text
asn :: Int
vlan :: Int
virtualInterfaceName :: Text
tags :: Maybe (NonEmpty Tag)
mtu :: Maybe Int
customerAddress :: Maybe Text
authKey :: Maybe Text
amazonAddress :: Maybe Text
addressFamily :: Maybe AddressFamily
$sel:asn:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Int
$sel:vlan:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Int
$sel:virtualInterfaceName:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Text
$sel:tags:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe (NonEmpty Tag)
$sel:mtu:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe Int
$sel:customerAddress:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe Text
$sel:authKey:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe Text
$sel:amazonAddress:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe Text
$sel:addressFamily:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> 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 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` Text
virtualInterfaceName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
vlan
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
asn

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

instance
  Data.ToJSON
    NewPrivateVirtualInterfaceAllocation
  where
  toJSON :: NewPrivateVirtualInterfaceAllocation -> Value
toJSON NewPrivateVirtualInterfaceAllocation' {Int
Maybe Int
Maybe (NonEmpty Tag)
Maybe Text
Maybe AddressFamily
Text
asn :: Int
vlan :: Int
virtualInterfaceName :: Text
tags :: Maybe (NonEmpty Tag)
mtu :: Maybe Int
customerAddress :: Maybe Text
authKey :: Maybe Text
amazonAddress :: Maybe Text
addressFamily :: Maybe AddressFamily
$sel:asn:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Int
$sel:vlan:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Int
$sel:virtualInterfaceName:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Text
$sel:tags:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe (NonEmpty Tag)
$sel:mtu:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe Int
$sel:customerAddress:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe Text
$sel:authKey:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe Text
$sel:amazonAddress:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> Maybe Text
$sel:addressFamily:NewPrivateVirtualInterfaceAllocation' :: NewPrivateVirtualInterfaceAllocation -> 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
"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,
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"virtualInterfaceName"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
virtualInterfaceName
              ),
            forall a. a -> Maybe a
Prelude.Just (Key
"vlan" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
vlan),
            forall a. a -> Maybe a
Prelude.Just (Key
"asn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
asn)
          ]
      )