{-# 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.TransitGatewayPolicyRuleMetaData
-- 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.TransitGatewayPolicyRuleMetaData 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 the meta data tags associated with a transit gateway policy
-- rule.
--
-- /See:/ 'newTransitGatewayPolicyRuleMetaData' smart constructor.
data TransitGatewayPolicyRuleMetaData = TransitGatewayPolicyRuleMetaData'
  { -- | The key name for the transit gateway policy rule meta data tag.
    TransitGatewayPolicyRuleMetaData -> Maybe Text
metaDataKey :: Prelude.Maybe Prelude.Text,
    -- | The value of the key for the transit gateway policy rule meta data tag.
    TransitGatewayPolicyRuleMetaData -> Maybe Text
metaDataValue :: Prelude.Maybe Prelude.Text
  }
  deriving (TransitGatewayPolicyRuleMetaData
-> TransitGatewayPolicyRuleMetaData -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TransitGatewayPolicyRuleMetaData
-> TransitGatewayPolicyRuleMetaData -> Bool
$c/= :: TransitGatewayPolicyRuleMetaData
-> TransitGatewayPolicyRuleMetaData -> Bool
== :: TransitGatewayPolicyRuleMetaData
-> TransitGatewayPolicyRuleMetaData -> Bool
$c== :: TransitGatewayPolicyRuleMetaData
-> TransitGatewayPolicyRuleMetaData -> Bool
Prelude.Eq, ReadPrec [TransitGatewayPolicyRuleMetaData]
ReadPrec TransitGatewayPolicyRuleMetaData
Int -> ReadS TransitGatewayPolicyRuleMetaData
ReadS [TransitGatewayPolicyRuleMetaData]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TransitGatewayPolicyRuleMetaData]
$creadListPrec :: ReadPrec [TransitGatewayPolicyRuleMetaData]
readPrec :: ReadPrec TransitGatewayPolicyRuleMetaData
$creadPrec :: ReadPrec TransitGatewayPolicyRuleMetaData
readList :: ReadS [TransitGatewayPolicyRuleMetaData]
$creadList :: ReadS [TransitGatewayPolicyRuleMetaData]
readsPrec :: Int -> ReadS TransitGatewayPolicyRuleMetaData
$creadsPrec :: Int -> ReadS TransitGatewayPolicyRuleMetaData
Prelude.Read, Int -> TransitGatewayPolicyRuleMetaData -> ShowS
[TransitGatewayPolicyRuleMetaData] -> ShowS
TransitGatewayPolicyRuleMetaData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TransitGatewayPolicyRuleMetaData] -> ShowS
$cshowList :: [TransitGatewayPolicyRuleMetaData] -> ShowS
show :: TransitGatewayPolicyRuleMetaData -> String
$cshow :: TransitGatewayPolicyRuleMetaData -> String
showsPrec :: Int -> TransitGatewayPolicyRuleMetaData -> ShowS
$cshowsPrec :: Int -> TransitGatewayPolicyRuleMetaData -> ShowS
Prelude.Show, forall x.
Rep TransitGatewayPolicyRuleMetaData x
-> TransitGatewayPolicyRuleMetaData
forall x.
TransitGatewayPolicyRuleMetaData
-> Rep TransitGatewayPolicyRuleMetaData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TransitGatewayPolicyRuleMetaData x
-> TransitGatewayPolicyRuleMetaData
$cfrom :: forall x.
TransitGatewayPolicyRuleMetaData
-> Rep TransitGatewayPolicyRuleMetaData x
Prelude.Generic)

-- |
-- Create a value of 'TransitGatewayPolicyRuleMetaData' 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:
--
-- 'metaDataKey', 'transitGatewayPolicyRuleMetaData_metaDataKey' - The key name for the transit gateway policy rule meta data tag.
--
-- 'metaDataValue', 'transitGatewayPolicyRuleMetaData_metaDataValue' - The value of the key for the transit gateway policy rule meta data tag.
newTransitGatewayPolicyRuleMetaData ::
  TransitGatewayPolicyRuleMetaData
newTransitGatewayPolicyRuleMetaData :: TransitGatewayPolicyRuleMetaData
newTransitGatewayPolicyRuleMetaData =
  TransitGatewayPolicyRuleMetaData'
    { $sel:metaDataKey:TransitGatewayPolicyRuleMetaData' :: Maybe Text
metaDataKey =
        forall a. Maybe a
Prelude.Nothing,
      $sel:metaDataValue:TransitGatewayPolicyRuleMetaData' :: Maybe Text
metaDataValue = forall a. Maybe a
Prelude.Nothing
    }

-- | The key name for the transit gateway policy rule meta data tag.
transitGatewayPolicyRuleMetaData_metaDataKey :: Lens.Lens' TransitGatewayPolicyRuleMetaData (Prelude.Maybe Prelude.Text)
transitGatewayPolicyRuleMetaData_metaDataKey :: Lens' TransitGatewayPolicyRuleMetaData (Maybe Text)
transitGatewayPolicyRuleMetaData_metaDataKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransitGatewayPolicyRuleMetaData' {Maybe Text
metaDataKey :: Maybe Text
$sel:metaDataKey:TransitGatewayPolicyRuleMetaData' :: TransitGatewayPolicyRuleMetaData -> Maybe Text
metaDataKey} -> Maybe Text
metaDataKey) (\s :: TransitGatewayPolicyRuleMetaData
s@TransitGatewayPolicyRuleMetaData' {} Maybe Text
a -> TransitGatewayPolicyRuleMetaData
s {$sel:metaDataKey:TransitGatewayPolicyRuleMetaData' :: Maybe Text
metaDataKey = Maybe Text
a} :: TransitGatewayPolicyRuleMetaData)

-- | The value of the key for the transit gateway policy rule meta data tag.
transitGatewayPolicyRuleMetaData_metaDataValue :: Lens.Lens' TransitGatewayPolicyRuleMetaData (Prelude.Maybe Prelude.Text)
transitGatewayPolicyRuleMetaData_metaDataValue :: Lens' TransitGatewayPolicyRuleMetaData (Maybe Text)
transitGatewayPolicyRuleMetaData_metaDataValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransitGatewayPolicyRuleMetaData' {Maybe Text
metaDataValue :: Maybe Text
$sel:metaDataValue:TransitGatewayPolicyRuleMetaData' :: TransitGatewayPolicyRuleMetaData -> Maybe Text
metaDataValue} -> Maybe Text
metaDataValue) (\s :: TransitGatewayPolicyRuleMetaData
s@TransitGatewayPolicyRuleMetaData' {} Maybe Text
a -> TransitGatewayPolicyRuleMetaData
s {$sel:metaDataValue:TransitGatewayPolicyRuleMetaData' :: Maybe Text
metaDataValue = Maybe Text
a} :: TransitGatewayPolicyRuleMetaData)

instance
  Data.FromXML
    TransitGatewayPolicyRuleMetaData
  where
  parseXML :: [Node] -> Either String TransitGatewayPolicyRuleMetaData
parseXML [Node]
x =
    Maybe Text -> Maybe Text -> TransitGatewayPolicyRuleMetaData
TransitGatewayPolicyRuleMetaData'
      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
"metaDataKey")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"metaDataValue")

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

instance
  Prelude.NFData
    TransitGatewayPolicyRuleMetaData
  where
  rnf :: TransitGatewayPolicyRuleMetaData -> ()
rnf TransitGatewayPolicyRuleMetaData' {Maybe Text
metaDataValue :: Maybe Text
metaDataKey :: Maybe Text
$sel:metaDataValue:TransitGatewayPolicyRuleMetaData' :: TransitGatewayPolicyRuleMetaData -> Maybe Text
$sel:metaDataKey:TransitGatewayPolicyRuleMetaData' :: TransitGatewayPolicyRuleMetaData -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metaDataKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metaDataValue