{-# 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.DirectoryService.Types.Setting 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 Setting = Setting'
{
Setting -> Text
name :: Prelude.Text,
Setting -> Text
value :: Prelude.Text
}
deriving (Setting -> Setting -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Setting -> Setting -> Bool
$c/= :: Setting -> Setting -> Bool
== :: Setting -> Setting -> Bool
$c== :: Setting -> Setting -> Bool
Prelude.Eq, ReadPrec [Setting]
ReadPrec Setting
Int -> ReadS Setting
ReadS [Setting]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Setting]
$creadListPrec :: ReadPrec [Setting]
readPrec :: ReadPrec Setting
$creadPrec :: ReadPrec Setting
readList :: ReadS [Setting]
$creadList :: ReadS [Setting]
readsPrec :: Int -> ReadS Setting
$creadsPrec :: Int -> ReadS Setting
Prelude.Read, Int -> Setting -> ShowS
[Setting] -> ShowS
Setting -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Setting] -> ShowS
$cshowList :: [Setting] -> ShowS
show :: Setting -> String
$cshow :: Setting -> String
showsPrec :: Int -> Setting -> ShowS
$cshowsPrec :: Int -> Setting -> ShowS
Prelude.Show, forall x. Rep Setting x -> Setting
forall x. Setting -> Rep Setting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Setting x -> Setting
$cfrom :: forall x. Setting -> Rep Setting x
Prelude.Generic)
newSetting ::
Prelude.Text ->
Prelude.Text ->
Setting
newSetting :: Text -> Text -> Setting
newSetting Text
pName_ Text
pValue_ =
Setting' {$sel:name:Setting' :: Text
name = Text
pName_, $sel:value:Setting' :: Text
value = Text
pValue_}
setting_name :: Lens.Lens' Setting Prelude.Text
setting_name :: Lens' Setting Text
setting_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Setting' {Text
name :: Text
$sel:name:Setting' :: Setting -> Text
name} -> Text
name) (\s :: Setting
s@Setting' {} Text
a -> Setting
s {$sel:name:Setting' :: Text
name = Text
a} :: Setting)
setting_value :: Lens.Lens' Setting Prelude.Text
setting_value :: Lens' Setting Text
setting_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Setting' {Text
value :: Text
$sel:value:Setting' :: Setting -> Text
value} -> Text
value) (\s :: Setting
s@Setting' {} Text
a -> Setting
s {$sel:value:Setting' :: Text
value = Text
a} :: Setting)
instance Prelude.Hashable Setting where
hashWithSalt :: Int -> Setting -> Int
hashWithSalt Int
_salt Setting' {Text
value :: Text
name :: Text
$sel:value:Setting' :: Setting -> Text
$sel:name:Setting' :: Setting -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
value
instance Prelude.NFData Setting where
rnf :: Setting -> ()
rnf Setting' {Text
value :: Text
name :: Text
$sel:value:Setting' :: Setting -> Text
$sel:name:Setting' :: Setting -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
name seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
value
instance Data.ToJSON Setting where
toJSON :: Setting -> Value
toJSON Setting' {Text
value :: Text
name :: Text
$sel:value:Setting' :: Setting -> Text
$sel:name:Setting' :: Setting -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just (Key
"Value" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
value)
]
)