{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DirectConnect.Types.DirectConnectGatewayAssociation 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.AssociatedGateway
import Amazonka.DirectConnect.Types.DirectConnectGatewayAssociationState
import Amazonka.DirectConnect.Types.RouteFilterPrefix
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 Amazon VPC prefixes to advertise to the Direct Connect gateway.
    DirectConnectGatewayAssociation -> Maybe [RouteFilterPrefix]
allowedPrefixesToDirectConnectGateway :: Prelude.Maybe [RouteFilterPrefix],
    -- | Information about the associated gateway.
    DirectConnectGatewayAssociation -> Maybe AssociatedGateway
associatedGateway :: Prelude.Maybe AssociatedGateway,
    -- | The ID of the Direct Connect gateway association.
    DirectConnectGatewayAssociation -> Maybe Text
associationId :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | 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 associated
    -- gateway.
    DirectConnectGatewayAssociation -> Maybe Text
directConnectGatewayOwnerAccount :: 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 ID of the virtual private gateway. Applies only to private virtual
    -- interfaces.
    DirectConnectGatewayAssociation -> Maybe Text
virtualGatewayId :: 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 Amazon Web Services Region where the virtual private gateway is
    -- located.
    DirectConnectGatewayAssociation -> Maybe Text
virtualGatewayRegion :: Prelude.Maybe Prelude.Text
  }
  deriving (DirectConnectGatewayAssociation
-> DirectConnectGatewayAssociation -> Bool
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]
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
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.
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:
--
-- 'allowedPrefixesToDirectConnectGateway', 'directConnectGatewayAssociation_allowedPrefixesToDirectConnectGateway' - The Amazon VPC prefixes to advertise to the Direct Connect gateway.
--
-- 'associatedGateway', 'directConnectGatewayAssociation_associatedGateway' - Information about the associated gateway.
--
-- 'associationId', 'directConnectGatewayAssociation_associationId' - The ID of the Direct Connect gateway association.
--
-- '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.
--
-- 'directConnectGatewayId', 'directConnectGatewayAssociation_directConnectGatewayId' - The ID of the Direct Connect gateway.
--
-- 'directConnectGatewayOwnerAccount', 'directConnectGatewayAssociation_directConnectGatewayOwnerAccount' - The ID of the Amazon Web Services account that owns the associated
-- gateway.
--
-- 'stateChangeError', 'directConnectGatewayAssociation_stateChangeError' - The error message if the state of an object failed to advance.
--
-- 'virtualGatewayId', 'directConnectGatewayAssociation_virtualGatewayId' - The ID of the virtual private gateway. Applies only to private virtual
-- interfaces.
--
-- 'virtualGatewayOwnerAccount', 'directConnectGatewayAssociation_virtualGatewayOwnerAccount' - The ID of the Amazon Web Services account that owns the virtual private
-- gateway.
--
-- 'virtualGatewayRegion', 'directConnectGatewayAssociation_virtualGatewayRegion' - The Amazon Web Services Region where the virtual private gateway is
-- located.
newDirectConnectGatewayAssociation ::
  DirectConnectGatewayAssociation
newDirectConnectGatewayAssociation :: DirectConnectGatewayAssociation
newDirectConnectGatewayAssociation =
  DirectConnectGatewayAssociation'
    { $sel:allowedPrefixesToDirectConnectGateway:DirectConnectGatewayAssociation' :: Maybe [RouteFilterPrefix]
allowedPrefixesToDirectConnectGateway =
        forall a. Maybe a
Prelude.Nothing,
      $sel:associatedGateway:DirectConnectGatewayAssociation' :: Maybe AssociatedGateway
associatedGateway = forall a. Maybe a
Prelude.Nothing,
      $sel:associationId:DirectConnectGatewayAssociation' :: Maybe Text
associationId = forall a. Maybe a
Prelude.Nothing,
      $sel:associationState:DirectConnectGatewayAssociation' :: Maybe DirectConnectGatewayAssociationState
associationState = forall a. Maybe a
Prelude.Nothing,
      $sel:directConnectGatewayId:DirectConnectGatewayAssociation' :: Maybe Text
directConnectGatewayId = forall a. Maybe a
Prelude.Nothing,
      $sel:directConnectGatewayOwnerAccount:DirectConnectGatewayAssociation' :: Maybe Text
directConnectGatewayOwnerAccount =
        forall a. Maybe a
Prelude.Nothing,
      $sel:stateChangeError:DirectConnectGatewayAssociation' :: Maybe Text
stateChangeError = forall a. Maybe a
Prelude.Nothing,
      $sel:virtualGatewayId:DirectConnectGatewayAssociation' :: Maybe Text
virtualGatewayId = forall a. Maybe a
Prelude.Nothing,
      $sel:virtualGatewayOwnerAccount:DirectConnectGatewayAssociation' :: Maybe Text
virtualGatewayOwnerAccount =
        forall a. Maybe a
Prelude.Nothing,
      $sel:virtualGatewayRegion:DirectConnectGatewayAssociation' :: Maybe Text
virtualGatewayRegion = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon VPC prefixes to advertise to the Direct Connect gateway.
directConnectGatewayAssociation_allowedPrefixesToDirectConnectGateway :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe [RouteFilterPrefix])
directConnectGatewayAssociation_allowedPrefixesToDirectConnectGateway :: Lens' DirectConnectGatewayAssociation (Maybe [RouteFilterPrefix])
directConnectGatewayAssociation_allowedPrefixesToDirectConnectGateway = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Information about the associated gateway.
directConnectGatewayAssociation_associatedGateway :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe AssociatedGateway)
directConnectGatewayAssociation_associatedGateway :: Lens' DirectConnectGatewayAssociation (Maybe AssociatedGateway)
directConnectGatewayAssociation_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 Direct Connect gateway association.
directConnectGatewayAssociation_associationId :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe Prelude.Text)
directConnectGatewayAssociation_associationId :: Lens' DirectConnectGatewayAssociation (Maybe Text)
directConnectGatewayAssociation_associationId = 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 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 :: Lens'
  DirectConnectGatewayAssociation
  (Maybe DirectConnectGatewayAssociationState)
directConnectGatewayAssociation_associationState = 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)

-- | The ID of the Direct Connect gateway.
directConnectGatewayAssociation_directConnectGatewayId :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe Prelude.Text)
directConnectGatewayAssociation_directConnectGatewayId :: Lens' DirectConnectGatewayAssociation (Maybe Text)
directConnectGatewayAssociation_directConnectGatewayId = 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 associated
-- gateway.
directConnectGatewayAssociation_directConnectGatewayOwnerAccount :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe Prelude.Text)
directConnectGatewayAssociation_directConnectGatewayOwnerAccount :: Lens' DirectConnectGatewayAssociation (Maybe Text)
directConnectGatewayAssociation_directConnectGatewayOwnerAccount = 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 error message if the state of an object failed to advance.
directConnectGatewayAssociation_stateChangeError :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe Prelude.Text)
directConnectGatewayAssociation_stateChangeError :: Lens' DirectConnectGatewayAssociation (Maybe Text)
directConnectGatewayAssociation_stateChangeError = 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 ID of the virtual private gateway. Applies only to private virtual
-- interfaces.
directConnectGatewayAssociation_virtualGatewayId :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe Prelude.Text)
directConnectGatewayAssociation_virtualGatewayId :: Lens' DirectConnectGatewayAssociation (Maybe Text)
directConnectGatewayAssociation_virtualGatewayId = 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 Amazon Web Services account that owns the virtual private
-- gateway.
directConnectGatewayAssociation_virtualGatewayOwnerAccount :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe Prelude.Text)
directConnectGatewayAssociation_virtualGatewayOwnerAccount :: Lens' DirectConnectGatewayAssociation (Maybe Text)
directConnectGatewayAssociation_virtualGatewayOwnerAccount = 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 Amazon Web Services Region where the virtual private gateway is
-- located.
directConnectGatewayAssociation_virtualGatewayRegion :: Lens.Lens' DirectConnectGatewayAssociation (Prelude.Maybe Prelude.Text)
directConnectGatewayAssociation_virtualGatewayRegion :: Lens' DirectConnectGatewayAssociation (Maybe Text)
directConnectGatewayAssociation_virtualGatewayRegion = 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)

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

instance
  Prelude.Hashable
    DirectConnectGatewayAssociation
  where
  hashWithSalt :: Int -> DirectConnectGatewayAssociation -> Int
hashWithSalt
    Int
_salt
    DirectConnectGatewayAssociation' {Maybe [RouteFilterPrefix]
Maybe Text
Maybe DirectConnectGatewayAssociationState
Maybe AssociatedGateway
virtualGatewayRegion :: Maybe Text
virtualGatewayOwnerAccount :: Maybe Text
virtualGatewayId :: Maybe Text
stateChangeError :: Maybe Text
directConnectGatewayOwnerAccount :: Maybe Text
directConnectGatewayId :: Maybe Text
associationState :: Maybe DirectConnectGatewayAssociationState
associationId :: Maybe Text
associatedGateway :: Maybe AssociatedGateway
allowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
$sel:virtualGatewayRegion:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
$sel:virtualGatewayOwnerAccount:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
$sel:virtualGatewayId:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
$sel:stateChangeError:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
$sel:directConnectGatewayOwnerAccount:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
$sel:directConnectGatewayId:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
$sel:associationState:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation
-> Maybe DirectConnectGatewayAssociationState
$sel:associationId:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
$sel:associatedGateway:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe AssociatedGateway
$sel:allowedPrefixesToDirectConnectGateway:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe [RouteFilterPrefix]
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [RouteFilterPrefix]
allowedPrefixesToDirectConnectGateway
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AssociatedGateway
associatedGateway
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
associationId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DirectConnectGatewayAssociationState
associationState
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
directConnectGatewayId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
directConnectGatewayOwnerAccount
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stateChangeError
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
virtualGatewayId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
virtualGatewayOwnerAccount
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
virtualGatewayRegion

instance
  Prelude.NFData
    DirectConnectGatewayAssociation
  where
  rnf :: DirectConnectGatewayAssociation -> ()
rnf DirectConnectGatewayAssociation' {Maybe [RouteFilterPrefix]
Maybe Text
Maybe DirectConnectGatewayAssociationState
Maybe AssociatedGateway
virtualGatewayRegion :: Maybe Text
virtualGatewayOwnerAccount :: Maybe Text
virtualGatewayId :: Maybe Text
stateChangeError :: Maybe Text
directConnectGatewayOwnerAccount :: Maybe Text
directConnectGatewayId :: Maybe Text
associationState :: Maybe DirectConnectGatewayAssociationState
associationId :: Maybe Text
associatedGateway :: Maybe AssociatedGateway
allowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
$sel:virtualGatewayRegion:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
$sel:virtualGatewayOwnerAccount:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
$sel:virtualGatewayId:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
$sel:stateChangeError:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
$sel:directConnectGatewayOwnerAccount:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
$sel:directConnectGatewayId:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
$sel:associationState:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation
-> Maybe DirectConnectGatewayAssociationState
$sel:associationId:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe Text
$sel:associatedGateway:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe AssociatedGateway
$sel:allowedPrefixesToDirectConnectGateway:DirectConnectGatewayAssociation' :: DirectConnectGatewayAssociation -> Maybe [RouteFilterPrefix]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [RouteFilterPrefix]
allowedPrefixesToDirectConnectGateway
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AssociatedGateway
associatedGateway
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
associationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DirectConnectGatewayAssociationState
associationState
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
directConnectGatewayId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
directConnectGatewayOwnerAccount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stateChangeError
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
virtualGatewayId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
virtualGatewayOwnerAccount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
virtualGatewayRegion