{-# 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.AlexaBusiness.Types.RoomSkillParameter
-- 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.AlexaBusiness.Types.RoomSkillParameter where

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

-- | A skill parameter associated with a room.
--
-- /See:/ 'newRoomSkillParameter' smart constructor.
data RoomSkillParameter = RoomSkillParameter'
  { -- | The parameter key of a room skill parameter. ParameterKey is an
    -- enumerated type that only takes “DEFAULT” or “SCOPE” as valid values.
    RoomSkillParameter -> Text
parameterKey :: Prelude.Text,
    -- | The parameter value of a room skill parameter.
    RoomSkillParameter -> Text
parameterValue :: Prelude.Text
  }
  deriving (RoomSkillParameter -> RoomSkillParameter -> Bool
(RoomSkillParameter -> RoomSkillParameter -> Bool)
-> (RoomSkillParameter -> RoomSkillParameter -> Bool)
-> Eq RoomSkillParameter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RoomSkillParameter -> RoomSkillParameter -> Bool
$c/= :: RoomSkillParameter -> RoomSkillParameter -> Bool
== :: RoomSkillParameter -> RoomSkillParameter -> Bool
$c== :: RoomSkillParameter -> RoomSkillParameter -> Bool
Prelude.Eq, ReadPrec [RoomSkillParameter]
ReadPrec RoomSkillParameter
Int -> ReadS RoomSkillParameter
ReadS [RoomSkillParameter]
(Int -> ReadS RoomSkillParameter)
-> ReadS [RoomSkillParameter]
-> ReadPrec RoomSkillParameter
-> ReadPrec [RoomSkillParameter]
-> Read RoomSkillParameter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RoomSkillParameter]
$creadListPrec :: ReadPrec [RoomSkillParameter]
readPrec :: ReadPrec RoomSkillParameter
$creadPrec :: ReadPrec RoomSkillParameter
readList :: ReadS [RoomSkillParameter]
$creadList :: ReadS [RoomSkillParameter]
readsPrec :: Int -> ReadS RoomSkillParameter
$creadsPrec :: Int -> ReadS RoomSkillParameter
Prelude.Read, Int -> RoomSkillParameter -> ShowS
[RoomSkillParameter] -> ShowS
RoomSkillParameter -> String
(Int -> RoomSkillParameter -> ShowS)
-> (RoomSkillParameter -> String)
-> ([RoomSkillParameter] -> ShowS)
-> Show RoomSkillParameter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RoomSkillParameter] -> ShowS
$cshowList :: [RoomSkillParameter] -> ShowS
show :: RoomSkillParameter -> String
$cshow :: RoomSkillParameter -> String
showsPrec :: Int -> RoomSkillParameter -> ShowS
$cshowsPrec :: Int -> RoomSkillParameter -> ShowS
Prelude.Show, (forall x. RoomSkillParameter -> Rep RoomSkillParameter x)
-> (forall x. Rep RoomSkillParameter x -> RoomSkillParameter)
-> Generic RoomSkillParameter
forall x. Rep RoomSkillParameter x -> RoomSkillParameter
forall x. RoomSkillParameter -> Rep RoomSkillParameter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RoomSkillParameter x -> RoomSkillParameter
$cfrom :: forall x. RoomSkillParameter -> Rep RoomSkillParameter x
Prelude.Generic)

-- |
-- Create a value of 'RoomSkillParameter' 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:
--
-- 'parameterKey', 'roomSkillParameter_parameterKey' - The parameter key of a room skill parameter. ParameterKey is an
-- enumerated type that only takes “DEFAULT” or “SCOPE” as valid values.
--
-- 'parameterValue', 'roomSkillParameter_parameterValue' - The parameter value of a room skill parameter.
newRoomSkillParameter ::
  -- | 'parameterKey'
  Prelude.Text ->
  -- | 'parameterValue'
  Prelude.Text ->
  RoomSkillParameter
newRoomSkillParameter :: Text -> Text -> RoomSkillParameter
newRoomSkillParameter Text
pParameterKey_ Text
pParameterValue_ =
  RoomSkillParameter' :: Text -> Text -> RoomSkillParameter
RoomSkillParameter'
    { $sel:parameterKey:RoomSkillParameter' :: Text
parameterKey = Text
pParameterKey_,
      $sel:parameterValue:RoomSkillParameter' :: Text
parameterValue = Text
pParameterValue_
    }

-- | The parameter key of a room skill parameter. ParameterKey is an
-- enumerated type that only takes “DEFAULT” or “SCOPE” as valid values.
roomSkillParameter_parameterKey :: Lens.Lens' RoomSkillParameter Prelude.Text
roomSkillParameter_parameterKey :: (Text -> f Text) -> RoomSkillParameter -> f RoomSkillParameter
roomSkillParameter_parameterKey = (RoomSkillParameter -> Text)
-> (RoomSkillParameter -> Text -> RoomSkillParameter)
-> Lens RoomSkillParameter RoomSkillParameter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoomSkillParameter' {Text
parameterKey :: Text
$sel:parameterKey:RoomSkillParameter' :: RoomSkillParameter -> Text
parameterKey} -> Text
parameterKey) (\s :: RoomSkillParameter
s@RoomSkillParameter' {} Text
a -> RoomSkillParameter
s {$sel:parameterKey:RoomSkillParameter' :: Text
parameterKey = Text
a} :: RoomSkillParameter)

-- | The parameter value of a room skill parameter.
roomSkillParameter_parameterValue :: Lens.Lens' RoomSkillParameter Prelude.Text
roomSkillParameter_parameterValue :: (Text -> f Text) -> RoomSkillParameter -> f RoomSkillParameter
roomSkillParameter_parameterValue = (RoomSkillParameter -> Text)
-> (RoomSkillParameter -> Text -> RoomSkillParameter)
-> Lens RoomSkillParameter RoomSkillParameter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoomSkillParameter' {Text
parameterValue :: Text
$sel:parameterValue:RoomSkillParameter' :: RoomSkillParameter -> Text
parameterValue} -> Text
parameterValue) (\s :: RoomSkillParameter
s@RoomSkillParameter' {} Text
a -> RoomSkillParameter
s {$sel:parameterValue:RoomSkillParameter' :: Text
parameterValue = Text
a} :: RoomSkillParameter)

instance Core.FromJSON RoomSkillParameter where
  parseJSON :: Value -> Parser RoomSkillParameter
parseJSON =
    String
-> (Object -> Parser RoomSkillParameter)
-> Value
-> Parser RoomSkillParameter
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RoomSkillParameter"
      ( \Object
x ->
          Text -> Text -> RoomSkillParameter
RoomSkillParameter'
            (Text -> Text -> RoomSkillParameter)
-> Parser Text -> Parser (Text -> RoomSkillParameter)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ParameterKey")
            Parser (Text -> RoomSkillParameter)
-> Parser Text -> Parser RoomSkillParameter
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ParameterValue")
      )

instance Prelude.Hashable RoomSkillParameter

instance Prelude.NFData RoomSkillParameter

instance Core.ToJSON RoomSkillParameter where
  toJSON :: RoomSkillParameter -> Value
toJSON RoomSkillParameter' {Text
parameterValue :: Text
parameterKey :: Text
$sel:parameterValue:RoomSkillParameter' :: RoomSkillParameter -> Text
$sel:parameterKey:RoomSkillParameter' :: RoomSkillParameter -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ParameterKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
parameterKey),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ParameterValue" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
parameterValue)
          ]
      )