{-# 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.ServerlessApplicationRepository.Types.ParameterValue where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ParameterValue = ParameterValue'
{
ParameterValue -> Text
value :: Prelude.Text,
ParameterValue -> Text
name :: Prelude.Text
}
deriving (ParameterValue -> ParameterValue -> Bool
(ParameterValue -> ParameterValue -> Bool)
-> (ParameterValue -> ParameterValue -> Bool) -> Eq ParameterValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParameterValue -> ParameterValue -> Bool
$c/= :: ParameterValue -> ParameterValue -> Bool
== :: ParameterValue -> ParameterValue -> Bool
$c== :: ParameterValue -> ParameterValue -> Bool
Prelude.Eq, ReadPrec [ParameterValue]
ReadPrec ParameterValue
Int -> ReadS ParameterValue
ReadS [ParameterValue]
(Int -> ReadS ParameterValue)
-> ReadS [ParameterValue]
-> ReadPrec ParameterValue
-> ReadPrec [ParameterValue]
-> Read ParameterValue
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParameterValue]
$creadListPrec :: ReadPrec [ParameterValue]
readPrec :: ReadPrec ParameterValue
$creadPrec :: ReadPrec ParameterValue
readList :: ReadS [ParameterValue]
$creadList :: ReadS [ParameterValue]
readsPrec :: Int -> ReadS ParameterValue
$creadsPrec :: Int -> ReadS ParameterValue
Prelude.Read, Int -> ParameterValue -> ShowS
[ParameterValue] -> ShowS
ParameterValue -> String
(Int -> ParameterValue -> ShowS)
-> (ParameterValue -> String)
-> ([ParameterValue] -> ShowS)
-> Show ParameterValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParameterValue] -> ShowS
$cshowList :: [ParameterValue] -> ShowS
show :: ParameterValue -> String
$cshow :: ParameterValue -> String
showsPrec :: Int -> ParameterValue -> ShowS
$cshowsPrec :: Int -> ParameterValue -> ShowS
Prelude.Show, (forall x. ParameterValue -> Rep ParameterValue x)
-> (forall x. Rep ParameterValue x -> ParameterValue)
-> Generic ParameterValue
forall x. Rep ParameterValue x -> ParameterValue
forall x. ParameterValue -> Rep ParameterValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ParameterValue x -> ParameterValue
$cfrom :: forall x. ParameterValue -> Rep ParameterValue x
Prelude.Generic)
newParameterValue ::
Prelude.Text ->
Prelude.Text ->
ParameterValue
newParameterValue :: Text -> Text -> ParameterValue
newParameterValue Text
pValue_ Text
pName_ =
ParameterValue' :: Text -> Text -> ParameterValue
ParameterValue' {$sel:value:ParameterValue' :: Text
value = Text
pValue_, $sel:name:ParameterValue' :: Text
name = Text
pName_}
parameterValue_value :: Lens.Lens' ParameterValue Prelude.Text
parameterValue_value :: (Text -> f Text) -> ParameterValue -> f ParameterValue
parameterValue_value = (ParameterValue -> Text)
-> (ParameterValue -> Text -> ParameterValue)
-> Lens ParameterValue ParameterValue Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterValue' {Text
value :: Text
$sel:value:ParameterValue' :: ParameterValue -> Text
value} -> Text
value) (\s :: ParameterValue
s@ParameterValue' {} Text
a -> ParameterValue
s {$sel:value:ParameterValue' :: Text
value = Text
a} :: ParameterValue)
parameterValue_name :: Lens.Lens' ParameterValue Prelude.Text
parameterValue_name :: (Text -> f Text) -> ParameterValue -> f ParameterValue
parameterValue_name = (ParameterValue -> Text)
-> (ParameterValue -> Text -> ParameterValue)
-> Lens ParameterValue ParameterValue Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterValue' {Text
name :: Text
$sel:name:ParameterValue' :: ParameterValue -> Text
name} -> Text
name) (\s :: ParameterValue
s@ParameterValue' {} Text
a -> ParameterValue
s {$sel:name:ParameterValue' :: Text
name = Text
a} :: ParameterValue)
instance Prelude.Hashable ParameterValue
instance Prelude.NFData ParameterValue
instance Core.ToJSON ParameterValue where
toJSON :: ParameterValue -> Value
toJSON ParameterValue' {Text
name :: Text
value :: Text
$sel:name:ParameterValue' :: ParameterValue -> Text
$sel:value:ParameterValue' :: ParameterValue -> 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
"value" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
value),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
]
)