{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DirectConnect.Types.AddressFamily
import Amazonka.DirectConnect.Types.BGPPeerState
import Amazonka.DirectConnect.Types.BGPStatus
import qualified Amazonka.Prelude as Prelude
data BGPPeer = BGPPeer'
{
BGPPeer -> Maybe AddressFamily
addressFamily :: Prelude.Maybe AddressFamily,
BGPPeer -> Maybe Text
amazonAddress :: Prelude.Maybe Prelude.Text,
BGPPeer -> Maybe Int
asn :: Prelude.Maybe Prelude.Int,
BGPPeer -> Maybe Text
authKey :: Prelude.Maybe Prelude.Text,
BGPPeer -> Maybe Text
awsDeviceV2 :: Prelude.Maybe Prelude.Text,
BGPPeer -> Maybe Text
awsLogicalDeviceId :: Prelude.Maybe Prelude.Text,
BGPPeer -> Maybe Text
bgpPeerId :: Prelude.Maybe Prelude.Text,
BGPPeer -> Maybe BGPPeerState
bgpPeerState :: Prelude.Maybe BGPPeerState,
BGPPeer -> Maybe BGPStatus
bgpStatus :: Prelude.Maybe BGPStatus,
BGPPeer -> Maybe Text
customerAddress :: Prelude.Maybe Prelude.Text
}
deriving (BGPPeer -> BGPPeer -> Bool
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]
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
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. 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'
{ $sel:addressFamily:BGPPeer' :: Maybe AddressFamily
addressFamily = forall a. Maybe a
Prelude.Nothing,
$sel:amazonAddress:BGPPeer' :: Maybe Text
amazonAddress = forall a. Maybe a
Prelude.Nothing,
$sel:asn:BGPPeer' :: Maybe Int
asn = forall a. Maybe a
Prelude.Nothing,
$sel:authKey:BGPPeer' :: Maybe Text
authKey = forall a. Maybe a
Prelude.Nothing,
$sel:awsDeviceV2:BGPPeer' :: Maybe Text
awsDeviceV2 = forall a. Maybe a
Prelude.Nothing,
$sel:awsLogicalDeviceId:BGPPeer' :: Maybe Text
awsLogicalDeviceId = forall a. Maybe a
Prelude.Nothing,
$sel:bgpPeerId:BGPPeer' :: Maybe Text
bgpPeerId = forall a. Maybe a
Prelude.Nothing,
$sel:bgpPeerState:BGPPeer' :: Maybe BGPPeerState
bgpPeerState = forall a. Maybe a
Prelude.Nothing,
$sel:bgpStatus:BGPPeer' :: Maybe BGPStatus
bgpStatus = forall a. Maybe a
Prelude.Nothing,
$sel:customerAddress:BGPPeer' :: Maybe Text
customerAddress = forall a. Maybe a
Prelude.Nothing
}
bGPPeer_addressFamily :: Lens.Lens' BGPPeer (Prelude.Maybe AddressFamily)
bGPPeer_addressFamily :: Lens' BGPPeer (Maybe AddressFamily)
bGPPeer_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_amazonAddress :: Lens.Lens' BGPPeer (Prelude.Maybe Prelude.Text)
bGPPeer_amazonAddress :: Lens' BGPPeer (Maybe Text)
bGPPeer_amazonAddress = 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_asn :: Lens.Lens' BGPPeer (Prelude.Maybe Prelude.Int)
bGPPeer_asn :: Lens' BGPPeer (Maybe Int)
bGPPeer_asn = 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 :: Lens' BGPPeer (Maybe Text)
bGPPeer_authKey = 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_awsDeviceV2 :: Lens.Lens' BGPPeer (Prelude.Maybe Prelude.Text)
bGPPeer_awsDeviceV2 :: Lens' BGPPeer (Maybe Text)
bGPPeer_awsDeviceV2 = 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)
bGPPeer_awsLogicalDeviceId :: Lens.Lens' BGPPeer (Prelude.Maybe Prelude.Text)
bGPPeer_awsLogicalDeviceId :: Lens' BGPPeer (Maybe Text)
bGPPeer_awsLogicalDeviceId = 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_bgpPeerId :: Lens.Lens' BGPPeer (Prelude.Maybe Prelude.Text)
bGPPeer_bgpPeerId :: Lens' BGPPeer (Maybe Text)
bGPPeer_bgpPeerId = 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 :: Lens' BGPPeer (Maybe BGPPeerState)
bGPPeer_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_bgpStatus :: Lens.Lens' BGPPeer (Prelude.Maybe BGPStatus)
bGPPeer_bgpStatus :: Lens' BGPPeer (Maybe BGPStatus)
bGPPeer_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_customerAddress :: Lens.Lens' BGPPeer (Prelude.Maybe Prelude.Text)
bGPPeer_customerAddress :: Lens' BGPPeer (Maybe Text)
bGPPeer_customerAddress = 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)
instance Data.FromJSON BGPPeer where
parseJSON :: Value -> Parser BGPPeer
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"BGPPeer"
( \Object
x ->
Maybe AddressFamily
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe BGPPeerState
-> Maybe BGPStatus
-> Maybe Text
-> BGPPeer
BGPPeer'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"addressFamily")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"amazonAddress")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"asn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"authKey")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"awsDeviceV2")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"awsLogicalDeviceId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"bgpPeerId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"bgpPeerState")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"bgpStatus")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"customerAddress")
)
instance Prelude.Hashable BGPPeer where
hashWithSalt :: Int -> BGPPeer -> Int
hashWithSalt Int
_salt BGPPeer' {Maybe Int
Maybe Text
Maybe AddressFamily
Maybe BGPPeerState
Maybe BGPStatus
customerAddress :: Maybe Text
bgpStatus :: Maybe BGPStatus
bgpPeerState :: Maybe BGPPeerState
bgpPeerId :: Maybe Text
awsLogicalDeviceId :: Maybe Text
awsDeviceV2 :: Maybe Text
authKey :: Maybe Text
asn :: Maybe Int
amazonAddress :: Maybe Text
addressFamily :: Maybe AddressFamily
$sel:customerAddress:BGPPeer' :: BGPPeer -> Maybe Text
$sel:bgpStatus:BGPPeer' :: BGPPeer -> Maybe BGPStatus
$sel:bgpPeerState:BGPPeer' :: BGPPeer -> Maybe BGPPeerState
$sel:bgpPeerId:BGPPeer' :: BGPPeer -> Maybe Text
$sel:awsLogicalDeviceId:BGPPeer' :: BGPPeer -> Maybe Text
$sel:awsDeviceV2:BGPPeer' :: BGPPeer -> Maybe Text
$sel:authKey:BGPPeer' :: BGPPeer -> Maybe Text
$sel:asn:BGPPeer' :: BGPPeer -> Maybe Int
$sel:amazonAddress:BGPPeer' :: BGPPeer -> Maybe Text
$sel:addressFamily:BGPPeer' :: BGPPeer -> 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
awsDeviceV2
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
awsLogicalDeviceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bgpPeerId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BGPPeerState
bgpPeerState
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BGPStatus
bgpStatus
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
customerAddress
instance Prelude.NFData BGPPeer where
rnf :: BGPPeer -> ()
rnf BGPPeer' {Maybe Int
Maybe Text
Maybe AddressFamily
Maybe BGPPeerState
Maybe BGPStatus
customerAddress :: Maybe Text
bgpStatus :: Maybe BGPStatus
bgpPeerState :: Maybe BGPPeerState
bgpPeerId :: Maybe Text
awsLogicalDeviceId :: Maybe Text
awsDeviceV2 :: Maybe Text
authKey :: Maybe Text
asn :: Maybe Int
amazonAddress :: Maybe Text
addressFamily :: Maybe AddressFamily
$sel:customerAddress:BGPPeer' :: BGPPeer -> Maybe Text
$sel:bgpStatus:BGPPeer' :: BGPPeer -> Maybe BGPStatus
$sel:bgpPeerState:BGPPeer' :: BGPPeer -> Maybe BGPPeerState
$sel:bgpPeerId:BGPPeer' :: BGPPeer -> Maybe Text
$sel:awsLogicalDeviceId:BGPPeer' :: BGPPeer -> Maybe Text
$sel:awsDeviceV2:BGPPeer' :: BGPPeer -> Maybe Text
$sel:authKey:BGPPeer' :: BGPPeer -> Maybe Text
$sel:asn:BGPPeer' :: BGPPeer -> Maybe Int
$sel:amazonAddress:BGPPeer' :: BGPPeer -> Maybe Text
$sel:addressFamily:BGPPeer' :: BGPPeer -> 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
awsDeviceV2
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
awsLogicalDeviceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bgpPeerId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe BGPPeerState
bgpPeerState
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe BGPStatus
bgpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
customerAddress