{-# 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.DAX.Types.NodeTypeSpecificValue
-- 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.DAX.Types.NodeTypeSpecificValue where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents a parameter value that is applicable to a particular node
-- type.
--
-- /See:/ 'newNodeTypeSpecificValue' smart constructor.
data NodeTypeSpecificValue = NodeTypeSpecificValue'
  { -- | The parameter value for this node type.
    NodeTypeSpecificValue -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
    -- | A node type to which the parameter value applies.
    NodeTypeSpecificValue -> Maybe Text
nodeType :: Prelude.Maybe Prelude.Text
  }
  deriving (NodeTypeSpecificValue -> NodeTypeSpecificValue -> Bool
(NodeTypeSpecificValue -> NodeTypeSpecificValue -> Bool)
-> (NodeTypeSpecificValue -> NodeTypeSpecificValue -> Bool)
-> Eq NodeTypeSpecificValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NodeTypeSpecificValue -> NodeTypeSpecificValue -> Bool
$c/= :: NodeTypeSpecificValue -> NodeTypeSpecificValue -> Bool
== :: NodeTypeSpecificValue -> NodeTypeSpecificValue -> Bool
$c== :: NodeTypeSpecificValue -> NodeTypeSpecificValue -> Bool
Prelude.Eq, ReadPrec [NodeTypeSpecificValue]
ReadPrec NodeTypeSpecificValue
Int -> ReadS NodeTypeSpecificValue
ReadS [NodeTypeSpecificValue]
(Int -> ReadS NodeTypeSpecificValue)
-> ReadS [NodeTypeSpecificValue]
-> ReadPrec NodeTypeSpecificValue
-> ReadPrec [NodeTypeSpecificValue]
-> Read NodeTypeSpecificValue
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NodeTypeSpecificValue]
$creadListPrec :: ReadPrec [NodeTypeSpecificValue]
readPrec :: ReadPrec NodeTypeSpecificValue
$creadPrec :: ReadPrec NodeTypeSpecificValue
readList :: ReadS [NodeTypeSpecificValue]
$creadList :: ReadS [NodeTypeSpecificValue]
readsPrec :: Int -> ReadS NodeTypeSpecificValue
$creadsPrec :: Int -> ReadS NodeTypeSpecificValue
Prelude.Read, Int -> NodeTypeSpecificValue -> ShowS
[NodeTypeSpecificValue] -> ShowS
NodeTypeSpecificValue -> String
(Int -> NodeTypeSpecificValue -> ShowS)
-> (NodeTypeSpecificValue -> String)
-> ([NodeTypeSpecificValue] -> ShowS)
-> Show NodeTypeSpecificValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NodeTypeSpecificValue] -> ShowS
$cshowList :: [NodeTypeSpecificValue] -> ShowS
show :: NodeTypeSpecificValue -> String
$cshow :: NodeTypeSpecificValue -> String
showsPrec :: Int -> NodeTypeSpecificValue -> ShowS
$cshowsPrec :: Int -> NodeTypeSpecificValue -> ShowS
Prelude.Show, (forall x. NodeTypeSpecificValue -> Rep NodeTypeSpecificValue x)
-> (forall x. Rep NodeTypeSpecificValue x -> NodeTypeSpecificValue)
-> Generic NodeTypeSpecificValue
forall x. Rep NodeTypeSpecificValue x -> NodeTypeSpecificValue
forall x. NodeTypeSpecificValue -> Rep NodeTypeSpecificValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NodeTypeSpecificValue x -> NodeTypeSpecificValue
$cfrom :: forall x. NodeTypeSpecificValue -> Rep NodeTypeSpecificValue x
Prelude.Generic)

-- |
-- Create a value of 'NodeTypeSpecificValue' 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:
--
-- 'value', 'nodeTypeSpecificValue_value' - The parameter value for this node type.
--
-- 'nodeType', 'nodeTypeSpecificValue_nodeType' - A node type to which the parameter value applies.
newNodeTypeSpecificValue ::
  NodeTypeSpecificValue
newNodeTypeSpecificValue :: NodeTypeSpecificValue
newNodeTypeSpecificValue =
  NodeTypeSpecificValue' :: Maybe Text -> Maybe Text -> NodeTypeSpecificValue
NodeTypeSpecificValue'
    { $sel:value:NodeTypeSpecificValue' :: Maybe Text
value = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nodeType:NodeTypeSpecificValue' :: Maybe Text
nodeType = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The parameter value for this node type.
nodeTypeSpecificValue_value :: Lens.Lens' NodeTypeSpecificValue (Prelude.Maybe Prelude.Text)
nodeTypeSpecificValue_value :: (Maybe Text -> f (Maybe Text))
-> NodeTypeSpecificValue -> f NodeTypeSpecificValue
nodeTypeSpecificValue_value = (NodeTypeSpecificValue -> Maybe Text)
-> (NodeTypeSpecificValue -> Maybe Text -> NodeTypeSpecificValue)
-> Lens
     NodeTypeSpecificValue
     NodeTypeSpecificValue
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeTypeSpecificValue' {Maybe Text
value :: Maybe Text
$sel:value:NodeTypeSpecificValue' :: NodeTypeSpecificValue -> Maybe Text
value} -> Maybe Text
value) (\s :: NodeTypeSpecificValue
s@NodeTypeSpecificValue' {} Maybe Text
a -> NodeTypeSpecificValue
s {$sel:value:NodeTypeSpecificValue' :: Maybe Text
value = Maybe Text
a} :: NodeTypeSpecificValue)

-- | A node type to which the parameter value applies.
nodeTypeSpecificValue_nodeType :: Lens.Lens' NodeTypeSpecificValue (Prelude.Maybe Prelude.Text)
nodeTypeSpecificValue_nodeType :: (Maybe Text -> f (Maybe Text))
-> NodeTypeSpecificValue -> f NodeTypeSpecificValue
nodeTypeSpecificValue_nodeType = (NodeTypeSpecificValue -> Maybe Text)
-> (NodeTypeSpecificValue -> Maybe Text -> NodeTypeSpecificValue)
-> Lens
     NodeTypeSpecificValue
     NodeTypeSpecificValue
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeTypeSpecificValue' {Maybe Text
nodeType :: Maybe Text
$sel:nodeType:NodeTypeSpecificValue' :: NodeTypeSpecificValue -> Maybe Text
nodeType} -> Maybe Text
nodeType) (\s :: NodeTypeSpecificValue
s@NodeTypeSpecificValue' {} Maybe Text
a -> NodeTypeSpecificValue
s {$sel:nodeType:NodeTypeSpecificValue' :: Maybe Text
nodeType = Maybe Text
a} :: NodeTypeSpecificValue)

instance Core.FromJSON NodeTypeSpecificValue where
  parseJSON :: Value -> Parser NodeTypeSpecificValue
parseJSON =
    String
-> (Object -> Parser NodeTypeSpecificValue)
-> Value
-> Parser NodeTypeSpecificValue
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"NodeTypeSpecificValue"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> NodeTypeSpecificValue
NodeTypeSpecificValue'
            (Maybe Text -> Maybe Text -> NodeTypeSpecificValue)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> NodeTypeSpecificValue)
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
"Value")
            Parser (Maybe Text -> NodeTypeSpecificValue)
-> Parser (Maybe Text) -> Parser NodeTypeSpecificValue
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
"NodeType")
      )

instance Prelude.Hashable NodeTypeSpecificValue

instance Prelude.NFData NodeTypeSpecificValue