{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data ParameterValue = ParameterValue'
{
ParameterValue -> Text
value :: Prelude.Text,
ParameterValue -> Text
name :: Prelude.Text
}
deriving (ParameterValue -> ParameterValue -> Bool
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]
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
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. 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' {$sel:value:ParameterValue' :: Text
value = Text
pValue_, $sel:name:ParameterValue' :: Text
name = Text
pName_}
parameterValue_value :: Lens.Lens' ParameterValue Prelude.Text
parameterValue_value :: Lens' ParameterValue Text
parameterValue_value = 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 :: Lens' ParameterValue Text
parameterValue_name = 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 where
hashWithSalt :: Int -> ParameterValue -> Int
hashWithSalt Int
_salt ParameterValue' {Text
name :: Text
value :: Text
$sel:name:ParameterValue' :: ParameterValue -> Text
$sel:value:ParameterValue' :: ParameterValue -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
value
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData ParameterValue where
rnf :: ParameterValue -> ()
rnf ParameterValue' {Text
name :: Text
value :: Text
$sel:name:ParameterValue' :: ParameterValue -> Text
$sel:value:ParameterValue' :: ParameterValue -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
value seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"value" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
value),
forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
]
)