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