{-# 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.NetworkManager.Types.TransitGatewayConnectPeerAssociation
-- 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.NetworkManager.Types.TransitGatewayConnectPeerAssociation where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.NetworkManager.Types.TransitGatewayConnectPeerAssociationState
import qualified Amazonka.Prelude as Prelude

-- | Describes a transit gateway Connect peer association.
--
-- /See:/ 'newTransitGatewayConnectPeerAssociation' smart constructor.
data TransitGatewayConnectPeerAssociation = TransitGatewayConnectPeerAssociation'
  { -- | The state of the association.
    TransitGatewayConnectPeerAssociation
-> Maybe TransitGatewayConnectPeerAssociationState
state :: Prelude.Maybe TransitGatewayConnectPeerAssociationState,
    -- | The ID of the global network.
    TransitGatewayConnectPeerAssociation -> Maybe Text
globalNetworkId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the transit gateway Connect peer.
    TransitGatewayConnectPeerAssociation -> Maybe Text
transitGatewayConnectPeerArn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the link.
    TransitGatewayConnectPeerAssociation -> Maybe Text
linkId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the device.
    TransitGatewayConnectPeerAssociation -> Maybe Text
deviceId :: Prelude.Maybe Prelude.Text
  }
  deriving (TransitGatewayConnectPeerAssociation
-> TransitGatewayConnectPeerAssociation -> Bool
(TransitGatewayConnectPeerAssociation
 -> TransitGatewayConnectPeerAssociation -> Bool)
-> (TransitGatewayConnectPeerAssociation
    -> TransitGatewayConnectPeerAssociation -> Bool)
-> Eq TransitGatewayConnectPeerAssociation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TransitGatewayConnectPeerAssociation
-> TransitGatewayConnectPeerAssociation -> Bool
$c/= :: TransitGatewayConnectPeerAssociation
-> TransitGatewayConnectPeerAssociation -> Bool
== :: TransitGatewayConnectPeerAssociation
-> TransitGatewayConnectPeerAssociation -> Bool
$c== :: TransitGatewayConnectPeerAssociation
-> TransitGatewayConnectPeerAssociation -> Bool
Prelude.Eq, ReadPrec [TransitGatewayConnectPeerAssociation]
ReadPrec TransitGatewayConnectPeerAssociation
Int -> ReadS TransitGatewayConnectPeerAssociation
ReadS [TransitGatewayConnectPeerAssociation]
(Int -> ReadS TransitGatewayConnectPeerAssociation)
-> ReadS [TransitGatewayConnectPeerAssociation]
-> ReadPrec TransitGatewayConnectPeerAssociation
-> ReadPrec [TransitGatewayConnectPeerAssociation]
-> Read TransitGatewayConnectPeerAssociation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TransitGatewayConnectPeerAssociation]
$creadListPrec :: ReadPrec [TransitGatewayConnectPeerAssociation]
readPrec :: ReadPrec TransitGatewayConnectPeerAssociation
$creadPrec :: ReadPrec TransitGatewayConnectPeerAssociation
readList :: ReadS [TransitGatewayConnectPeerAssociation]
$creadList :: ReadS [TransitGatewayConnectPeerAssociation]
readsPrec :: Int -> ReadS TransitGatewayConnectPeerAssociation
$creadsPrec :: Int -> ReadS TransitGatewayConnectPeerAssociation
Prelude.Read, Int -> TransitGatewayConnectPeerAssociation -> ShowS
[TransitGatewayConnectPeerAssociation] -> ShowS
TransitGatewayConnectPeerAssociation -> String
(Int -> TransitGatewayConnectPeerAssociation -> ShowS)
-> (TransitGatewayConnectPeerAssociation -> String)
-> ([TransitGatewayConnectPeerAssociation] -> ShowS)
-> Show TransitGatewayConnectPeerAssociation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TransitGatewayConnectPeerAssociation] -> ShowS
$cshowList :: [TransitGatewayConnectPeerAssociation] -> ShowS
show :: TransitGatewayConnectPeerAssociation -> String
$cshow :: TransitGatewayConnectPeerAssociation -> String
showsPrec :: Int -> TransitGatewayConnectPeerAssociation -> ShowS
$cshowsPrec :: Int -> TransitGatewayConnectPeerAssociation -> ShowS
Prelude.Show, (forall x.
 TransitGatewayConnectPeerAssociation
 -> Rep TransitGatewayConnectPeerAssociation x)
-> (forall x.
    Rep TransitGatewayConnectPeerAssociation x
    -> TransitGatewayConnectPeerAssociation)
-> Generic TransitGatewayConnectPeerAssociation
forall x.
Rep TransitGatewayConnectPeerAssociation x
-> TransitGatewayConnectPeerAssociation
forall x.
TransitGatewayConnectPeerAssociation
-> Rep TransitGatewayConnectPeerAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TransitGatewayConnectPeerAssociation x
-> TransitGatewayConnectPeerAssociation
$cfrom :: forall x.
TransitGatewayConnectPeerAssociation
-> Rep TransitGatewayConnectPeerAssociation x
Prelude.Generic)

-- |
-- Create a value of 'TransitGatewayConnectPeerAssociation' 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:
--
-- 'state', 'transitGatewayConnectPeerAssociation_state' - The state of the association.
--
-- 'globalNetworkId', 'transitGatewayConnectPeerAssociation_globalNetworkId' - The ID of the global network.
--
-- 'transitGatewayConnectPeerArn', 'transitGatewayConnectPeerAssociation_transitGatewayConnectPeerArn' - The Amazon Resource Name (ARN) of the transit gateway Connect peer.
--
-- 'linkId', 'transitGatewayConnectPeerAssociation_linkId' - The ID of the link.
--
-- 'deviceId', 'transitGatewayConnectPeerAssociation_deviceId' - The ID of the device.
newTransitGatewayConnectPeerAssociation ::
  TransitGatewayConnectPeerAssociation
newTransitGatewayConnectPeerAssociation :: TransitGatewayConnectPeerAssociation
newTransitGatewayConnectPeerAssociation =
  TransitGatewayConnectPeerAssociation' :: Maybe TransitGatewayConnectPeerAssociationState
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> TransitGatewayConnectPeerAssociation
TransitGatewayConnectPeerAssociation'
    { $sel:state:TransitGatewayConnectPeerAssociation' :: Maybe TransitGatewayConnectPeerAssociationState
state =
        Maybe TransitGatewayConnectPeerAssociationState
forall a. Maybe a
Prelude.Nothing,
      $sel:globalNetworkId:TransitGatewayConnectPeerAssociation' :: Maybe Text
globalNetworkId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:transitGatewayConnectPeerArn:TransitGatewayConnectPeerAssociation' :: Maybe Text
transitGatewayConnectPeerArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:linkId:TransitGatewayConnectPeerAssociation' :: Maybe Text
linkId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceId:TransitGatewayConnectPeerAssociation' :: Maybe Text
deviceId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The state of the association.
transitGatewayConnectPeerAssociation_state :: Lens.Lens' TransitGatewayConnectPeerAssociation (Prelude.Maybe TransitGatewayConnectPeerAssociationState)
transitGatewayConnectPeerAssociation_state :: (Maybe TransitGatewayConnectPeerAssociationState
 -> f (Maybe TransitGatewayConnectPeerAssociationState))
-> TransitGatewayConnectPeerAssociation
-> f TransitGatewayConnectPeerAssociation
transitGatewayConnectPeerAssociation_state = (TransitGatewayConnectPeerAssociation
 -> Maybe TransitGatewayConnectPeerAssociationState)
-> (TransitGatewayConnectPeerAssociation
    -> Maybe TransitGatewayConnectPeerAssociationState
    -> TransitGatewayConnectPeerAssociation)
-> Lens
     TransitGatewayConnectPeerAssociation
     TransitGatewayConnectPeerAssociation
     (Maybe TransitGatewayConnectPeerAssociationState)
     (Maybe TransitGatewayConnectPeerAssociationState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransitGatewayConnectPeerAssociation' {Maybe TransitGatewayConnectPeerAssociationState
state :: Maybe TransitGatewayConnectPeerAssociationState
$sel:state:TransitGatewayConnectPeerAssociation' :: TransitGatewayConnectPeerAssociation
-> Maybe TransitGatewayConnectPeerAssociationState
state} -> Maybe TransitGatewayConnectPeerAssociationState
state) (\s :: TransitGatewayConnectPeerAssociation
s@TransitGatewayConnectPeerAssociation' {} Maybe TransitGatewayConnectPeerAssociationState
a -> TransitGatewayConnectPeerAssociation
s {$sel:state:TransitGatewayConnectPeerAssociation' :: Maybe TransitGatewayConnectPeerAssociationState
state = Maybe TransitGatewayConnectPeerAssociationState
a} :: TransitGatewayConnectPeerAssociation)

-- | The ID of the global network.
transitGatewayConnectPeerAssociation_globalNetworkId :: Lens.Lens' TransitGatewayConnectPeerAssociation (Prelude.Maybe Prelude.Text)
transitGatewayConnectPeerAssociation_globalNetworkId :: (Maybe Text -> f (Maybe Text))
-> TransitGatewayConnectPeerAssociation
-> f TransitGatewayConnectPeerAssociation
transitGatewayConnectPeerAssociation_globalNetworkId = (TransitGatewayConnectPeerAssociation -> Maybe Text)
-> (TransitGatewayConnectPeerAssociation
    -> Maybe Text -> TransitGatewayConnectPeerAssociation)
-> Lens
     TransitGatewayConnectPeerAssociation
     TransitGatewayConnectPeerAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransitGatewayConnectPeerAssociation' {Maybe Text
globalNetworkId :: Maybe Text
$sel:globalNetworkId:TransitGatewayConnectPeerAssociation' :: TransitGatewayConnectPeerAssociation -> Maybe Text
globalNetworkId} -> Maybe Text
globalNetworkId) (\s :: TransitGatewayConnectPeerAssociation
s@TransitGatewayConnectPeerAssociation' {} Maybe Text
a -> TransitGatewayConnectPeerAssociation
s {$sel:globalNetworkId:TransitGatewayConnectPeerAssociation' :: Maybe Text
globalNetworkId = Maybe Text
a} :: TransitGatewayConnectPeerAssociation)

-- | The Amazon Resource Name (ARN) of the transit gateway Connect peer.
transitGatewayConnectPeerAssociation_transitGatewayConnectPeerArn :: Lens.Lens' TransitGatewayConnectPeerAssociation (Prelude.Maybe Prelude.Text)
transitGatewayConnectPeerAssociation_transitGatewayConnectPeerArn :: (Maybe Text -> f (Maybe Text))
-> TransitGatewayConnectPeerAssociation
-> f TransitGatewayConnectPeerAssociation
transitGatewayConnectPeerAssociation_transitGatewayConnectPeerArn = (TransitGatewayConnectPeerAssociation -> Maybe Text)
-> (TransitGatewayConnectPeerAssociation
    -> Maybe Text -> TransitGatewayConnectPeerAssociation)
-> Lens
     TransitGatewayConnectPeerAssociation
     TransitGatewayConnectPeerAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransitGatewayConnectPeerAssociation' {Maybe Text
transitGatewayConnectPeerArn :: Maybe Text
$sel:transitGatewayConnectPeerArn:TransitGatewayConnectPeerAssociation' :: TransitGatewayConnectPeerAssociation -> Maybe Text
transitGatewayConnectPeerArn} -> Maybe Text
transitGatewayConnectPeerArn) (\s :: TransitGatewayConnectPeerAssociation
s@TransitGatewayConnectPeerAssociation' {} Maybe Text
a -> TransitGatewayConnectPeerAssociation
s {$sel:transitGatewayConnectPeerArn:TransitGatewayConnectPeerAssociation' :: Maybe Text
transitGatewayConnectPeerArn = Maybe Text
a} :: TransitGatewayConnectPeerAssociation)

-- | The ID of the link.
transitGatewayConnectPeerAssociation_linkId :: Lens.Lens' TransitGatewayConnectPeerAssociation (Prelude.Maybe Prelude.Text)
transitGatewayConnectPeerAssociation_linkId :: (Maybe Text -> f (Maybe Text))
-> TransitGatewayConnectPeerAssociation
-> f TransitGatewayConnectPeerAssociation
transitGatewayConnectPeerAssociation_linkId = (TransitGatewayConnectPeerAssociation -> Maybe Text)
-> (TransitGatewayConnectPeerAssociation
    -> Maybe Text -> TransitGatewayConnectPeerAssociation)
-> Lens
     TransitGatewayConnectPeerAssociation
     TransitGatewayConnectPeerAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransitGatewayConnectPeerAssociation' {Maybe Text
linkId :: Maybe Text
$sel:linkId:TransitGatewayConnectPeerAssociation' :: TransitGatewayConnectPeerAssociation -> Maybe Text
linkId} -> Maybe Text
linkId) (\s :: TransitGatewayConnectPeerAssociation
s@TransitGatewayConnectPeerAssociation' {} Maybe Text
a -> TransitGatewayConnectPeerAssociation
s {$sel:linkId:TransitGatewayConnectPeerAssociation' :: Maybe Text
linkId = Maybe Text
a} :: TransitGatewayConnectPeerAssociation)

-- | The ID of the device.
transitGatewayConnectPeerAssociation_deviceId :: Lens.Lens' TransitGatewayConnectPeerAssociation (Prelude.Maybe Prelude.Text)
transitGatewayConnectPeerAssociation_deviceId :: (Maybe Text -> f (Maybe Text))
-> TransitGatewayConnectPeerAssociation
-> f TransitGatewayConnectPeerAssociation
transitGatewayConnectPeerAssociation_deviceId = (TransitGatewayConnectPeerAssociation -> Maybe Text)
-> (TransitGatewayConnectPeerAssociation
    -> Maybe Text -> TransitGatewayConnectPeerAssociation)
-> Lens
     TransitGatewayConnectPeerAssociation
     TransitGatewayConnectPeerAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransitGatewayConnectPeerAssociation' {Maybe Text
deviceId :: Maybe Text
$sel:deviceId:TransitGatewayConnectPeerAssociation' :: TransitGatewayConnectPeerAssociation -> Maybe Text
deviceId} -> Maybe Text
deviceId) (\s :: TransitGatewayConnectPeerAssociation
s@TransitGatewayConnectPeerAssociation' {} Maybe Text
a -> TransitGatewayConnectPeerAssociation
s {$sel:deviceId:TransitGatewayConnectPeerAssociation' :: Maybe Text
deviceId = Maybe Text
a} :: TransitGatewayConnectPeerAssociation)

instance
  Core.FromJSON
    TransitGatewayConnectPeerAssociation
  where
  parseJSON :: Value -> Parser TransitGatewayConnectPeerAssociation
parseJSON =
    String
-> (Object -> Parser TransitGatewayConnectPeerAssociation)
-> Value
-> Parser TransitGatewayConnectPeerAssociation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TransitGatewayConnectPeerAssociation"
      ( \Object
x ->
          Maybe TransitGatewayConnectPeerAssociationState
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> TransitGatewayConnectPeerAssociation
TransitGatewayConnectPeerAssociation'
            (Maybe TransitGatewayConnectPeerAssociationState
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> TransitGatewayConnectPeerAssociation)
-> Parser (Maybe TransitGatewayConnectPeerAssociationState)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> TransitGatewayConnectPeerAssociation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Parser (Maybe TransitGatewayConnectPeerAssociationState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> TransitGatewayConnectPeerAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> TransitGatewayConnectPeerAssociation)
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
"GlobalNetworkId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> TransitGatewayConnectPeerAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> TransitGatewayConnectPeerAssociation)
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
"TransitGatewayConnectPeerArn")
            Parser
  (Maybe Text -> Maybe Text -> TransitGatewayConnectPeerAssociation)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> TransitGatewayConnectPeerAssociation)
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
"LinkId")
            Parser (Maybe Text -> TransitGatewayConnectPeerAssociation)
-> Parser (Maybe Text)
-> Parser TransitGatewayConnectPeerAssociation
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
"DeviceId")
      )

instance
  Prelude.Hashable
    TransitGatewayConnectPeerAssociation

instance
  Prelude.NFData
    TransitGatewayConnectPeerAssociation