{-# 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.BGPPeer where
import qualified Amazonka.Core as Core
import Amazonka.DirectConnect.Types.AddressFamily
import Amazonka.DirectConnect.Types.BGPPeerState
import Amazonka.DirectConnect.Types.BGPStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BGPPeer = BGPPeer'
{
BGPPeer -> Maybe Text
customerAddress :: Prelude.Maybe Prelude.Text,
BGPPeer -> Maybe Text
amazonAddress :: Prelude.Maybe Prelude.Text,
BGPPeer -> Maybe AddressFamily
addressFamily :: Prelude.Maybe AddressFamily,
BGPPeer -> Maybe Text
awsLogicalDeviceId :: Prelude.Maybe Prelude.Text,
BGPPeer -> Maybe BGPStatus
bgpStatus :: Prelude.Maybe BGPStatus,
BGPPeer -> Maybe Int
asn :: Prelude.Maybe Prelude.Int,
BGPPeer -> Maybe Text
authKey :: Prelude.Maybe Prelude.Text,
BGPPeer -> Maybe Text
bgpPeerId :: Prelude.Maybe Prelude.Text,
BGPPeer -> Maybe BGPPeerState
bgpPeerState :: Prelude.Maybe BGPPeerState,
BGPPeer -> Maybe Text
awsDeviceV2 :: Prelude.Maybe Prelude.Text
}
deriving (BGPPeer -> BGPPeer -> Bool
(BGPPeer -> BGPPeer -> Bool)
-> (BGPPeer -> BGPPeer -> Bool) -> Eq BGPPeer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BGPPeer -> BGPPeer -> Bool
$c/= :: BGPPeer -> BGPPeer -> Bool
== :: BGPPeer -> BGPPeer -> Bool
$c== :: BGPPeer -> BGPPeer -> Bool
Prelude.Eq, ReadPrec [BGPPeer]
ReadPrec BGPPeer
Int -> ReadS BGPPeer
ReadS [BGPPeer]
(Int -> ReadS BGPPeer)
-> ReadS [BGPPeer]
-> ReadPrec BGPPeer
-> ReadPrec [BGPPeer]
-> Read BGPPeer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BGPPeer]
$creadListPrec :: ReadPrec [BGPPeer]
readPrec :: ReadPrec BGPPeer
$creadPrec :: ReadPrec BGPPeer
readList :: ReadS [BGPPeer]
$creadList :: ReadS [BGPPeer]
readsPrec :: Int -> ReadS BGPPeer
$creadsPrec :: Int -> ReadS BGPPeer
Prelude.Read, Int -> BGPPeer -> ShowS
[BGPPeer] -> ShowS
BGPPeer -> String
(Int -> BGPPeer -> ShowS)
-> (BGPPeer -> String) -> ([BGPPeer] -> ShowS) -> Show BGPPeer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BGPPeer] -> ShowS
$cshowList :: [BGPPeer] -> ShowS
show :: BGPPeer -> String
$cshow :: BGPPeer -> String
showsPrec :: Int -> BGPPeer -> ShowS
$cshowsPrec :: Int -> BGPPeer -> ShowS
Prelude.Show, (forall x. BGPPeer -> Rep BGPPeer x)
-> (forall x. Rep BGPPeer x -> BGPPeer) -> Generic BGPPeer
forall x. Rep BGPPeer x -> BGPPeer
forall x. BGPPeer -> Rep BGPPeer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BGPPeer x -> BGPPeer
$cfrom :: forall x. BGPPeer -> Rep BGPPeer x
Prelude.Generic)
newBGPPeer ::
BGPPeer
newBGPPeer :: BGPPeer
newBGPPeer =
BGPPeer' :: Maybe Text
-> Maybe Text
-> Maybe AddressFamily
-> Maybe Text
-> Maybe BGPStatus
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe BGPPeerState
-> Maybe Text
-> BGPPeer
BGPPeer'
{ $sel:customerAddress:BGPPeer' :: Maybe Text
customerAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:amazonAddress:BGPPeer' :: Maybe Text
amazonAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:addressFamily:BGPPeer' :: Maybe AddressFamily
addressFamily = Maybe AddressFamily
forall a. Maybe a
Prelude.Nothing,
$sel:awsLogicalDeviceId:BGPPeer' :: Maybe Text
awsLogicalDeviceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bgpStatus:BGPPeer' :: Maybe BGPStatus
bgpStatus = Maybe BGPStatus
forall a. Maybe a
Prelude.Nothing,
$sel:asn:BGPPeer' :: Maybe Int
asn = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:authKey:BGPPeer' :: Maybe Text
authKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bgpPeerId:BGPPeer' :: Maybe Text
bgpPeerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bgpPeerState:BGPPeer' :: Maybe BGPPeerState
bgpPeerState = Maybe BGPPeerState
forall a. Maybe a
Prelude.Nothing,
$sel:awsDeviceV2:BGPPeer' :: Maybe Text
awsDeviceV2 = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
bGPPeer_customerAddress :: Lens.Lens' BGPPeer (Prelude.Maybe Prelude.Text)
bGPPeer_customerAddress :: (Maybe Text -> f (Maybe Text)) -> BGPPeer -> f BGPPeer
bGPPeer_customerAddress = (BGPPeer -> Maybe Text)
-> (BGPPeer -> Maybe Text -> BGPPeer)
-> Lens BGPPeer BGPPeer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BGPPeer' {Maybe Text
customerAddress :: Maybe Text
$sel:customerAddress:BGPPeer' :: BGPPeer -> Maybe Text
customerAddress} -> Maybe Text
customerAddress) (\s :: BGPPeer
s@BGPPeer' {} Maybe Text
a -> BGPPeer
s {$sel:customerAddress:BGPPeer' :: Maybe Text
customerAddress = Maybe Text
a} :: BGPPeer)
bGPPeer_amazonAddress :: Lens.Lens' BGPPeer (Prelude.Maybe Prelude.Text)
bGPPeer_amazonAddress :: (Maybe Text -> f (Maybe Text)) -> BGPPeer -> f BGPPeer
bGPPeer_amazonAddress = (BGPPeer -> Maybe Text)
-> (BGPPeer -> Maybe Text -> BGPPeer)
-> Lens BGPPeer BGPPeer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BGPPeer' {Maybe Text
amazonAddress :: Maybe Text
$sel:amazonAddress:BGPPeer' :: BGPPeer -> Maybe Text
amazonAddress} -> Maybe Text
amazonAddress) (\s :: BGPPeer
s@BGPPeer' {} Maybe Text
a -> BGPPeer
s {$sel:amazonAddress:BGPPeer' :: Maybe Text
amazonAddress = Maybe Text
a} :: BGPPeer)
bGPPeer_addressFamily :: Lens.Lens' BGPPeer (Prelude.Maybe AddressFamily)
bGPPeer_addressFamily :: (Maybe AddressFamily -> f (Maybe AddressFamily))
-> BGPPeer -> f BGPPeer
bGPPeer_addressFamily = (BGPPeer -> Maybe AddressFamily)
-> (BGPPeer -> Maybe AddressFamily -> BGPPeer)
-> Lens BGPPeer BGPPeer (Maybe AddressFamily) (Maybe AddressFamily)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BGPPeer' {Maybe AddressFamily
addressFamily :: Maybe AddressFamily
$sel:addressFamily:BGPPeer' :: BGPPeer -> Maybe AddressFamily
addressFamily} -> Maybe AddressFamily
addressFamily) (\s :: BGPPeer
s@BGPPeer' {} Maybe AddressFamily
a -> BGPPeer
s {$sel:addressFamily:BGPPeer' :: Maybe AddressFamily
addressFamily = Maybe AddressFamily
a} :: BGPPeer)
bGPPeer_awsLogicalDeviceId :: Lens.Lens' BGPPeer (Prelude.Maybe Prelude.Text)
bGPPeer_awsLogicalDeviceId :: (Maybe Text -> f (Maybe Text)) -> BGPPeer -> f BGPPeer
bGPPeer_awsLogicalDeviceId = (BGPPeer -> Maybe Text)
-> (BGPPeer -> Maybe Text -> BGPPeer)
-> Lens BGPPeer BGPPeer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BGPPeer' {Maybe Text
awsLogicalDeviceId :: Maybe Text
$sel:awsLogicalDeviceId:BGPPeer' :: BGPPeer -> Maybe Text
awsLogicalDeviceId} -> Maybe Text
awsLogicalDeviceId) (\s :: BGPPeer
s@BGPPeer' {} Maybe Text
a -> BGPPeer
s {$sel:awsLogicalDeviceId:BGPPeer' :: Maybe Text
awsLogicalDeviceId = Maybe Text
a} :: BGPPeer)
bGPPeer_bgpStatus :: Lens.Lens' BGPPeer (Prelude.Maybe BGPStatus)
bGPPeer_bgpStatus :: (Maybe BGPStatus -> f (Maybe BGPStatus)) -> BGPPeer -> f BGPPeer
bGPPeer_bgpStatus = (BGPPeer -> Maybe BGPStatus)
-> (BGPPeer -> Maybe BGPStatus -> BGPPeer)
-> Lens BGPPeer BGPPeer (Maybe BGPStatus) (Maybe BGPStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BGPPeer' {Maybe BGPStatus
bgpStatus :: Maybe BGPStatus
$sel:bgpStatus:BGPPeer' :: BGPPeer -> Maybe BGPStatus
bgpStatus} -> Maybe BGPStatus
bgpStatus) (\s :: BGPPeer
s@BGPPeer' {} Maybe BGPStatus
a -> BGPPeer
s {$sel:bgpStatus:BGPPeer' :: Maybe BGPStatus
bgpStatus = Maybe BGPStatus
a} :: BGPPeer)
bGPPeer_asn :: Lens.Lens' BGPPeer (Prelude.Maybe Prelude.Int)
bGPPeer_asn :: (Maybe Int -> f (Maybe Int)) -> BGPPeer -> f BGPPeer
bGPPeer_asn = (BGPPeer -> Maybe Int)
-> (BGPPeer -> Maybe Int -> BGPPeer)
-> Lens BGPPeer BGPPeer (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BGPPeer' {Maybe Int
asn :: Maybe Int
$sel:asn:BGPPeer' :: BGPPeer -> Maybe Int
asn} -> Maybe Int
asn) (\s :: BGPPeer
s@BGPPeer' {} Maybe Int
a -> BGPPeer
s {$sel:asn:BGPPeer' :: Maybe Int
asn = Maybe Int
a} :: BGPPeer)
bGPPeer_authKey :: Lens.Lens' BGPPeer (Prelude.Maybe Prelude.Text)
bGPPeer_authKey :: (Maybe Text -> f (Maybe Text)) -> BGPPeer -> f BGPPeer
bGPPeer_authKey = (BGPPeer -> Maybe Text)
-> (BGPPeer -> Maybe Text -> BGPPeer)
-> Lens BGPPeer BGPPeer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BGPPeer' {Maybe Text
authKey :: Maybe Text
$sel:authKey:BGPPeer' :: BGPPeer -> Maybe Text
authKey} -> Maybe Text
authKey) (\s :: BGPPeer
s@BGPPeer' {} Maybe Text
a -> BGPPeer
s {$sel:authKey:BGPPeer' :: Maybe Text
authKey = Maybe Text
a} :: BGPPeer)
bGPPeer_bgpPeerId :: Lens.Lens' BGPPeer (Prelude.Maybe Prelude.Text)
bGPPeer_bgpPeerId :: (Maybe Text -> f (Maybe Text)) -> BGPPeer -> f BGPPeer
bGPPeer_bgpPeerId = (BGPPeer -> Maybe Text)
-> (BGPPeer -> Maybe Text -> BGPPeer)
-> Lens BGPPeer BGPPeer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BGPPeer' {Maybe Text
bgpPeerId :: Maybe Text
$sel:bgpPeerId:BGPPeer' :: BGPPeer -> Maybe Text
bgpPeerId} -> Maybe Text
bgpPeerId) (\s :: BGPPeer
s@BGPPeer' {} Maybe Text
a -> BGPPeer
s {$sel:bgpPeerId:BGPPeer' :: Maybe Text
bgpPeerId = Maybe Text
a} :: BGPPeer)
bGPPeer_bgpPeerState :: Lens.Lens' BGPPeer (Prelude.Maybe BGPPeerState)
bGPPeer_bgpPeerState :: (Maybe BGPPeerState -> f (Maybe BGPPeerState))
-> BGPPeer -> f BGPPeer
bGPPeer_bgpPeerState = (BGPPeer -> Maybe BGPPeerState)
-> (BGPPeer -> Maybe BGPPeerState -> BGPPeer)
-> Lens BGPPeer BGPPeer (Maybe BGPPeerState) (Maybe BGPPeerState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BGPPeer' {Maybe BGPPeerState
bgpPeerState :: Maybe BGPPeerState
$sel:bgpPeerState:BGPPeer' :: BGPPeer -> Maybe BGPPeerState
bgpPeerState} -> Maybe BGPPeerState
bgpPeerState) (\s :: BGPPeer
s@BGPPeer' {} Maybe BGPPeerState
a -> BGPPeer
s {$sel:bgpPeerState:BGPPeer' :: Maybe BGPPeerState
bgpPeerState = Maybe BGPPeerState
a} :: BGPPeer)
bGPPeer_awsDeviceV2 :: Lens.Lens' BGPPeer (Prelude.Maybe Prelude.Text)
bGPPeer_awsDeviceV2 :: (Maybe Text -> f (Maybe Text)) -> BGPPeer -> f BGPPeer
bGPPeer_awsDeviceV2 = (BGPPeer -> Maybe Text)
-> (BGPPeer -> Maybe Text -> BGPPeer)
-> Lens BGPPeer BGPPeer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BGPPeer' {Maybe Text
awsDeviceV2 :: Maybe Text
$sel:awsDeviceV2:BGPPeer' :: BGPPeer -> Maybe Text
awsDeviceV2} -> Maybe Text
awsDeviceV2) (\s :: BGPPeer
s@BGPPeer' {} Maybe Text
a -> BGPPeer
s {$sel:awsDeviceV2:BGPPeer' :: Maybe Text
awsDeviceV2 = Maybe Text
a} :: BGPPeer)
instance Core.FromJSON BGPPeer where
parseJSON :: Value -> Parser BGPPeer
parseJSON =
String -> (Object -> Parser BGPPeer) -> Value -> Parser BGPPeer
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BGPPeer"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe AddressFamily
-> Maybe Text
-> Maybe BGPStatus
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe BGPPeerState
-> Maybe Text
-> BGPPeer
BGPPeer'
(Maybe Text
-> Maybe Text
-> Maybe AddressFamily
-> Maybe Text
-> Maybe BGPStatus
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe BGPPeerState
-> Maybe Text
-> BGPPeer)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe AddressFamily
-> Maybe Text
-> Maybe BGPStatus
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe BGPPeerState
-> Maybe Text
-> BGPPeer)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"customerAddress")
Parser
(Maybe Text
-> Maybe AddressFamily
-> Maybe Text
-> Maybe BGPStatus
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe BGPPeerState
-> Maybe Text
-> BGPPeer)
-> Parser (Maybe Text)
-> Parser
(Maybe AddressFamily
-> Maybe Text
-> Maybe BGPStatus
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe BGPPeerState
-> Maybe Text
-> BGPPeer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"amazonAddress")
Parser
(Maybe AddressFamily
-> Maybe Text
-> Maybe BGPStatus
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe BGPPeerState
-> Maybe Text
-> BGPPeer)
-> Parser (Maybe AddressFamily)
-> Parser
(Maybe Text
-> Maybe BGPStatus
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe BGPPeerState
-> Maybe Text
-> BGPPeer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AddressFamily)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"addressFamily")
Parser
(Maybe Text
-> Maybe BGPStatus
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe BGPPeerState
-> Maybe Text
-> BGPPeer)
-> Parser (Maybe Text)
-> Parser
(Maybe BGPStatus
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe BGPPeerState
-> Maybe Text
-> BGPPeer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"awsLogicalDeviceId")
Parser
(Maybe BGPStatus
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe BGPPeerState
-> Maybe Text
-> BGPPeer)
-> Parser (Maybe BGPStatus)
-> Parser
(Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe BGPPeerState
-> Maybe Text
-> BGPPeer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BGPStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"bgpStatus")
Parser
(Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe BGPPeerState
-> Maybe Text
-> BGPPeer)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe BGPPeerState -> Maybe Text -> BGPPeer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"asn")
Parser
(Maybe Text
-> Maybe Text -> Maybe BGPPeerState -> Maybe Text -> BGPPeer)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe BGPPeerState -> Maybe Text -> BGPPeer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"authKey")
Parser (Maybe Text -> Maybe BGPPeerState -> Maybe Text -> BGPPeer)
-> Parser (Maybe Text)
-> Parser (Maybe BGPPeerState -> Maybe Text -> BGPPeer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"bgpPeerId")
Parser (Maybe BGPPeerState -> Maybe Text -> BGPPeer)
-> Parser (Maybe BGPPeerState) -> Parser (Maybe Text -> BGPPeer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BGPPeerState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"bgpPeerState")
Parser (Maybe Text -> BGPPeer)
-> Parser (Maybe Text) -> Parser BGPPeer
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"awsDeviceV2")
)
instance Prelude.Hashable BGPPeer
instance Prelude.NFData BGPPeer