{-# 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.ECS.Types.ClusterSetting where
import qualified Amazonka.Core as Core
import Amazonka.ECS.Types.ClusterSettingName
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ClusterSetting = ClusterSetting'
{
ClusterSetting -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
ClusterSetting -> Maybe ClusterSettingName
name :: Prelude.Maybe ClusterSettingName
}
deriving (ClusterSetting -> ClusterSetting -> Bool
(ClusterSetting -> ClusterSetting -> Bool)
-> (ClusterSetting -> ClusterSetting -> Bool) -> Eq ClusterSetting
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClusterSetting -> ClusterSetting -> Bool
$c/= :: ClusterSetting -> ClusterSetting -> Bool
== :: ClusterSetting -> ClusterSetting -> Bool
$c== :: ClusterSetting -> ClusterSetting -> Bool
Prelude.Eq, ReadPrec [ClusterSetting]
ReadPrec ClusterSetting
Int -> ReadS ClusterSetting
ReadS [ClusterSetting]
(Int -> ReadS ClusterSetting)
-> ReadS [ClusterSetting]
-> ReadPrec ClusterSetting
-> ReadPrec [ClusterSetting]
-> Read ClusterSetting
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClusterSetting]
$creadListPrec :: ReadPrec [ClusterSetting]
readPrec :: ReadPrec ClusterSetting
$creadPrec :: ReadPrec ClusterSetting
readList :: ReadS [ClusterSetting]
$creadList :: ReadS [ClusterSetting]
readsPrec :: Int -> ReadS ClusterSetting
$creadsPrec :: Int -> ReadS ClusterSetting
Prelude.Read, Int -> ClusterSetting -> ShowS
[ClusterSetting] -> ShowS
ClusterSetting -> String
(Int -> ClusterSetting -> ShowS)
-> (ClusterSetting -> String)
-> ([ClusterSetting] -> ShowS)
-> Show ClusterSetting
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClusterSetting] -> ShowS
$cshowList :: [ClusterSetting] -> ShowS
show :: ClusterSetting -> String
$cshow :: ClusterSetting -> String
showsPrec :: Int -> ClusterSetting -> ShowS
$cshowsPrec :: Int -> ClusterSetting -> ShowS
Prelude.Show, (forall x. ClusterSetting -> Rep ClusterSetting x)
-> (forall x. Rep ClusterSetting x -> ClusterSetting)
-> Generic ClusterSetting
forall x. Rep ClusterSetting x -> ClusterSetting
forall x. ClusterSetting -> Rep ClusterSetting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClusterSetting x -> ClusterSetting
$cfrom :: forall x. ClusterSetting -> Rep ClusterSetting x
Prelude.Generic)
newClusterSetting ::
ClusterSetting
newClusterSetting :: ClusterSetting
newClusterSetting =
ClusterSetting' :: Maybe Text -> Maybe ClusterSettingName -> ClusterSetting
ClusterSetting'
{ $sel:value:ClusterSetting' :: Maybe Text
value = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:ClusterSetting' :: Maybe ClusterSettingName
name = Maybe ClusterSettingName
forall a. Maybe a
Prelude.Nothing
}
clusterSetting_value :: Lens.Lens' ClusterSetting (Prelude.Maybe Prelude.Text)
clusterSetting_value :: (Maybe Text -> f (Maybe Text))
-> ClusterSetting -> f ClusterSetting
clusterSetting_value = (ClusterSetting -> Maybe Text)
-> (ClusterSetting -> Maybe Text -> ClusterSetting)
-> Lens ClusterSetting ClusterSetting (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSetting' {Maybe Text
value :: Maybe Text
$sel:value:ClusterSetting' :: ClusterSetting -> Maybe Text
value} -> Maybe Text
value) (\s :: ClusterSetting
s@ClusterSetting' {} Maybe Text
a -> ClusterSetting
s {$sel:value:ClusterSetting' :: Maybe Text
value = Maybe Text
a} :: ClusterSetting)
clusterSetting_name :: Lens.Lens' ClusterSetting (Prelude.Maybe ClusterSettingName)
clusterSetting_name :: (Maybe ClusterSettingName -> f (Maybe ClusterSettingName))
-> ClusterSetting -> f ClusterSetting
clusterSetting_name = (ClusterSetting -> Maybe ClusterSettingName)
-> (ClusterSetting -> Maybe ClusterSettingName -> ClusterSetting)
-> Lens
ClusterSetting
ClusterSetting
(Maybe ClusterSettingName)
(Maybe ClusterSettingName)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSetting' {Maybe ClusterSettingName
name :: Maybe ClusterSettingName
$sel:name:ClusterSetting' :: ClusterSetting -> Maybe ClusterSettingName
name} -> Maybe ClusterSettingName
name) (\s :: ClusterSetting
s@ClusterSetting' {} Maybe ClusterSettingName
a -> ClusterSetting
s {$sel:name:ClusterSetting' :: Maybe ClusterSettingName
name = Maybe ClusterSettingName
a} :: ClusterSetting)
instance Core.FromJSON ClusterSetting where
parseJSON :: Value -> Parser ClusterSetting
parseJSON =
String
-> (Object -> Parser ClusterSetting)
-> Value
-> Parser ClusterSetting
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ClusterSetting"
( \Object
x ->
Maybe Text -> Maybe ClusterSettingName -> ClusterSetting
ClusterSetting'
(Maybe Text -> Maybe ClusterSettingName -> ClusterSetting)
-> Parser (Maybe Text)
-> Parser (Maybe ClusterSettingName -> ClusterSetting)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"value") Parser (Maybe ClusterSettingName -> ClusterSetting)
-> Parser (Maybe ClusterSettingName) -> Parser ClusterSetting
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ClusterSettingName)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
)
instance Prelude.Hashable ClusterSetting
instance Prelude.NFData ClusterSetting
instance Core.ToJSON ClusterSetting where
toJSON :: ClusterSetting -> Value
toJSON ClusterSetting' {Maybe Text
Maybe ClusterSettingName
name :: Maybe ClusterSettingName
value :: Maybe Text
$sel:name:ClusterSetting' :: ClusterSetting -> Maybe ClusterSettingName
$sel:value:ClusterSetting' :: ClusterSetting -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"value" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
value,
(Text
"name" Text -> ClusterSettingName -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ClusterSettingName -> Pair)
-> Maybe ClusterSettingName -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ClusterSettingName
name
]
)