{-# 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.WorkMail.Types.Group where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WorkMail.Types.EntityState
data Group = Group'
{
Group -> Maybe Text
email :: Prelude.Maybe Prelude.Text,
Group -> Maybe EntityState
state :: Prelude.Maybe EntityState,
Group -> Maybe POSIX
disabledDate :: Prelude.Maybe Core.POSIX,
Group -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Group -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Group -> Maybe POSIX
enabledDate :: Prelude.Maybe Core.POSIX
}
deriving (Group -> Group -> Bool
(Group -> Group -> Bool) -> (Group -> Group -> Bool) -> Eq Group
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Group -> Group -> Bool
$c/= :: Group -> Group -> Bool
== :: Group -> Group -> Bool
$c== :: Group -> Group -> Bool
Prelude.Eq, ReadPrec [Group]
ReadPrec Group
Int -> ReadS Group
ReadS [Group]
(Int -> ReadS Group)
-> ReadS [Group]
-> ReadPrec Group
-> ReadPrec [Group]
-> Read Group
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Group]
$creadListPrec :: ReadPrec [Group]
readPrec :: ReadPrec Group
$creadPrec :: ReadPrec Group
readList :: ReadS [Group]
$creadList :: ReadS [Group]
readsPrec :: Int -> ReadS Group
$creadsPrec :: Int -> ReadS Group
Prelude.Read, Int -> Group -> ShowS
[Group] -> ShowS
Group -> String
(Int -> Group -> ShowS)
-> (Group -> String) -> ([Group] -> ShowS) -> Show Group
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Group] -> ShowS
$cshowList :: [Group] -> ShowS
show :: Group -> String
$cshow :: Group -> String
showsPrec :: Int -> Group -> ShowS
$cshowsPrec :: Int -> Group -> ShowS
Prelude.Show, (forall x. Group -> Rep Group x)
-> (forall x. Rep Group x -> Group) -> Generic Group
forall x. Rep Group x -> Group
forall x. Group -> Rep Group x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Group x -> Group
$cfrom :: forall x. Group -> Rep Group x
Prelude.Generic)
newGroup ::
Group
newGroup :: Group
newGroup =
Group' :: Maybe Text
-> Maybe EntityState
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Group
Group'
{ $sel:email:Group' :: Maybe Text
email = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:state:Group' :: Maybe EntityState
state = Maybe EntityState
forall a. Maybe a
Prelude.Nothing,
$sel:disabledDate:Group' :: Maybe POSIX
disabledDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:name:Group' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:Group' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:enabledDate:Group' :: Maybe POSIX
enabledDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
group_email :: Lens.Lens' Group (Prelude.Maybe Prelude.Text)
group_email :: (Maybe Text -> f (Maybe Text)) -> Group -> f Group
group_email = (Group -> Maybe Text)
-> (Group -> Maybe Text -> Group)
-> Lens Group Group (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Group' {Maybe Text
email :: Maybe Text
$sel:email:Group' :: Group -> Maybe Text
email} -> Maybe Text
email) (\s :: Group
s@Group' {} Maybe Text
a -> Group
s {$sel:email:Group' :: Maybe Text
email = Maybe Text
a} :: Group)
group_state :: Lens.Lens' Group (Prelude.Maybe EntityState)
group_state :: (Maybe EntityState -> f (Maybe EntityState)) -> Group -> f Group
group_state = (Group -> Maybe EntityState)
-> (Group -> Maybe EntityState -> Group)
-> Lens Group Group (Maybe EntityState) (Maybe EntityState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Group' {Maybe EntityState
state :: Maybe EntityState
$sel:state:Group' :: Group -> Maybe EntityState
state} -> Maybe EntityState
state) (\s :: Group
s@Group' {} Maybe EntityState
a -> Group
s {$sel:state:Group' :: Maybe EntityState
state = Maybe EntityState
a} :: Group)
group_disabledDate :: Lens.Lens' Group (Prelude.Maybe Prelude.UTCTime)
group_disabledDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Group -> f Group
group_disabledDate = (Group -> Maybe POSIX)
-> (Group -> Maybe POSIX -> Group)
-> Lens Group Group (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Group' {Maybe POSIX
disabledDate :: Maybe POSIX
$sel:disabledDate:Group' :: Group -> Maybe POSIX
disabledDate} -> Maybe POSIX
disabledDate) (\s :: Group
s@Group' {} Maybe POSIX
a -> Group
s {$sel:disabledDate:Group' :: Maybe POSIX
disabledDate = Maybe POSIX
a} :: Group) ((Maybe POSIX -> f (Maybe POSIX)) -> Group -> f Group)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Group
-> f Group
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
group_name :: Lens.Lens' Group (Prelude.Maybe Prelude.Text)
group_name :: (Maybe Text -> f (Maybe Text)) -> Group -> f Group
group_name = (Group -> Maybe Text)
-> (Group -> Maybe Text -> Group)
-> Lens Group Group (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Group' {Maybe Text
name :: Maybe Text
$sel:name:Group' :: Group -> Maybe Text
name} -> Maybe Text
name) (\s :: Group
s@Group' {} Maybe Text
a -> Group
s {$sel:name:Group' :: Maybe Text
name = Maybe Text
a} :: Group)
group_id :: Lens.Lens' Group (Prelude.Maybe Prelude.Text)
group_id :: (Maybe Text -> f (Maybe Text)) -> Group -> f Group
group_id = (Group -> Maybe Text)
-> (Group -> Maybe Text -> Group)
-> Lens Group Group (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Group' {Maybe Text
id :: Maybe Text
$sel:id:Group' :: Group -> Maybe Text
id} -> Maybe Text
id) (\s :: Group
s@Group' {} Maybe Text
a -> Group
s {$sel:id:Group' :: Maybe Text
id = Maybe Text
a} :: Group)
group_enabledDate :: Lens.Lens' Group (Prelude.Maybe Prelude.UTCTime)
group_enabledDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Group -> f Group
group_enabledDate = (Group -> Maybe POSIX)
-> (Group -> Maybe POSIX -> Group)
-> Lens Group Group (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Group' {Maybe POSIX
enabledDate :: Maybe POSIX
$sel:enabledDate:Group' :: Group -> Maybe POSIX
enabledDate} -> Maybe POSIX
enabledDate) (\s :: Group
s@Group' {} Maybe POSIX
a -> Group
s {$sel:enabledDate:Group' :: Maybe POSIX
enabledDate = Maybe POSIX
a} :: Group) ((Maybe POSIX -> f (Maybe POSIX)) -> Group -> f Group)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Group
-> f Group
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON Group where
parseJSON :: Value -> Parser Group
parseJSON =
String -> (Object -> Parser Group) -> Value -> Parser Group
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Group"
( \Object
x ->
Maybe Text
-> Maybe EntityState
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Group
Group'
(Maybe Text
-> Maybe EntityState
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Group)
-> Parser (Maybe Text)
-> Parser
(Maybe EntityState
-> Maybe POSIX -> Maybe Text -> Maybe Text -> Maybe POSIX -> Group)
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
"Email")
Parser
(Maybe EntityState
-> Maybe POSIX -> Maybe Text -> Maybe Text -> Maybe POSIX -> Group)
-> Parser (Maybe EntityState)
-> Parser
(Maybe POSIX -> Maybe Text -> Maybe Text -> Maybe POSIX -> Group)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EntityState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
Parser
(Maybe POSIX -> Maybe Text -> Maybe Text -> Maybe POSIX -> Group)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> Maybe POSIX -> Group)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DisabledDate")
Parser (Maybe Text -> Maybe Text -> Maybe POSIX -> Group)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe POSIX -> Group)
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
"Name")
Parser (Maybe Text -> Maybe POSIX -> Group)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> Group)
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
"Id")
Parser (Maybe POSIX -> Group)
-> Parser (Maybe POSIX) -> Parser Group
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EnabledDate")
)
instance Prelude.Hashable Group
instance Prelude.NFData Group