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

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

-- |
-- Module      : Amazonka.DirectConnect.Types.NewPublicVirtualInterfaceAllocation
-- Copyright   : (c) 2013-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.NewPublicVirtualInterfaceAllocation 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.RouteFilterPrefix
import Amazonka.DirectConnect.Types.Tag
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'NewPublicVirtualInterfaceAllocation' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'addressFamily', 'newPublicVirtualInterfaceAllocation_addressFamily' - The address family for the BGP peer.
--
-- 'amazonAddress', 'newPublicVirtualInterfaceAllocation_amazonAddress' - The IP address assigned to the Amazon interface.
--
-- 'authKey', 'newPublicVirtualInterfaceAllocation_authKey' - The authentication key for BGP configuration. This string has a minimum
-- length of 6 characters and and a maximun lenth of 80 characters.
--
-- 'customerAddress', 'newPublicVirtualInterfaceAllocation_customerAddress' - The IP address assigned to the customer interface.
--
-- 'routeFilterPrefixes', 'newPublicVirtualInterfaceAllocation_routeFilterPrefixes' - The routes to be advertised to the Amazon Web Services network in this
-- Region. Applies to public virtual interfaces.
--
-- 'tags', 'newPublicVirtualInterfaceAllocation_tags' - The tags associated with the public virtual interface.
--
-- 'virtualInterfaceName', 'newPublicVirtualInterfaceAllocation_virtualInterfaceName' - The name of the virtual interface assigned by the customer network. The
-- name has a maximum of 100 characters. The following are valid
-- characters: a-z, 0-9 and a hyphen (-).
--
-- 'vlan', 'newPublicVirtualInterfaceAllocation_vlan' - The ID of the VLAN.
--
-- 'asn', 'newPublicVirtualInterfaceAllocation_asn' - The autonomous system (AS) number for Border Gateway Protocol (BGP)
-- configuration.
--
-- The valid values are 1-2147483647.
newNewPublicVirtualInterfaceAllocation ::
  -- | 'virtualInterfaceName'
  Prelude.Text ->
  -- | 'vlan'
  Prelude.Int ->
  -- | 'asn'
  Prelude.Int ->
  NewPublicVirtualInterfaceAllocation
newNewPublicVirtualInterfaceAllocation :: Text -> Int -> Int -> NewPublicVirtualInterfaceAllocation
newNewPublicVirtualInterfaceAllocation
  Text
pVirtualInterfaceName_
  Int
pVlan_
  Int
pAsn_ =
    NewPublicVirtualInterfaceAllocation'
      { $sel:addressFamily:NewPublicVirtualInterfaceAllocation' :: Maybe AddressFamily
addressFamily =
          forall a. Maybe a
Prelude.Nothing,
        $sel:amazonAddress:NewPublicVirtualInterfaceAllocation' :: Maybe Text
amazonAddress = forall a. Maybe a
Prelude.Nothing,
        $sel:authKey:NewPublicVirtualInterfaceAllocation' :: Maybe Text
authKey = forall a. Maybe a
Prelude.Nothing,
        $sel:customerAddress:NewPublicVirtualInterfaceAllocation' :: Maybe Text
customerAddress = forall a. Maybe a
Prelude.Nothing,
        $sel:routeFilterPrefixes:NewPublicVirtualInterfaceAllocation' :: Maybe [RouteFilterPrefix]
routeFilterPrefixes = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:NewPublicVirtualInterfaceAllocation' :: Maybe (NonEmpty Tag)
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:virtualInterfaceName:NewPublicVirtualInterfaceAllocation' :: Text
virtualInterfaceName =
          Text
pVirtualInterfaceName_,
        $sel:vlan:NewPublicVirtualInterfaceAllocation' :: Int
vlan = Int
pVlan_,
        $sel:asn:NewPublicVirtualInterfaceAllocation' :: Int
asn = Int
pAsn_
      }

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

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

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

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

-- | The routes to be advertised to the Amazon Web Services network in this
-- Region. Applies to public virtual interfaces.
newPublicVirtualInterfaceAllocation_routeFilterPrefixes :: Lens.Lens' NewPublicVirtualInterfaceAllocation (Prelude.Maybe [RouteFilterPrefix])
newPublicVirtualInterfaceAllocation_routeFilterPrefixes :: Lens'
  NewPublicVirtualInterfaceAllocation (Maybe [RouteFilterPrefix])
newPublicVirtualInterfaceAllocation_routeFilterPrefixes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewPublicVirtualInterfaceAllocation' {Maybe [RouteFilterPrefix]
routeFilterPrefixes :: Maybe [RouteFilterPrefix]
$sel:routeFilterPrefixes:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe [RouteFilterPrefix]
routeFilterPrefixes} -> Maybe [RouteFilterPrefix]
routeFilterPrefixes) (\s :: NewPublicVirtualInterfaceAllocation
s@NewPublicVirtualInterfaceAllocation' {} Maybe [RouteFilterPrefix]
a -> NewPublicVirtualInterfaceAllocation
s {$sel:routeFilterPrefixes:NewPublicVirtualInterfaceAllocation' :: Maybe [RouteFilterPrefix]
routeFilterPrefixes = Maybe [RouteFilterPrefix]
a} :: NewPublicVirtualInterfaceAllocation) 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 tags associated with the public virtual interface.
newPublicVirtualInterfaceAllocation_tags :: Lens.Lens' NewPublicVirtualInterfaceAllocation (Prelude.Maybe (Prelude.NonEmpty Tag))
newPublicVirtualInterfaceAllocation_tags :: Lens' NewPublicVirtualInterfaceAllocation (Maybe (NonEmpty Tag))
newPublicVirtualInterfaceAllocation_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewPublicVirtualInterfaceAllocation' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: NewPublicVirtualInterfaceAllocation
s@NewPublicVirtualInterfaceAllocation' {} Maybe (NonEmpty Tag)
a -> NewPublicVirtualInterfaceAllocation
s {$sel:tags:NewPublicVirtualInterfaceAllocation' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: NewPublicVirtualInterfaceAllocation) 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 (-).
newPublicVirtualInterfaceAllocation_virtualInterfaceName :: Lens.Lens' NewPublicVirtualInterfaceAllocation Prelude.Text
newPublicVirtualInterfaceAllocation_virtualInterfaceName :: Lens' NewPublicVirtualInterfaceAllocation Text
newPublicVirtualInterfaceAllocation_virtualInterfaceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewPublicVirtualInterfaceAllocation' {Text
virtualInterfaceName :: Text
$sel:virtualInterfaceName:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Text
virtualInterfaceName} -> Text
virtualInterfaceName) (\s :: NewPublicVirtualInterfaceAllocation
s@NewPublicVirtualInterfaceAllocation' {} Text
a -> NewPublicVirtualInterfaceAllocation
s {$sel:virtualInterfaceName:NewPublicVirtualInterfaceAllocation' :: Text
virtualInterfaceName = Text
a} :: NewPublicVirtualInterfaceAllocation)

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

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

instance
  Prelude.Hashable
    NewPublicVirtualInterfaceAllocation
  where
  hashWithSalt :: Int -> NewPublicVirtualInterfaceAllocation -> Int
hashWithSalt
    Int
_salt
    NewPublicVirtualInterfaceAllocation' {Int
Maybe [RouteFilterPrefix]
Maybe (NonEmpty Tag)
Maybe Text
Maybe AddressFamily
Text
asn :: Int
vlan :: Int
virtualInterfaceName :: Text
tags :: Maybe (NonEmpty Tag)
routeFilterPrefixes :: Maybe [RouteFilterPrefix]
customerAddress :: Maybe Text
authKey :: Maybe Text
amazonAddress :: Maybe Text
addressFamily :: Maybe AddressFamily
$sel:asn:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Int
$sel:vlan:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Int
$sel:virtualInterfaceName:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Text
$sel:tags:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe (NonEmpty Tag)
$sel:routeFilterPrefixes:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe [RouteFilterPrefix]
$sel:customerAddress:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe Text
$sel:authKey:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe Text
$sel:amazonAddress:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe Text
$sel:addressFamily:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> 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 [RouteFilterPrefix]
routeFilterPrefixes
        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
    NewPublicVirtualInterfaceAllocation
  where
  rnf :: NewPublicVirtualInterfaceAllocation -> ()
rnf NewPublicVirtualInterfaceAllocation' {Int
Maybe [RouteFilterPrefix]
Maybe (NonEmpty Tag)
Maybe Text
Maybe AddressFamily
Text
asn :: Int
vlan :: Int
virtualInterfaceName :: Text
tags :: Maybe (NonEmpty Tag)
routeFilterPrefixes :: Maybe [RouteFilterPrefix]
customerAddress :: Maybe Text
authKey :: Maybe Text
amazonAddress :: Maybe Text
addressFamily :: Maybe AddressFamily
$sel:asn:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Int
$sel:vlan:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Int
$sel:virtualInterfaceName:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Text
$sel:tags:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe (NonEmpty Tag)
$sel:routeFilterPrefixes:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe [RouteFilterPrefix]
$sel:customerAddress:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe Text
$sel:authKey:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe Text
$sel:amazonAddress:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe Text
$sel:addressFamily:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> 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 [RouteFilterPrefix]
routeFilterPrefixes
      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
    NewPublicVirtualInterfaceAllocation
  where
  toJSON :: NewPublicVirtualInterfaceAllocation -> Value
toJSON NewPublicVirtualInterfaceAllocation' {Int
Maybe [RouteFilterPrefix]
Maybe (NonEmpty Tag)
Maybe Text
Maybe AddressFamily
Text
asn :: Int
vlan :: Int
virtualInterfaceName :: Text
tags :: Maybe (NonEmpty Tag)
routeFilterPrefixes :: Maybe [RouteFilterPrefix]
customerAddress :: Maybe Text
authKey :: Maybe Text
amazonAddress :: Maybe Text
addressFamily :: Maybe AddressFamily
$sel:asn:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Int
$sel:vlan:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Int
$sel:virtualInterfaceName:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Text
$sel:tags:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe (NonEmpty Tag)
$sel:routeFilterPrefixes:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe [RouteFilterPrefix]
$sel:customerAddress:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe Text
$sel:authKey:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe Text
$sel:amazonAddress:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> Maybe Text
$sel:addressFamily:NewPublicVirtualInterfaceAllocation' :: NewPublicVirtualInterfaceAllocation -> 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
"routeFilterPrefixes" 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 [RouteFilterPrefix]
routeFilterPrefixes,
            (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)
          ]
      )