{-# 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.Setting where
import qualified Amazonka.Core as Core
import Amazonka.ECS.Types.SettingName
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Setting = Setting'
{
Setting -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
Setting -> Maybe SettingName
name :: Prelude.Maybe SettingName,
Setting -> Maybe Text
principalArn :: Prelude.Maybe Prelude.Text
}
deriving (Setting -> Setting -> Bool
(Setting -> Setting -> Bool)
-> (Setting -> Setting -> Bool) -> Eq Setting
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]
(Int -> ReadS Setting)
-> ReadS [Setting]
-> ReadPrec Setting
-> ReadPrec [Setting]
-> Read 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
(Int -> Setting -> ShowS)
-> (Setting -> String) -> ([Setting] -> ShowS) -> Show Setting
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. Setting -> Rep Setting x)
-> (forall x. Rep Setting x -> Setting) -> Generic Setting
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 ::
Setting
newSetting :: Setting
newSetting =
Setting' :: Maybe Text -> Maybe SettingName -> Maybe Text -> Setting
Setting'
{ $sel:value:Setting' :: Maybe Text
value = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:Setting' :: Maybe SettingName
name = Maybe SettingName
forall a. Maybe a
Prelude.Nothing,
$sel:principalArn:Setting' :: Maybe Text
principalArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
setting_value :: Lens.Lens' Setting (Prelude.Maybe Prelude.Text)
setting_value :: (Maybe Text -> f (Maybe Text)) -> Setting -> f Setting
setting_value = (Setting -> Maybe Text)
-> (Setting -> Maybe Text -> Setting)
-> Lens Setting Setting (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Setting' {Maybe Text
value :: Maybe Text
$sel:value:Setting' :: Setting -> Maybe Text
value} -> Maybe Text
value) (\s :: Setting
s@Setting' {} Maybe Text
a -> Setting
s {$sel:value:Setting' :: Maybe Text
value = Maybe Text
a} :: Setting)
setting_name :: Lens.Lens' Setting (Prelude.Maybe SettingName)
setting_name :: (Maybe SettingName -> f (Maybe SettingName))
-> Setting -> f Setting
setting_name = (Setting -> Maybe SettingName)
-> (Setting -> Maybe SettingName -> Setting)
-> Lens Setting Setting (Maybe SettingName) (Maybe SettingName)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Setting' {Maybe SettingName
name :: Maybe SettingName
$sel:name:Setting' :: Setting -> Maybe SettingName
name} -> Maybe SettingName
name) (\s :: Setting
s@Setting' {} Maybe SettingName
a -> Setting
s {$sel:name:Setting' :: Maybe SettingName
name = Maybe SettingName
a} :: Setting)
setting_principalArn :: Lens.Lens' Setting (Prelude.Maybe Prelude.Text)
setting_principalArn :: (Maybe Text -> f (Maybe Text)) -> Setting -> f Setting
setting_principalArn = (Setting -> Maybe Text)
-> (Setting -> Maybe Text -> Setting)
-> Lens Setting Setting (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Setting' {Maybe Text
principalArn :: Maybe Text
$sel:principalArn:Setting' :: Setting -> Maybe Text
principalArn} -> Maybe Text
principalArn) (\s :: Setting
s@Setting' {} Maybe Text
a -> Setting
s {$sel:principalArn:Setting' :: Maybe Text
principalArn = Maybe Text
a} :: Setting)
instance Core.FromJSON Setting where
parseJSON :: Value -> Parser Setting
parseJSON =
String -> (Object -> Parser Setting) -> Value -> Parser Setting
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Setting"
( \Object
x ->
Maybe Text -> Maybe SettingName -> Maybe Text -> Setting
Setting'
(Maybe Text -> Maybe SettingName -> Maybe Text -> Setting)
-> Parser (Maybe Text)
-> Parser (Maybe SettingName -> Maybe Text -> Setting)
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 SettingName -> Maybe Text -> Setting)
-> Parser (Maybe SettingName) -> Parser (Maybe Text -> Setting)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SettingName)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
Parser (Maybe Text -> Setting)
-> Parser (Maybe Text) -> Parser Setting
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
"principalArn")
)
instance Prelude.Hashable Setting
instance Prelude.NFData Setting