{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ECS.Types.SettingName
import qualified Amazonka.Prelude as Prelude
data Setting = Setting'
{
Setting -> Maybe SettingName
name :: Prelude.Maybe SettingName,
Setting -> Maybe Text
principalArn :: Prelude.Maybe Prelude.Text,
Setting -> Maybe Text
value :: Prelude.Maybe 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 ::
Setting
newSetting :: Setting
newSetting =
Setting'
{ $sel:name:Setting' :: Maybe SettingName
name = forall a. Maybe a
Prelude.Nothing,
$sel:principalArn:Setting' :: Maybe Text
principalArn = forall a. Maybe a
Prelude.Nothing,
$sel:value:Setting' :: Maybe Text
value = forall a. Maybe a
Prelude.Nothing
}
setting_name :: Lens.Lens' Setting (Prelude.Maybe SettingName)
setting_name :: Lens' Setting (Maybe SettingName)
setting_name = 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 :: Lens' Setting (Maybe Text)
setting_principalArn = 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)
setting_value :: Lens.Lens' Setting (Prelude.Maybe Prelude.Text)
setting_value :: Lens' Setting (Maybe Text)
setting_value = 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)
instance Data.FromJSON Setting where
parseJSON :: Value -> Parser Setting
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Setting"
( \Object
x ->
Maybe SettingName -> Maybe Text -> Maybe Text -> Setting
Setting'
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
"name")
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
"principalArn")
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 Setting where
hashWithSalt :: Int -> Setting -> Int
hashWithSalt Int
_salt Setting' {Maybe Text
Maybe SettingName
value :: Maybe Text
principalArn :: Maybe Text
name :: Maybe SettingName
$sel:value:Setting' :: Setting -> Maybe Text
$sel:principalArn:Setting' :: Setting -> Maybe Text
$sel:name:Setting' :: Setting -> Maybe SettingName
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SettingName
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
principalArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
value
instance Prelude.NFData Setting where
rnf :: Setting -> ()
rnf Setting' {Maybe Text
Maybe SettingName
value :: Maybe Text
principalArn :: Maybe Text
name :: Maybe SettingName
$sel:value:Setting' :: Setting -> Maybe Text
$sel:principalArn:Setting' :: Setting -> Maybe Text
$sel:name:Setting' :: Setting -> Maybe SettingName
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe SettingName
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
principalArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
value