{-# 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 #-}
module Amazonka.DirectConnect.Types.NewBGPPeer 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 qualified Amazonka.Prelude as Prelude
data NewBGPPeer = NewBGPPeer'
{
NewBGPPeer -> Maybe AddressFamily
addressFamily :: Prelude.Maybe AddressFamily,
NewBGPPeer -> Maybe Text
amazonAddress :: Prelude.Maybe Prelude.Text,
NewBGPPeer -> Maybe Int
asn :: Prelude.Maybe Prelude.Int,
NewBGPPeer -> Maybe Text
authKey :: Prelude.Maybe Prelude.Text,
NewBGPPeer -> Maybe Text
customerAddress :: Prelude.Maybe Prelude.Text
}
deriving (NewBGPPeer -> NewBGPPeer -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NewBGPPeer -> NewBGPPeer -> Bool
$c/= :: NewBGPPeer -> NewBGPPeer -> Bool
== :: NewBGPPeer -> NewBGPPeer -> Bool
$c== :: NewBGPPeer -> NewBGPPeer -> Bool
Prelude.Eq, ReadPrec [NewBGPPeer]
ReadPrec NewBGPPeer
Int -> ReadS NewBGPPeer
ReadS [NewBGPPeer]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NewBGPPeer]
$creadListPrec :: ReadPrec [NewBGPPeer]
readPrec :: ReadPrec NewBGPPeer
$creadPrec :: ReadPrec NewBGPPeer
readList :: ReadS [NewBGPPeer]
$creadList :: ReadS [NewBGPPeer]
readsPrec :: Int -> ReadS NewBGPPeer
$creadsPrec :: Int -> ReadS NewBGPPeer
Prelude.Read, Int -> NewBGPPeer -> ShowS
[NewBGPPeer] -> ShowS
NewBGPPeer -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NewBGPPeer] -> ShowS
$cshowList :: [NewBGPPeer] -> ShowS
show :: NewBGPPeer -> String
$cshow :: NewBGPPeer -> String
showsPrec :: Int -> NewBGPPeer -> ShowS
$cshowsPrec :: Int -> NewBGPPeer -> ShowS
Prelude.Show, forall x. Rep NewBGPPeer x -> NewBGPPeer
forall x. NewBGPPeer -> Rep NewBGPPeer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NewBGPPeer x -> NewBGPPeer
$cfrom :: forall x. NewBGPPeer -> Rep NewBGPPeer x
Prelude.Generic)
newNewBGPPeer ::
NewBGPPeer
newNewBGPPeer :: NewBGPPeer
newNewBGPPeer =
NewBGPPeer'
{ $sel:addressFamily:NewBGPPeer' :: Maybe AddressFamily
addressFamily = forall a. Maybe a
Prelude.Nothing,
$sel:amazonAddress:NewBGPPeer' :: Maybe Text
amazonAddress = forall a. Maybe a
Prelude.Nothing,
$sel:asn:NewBGPPeer' :: Maybe Int
asn = forall a. Maybe a
Prelude.Nothing,
$sel:authKey:NewBGPPeer' :: Maybe Text
authKey = forall a. Maybe a
Prelude.Nothing,
$sel:customerAddress:NewBGPPeer' :: Maybe Text
customerAddress = forall a. Maybe a
Prelude.Nothing
}
newBGPPeer_addressFamily :: Lens.Lens' NewBGPPeer (Prelude.Maybe AddressFamily)
newBGPPeer_addressFamily :: Lens' NewBGPPeer (Maybe AddressFamily)
newBGPPeer_addressFamily = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewBGPPeer' {Maybe AddressFamily
addressFamily :: Maybe AddressFamily
$sel:addressFamily:NewBGPPeer' :: NewBGPPeer -> Maybe AddressFamily
addressFamily} -> Maybe AddressFamily
addressFamily) (\s :: NewBGPPeer
s@NewBGPPeer' {} Maybe AddressFamily
a -> NewBGPPeer
s {$sel:addressFamily:NewBGPPeer' :: Maybe AddressFamily
addressFamily = Maybe AddressFamily
a} :: NewBGPPeer)
newBGPPeer_amazonAddress :: Lens.Lens' NewBGPPeer (Prelude.Maybe Prelude.Text)
newBGPPeer_amazonAddress :: Lens' NewBGPPeer (Maybe Text)
newBGPPeer_amazonAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewBGPPeer' {Maybe Text
amazonAddress :: Maybe Text
$sel:amazonAddress:NewBGPPeer' :: NewBGPPeer -> Maybe Text
amazonAddress} -> Maybe Text
amazonAddress) (\s :: NewBGPPeer
s@NewBGPPeer' {} Maybe Text
a -> NewBGPPeer
s {$sel:amazonAddress:NewBGPPeer' :: Maybe Text
amazonAddress = Maybe Text
a} :: NewBGPPeer)
newBGPPeer_asn :: Lens.Lens' NewBGPPeer (Prelude.Maybe Prelude.Int)
newBGPPeer_asn :: Lens' NewBGPPeer (Maybe Int)
newBGPPeer_asn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewBGPPeer' {Maybe Int
asn :: Maybe Int
$sel:asn:NewBGPPeer' :: NewBGPPeer -> Maybe Int
asn} -> Maybe Int
asn) (\s :: NewBGPPeer
s@NewBGPPeer' {} Maybe Int
a -> NewBGPPeer
s {$sel:asn:NewBGPPeer' :: Maybe Int
asn = Maybe Int
a} :: NewBGPPeer)
newBGPPeer_authKey :: Lens.Lens' NewBGPPeer (Prelude.Maybe Prelude.Text)
newBGPPeer_authKey :: Lens' NewBGPPeer (Maybe Text)
newBGPPeer_authKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewBGPPeer' {Maybe Text
authKey :: Maybe Text
$sel:authKey:NewBGPPeer' :: NewBGPPeer -> Maybe Text
authKey} -> Maybe Text
authKey) (\s :: NewBGPPeer
s@NewBGPPeer' {} Maybe Text
a -> NewBGPPeer
s {$sel:authKey:NewBGPPeer' :: Maybe Text
authKey = Maybe Text
a} :: NewBGPPeer)
newBGPPeer_customerAddress :: Lens.Lens' NewBGPPeer (Prelude.Maybe Prelude.Text)
newBGPPeer_customerAddress :: Lens' NewBGPPeer (Maybe Text)
newBGPPeer_customerAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewBGPPeer' {Maybe Text
customerAddress :: Maybe Text
$sel:customerAddress:NewBGPPeer' :: NewBGPPeer -> Maybe Text
customerAddress} -> Maybe Text
customerAddress) (\s :: NewBGPPeer
s@NewBGPPeer' {} Maybe Text
a -> NewBGPPeer
s {$sel:customerAddress:NewBGPPeer' :: Maybe Text
customerAddress = Maybe Text
a} :: NewBGPPeer)
instance Prelude.Hashable NewBGPPeer where
hashWithSalt :: Int -> NewBGPPeer -> Int
hashWithSalt Int
_salt NewBGPPeer' {Maybe Int
Maybe Text
Maybe AddressFamily
customerAddress :: Maybe Text
authKey :: Maybe Text
asn :: Maybe Int
amazonAddress :: Maybe Text
addressFamily :: Maybe AddressFamily
$sel:customerAddress:NewBGPPeer' :: NewBGPPeer -> Maybe Text
$sel:authKey:NewBGPPeer' :: NewBGPPeer -> Maybe Text
$sel:asn:NewBGPPeer' :: NewBGPPeer -> Maybe Int
$sel:amazonAddress:NewBGPPeer' :: NewBGPPeer -> Maybe Text
$sel:addressFamily:NewBGPPeer' :: NewBGPPeer -> 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
instance Prelude.NFData NewBGPPeer where
rnf :: NewBGPPeer -> ()
rnf NewBGPPeer' {Maybe Int
Maybe Text
Maybe AddressFamily
customerAddress :: Maybe Text
authKey :: Maybe Text
asn :: Maybe Int
amazonAddress :: Maybe Text
addressFamily :: Maybe AddressFamily
$sel:customerAddress:NewBGPPeer' :: NewBGPPeer -> Maybe Text
$sel:authKey:NewBGPPeer' :: NewBGPPeer -> Maybe Text
$sel:asn:NewBGPPeer' :: NewBGPPeer -> Maybe Int
$sel:amazonAddress:NewBGPPeer' :: NewBGPPeer -> Maybe Text
$sel:addressFamily:NewBGPPeer' :: NewBGPPeer -> 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
instance Data.ToJSON NewBGPPeer where
toJSON :: NewBGPPeer -> Value
toJSON NewBGPPeer' {Maybe Int
Maybe Text
Maybe AddressFamily
customerAddress :: Maybe Text
authKey :: Maybe Text
asn :: Maybe Int
amazonAddress :: Maybe Text
addressFamily :: Maybe AddressFamily
$sel:customerAddress:NewBGPPeer' :: NewBGPPeer -> Maybe Text
$sel:authKey:NewBGPPeer' :: NewBGPPeer -> Maybe Text
$sel:asn:NewBGPPeer' :: NewBGPPeer -> Maybe Int
$sel:amazonAddress:NewBGPPeer' :: NewBGPPeer -> Maybe Text
$sel:addressFamily:NewBGPPeer' :: NewBGPPeer -> 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
]
)