{-# 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 #-}
module Amazonka.AlexaBusiness.Types.RoomSkillParameter where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RoomSkillParameter = RoomSkillParameter'
{
RoomSkillParameter -> Text
parameterKey :: Prelude.Text,
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)
newRoomSkillParameter ::
Prelude.Text ->
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_
}
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)
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)
]
)