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

import qualified Amazonka.Core as Core
import Amazonka.DirectConnect.Types.DirectConnectGatewayAttachmentState
import Amazonka.DirectConnect.Types.DirectConnectGatewayAttachmentType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about an attachment between a Direct Connect gateway and a
-- virtual interface.
--
-- /See:/ 'newDirectConnectGatewayAttachment' smart constructor.
data DirectConnectGatewayAttachment = DirectConnectGatewayAttachment'
  { -- | The ID of the Direct Connect gateway.
    DirectConnectGatewayAttachment -> Maybe Text
directConnectGatewayId :: Prelude.Maybe Prelude.Text,
    -- | The state of the attachment. The following are the possible values:
    --
    -- -   @attaching@: The initial state after a virtual interface is created
    --     using the Direct Connect gateway.
    --
    -- -   @attached@: The Direct Connect gateway and virtual interface are
    --     attached and ready to pass traffic.
    --
    -- -   @detaching@: The initial state after calling DeleteVirtualInterface.
    --
    -- -   @detached@: The virtual interface is detached from the Direct
    --     Connect gateway. Traffic flow between the Direct Connect gateway and
    --     virtual interface is stopped.
    DirectConnectGatewayAttachment
-> Maybe DirectConnectGatewayAttachmentState
attachmentState :: Prelude.Maybe DirectConnectGatewayAttachmentState,
    -- | The error message if the state of an object failed to advance.
    DirectConnectGatewayAttachment -> Maybe Text
stateChangeError :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services Region where the virtual interface is located.
    DirectConnectGatewayAttachment -> Maybe Text
virtualInterfaceRegion :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Amazon Web Services account that owns the virtual
    -- interface.
    DirectConnectGatewayAttachment -> Maybe Text
virtualInterfaceOwnerAccount :: Prelude.Maybe Prelude.Text,
    -- | The ID of the virtual interface.
    DirectConnectGatewayAttachment -> Maybe Text
virtualInterfaceId :: Prelude.Maybe Prelude.Text,
    -- | The type of attachment.
    DirectConnectGatewayAttachment
-> Maybe DirectConnectGatewayAttachmentType
attachmentType :: Prelude.Maybe DirectConnectGatewayAttachmentType
  }
  deriving (DirectConnectGatewayAttachment
-> DirectConnectGatewayAttachment -> Bool
(DirectConnectGatewayAttachment
 -> DirectConnectGatewayAttachment -> Bool)
-> (DirectConnectGatewayAttachment
    -> DirectConnectGatewayAttachment -> Bool)
-> Eq DirectConnectGatewayAttachment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DirectConnectGatewayAttachment
-> DirectConnectGatewayAttachment -> Bool
$c/= :: DirectConnectGatewayAttachment
-> DirectConnectGatewayAttachment -> Bool
== :: DirectConnectGatewayAttachment
-> DirectConnectGatewayAttachment -> Bool
$c== :: DirectConnectGatewayAttachment
-> DirectConnectGatewayAttachment -> Bool
Prelude.Eq, ReadPrec [DirectConnectGatewayAttachment]
ReadPrec DirectConnectGatewayAttachment
Int -> ReadS DirectConnectGatewayAttachment
ReadS [DirectConnectGatewayAttachment]
(Int -> ReadS DirectConnectGatewayAttachment)
-> ReadS [DirectConnectGatewayAttachment]
-> ReadPrec DirectConnectGatewayAttachment
-> ReadPrec [DirectConnectGatewayAttachment]
-> Read DirectConnectGatewayAttachment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DirectConnectGatewayAttachment]
$creadListPrec :: ReadPrec [DirectConnectGatewayAttachment]
readPrec :: ReadPrec DirectConnectGatewayAttachment
$creadPrec :: ReadPrec DirectConnectGatewayAttachment
readList :: ReadS [DirectConnectGatewayAttachment]
$creadList :: ReadS [DirectConnectGatewayAttachment]
readsPrec :: Int -> ReadS DirectConnectGatewayAttachment
$creadsPrec :: Int -> ReadS DirectConnectGatewayAttachment
Prelude.Read, Int -> DirectConnectGatewayAttachment -> ShowS
[DirectConnectGatewayAttachment] -> ShowS
DirectConnectGatewayAttachment -> String
(Int -> DirectConnectGatewayAttachment -> ShowS)
-> (DirectConnectGatewayAttachment -> String)
-> ([DirectConnectGatewayAttachment] -> ShowS)
-> Show DirectConnectGatewayAttachment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DirectConnectGatewayAttachment] -> ShowS
$cshowList :: [DirectConnectGatewayAttachment] -> ShowS
show :: DirectConnectGatewayAttachment -> String
$cshow :: DirectConnectGatewayAttachment -> String
showsPrec :: Int -> DirectConnectGatewayAttachment -> ShowS
$cshowsPrec :: Int -> DirectConnectGatewayAttachment -> ShowS
Prelude.Show, (forall x.
 DirectConnectGatewayAttachment
 -> Rep DirectConnectGatewayAttachment x)
-> (forall x.
    Rep DirectConnectGatewayAttachment x
    -> DirectConnectGatewayAttachment)
-> Generic DirectConnectGatewayAttachment
forall x.
Rep DirectConnectGatewayAttachment x
-> DirectConnectGatewayAttachment
forall x.
DirectConnectGatewayAttachment
-> Rep DirectConnectGatewayAttachment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DirectConnectGatewayAttachment x
-> DirectConnectGatewayAttachment
$cfrom :: forall x.
DirectConnectGatewayAttachment
-> Rep DirectConnectGatewayAttachment x
Prelude.Generic)

-- |
-- Create a value of 'DirectConnectGatewayAttachment' 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:
--
-- 'directConnectGatewayId', 'directConnectGatewayAttachment_directConnectGatewayId' - The ID of the Direct Connect gateway.
--
-- 'attachmentState', 'directConnectGatewayAttachment_attachmentState' - The state of the attachment. The following are the possible values:
--
-- -   @attaching@: The initial state after a virtual interface is created
--     using the Direct Connect gateway.
--
-- -   @attached@: The Direct Connect gateway and virtual interface are
--     attached and ready to pass traffic.
--
-- -   @detaching@: The initial state after calling DeleteVirtualInterface.
--
-- -   @detached@: The virtual interface is detached from the Direct
--     Connect gateway. Traffic flow between the Direct Connect gateway and
--     virtual interface is stopped.
--
-- 'stateChangeError', 'directConnectGatewayAttachment_stateChangeError' - The error message if the state of an object failed to advance.
--
-- 'virtualInterfaceRegion', 'directConnectGatewayAttachment_virtualInterfaceRegion' - The Amazon Web Services Region where the virtual interface is located.
--
-- 'virtualInterfaceOwnerAccount', 'directConnectGatewayAttachment_virtualInterfaceOwnerAccount' - The ID of the Amazon Web Services account that owns the virtual
-- interface.
--
-- 'virtualInterfaceId', 'directConnectGatewayAttachment_virtualInterfaceId' - The ID of the virtual interface.
--
-- 'attachmentType', 'directConnectGatewayAttachment_attachmentType' - The type of attachment.
newDirectConnectGatewayAttachment ::
  DirectConnectGatewayAttachment
newDirectConnectGatewayAttachment :: DirectConnectGatewayAttachment
newDirectConnectGatewayAttachment =
  DirectConnectGatewayAttachment' :: Maybe Text
-> Maybe DirectConnectGatewayAttachmentState
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DirectConnectGatewayAttachmentType
-> DirectConnectGatewayAttachment
DirectConnectGatewayAttachment'
    { $sel:directConnectGatewayId:DirectConnectGatewayAttachment' :: Maybe Text
directConnectGatewayId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attachmentState:DirectConnectGatewayAttachment' :: Maybe DirectConnectGatewayAttachmentState
attachmentState = Maybe DirectConnectGatewayAttachmentState
forall a. Maybe a
Prelude.Nothing,
      $sel:stateChangeError:DirectConnectGatewayAttachment' :: Maybe Text
stateChangeError = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:virtualInterfaceRegion:DirectConnectGatewayAttachment' :: Maybe Text
virtualInterfaceRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:virtualInterfaceOwnerAccount:DirectConnectGatewayAttachment' :: Maybe Text
virtualInterfaceOwnerAccount =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:virtualInterfaceId:DirectConnectGatewayAttachment' :: Maybe Text
virtualInterfaceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attachmentType:DirectConnectGatewayAttachment' :: Maybe DirectConnectGatewayAttachmentType
attachmentType = Maybe DirectConnectGatewayAttachmentType
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The state of the attachment. The following are the possible values:
--
-- -   @attaching@: The initial state after a virtual interface is created
--     using the Direct Connect gateway.
--
-- -   @attached@: The Direct Connect gateway and virtual interface are
--     attached and ready to pass traffic.
--
-- -   @detaching@: The initial state after calling DeleteVirtualInterface.
--
-- -   @detached@: The virtual interface is detached from the Direct
--     Connect gateway. Traffic flow between the Direct Connect gateway and
--     virtual interface is stopped.
directConnectGatewayAttachment_attachmentState :: Lens.Lens' DirectConnectGatewayAttachment (Prelude.Maybe DirectConnectGatewayAttachmentState)
directConnectGatewayAttachment_attachmentState :: (Maybe DirectConnectGatewayAttachmentState
 -> f (Maybe DirectConnectGatewayAttachmentState))
-> DirectConnectGatewayAttachment
-> f DirectConnectGatewayAttachment
directConnectGatewayAttachment_attachmentState = (DirectConnectGatewayAttachment
 -> Maybe DirectConnectGatewayAttachmentState)
-> (DirectConnectGatewayAttachment
    -> Maybe DirectConnectGatewayAttachmentState
    -> DirectConnectGatewayAttachment)
-> Lens
     DirectConnectGatewayAttachment
     DirectConnectGatewayAttachment
     (Maybe DirectConnectGatewayAttachmentState)
     (Maybe DirectConnectGatewayAttachmentState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGatewayAttachment' {Maybe DirectConnectGatewayAttachmentState
attachmentState :: Maybe DirectConnectGatewayAttachmentState
$sel:attachmentState:DirectConnectGatewayAttachment' :: DirectConnectGatewayAttachment
-> Maybe DirectConnectGatewayAttachmentState
attachmentState} -> Maybe DirectConnectGatewayAttachmentState
attachmentState) (\s :: DirectConnectGatewayAttachment
s@DirectConnectGatewayAttachment' {} Maybe DirectConnectGatewayAttachmentState
a -> DirectConnectGatewayAttachment
s {$sel:attachmentState:DirectConnectGatewayAttachment' :: Maybe DirectConnectGatewayAttachmentState
attachmentState = Maybe DirectConnectGatewayAttachmentState
a} :: DirectConnectGatewayAttachment)

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

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

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

-- | The ID of the virtual interface.
directConnectGatewayAttachment_virtualInterfaceId :: Lens.Lens' DirectConnectGatewayAttachment (Prelude.Maybe Prelude.Text)
directConnectGatewayAttachment_virtualInterfaceId :: (Maybe Text -> f (Maybe Text))
-> DirectConnectGatewayAttachment
-> f DirectConnectGatewayAttachment
directConnectGatewayAttachment_virtualInterfaceId = (DirectConnectGatewayAttachment -> Maybe Text)
-> (DirectConnectGatewayAttachment
    -> Maybe Text -> DirectConnectGatewayAttachment)
-> Lens
     DirectConnectGatewayAttachment
     DirectConnectGatewayAttachment
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGatewayAttachment' {Maybe Text
virtualInterfaceId :: Maybe Text
$sel:virtualInterfaceId:DirectConnectGatewayAttachment' :: DirectConnectGatewayAttachment -> Maybe Text
virtualInterfaceId} -> Maybe Text
virtualInterfaceId) (\s :: DirectConnectGatewayAttachment
s@DirectConnectGatewayAttachment' {} Maybe Text
a -> DirectConnectGatewayAttachment
s {$sel:virtualInterfaceId:DirectConnectGatewayAttachment' :: Maybe Text
virtualInterfaceId = Maybe Text
a} :: DirectConnectGatewayAttachment)

-- | The type of attachment.
directConnectGatewayAttachment_attachmentType :: Lens.Lens' DirectConnectGatewayAttachment (Prelude.Maybe DirectConnectGatewayAttachmentType)
directConnectGatewayAttachment_attachmentType :: (Maybe DirectConnectGatewayAttachmentType
 -> f (Maybe DirectConnectGatewayAttachmentType))
-> DirectConnectGatewayAttachment
-> f DirectConnectGatewayAttachment
directConnectGatewayAttachment_attachmentType = (DirectConnectGatewayAttachment
 -> Maybe DirectConnectGatewayAttachmentType)
-> (DirectConnectGatewayAttachment
    -> Maybe DirectConnectGatewayAttachmentType
    -> DirectConnectGatewayAttachment)
-> Lens
     DirectConnectGatewayAttachment
     DirectConnectGatewayAttachment
     (Maybe DirectConnectGatewayAttachmentType)
     (Maybe DirectConnectGatewayAttachmentType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGatewayAttachment' {Maybe DirectConnectGatewayAttachmentType
attachmentType :: Maybe DirectConnectGatewayAttachmentType
$sel:attachmentType:DirectConnectGatewayAttachment' :: DirectConnectGatewayAttachment
-> Maybe DirectConnectGatewayAttachmentType
attachmentType} -> Maybe DirectConnectGatewayAttachmentType
attachmentType) (\s :: DirectConnectGatewayAttachment
s@DirectConnectGatewayAttachment' {} Maybe DirectConnectGatewayAttachmentType
a -> DirectConnectGatewayAttachment
s {$sel:attachmentType:DirectConnectGatewayAttachment' :: Maybe DirectConnectGatewayAttachmentType
attachmentType = Maybe DirectConnectGatewayAttachmentType
a} :: DirectConnectGatewayAttachment)

instance Core.FromJSON DirectConnectGatewayAttachment where
  parseJSON :: Value -> Parser DirectConnectGatewayAttachment
parseJSON =
    String
-> (Object -> Parser DirectConnectGatewayAttachment)
-> Value
-> Parser DirectConnectGatewayAttachment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DirectConnectGatewayAttachment"
      ( \Object
x ->
          Maybe Text
-> Maybe DirectConnectGatewayAttachmentState
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DirectConnectGatewayAttachmentType
-> DirectConnectGatewayAttachment
DirectConnectGatewayAttachment'
            (Maybe Text
 -> Maybe DirectConnectGatewayAttachmentState
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe DirectConnectGatewayAttachmentType
 -> DirectConnectGatewayAttachment)
-> Parser (Maybe Text)
-> Parser
     (Maybe DirectConnectGatewayAttachmentState
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe DirectConnectGatewayAttachmentType
      -> DirectConnectGatewayAttachment)
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
"directConnectGatewayId")
            Parser
  (Maybe DirectConnectGatewayAttachmentState
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe DirectConnectGatewayAttachmentType
   -> DirectConnectGatewayAttachment)
-> Parser (Maybe DirectConnectGatewayAttachmentState)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe DirectConnectGatewayAttachmentType
      -> DirectConnectGatewayAttachment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe DirectConnectGatewayAttachmentState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"attachmentState")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe DirectConnectGatewayAttachmentType
   -> DirectConnectGatewayAttachment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe DirectConnectGatewayAttachmentType
      -> DirectConnectGatewayAttachment)
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 Text
   -> Maybe Text
   -> Maybe DirectConnectGatewayAttachmentType
   -> DirectConnectGatewayAttachment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe DirectConnectGatewayAttachmentType
      -> DirectConnectGatewayAttachment)
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
"virtualInterfaceRegion")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe DirectConnectGatewayAttachmentType
   -> DirectConnectGatewayAttachment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe DirectConnectGatewayAttachmentType
      -> DirectConnectGatewayAttachment)
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
"virtualInterfaceOwnerAccount")
            Parser
  (Maybe Text
   -> Maybe DirectConnectGatewayAttachmentType
   -> DirectConnectGatewayAttachment)
-> Parser (Maybe Text)
-> Parser
     (Maybe DirectConnectGatewayAttachmentType
      -> DirectConnectGatewayAttachment)
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
"virtualInterfaceId")
            Parser
  (Maybe DirectConnectGatewayAttachmentType
   -> DirectConnectGatewayAttachment)
-> Parser (Maybe DirectConnectGatewayAttachmentType)
-> Parser DirectConnectGatewayAttachment
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DirectConnectGatewayAttachmentType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"attachmentType")
      )

instance
  Prelude.Hashable
    DirectConnectGatewayAttachment

instance
  Prelude.NFData
    DirectConnectGatewayAttachment