{-# 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.DirectConnectGatewayAssociation
-- 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.DirectConnectGatewayAssociation where

import qualified Amazonka.Core as Core
import Amazonka.DirectConnect.Types.AssociatedGateway
import Amazonka.DirectConnect.Types.DirectConnectGatewayAssociationState
import Amazonka.DirectConnect.Types.RouteFilterPrefix
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about an association between a Direct Connect gateway and a
-- virtual private gateway or transit gateway.
--
-- /See:/ 'newDirectConnectGatewayAssociation' smart constructor.
data DirectConnectGatewayAssociation = DirectConnectGatewayAssociation'
  { -- | The ID of the virtual private gateway. Applies only to private virtual
    -- interfaces.
    DirectConnectGatewayAssociation -> Maybe Text
virtualGatewayId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Direct Connect gateway association.
    DirectConnectGatewayAssociation -> Maybe Text
associationId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Direct Connect gateway.
    DirectConnectGatewayAssociation -> Maybe Text
directConnectGatewayId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Amazon Web Services account that owns the virtual private
    -- gateway.
    DirectConnectGatewayAssociation -> Maybe Text
virtualGatewayOwnerAccount :: Prelude.Maybe Prelude.Text,
    -- | The error message if the state of an object failed to advance.
    DirectConnectGatewayAssociation -> Maybe Text
stateChangeError :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services Region where the virtual private gateway is
    -- located.
    DirectConnectGatewayAssociation -> Maybe Text
virtualGatewayRegion :: Prelude.Maybe Prelude.Text,
    -- | Information about the associated gateway.
    DirectConnectGatewayAssociation -> Maybe AssociatedGateway
associatedGateway :: Prelude.Maybe AssociatedGateway,
    -- | The ID of the Amazon Web Services account that owns the associated
    -- gateway.
    DirectConnectGatewayAssociation -> Maybe Text
directConnectGatewayOwnerAccount :: Prelude.Maybe Prelude.Text,
    -- | The Amazon VPC prefixes to advertise to the Direct Connect gateway.
    DirectConnectGatewayAssociation -> Maybe [RouteFilterPrefix]
allowedPrefixesToDirectConnectGateway :: Prelude.Maybe [RouteFilterPrefix],
    -- | The state of the association. The following are the possible values:
    --
    -- -   @associating@: The initial state after calling
    --     CreateDirectConnectGatewayAssociation.
    --
    -- -   @associated@: The Direct Connect gateway and virtual private gateway
    --     or transit gateway are successfully associated and ready to pass
    --     traffic.
    --
    -- -   @disassociating@: The initial state after calling
    --     DeleteDirectConnectGatewayAssociation.
    --
    -- -   @disassociated@: The virtual private gateway or transit gateway is
    --     disassociated from the Direct Connect gateway. Traffic flow between
    --     the Direct Connect gateway and virtual private gateway or transit
    --     gateway is stopped.
    DirectConnectGatewayAssociation
-> Maybe DirectConnectGatewayAssociationState
associationState :: Prelude.Maybe DirectConnectGatewayAssociationState
  }
  deriving (DirectConnectGatewayAssociation
-> DirectConnectGatewayAssociation -> Bool
(DirectConnectGatewayAssociation
 -> DirectConnectGatewayAssociation -> Bool)
-> (DirectConnectGatewayAssociation
    -> DirectConnectGatewayAssociation -> Bool)
-> Eq DirectConnectGatewayAssociation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DirectConnectGatewayAssociation
-> DirectConnectGatewayAssociation -> Bool
$c/= :: DirectConnectGatewayAssociation
-> DirectConnectGatewayAssociation -> Bool
== :: DirectConnectGatewayAssociation
-> DirectConnectGatewayAssociation -> Bool
$c== :: DirectConnectGatewayAssociation
-> DirectConnectGatewayAssociation -> Bool
Prelude.Eq, ReadPrec [DirectConnectGatewayAssociation]
ReadPrec DirectConnectGatewayAssociation
Int -> ReadS DirectConnectGatewayAssociation
ReadS [DirectConnectGatewayAssociation]
(Int -> ReadS DirectConnectGatewayAssociation)
-> ReadS [DirectConnectGatewayAssociation]
-> ReadPrec DirectConnectGatewayAssociation
-> ReadPrec [DirectConnectGatewayAssociation]
-> Read DirectConnectGatewayAssociation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DirectConnectGatewayAssociation]
$creadListPrec :: ReadPrec [DirectConnectGatewayAssociation]
readPrec :: ReadPrec DirectConnectGatewayAssociation
$creadPrec :: ReadPrec DirectConnectGatewayAssociation
readList :: ReadS [DirectConnectGatewayAssociation]
$creadList :: ReadS [DirectConnectGatewayAssociation]
readsPrec :: Int -> ReadS DirectConnectGatewayAssociation
$creadsPrec :: Int -> ReadS DirectConnectGatewayAssociation
Prelude.Read, Int -> DirectConnectGatewayAssociation -> ShowS
[DirectConnectGatewayAssociation] -> ShowS
DirectConnectGatewayAssociation -> String
(Int -> DirectConnectGatewayAssociation -> ShowS)
-> (DirectConnectGatewayAssociation -> String)
-> ([DirectConnectGatewayAssociation] -> ShowS)
-> Show DirectConnectGatewayAssociation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DirectConnectGatewayAssociation] -> ShowS
$cshowList :: [DirectConnectGatewayAssociation] -> ShowS
show :: DirectConnectGatewayAssociation -> String
$cshow :: DirectConnectGatewayAssociation -> String
showsPrec :: Int -> DirectConnectGatewayAssociation -> ShowS
$cshowsPrec :: Int -> DirectConnectGatewayAssociation -> ShowS
Prelude.Show, (forall x.
 DirectConnectGatewayAssociation
 -> Rep DirectConnectGatewayAssociation x)
-> (forall x.
    Rep DirectConnectGatewayAssociation x
    -> DirectConnectGatewayAssociation)
-> Generic DirectConnectGatewayAssociation
forall x.
Rep DirectConnectGatewayAssociation x
-> DirectConnectGatewayAssociation
forall x.
DirectConnectGatewayAssociation
-> Rep DirectConnectGatewayAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DirectConnectGatewayAssociation x
-> DirectConnectGatewayAssociation
$cfrom :: forall x.
DirectConnectGatewayAssociation
-> Rep DirectConnectGatewayAssociation x
Prelude.Generic)

-- |
-- Create a value of 'DirectConnectGatewayAssociation' 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:
--
-- 'virtualGatewayId', 'directConnectGatewayAssociation_virtualGatewayId' - The ID of the virtual private gateway. Applies only to private virtual
-- interfaces.
--
-- 'associationId', 'directConnectGatewayAssociation_associationId' - The ID of the Direct Connect gateway association.
--
-- 'directConnectGatewayId', 'directConnectGatewayAssociation_directConnectGatewayId' - The ID of the Direct Connect gateway.
--
-- 'virtualGatewayOwnerAccount', 'directConnectGatewayAssociation_virtualGatewayOwnerAccount' - The ID of the Amazon Web Services account that owns the virtual private
-- gateway.
--
-- 'stateChangeError', 'directConnectGatewayAssociation_stateChangeError' - The error message if the state of an object failed to advance.
--
-- 'virtualGatewayRegion', 'directConnectGatewayAssociation_virtualGatewayRegion' - The Amazon Web Services Region where the virtual private gateway is
-- located.
--
-- 'associatedGateway', 'directConnectGatewayAssociation_associatedGateway' - Information about the associated gateway.
--
-- 'directConnectGatewayOwnerAccount', 'directConnectGatewayAssociation_directConnectGatewayOwnerAccount' - The ID of the Amazon Web Services account that owns the associated
-- gateway.
--
-- 'allowedPrefixesToDirectConnectGateway', 'directConnectGatewayAssociation_allowedPrefixesToDirectConnectGateway' - The Amazon VPC prefixes to advertise to the Direct Connect gateway.
--
-- 'associationState', 'directConnectGatewayAssociation_associationState' - The state of the association. The following are the possible values:
--
-- -   @associating@: The initial state after calling
--     CreateDirectConnectGatewayAssociation.
--
-- -   @associated@: The Direct Connect gateway and virtual private gateway
--     or transit gateway are successfully associated and ready to pass
--     traffic.
--
-- -   @disassociating@: The initial state after calling
--     DeleteDirectConnectGatewayAssociation.
--
-- -   @disassociated@: The virtual private gateway or transit gateway is
--     disassociated from the Direct Connect gateway. Traffic flow between
--     the Direct Connect gateway and virtual private gateway or transit
--     gateway is stopped.
newDirectConnectGatewayAssociation ::
  DirectConnectGatewayAssociation
newDirectConnectGatewayAssociation :: DirectConnectGatewayAssociation
newDirectConnectGatewayAssociation =
  DirectConnectGatewayAssociation' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AssociatedGateway
-> Maybe Text
-> Maybe [RouteFilterPrefix]
-> Maybe DirectConnectGatewayAssociationState
-> DirectConnectGatewayAssociation
DirectConnectGatewayAssociation'
    { $sel:virtualGatewayId:DirectConnectGatewayAssociation' :: Maybe Text
virtualGatewayId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:associationId:DirectConnectGatewayAssociation' :: Maybe Text
associationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:directConnectGatewayId:DirectConnectGatewayAssociation' :: Maybe Text
directConnectGatewayId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:virtualGatewayOwnerAccount:DirectConnectGatewayAssociation' :: Maybe Text
virtualGatewayOwnerAccount =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stateChangeError:DirectConnectGatewayAssociation' :: Maybe Text
stateChangeError = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:virtualGatewayRegion:DirectConnectGatewayAssociation' :: Maybe Text
virtualGatewayRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:associatedGateway:DirectConnectGatewayAssociation' :: Maybe AssociatedGateway
associatedGateway = Maybe AssociatedGateway
forall a. Maybe a
Prelude.Nothing,
      $sel:directConnectGatewayOwnerAccount:DirectConnectGatewayAssociation' :: Maybe Text
directConnectGatewayOwnerAccount =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:allowedPrefixesToDirectConnectGateway:DirectConnectGatewayAssociation' :: Maybe [RouteFilterPrefix]
allowedPrefixesToDirectConnectGateway =
        Maybe [RouteFilterPrefix]
forall a. Maybe a
Prelude.Nothing,
      $sel:associationState:DirectConnectGatewayAssociation' :: Maybe DirectConnectGatewayAssociationState
associationState = Maybe DirectConnectGatewayAssociationState
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the virtual private gateway. Applies only to private virtual
-- interfaces.
directConnectGatewayAssociation_virtualGatewayId :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe Prelude.Text)
directConnectGatewayAssociation_virtualGatewayId :: (Maybe Text -> f (Maybe Text))
-> DirectConnectGatewayAssociation
-> f DirectConnectGatewayAssociation
directConnectGatewayAssociation_virtualGatewayId = (DirectConnectGatewayAssociation -> Maybe Text)
-> (DirectConnectGatewayAssociation
    -> Maybe Text -> DirectConnectGatewayAssociation)
-> Lens
     DirectConnectGatewayAssociation
     DirectConnectGatewayAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGatewayAssociation' {Maybe Text
virtualGatewayId :: Maybe Text
$sel:virtualGatewayId:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
virtualGatewayId} -> Maybe Text
virtualGatewayId) (\s :: DirectConnectGatewayAssociation
s@DirectConnectGatewayAssociation' {} Maybe Text
a -> DirectConnectGatewayAssociation
s {$sel:virtualGatewayId:DirectConnectGatewayAssociation' :: Maybe Text
virtualGatewayId = Maybe Text
a} :: DirectConnectGatewayAssociation)

-- | The ID of the Direct Connect gateway association.
directConnectGatewayAssociation_associationId :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe Prelude.Text)
directConnectGatewayAssociation_associationId :: (Maybe Text -> f (Maybe Text))
-> DirectConnectGatewayAssociation
-> f DirectConnectGatewayAssociation
directConnectGatewayAssociation_associationId = (DirectConnectGatewayAssociation -> Maybe Text)
-> (DirectConnectGatewayAssociation
    -> Maybe Text -> DirectConnectGatewayAssociation)
-> Lens
     DirectConnectGatewayAssociation
     DirectConnectGatewayAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGatewayAssociation' {Maybe Text
associationId :: Maybe Text
$sel:associationId:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
associationId} -> Maybe Text
associationId) (\s :: DirectConnectGatewayAssociation
s@DirectConnectGatewayAssociation' {} Maybe Text
a -> DirectConnectGatewayAssociation
s {$sel:associationId:DirectConnectGatewayAssociation' :: Maybe Text
associationId = Maybe Text
a} :: DirectConnectGatewayAssociation)

-- | The ID of the Direct Connect gateway.
directConnectGatewayAssociation_directConnectGatewayId :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe Prelude.Text)
directConnectGatewayAssociation_directConnectGatewayId :: (Maybe Text -> f (Maybe Text))
-> DirectConnectGatewayAssociation
-> f DirectConnectGatewayAssociation
directConnectGatewayAssociation_directConnectGatewayId = (DirectConnectGatewayAssociation -> Maybe Text)
-> (DirectConnectGatewayAssociation
    -> Maybe Text -> DirectConnectGatewayAssociation)
-> Lens
     DirectConnectGatewayAssociation
     DirectConnectGatewayAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGatewayAssociation' {Maybe Text
directConnectGatewayId :: Maybe Text
$sel:directConnectGatewayId:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
directConnectGatewayId} -> Maybe Text
directConnectGatewayId) (\s :: DirectConnectGatewayAssociation
s@DirectConnectGatewayAssociation' {} Maybe Text
a -> DirectConnectGatewayAssociation
s {$sel:directConnectGatewayId:DirectConnectGatewayAssociation' :: Maybe Text
directConnectGatewayId = Maybe Text
a} :: DirectConnectGatewayAssociation)

-- | The ID of the Amazon Web Services account that owns the virtual private
-- gateway.
directConnectGatewayAssociation_virtualGatewayOwnerAccount :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe Prelude.Text)
directConnectGatewayAssociation_virtualGatewayOwnerAccount :: (Maybe Text -> f (Maybe Text))
-> DirectConnectGatewayAssociation
-> f DirectConnectGatewayAssociation
directConnectGatewayAssociation_virtualGatewayOwnerAccount = (DirectConnectGatewayAssociation -> Maybe Text)
-> (DirectConnectGatewayAssociation
    -> Maybe Text -> DirectConnectGatewayAssociation)
-> Lens
     DirectConnectGatewayAssociation
     DirectConnectGatewayAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGatewayAssociation' {Maybe Text
virtualGatewayOwnerAccount :: Maybe Text
$sel:virtualGatewayOwnerAccount:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
virtualGatewayOwnerAccount} -> Maybe Text
virtualGatewayOwnerAccount) (\s :: DirectConnectGatewayAssociation
s@DirectConnectGatewayAssociation' {} Maybe Text
a -> DirectConnectGatewayAssociation
s {$sel:virtualGatewayOwnerAccount:DirectConnectGatewayAssociation' :: Maybe Text
virtualGatewayOwnerAccount = Maybe Text
a} :: DirectConnectGatewayAssociation)

-- | The error message if the state of an object failed to advance.
directConnectGatewayAssociation_stateChangeError :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe Prelude.Text)
directConnectGatewayAssociation_stateChangeError :: (Maybe Text -> f (Maybe Text))
-> DirectConnectGatewayAssociation
-> f DirectConnectGatewayAssociation
directConnectGatewayAssociation_stateChangeError = (DirectConnectGatewayAssociation -> Maybe Text)
-> (DirectConnectGatewayAssociation
    -> Maybe Text -> DirectConnectGatewayAssociation)
-> Lens
     DirectConnectGatewayAssociation
     DirectConnectGatewayAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGatewayAssociation' {Maybe Text
stateChangeError :: Maybe Text
$sel:stateChangeError:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
stateChangeError} -> Maybe Text
stateChangeError) (\s :: DirectConnectGatewayAssociation
s@DirectConnectGatewayAssociation' {} Maybe Text
a -> DirectConnectGatewayAssociation
s {$sel:stateChangeError:DirectConnectGatewayAssociation' :: Maybe Text
stateChangeError = Maybe Text
a} :: DirectConnectGatewayAssociation)

-- | The Amazon Web Services Region where the virtual private gateway is
-- located.
directConnectGatewayAssociation_virtualGatewayRegion :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe Prelude.Text)
directConnectGatewayAssociation_virtualGatewayRegion :: (Maybe Text -> f (Maybe Text))
-> DirectConnectGatewayAssociation
-> f DirectConnectGatewayAssociation
directConnectGatewayAssociation_virtualGatewayRegion = (DirectConnectGatewayAssociation -> Maybe Text)
-> (DirectConnectGatewayAssociation
    -> Maybe Text -> DirectConnectGatewayAssociation)
-> Lens
     DirectConnectGatewayAssociation
     DirectConnectGatewayAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGatewayAssociation' {Maybe Text
virtualGatewayRegion :: Maybe Text
$sel:virtualGatewayRegion:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
virtualGatewayRegion} -> Maybe Text
virtualGatewayRegion) (\s :: DirectConnectGatewayAssociation
s@DirectConnectGatewayAssociation' {} Maybe Text
a -> DirectConnectGatewayAssociation
s {$sel:virtualGatewayRegion:DirectConnectGatewayAssociation' :: Maybe Text
virtualGatewayRegion = Maybe Text
a} :: DirectConnectGatewayAssociation)

-- | Information about the associated gateway.
directConnectGatewayAssociation_associatedGateway :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe AssociatedGateway)
directConnectGatewayAssociation_associatedGateway :: (Maybe AssociatedGateway -> f (Maybe AssociatedGateway))
-> DirectConnectGatewayAssociation
-> f DirectConnectGatewayAssociation
directConnectGatewayAssociation_associatedGateway = (DirectConnectGatewayAssociation -> Maybe AssociatedGateway)
-> (DirectConnectGatewayAssociation
    -> Maybe AssociatedGateway -> DirectConnectGatewayAssociation)
-> Lens
     DirectConnectGatewayAssociation
     DirectConnectGatewayAssociation
     (Maybe AssociatedGateway)
     (Maybe AssociatedGateway)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGatewayAssociation' {Maybe AssociatedGateway
associatedGateway :: Maybe AssociatedGateway
$sel:associatedGateway:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe AssociatedGateway
associatedGateway} -> Maybe AssociatedGateway
associatedGateway) (\s :: DirectConnectGatewayAssociation
s@DirectConnectGatewayAssociation' {} Maybe AssociatedGateway
a -> DirectConnectGatewayAssociation
s {$sel:associatedGateway:DirectConnectGatewayAssociation' :: Maybe AssociatedGateway
associatedGateway = Maybe AssociatedGateway
a} :: DirectConnectGatewayAssociation)

-- | The ID of the Amazon Web Services account that owns the associated
-- gateway.
directConnectGatewayAssociation_directConnectGatewayOwnerAccount :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe Prelude.Text)
directConnectGatewayAssociation_directConnectGatewayOwnerAccount :: (Maybe Text -> f (Maybe Text))
-> DirectConnectGatewayAssociation
-> f DirectConnectGatewayAssociation
directConnectGatewayAssociation_directConnectGatewayOwnerAccount = (DirectConnectGatewayAssociation -> Maybe Text)
-> (DirectConnectGatewayAssociation
    -> Maybe Text -> DirectConnectGatewayAssociation)
-> Lens
     DirectConnectGatewayAssociation
     DirectConnectGatewayAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGatewayAssociation' {Maybe Text
directConnectGatewayOwnerAccount :: Maybe Text
$sel:directConnectGatewayOwnerAccount:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
directConnectGatewayOwnerAccount} -> Maybe Text
directConnectGatewayOwnerAccount) (\s :: DirectConnectGatewayAssociation
s@DirectConnectGatewayAssociation' {} Maybe Text
a -> DirectConnectGatewayAssociation
s {$sel:directConnectGatewayOwnerAccount:DirectConnectGatewayAssociation' :: Maybe Text
directConnectGatewayOwnerAccount = Maybe Text
a} :: DirectConnectGatewayAssociation)

-- | The Amazon VPC prefixes to advertise to the Direct Connect gateway.
directConnectGatewayAssociation_allowedPrefixesToDirectConnectGateway :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe [RouteFilterPrefix])
directConnectGatewayAssociation_allowedPrefixesToDirectConnectGateway :: (Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> DirectConnectGatewayAssociation
-> f DirectConnectGatewayAssociation
directConnectGatewayAssociation_allowedPrefixesToDirectConnectGateway = (DirectConnectGatewayAssociation -> Maybe [RouteFilterPrefix])
-> (DirectConnectGatewayAssociation
    -> Maybe [RouteFilterPrefix] -> DirectConnectGatewayAssociation)
-> Lens
     DirectConnectGatewayAssociation
     DirectConnectGatewayAssociation
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGatewayAssociation' {Maybe [RouteFilterPrefix]
allowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
$sel:allowedPrefixesToDirectConnectGateway:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe [RouteFilterPrefix]
allowedPrefixesToDirectConnectGateway} -> Maybe [RouteFilterPrefix]
allowedPrefixesToDirectConnectGateway) (\s :: DirectConnectGatewayAssociation
s@DirectConnectGatewayAssociation' {} Maybe [RouteFilterPrefix]
a -> DirectConnectGatewayAssociation
s {$sel:allowedPrefixesToDirectConnectGateway:DirectConnectGatewayAssociation' :: Maybe [RouteFilterPrefix]
allowedPrefixesToDirectConnectGateway = Maybe [RouteFilterPrefix]
a} :: DirectConnectGatewayAssociation) ((Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
 -> DirectConnectGatewayAssociation
 -> f DirectConnectGatewayAssociation)
-> ((Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
    -> Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> (Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> DirectConnectGatewayAssociation
-> f DirectConnectGatewayAssociation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
-> Iso
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The state of the association. The following are the possible values:
--
-- -   @associating@: The initial state after calling
--     CreateDirectConnectGatewayAssociation.
--
-- -   @associated@: The Direct Connect gateway and virtual private gateway
--     or transit gateway are successfully associated and ready to pass
--     traffic.
--
-- -   @disassociating@: The initial state after calling
--     DeleteDirectConnectGatewayAssociation.
--
-- -   @disassociated@: The virtual private gateway or transit gateway is
--     disassociated from the Direct Connect gateway. Traffic flow between
--     the Direct Connect gateway and virtual private gateway or transit
--     gateway is stopped.
directConnectGatewayAssociation_associationState :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe DirectConnectGatewayAssociationState)
directConnectGatewayAssociation_associationState :: (Maybe DirectConnectGatewayAssociationState
 -> f (Maybe DirectConnectGatewayAssociationState))
-> DirectConnectGatewayAssociation
-> f DirectConnectGatewayAssociation
directConnectGatewayAssociation_associationState = (DirectConnectGatewayAssociation
 -> Maybe DirectConnectGatewayAssociationState)
-> (DirectConnectGatewayAssociation
    -> Maybe DirectConnectGatewayAssociationState
    -> DirectConnectGatewayAssociation)
-> Lens
     DirectConnectGatewayAssociation
     DirectConnectGatewayAssociation
     (Maybe DirectConnectGatewayAssociationState)
     (Maybe DirectConnectGatewayAssociationState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGatewayAssociation' {Maybe DirectConnectGatewayAssociationState
associationState :: Maybe DirectConnectGatewayAssociationState
$sel:associationState:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation
-> Maybe DirectConnectGatewayAssociationState
associationState} -> Maybe DirectConnectGatewayAssociationState
associationState) (\s :: DirectConnectGatewayAssociation
s@DirectConnectGatewayAssociation' {} Maybe DirectConnectGatewayAssociationState
a -> DirectConnectGatewayAssociation
s {$sel:associationState:DirectConnectGatewayAssociation' :: Maybe DirectConnectGatewayAssociationState
associationState = Maybe DirectConnectGatewayAssociationState
a} :: DirectConnectGatewayAssociation)

instance
  Core.FromJSON
    DirectConnectGatewayAssociation
  where
  parseJSON :: Value -> Parser DirectConnectGatewayAssociation
parseJSON =
    String
-> (Object -> Parser DirectConnectGatewayAssociation)
-> Value
-> Parser DirectConnectGatewayAssociation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DirectConnectGatewayAssociation"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AssociatedGateway
-> Maybe Text
-> Maybe [RouteFilterPrefix]
-> Maybe DirectConnectGatewayAssociationState
-> DirectConnectGatewayAssociation
DirectConnectGatewayAssociation'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe AssociatedGateway
 -> Maybe Text
 -> Maybe [RouteFilterPrefix]
 -> Maybe DirectConnectGatewayAssociationState
 -> DirectConnectGatewayAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AssociatedGateway
      -> Maybe Text
      -> Maybe [RouteFilterPrefix]
      -> Maybe DirectConnectGatewayAssociationState
      -> DirectConnectGatewayAssociation)
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
"virtualGatewayId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AssociatedGateway
   -> Maybe Text
   -> Maybe [RouteFilterPrefix]
   -> Maybe DirectConnectGatewayAssociationState
   -> DirectConnectGatewayAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AssociatedGateway
      -> Maybe Text
      -> Maybe [RouteFilterPrefix]
      -> Maybe DirectConnectGatewayAssociationState
      -> DirectConnectGatewayAssociation)
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
"associationId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AssociatedGateway
   -> Maybe Text
   -> Maybe [RouteFilterPrefix]
   -> Maybe DirectConnectGatewayAssociationState
   -> DirectConnectGatewayAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AssociatedGateway
      -> Maybe Text
      -> Maybe [RouteFilterPrefix]
      -> Maybe DirectConnectGatewayAssociationState
      -> DirectConnectGatewayAssociation)
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
"directConnectGatewayId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AssociatedGateway
   -> Maybe Text
   -> Maybe [RouteFilterPrefix]
   -> Maybe DirectConnectGatewayAssociationState
   -> DirectConnectGatewayAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe AssociatedGateway
      -> Maybe Text
      -> Maybe [RouteFilterPrefix]
      -> Maybe DirectConnectGatewayAssociationState
      -> DirectConnectGatewayAssociation)
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
"virtualGatewayOwnerAccount")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe AssociatedGateway
   -> Maybe Text
   -> Maybe [RouteFilterPrefix]
   -> Maybe DirectConnectGatewayAssociationState
   -> DirectConnectGatewayAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe AssociatedGateway
      -> Maybe Text
      -> Maybe [RouteFilterPrefix]
      -> Maybe DirectConnectGatewayAssociationState
      -> DirectConnectGatewayAssociation)
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
"stateChangeError")
            Parser
  (Maybe Text
   -> Maybe AssociatedGateway
   -> Maybe Text
   -> Maybe [RouteFilterPrefix]
   -> Maybe DirectConnectGatewayAssociationState
   -> DirectConnectGatewayAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe AssociatedGateway
      -> Maybe Text
      -> Maybe [RouteFilterPrefix]
      -> Maybe DirectConnectGatewayAssociationState
      -> DirectConnectGatewayAssociation)
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
"virtualGatewayRegion")
            Parser
  (Maybe AssociatedGateway
   -> Maybe Text
   -> Maybe [RouteFilterPrefix]
   -> Maybe DirectConnectGatewayAssociationState
   -> DirectConnectGatewayAssociation)
-> Parser (Maybe AssociatedGateway)
-> Parser
     (Maybe Text
      -> Maybe [RouteFilterPrefix]
      -> Maybe DirectConnectGatewayAssociationState
      -> DirectConnectGatewayAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AssociatedGateway)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"associatedGateway")
            Parser
  (Maybe Text
   -> Maybe [RouteFilterPrefix]
   -> Maybe DirectConnectGatewayAssociationState
   -> DirectConnectGatewayAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe [RouteFilterPrefix]
      -> Maybe DirectConnectGatewayAssociationState
      -> DirectConnectGatewayAssociation)
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
"directConnectGatewayOwnerAccount")
            Parser
  (Maybe [RouteFilterPrefix]
   -> Maybe DirectConnectGatewayAssociationState
   -> DirectConnectGatewayAssociation)
-> Parser (Maybe [RouteFilterPrefix])
-> Parser
     (Maybe DirectConnectGatewayAssociationState
      -> DirectConnectGatewayAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [RouteFilterPrefix]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"allowedPrefixesToDirectConnectGateway"
                            Parser (Maybe (Maybe [RouteFilterPrefix]))
-> Maybe [RouteFilterPrefix] -> Parser (Maybe [RouteFilterPrefix])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [RouteFilterPrefix]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe DirectConnectGatewayAssociationState
   -> DirectConnectGatewayAssociation)
-> Parser (Maybe DirectConnectGatewayAssociationState)
-> Parser DirectConnectGatewayAssociation
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe DirectConnectGatewayAssociationState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"associationState")
      )

instance
  Prelude.Hashable
    DirectConnectGatewayAssociation

instance
  Prelude.NFData
    DirectConnectGatewayAssociation