{-# 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 Amazonka.DirectConnect.Types.AddressFamily
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data NewBGPPeer = NewBGPPeer'
{
NewBGPPeer -> Maybe Text
customerAddress :: Prelude.Maybe Prelude.Text,
NewBGPPeer -> Maybe Text
amazonAddress :: Prelude.Maybe Prelude.Text,
NewBGPPeer -> Maybe AddressFamily
addressFamily :: Prelude.Maybe AddressFamily,
NewBGPPeer -> Maybe Int
asn :: Prelude.Maybe Prelude.Int,
NewBGPPeer -> Maybe Text
authKey :: Prelude.Maybe Prelude.Text
}
deriving (NewBGPPeer -> NewBGPPeer -> Bool
(NewBGPPeer -> NewBGPPeer -> Bool)
-> (NewBGPPeer -> NewBGPPeer -> Bool) -> Eq NewBGPPeer
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]
(Int -> ReadS NewBGPPeer)
-> ReadS [NewBGPPeer]
-> ReadPrec NewBGPPeer
-> ReadPrec [NewBGPPeer]
-> Read 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
(Int -> NewBGPPeer -> ShowS)
-> (NewBGPPeer -> String)
-> ([NewBGPPeer] -> ShowS)
-> Show NewBGPPeer
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. NewBGPPeer -> Rep NewBGPPeer x)
-> (forall x. Rep NewBGPPeer x -> NewBGPPeer) -> Generic NewBGPPeer
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' :: Maybe Text
-> Maybe Text
-> Maybe AddressFamily
-> Maybe Int
-> Maybe Text
-> NewBGPPeer
NewBGPPeer'
{ $sel:customerAddress:NewBGPPeer' :: Maybe Text
customerAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:amazonAddress:NewBGPPeer' :: Maybe Text
amazonAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:addressFamily:NewBGPPeer' :: Maybe AddressFamily
addressFamily = Maybe AddressFamily
forall a. Maybe a
Prelude.Nothing,
$sel:asn:NewBGPPeer' :: Maybe Int
asn = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:authKey:NewBGPPeer' :: Maybe Text
authKey = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
newBGPPeer_customerAddress :: Lens.Lens' NewBGPPeer (Prelude.Maybe Prelude.Text)
newBGPPeer_customerAddress :: (Maybe Text -> f (Maybe Text)) -> NewBGPPeer -> f NewBGPPeer
newBGPPeer_customerAddress = (NewBGPPeer -> Maybe Text)
-> (NewBGPPeer -> Maybe Text -> NewBGPPeer)
-> Lens NewBGPPeer NewBGPPeer (Maybe Text) (Maybe Text)
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)
newBGPPeer_amazonAddress :: Lens.Lens' NewBGPPeer (Prelude.Maybe Prelude.Text)
newBGPPeer_amazonAddress :: (Maybe Text -> f (Maybe Text)) -> NewBGPPeer -> f NewBGPPeer
newBGPPeer_amazonAddress = (NewBGPPeer -> Maybe Text)
-> (NewBGPPeer -> Maybe Text -> NewBGPPeer)
-> Lens NewBGPPeer NewBGPPeer (Maybe Text) (Maybe Text)
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_addressFamily :: Lens.Lens' NewBGPPeer (Prelude.Maybe AddressFamily)
newBGPPeer_addressFamily :: (Maybe AddressFamily -> f (Maybe AddressFamily))
-> NewBGPPeer -> f NewBGPPeer
newBGPPeer_addressFamily = (NewBGPPeer -> Maybe AddressFamily)
-> (NewBGPPeer -> Maybe AddressFamily -> NewBGPPeer)
-> Lens
NewBGPPeer NewBGPPeer (Maybe AddressFamily) (Maybe 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_asn :: Lens.Lens' NewBGPPeer (Prelude.Maybe Prelude.Int)
newBGPPeer_asn :: (Maybe Int -> f (Maybe Int)) -> NewBGPPeer -> f NewBGPPeer
newBGPPeer_asn = (NewBGPPeer -> Maybe Int)
-> (NewBGPPeer -> Maybe Int -> NewBGPPeer)
-> Lens NewBGPPeer NewBGPPeer (Maybe Int) (Maybe Int)
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 :: (Maybe Text -> f (Maybe Text)) -> NewBGPPeer -> f NewBGPPeer
newBGPPeer_authKey = (NewBGPPeer -> Maybe Text)
-> (NewBGPPeer -> Maybe Text -> NewBGPPeer)
-> Lens NewBGPPeer NewBGPPeer (Maybe Text) (Maybe Text)
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)
instance Prelude.Hashable NewBGPPeer
instance Prelude.NFData NewBGPPeer
instance Core.ToJSON NewBGPPeer where
toJSON :: NewBGPPeer -> Value
toJSON NewBGPPeer' {Maybe Int
Maybe Text
Maybe AddressFamily
authKey :: Maybe Text
asn :: Maybe Int
addressFamily :: Maybe AddressFamily
amazonAddress :: Maybe Text
customerAddress :: Maybe Text
$sel:authKey:NewBGPPeer' :: NewBGPPeer -> Maybe Text
$sel:asn:NewBGPPeer' :: NewBGPPeer -> Maybe Int
$sel:addressFamily:NewBGPPeer' :: NewBGPPeer -> Maybe AddressFamily
$sel:amazonAddress:NewBGPPeer' :: NewBGPPeer -> Maybe Text
$sel:customerAddress:NewBGPPeer' :: NewBGPPeer -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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
"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
]
)