{-# 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.BGPPeer
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Information about a BGP peer.
--
-- /See:/ 'newBGPPeer' smart constructor.
data BGPPeer = BGPPeer'
  { -- | The IP address assigned to the customer interface.
    BGPPeer -> Maybe Text
customerAddress :: Prelude.Maybe Prelude.Text,
    -- | The IP address assigned to the Amazon interface.
    BGPPeer -> Maybe Text
amazonAddress :: Prelude.Maybe Prelude.Text,
    -- | The address family for the BGP peer.
    BGPPeer -> Maybe AddressFamily
addressFamily :: Prelude.Maybe AddressFamily,
    -- | The Direct Connect endpoint that terminates the logical connection. This
    -- device might be different than the device that terminates the physical
    -- connection.
    BGPPeer -> Maybe Text
awsLogicalDeviceId :: Prelude.Maybe Prelude.Text,
    -- | The status of the BGP peer. The following are the possible values:
    --
    -- -   @up@: The BGP peer is established. This state does not indicate the
    --     state of the routing function. Ensure that you are receiving routes
    --     over the BGP session.
    --
    -- -   @down@: The BGP peer is down.
    --
    -- -   @unknown@: The BGP peer status is not available.
    BGPPeer -> Maybe BGPStatus
bgpStatus :: Prelude.Maybe BGPStatus,
    -- | The autonomous system (AS) number for Border Gateway Protocol (BGP)
    -- configuration.
    BGPPeer -> Maybe Int
asn :: Prelude.Maybe Prelude.Int,
    -- | The authentication key for BGP configuration. This string has a minimum
    -- length of 6 characters and and a maximun lenth of 80 characters.
    BGPPeer -> Maybe Text
authKey :: Prelude.Maybe Prelude.Text,
    -- | The ID of the BGP peer.
    BGPPeer -> Maybe Text
bgpPeerId :: Prelude.Maybe Prelude.Text,
    -- | The state of the BGP peer. The following are the possible values:
    --
    -- -   @verifying@: The BGP peering addresses or ASN require validation
    --     before the BGP peer can be created. This state applies only to
    --     public virtual interfaces.
    --
    -- -   @pending@: The BGP peer is created, and remains in this state until
    --     it is ready to be established.
    --
    -- -   @available@: The BGP peer is ready to be established.
    --
    -- -   @deleting@: The BGP peer is being deleted.
    --
    -- -   @deleted@: The BGP peer is deleted and cannot be established.
    BGPPeer -> Maybe BGPPeerState
bgpPeerState :: Prelude.Maybe BGPPeerState,
    -- | The Direct Connect endpoint that terminates the BGP peer.
    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)

-- |
-- Create a value of 'BGPPeer' 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:
--
-- 'customerAddress', 'bGPPeer_customerAddress' - The IP address assigned to the customer interface.
--
-- 'amazonAddress', 'bGPPeer_amazonAddress' - The IP address assigned to the Amazon interface.
--
-- 'addressFamily', 'bGPPeer_addressFamily' - The address family for the BGP peer.
--
-- 'awsLogicalDeviceId', 'bGPPeer_awsLogicalDeviceId' - The Direct Connect endpoint that terminates the logical connection. This
-- device might be different than the device that terminates the physical
-- connection.
--
-- 'bgpStatus', 'bGPPeer_bgpStatus' - The status of the BGP peer. The following are the possible values:
--
-- -   @up@: The BGP peer is established. This state does not indicate the
--     state of the routing function. Ensure that you are receiving routes
--     over the BGP session.
--
-- -   @down@: The BGP peer is down.
--
-- -   @unknown@: The BGP peer status is not available.
--
-- 'asn', 'bGPPeer_asn' - The autonomous system (AS) number for Border Gateway Protocol (BGP)
-- configuration.
--
-- 'authKey', 'bGPPeer_authKey' - The authentication key for BGP configuration. This string has a minimum
-- length of 6 characters and and a maximun lenth of 80 characters.
--
-- 'bgpPeerId', 'bGPPeer_bgpPeerId' - The ID of the BGP peer.
--
-- 'bgpPeerState', 'bGPPeer_bgpPeerState' - The state of the BGP peer. The following are the possible values:
--
-- -   @verifying@: The BGP peering addresses or ASN require validation
--     before the BGP peer can be created. This state applies only to
--     public virtual interfaces.
--
-- -   @pending@: The BGP peer is created, and remains in this state until
--     it is ready to be established.
--
-- -   @available@: The BGP peer is ready to be established.
--
-- -   @deleting@: The BGP peer is being deleted.
--
-- -   @deleted@: The BGP peer is deleted and cannot be established.
--
-- 'awsDeviceV2', 'bGPPeer_awsDeviceV2' - The Direct Connect endpoint that terminates the BGP peer.
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
    }

-- | The IP address assigned to the customer interface.
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)

-- | The IP address assigned to the Amazon interface.
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)

-- | The address family for the BGP peer.
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)

-- | The Direct Connect endpoint that terminates the logical connection. This
-- device might be different than the device that terminates the physical
-- connection.
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)

-- | The status of the BGP peer. The following are the possible values:
--
-- -   @up@: The BGP peer is established. This state does not indicate the
--     state of the routing function. Ensure that you are receiving routes
--     over the BGP session.
--
-- -   @down@: The BGP peer is down.
--
-- -   @unknown@: The BGP peer status is not available.
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)

-- | The autonomous system (AS) number for Border Gateway Protocol (BGP)
-- configuration.
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)

-- | The authentication key for BGP configuration. This string has a minimum
-- length of 6 characters and and a maximun lenth of 80 characters.
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)

-- | The ID of the BGP peer.
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)

-- | The state of the BGP peer. The following are the possible values:
--
-- -   @verifying@: The BGP peering addresses or ASN require validation
--     before the BGP peer can be created. This state applies only to
--     public virtual interfaces.
--
-- -   @pending@: The BGP peer is created, and remains in this state until
--     it is ready to be established.
--
-- -   @available@: The BGP peer is ready to be established.
--
-- -   @deleting@: The BGP peer is being deleted.
--
-- -   @deleted@: The BGP peer is deleted and cannot be established.
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)

-- | The Direct Connect endpoint that terminates the BGP peer.
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