{-# 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.Config.Types.StaticValue 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 StaticValue = StaticValue'
{
StaticValue -> [Text]
values :: [Prelude.Text]
}
deriving (StaticValue -> StaticValue -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StaticValue -> StaticValue -> Bool
$c/= :: StaticValue -> StaticValue -> Bool
== :: StaticValue -> StaticValue -> Bool
$c== :: StaticValue -> StaticValue -> Bool
Prelude.Eq, ReadPrec [StaticValue]
ReadPrec StaticValue
Int -> ReadS StaticValue
ReadS [StaticValue]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StaticValue]
$creadListPrec :: ReadPrec [StaticValue]
readPrec :: ReadPrec StaticValue
$creadPrec :: ReadPrec StaticValue
readList :: ReadS [StaticValue]
$creadList :: ReadS [StaticValue]
readsPrec :: Int -> ReadS StaticValue
$creadsPrec :: Int -> ReadS StaticValue
Prelude.Read, Int -> StaticValue -> ShowS
[StaticValue] -> ShowS
StaticValue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StaticValue] -> ShowS
$cshowList :: [StaticValue] -> ShowS
show :: StaticValue -> String
$cshow :: StaticValue -> String
showsPrec :: Int -> StaticValue -> ShowS
$cshowsPrec :: Int -> StaticValue -> ShowS
Prelude.Show, forall x. Rep StaticValue x -> StaticValue
forall x. StaticValue -> Rep StaticValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StaticValue x -> StaticValue
$cfrom :: forall x. StaticValue -> Rep StaticValue x
Prelude.Generic)
newStaticValue ::
StaticValue
newStaticValue :: StaticValue
newStaticValue =
StaticValue' {$sel:values:StaticValue' :: [Text]
values = forall a. Monoid a => a
Prelude.mempty}
staticValue_values :: Lens.Lens' StaticValue [Prelude.Text]
staticValue_values :: Lens' StaticValue [Text]
staticValue_values = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StaticValue' {[Text]
values :: [Text]
$sel:values:StaticValue' :: StaticValue -> [Text]
values} -> [Text]
values) (\s :: StaticValue
s@StaticValue' {} [Text]
a -> StaticValue
s {$sel:values:StaticValue' :: [Text]
values = [Text]
a} :: StaticValue) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON StaticValue where
parseJSON :: Value -> Parser StaticValue
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"StaticValue"
( \Object
x ->
[Text] -> StaticValue
StaticValue'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Values" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable StaticValue where
hashWithSalt :: Int -> StaticValue -> Int
hashWithSalt Int
_salt StaticValue' {[Text]
values :: [Text]
$sel:values:StaticValue' :: StaticValue -> [Text]
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
values
instance Prelude.NFData StaticValue where
rnf :: StaticValue -> ()
rnf StaticValue' {[Text]
values :: [Text]
$sel:values:StaticValue' :: StaticValue -> [Text]
..} = forall a. NFData a => a -> ()
Prelude.rnf [Text]
values
instance Data.ToJSON StaticValue where
toJSON :: StaticValue -> Value
toJSON StaticValue' {[Text]
values :: [Text]
$sel:values:StaticValue' :: StaticValue -> [Text]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"Values" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
values)]
)