{-# 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.EC2.Types.PropagatingVgw
-- 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.EC2.Types.PropagatingVgw where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import qualified Amazonka.Prelude as Prelude

-- | Describes a virtual private gateway propagating route.
--
-- /See:/ 'newPropagatingVgw' smart constructor.
data PropagatingVgw = PropagatingVgw'
  { -- | The ID of the virtual private gateway.
    PropagatingVgw -> Maybe Text
gatewayId :: Prelude.Maybe Prelude.Text
  }
  deriving (PropagatingVgw -> PropagatingVgw -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PropagatingVgw -> PropagatingVgw -> Bool
$c/= :: PropagatingVgw -> PropagatingVgw -> Bool
== :: PropagatingVgw -> PropagatingVgw -> Bool
$c== :: PropagatingVgw -> PropagatingVgw -> Bool
Prelude.Eq, ReadPrec [PropagatingVgw]
ReadPrec PropagatingVgw
Int -> ReadS PropagatingVgw
ReadS [PropagatingVgw]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PropagatingVgw]
$creadListPrec :: ReadPrec [PropagatingVgw]
readPrec :: ReadPrec PropagatingVgw
$creadPrec :: ReadPrec PropagatingVgw
readList :: ReadS [PropagatingVgw]
$creadList :: ReadS [PropagatingVgw]
readsPrec :: Int -> ReadS PropagatingVgw
$creadsPrec :: Int -> ReadS PropagatingVgw
Prelude.Read, Int -> PropagatingVgw -> ShowS
[PropagatingVgw] -> ShowS
PropagatingVgw -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PropagatingVgw] -> ShowS
$cshowList :: [PropagatingVgw] -> ShowS
show :: PropagatingVgw -> String
$cshow :: PropagatingVgw -> String
showsPrec :: Int -> PropagatingVgw -> ShowS
$cshowsPrec :: Int -> PropagatingVgw -> ShowS
Prelude.Show, forall x. Rep PropagatingVgw x -> PropagatingVgw
forall x. PropagatingVgw -> Rep PropagatingVgw x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PropagatingVgw x -> PropagatingVgw
$cfrom :: forall x. PropagatingVgw -> Rep PropagatingVgw x
Prelude.Generic)

-- |
-- Create a value of 'PropagatingVgw' 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:
--
-- 'gatewayId', 'propagatingVgw_gatewayId' - The ID of the virtual private gateway.
newPropagatingVgw ::
  PropagatingVgw
newPropagatingVgw :: PropagatingVgw
newPropagatingVgw =
  PropagatingVgw' {$sel:gatewayId:PropagatingVgw' :: Maybe Text
gatewayId = forall a. Maybe a
Prelude.Nothing}

-- | The ID of the virtual private gateway.
propagatingVgw_gatewayId :: Lens.Lens' PropagatingVgw (Prelude.Maybe Prelude.Text)
propagatingVgw_gatewayId :: Lens' PropagatingVgw (Maybe Text)
propagatingVgw_gatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PropagatingVgw' {Maybe Text
gatewayId :: Maybe Text
$sel:gatewayId:PropagatingVgw' :: PropagatingVgw -> Maybe Text
gatewayId} -> Maybe Text
gatewayId) (\s :: PropagatingVgw
s@PropagatingVgw' {} Maybe Text
a -> PropagatingVgw
s {$sel:gatewayId:PropagatingVgw' :: Maybe Text
gatewayId = Maybe Text
a} :: PropagatingVgw)

instance Data.FromXML PropagatingVgw where
  parseXML :: [Node] -> Either String PropagatingVgw
parseXML [Node]
x =
    Maybe Text -> PropagatingVgw
PropagatingVgw'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"gatewayId")

instance Prelude.Hashable PropagatingVgw where
  hashWithSalt :: Int -> PropagatingVgw -> Int
hashWithSalt Int
_salt PropagatingVgw' {Maybe Text
gatewayId :: Maybe Text
$sel:gatewayId:PropagatingVgw' :: PropagatingVgw -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gatewayId

instance Prelude.NFData PropagatingVgw where
  rnf :: PropagatingVgw -> ()
rnf PropagatingVgw' {Maybe Text
gatewayId :: Maybe Text
$sel:gatewayId:PropagatingVgw' :: PropagatingVgw -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gatewayId