{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data SystemControl = SystemControl'
{
SystemControl -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text,
SystemControl -> Maybe Text
value :: Prelude.Maybe Prelude.Text
}
deriving (SystemControl -> SystemControl -> Bool
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]
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
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. 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'
{ $sel:namespace:SystemControl' :: Maybe Text
namespace = forall a. Maybe a
Prelude.Nothing,
$sel:value:SystemControl' :: Maybe Text
value = forall a. Maybe a
Prelude.Nothing
}
systemControl_namespace :: Lens.Lens' SystemControl (Prelude.Maybe Prelude.Text)
systemControl_namespace :: Lens' SystemControl (Maybe Text)
systemControl_namespace = 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)
systemControl_value :: Lens.Lens' SystemControl (Prelude.Maybe Prelude.Text)
systemControl_value :: Lens' SystemControl (Maybe Text)
systemControl_value = 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)
instance Data.FromJSON SystemControl where
parseJSON :: Value -> Parser SystemControl
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SystemControl"
( \Object
x ->
Maybe Text -> Maybe Text -> SystemControl
SystemControl'
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
"namespace")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"value")
)
instance Prelude.Hashable SystemControl where
hashWithSalt :: Int -> SystemControl -> Int
hashWithSalt Int
_salt SystemControl' {Maybe Text
value :: Maybe Text
namespace :: Maybe Text
$sel:value:SystemControl' :: SystemControl -> Maybe Text
$sel:namespace:SystemControl' :: SystemControl -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
namespace
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
value
instance Prelude.NFData SystemControl where
rnf :: SystemControl -> ()
rnf SystemControl' {Maybe Text
value :: Maybe Text
namespace :: Maybe Text
$sel:value:SystemControl' :: SystemControl -> Maybe Text
$sel:namespace:SystemControl' :: SystemControl -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
namespace
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
value
instance Data.ToJSON SystemControl where
toJSON :: SystemControl -> Value
toJSON SystemControl' {Maybe Text
value :: Maybe Text
namespace :: Maybe Text
$sel:value:SystemControl' :: SystemControl -> Maybe Text
$sel:namespace:SystemControl' :: SystemControl -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"namespace" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
namespace,
(Key
"value" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
value
]
)