{-# 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.Greengrass.Types.GroupOwnerSetting 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 GroupOwnerSetting = GroupOwnerSetting'
{
GroupOwnerSetting -> Maybe Bool
autoAddGroupOwner :: Prelude.Maybe Prelude.Bool,
GroupOwnerSetting -> Maybe Text
groupOwner :: Prelude.Maybe Prelude.Text
}
deriving (GroupOwnerSetting -> GroupOwnerSetting -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GroupOwnerSetting -> GroupOwnerSetting -> Bool
$c/= :: GroupOwnerSetting -> GroupOwnerSetting -> Bool
== :: GroupOwnerSetting -> GroupOwnerSetting -> Bool
$c== :: GroupOwnerSetting -> GroupOwnerSetting -> Bool
Prelude.Eq, ReadPrec [GroupOwnerSetting]
ReadPrec GroupOwnerSetting
Int -> ReadS GroupOwnerSetting
ReadS [GroupOwnerSetting]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GroupOwnerSetting]
$creadListPrec :: ReadPrec [GroupOwnerSetting]
readPrec :: ReadPrec GroupOwnerSetting
$creadPrec :: ReadPrec GroupOwnerSetting
readList :: ReadS [GroupOwnerSetting]
$creadList :: ReadS [GroupOwnerSetting]
readsPrec :: Int -> ReadS GroupOwnerSetting
$creadsPrec :: Int -> ReadS GroupOwnerSetting
Prelude.Read, Int -> GroupOwnerSetting -> ShowS
[GroupOwnerSetting] -> ShowS
GroupOwnerSetting -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GroupOwnerSetting] -> ShowS
$cshowList :: [GroupOwnerSetting] -> ShowS
show :: GroupOwnerSetting -> String
$cshow :: GroupOwnerSetting -> String
showsPrec :: Int -> GroupOwnerSetting -> ShowS
$cshowsPrec :: Int -> GroupOwnerSetting -> ShowS
Prelude.Show, forall x. Rep GroupOwnerSetting x -> GroupOwnerSetting
forall x. GroupOwnerSetting -> Rep GroupOwnerSetting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GroupOwnerSetting x -> GroupOwnerSetting
$cfrom :: forall x. GroupOwnerSetting -> Rep GroupOwnerSetting x
Prelude.Generic)
newGroupOwnerSetting ::
GroupOwnerSetting
newGroupOwnerSetting :: GroupOwnerSetting
newGroupOwnerSetting =
GroupOwnerSetting'
{ $sel:autoAddGroupOwner:GroupOwnerSetting' :: Maybe Bool
autoAddGroupOwner =
forall a. Maybe a
Prelude.Nothing,
$sel:groupOwner:GroupOwnerSetting' :: Maybe Text
groupOwner = forall a. Maybe a
Prelude.Nothing
}
groupOwnerSetting_autoAddGroupOwner :: Lens.Lens' GroupOwnerSetting (Prelude.Maybe Prelude.Bool)
groupOwnerSetting_autoAddGroupOwner :: Lens' GroupOwnerSetting (Maybe Bool)
groupOwnerSetting_autoAddGroupOwner = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupOwnerSetting' {Maybe Bool
autoAddGroupOwner :: Maybe Bool
$sel:autoAddGroupOwner:GroupOwnerSetting' :: GroupOwnerSetting -> Maybe Bool
autoAddGroupOwner} -> Maybe Bool
autoAddGroupOwner) (\s :: GroupOwnerSetting
s@GroupOwnerSetting' {} Maybe Bool
a -> GroupOwnerSetting
s {$sel:autoAddGroupOwner:GroupOwnerSetting' :: Maybe Bool
autoAddGroupOwner = Maybe Bool
a} :: GroupOwnerSetting)
groupOwnerSetting_groupOwner :: Lens.Lens' GroupOwnerSetting (Prelude.Maybe Prelude.Text)
groupOwnerSetting_groupOwner :: Lens' GroupOwnerSetting (Maybe Text)
groupOwnerSetting_groupOwner = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupOwnerSetting' {Maybe Text
groupOwner :: Maybe Text
$sel:groupOwner:GroupOwnerSetting' :: GroupOwnerSetting -> Maybe Text
groupOwner} -> Maybe Text
groupOwner) (\s :: GroupOwnerSetting
s@GroupOwnerSetting' {} Maybe Text
a -> GroupOwnerSetting
s {$sel:groupOwner:GroupOwnerSetting' :: Maybe Text
groupOwner = Maybe Text
a} :: GroupOwnerSetting)
instance Data.FromJSON GroupOwnerSetting where
parseJSON :: Value -> Parser GroupOwnerSetting
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"GroupOwnerSetting"
( \Object
x ->
Maybe Bool -> Maybe Text -> GroupOwnerSetting
GroupOwnerSetting'
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
"AutoAddGroupOwner")
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
"GroupOwner")
)
instance Prelude.Hashable GroupOwnerSetting where
hashWithSalt :: Int -> GroupOwnerSetting -> Int
hashWithSalt Int
_salt GroupOwnerSetting' {Maybe Bool
Maybe Text
groupOwner :: Maybe Text
autoAddGroupOwner :: Maybe Bool
$sel:groupOwner:GroupOwnerSetting' :: GroupOwnerSetting -> Maybe Text
$sel:autoAddGroupOwner:GroupOwnerSetting' :: GroupOwnerSetting -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
autoAddGroupOwner
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
groupOwner
instance Prelude.NFData GroupOwnerSetting where
rnf :: GroupOwnerSetting -> ()
rnf GroupOwnerSetting' {Maybe Bool
Maybe Text
groupOwner :: Maybe Text
autoAddGroupOwner :: Maybe Bool
$sel:groupOwner:GroupOwnerSetting' :: GroupOwnerSetting -> Maybe Text
$sel:autoAddGroupOwner:GroupOwnerSetting' :: GroupOwnerSetting -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
autoAddGroupOwner
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
groupOwner
instance Data.ToJSON GroupOwnerSetting where
toJSON :: GroupOwnerSetting -> Value
toJSON GroupOwnerSetting' {Maybe Bool
Maybe Text
groupOwner :: Maybe Text
autoAddGroupOwner :: Maybe Bool
$sel:groupOwner:GroupOwnerSetting' :: GroupOwnerSetting -> Maybe Text
$sel:autoAddGroupOwner:GroupOwnerSetting' :: GroupOwnerSetting -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AutoAddGroupOwner" 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 Bool
autoAddGroupOwner,
(Key
"GroupOwner" 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
groupOwner
]
)