{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.WorkMail.Types.EntityState
data Group = Group'
{
Group -> Maybe POSIX
disabledDate :: Prelude.Maybe Data.POSIX,
Group -> Maybe Text
email :: Prelude.Maybe Prelude.Text,
Group -> Maybe POSIX
enabledDate :: Prelude.Maybe Data.POSIX,
Group -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Group -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Group -> Maybe EntityState
state :: Prelude.Maybe EntityState
}
deriving (Group -> Group -> Bool
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]
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
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. 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'
{ $sel:disabledDate:Group' :: Maybe POSIX
disabledDate = forall a. Maybe a
Prelude.Nothing,
$sel:email:Group' :: Maybe Text
email = forall a. Maybe a
Prelude.Nothing,
$sel:enabledDate:Group' :: Maybe POSIX
enabledDate = forall a. Maybe a
Prelude.Nothing,
$sel:id:Group' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
$sel:name:Group' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:state:Group' :: Maybe EntityState
state = forall a. Maybe a
Prelude.Nothing
}
group_disabledDate :: Lens.Lens' Group (Prelude.Maybe Prelude.UTCTime)
group_disabledDate :: Lens' Group (Maybe UTCTime)
group_disabledDate = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
group_email :: Lens.Lens' Group (Prelude.Maybe Prelude.Text)
group_email :: Lens' Group (Maybe Text)
group_email = 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_enabledDate :: Lens.Lens' Group (Prelude.Maybe Prelude.UTCTime)
group_enabledDate :: Lens' Group (Maybe UTCTime)
group_enabledDate = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
group_id :: Lens.Lens' Group (Prelude.Maybe Prelude.Text)
group_id :: Lens' Group (Maybe Text)
group_id = 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_name :: Lens.Lens' Group (Prelude.Maybe Prelude.Text)
group_name :: Lens' Group (Maybe Text)
group_name = 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_state :: Lens.Lens' Group (Prelude.Maybe EntityState)
group_state :: Lens' Group (Maybe EntityState)
group_state = 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)
instance Data.FromJSON Group where
parseJSON :: Value -> Parser Group
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Group"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe EntityState
-> Group
Group'
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
"DisabledDate")
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
"Email")
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
"EnabledDate")
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
"Id")
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
"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
"State")
)
instance Prelude.Hashable Group where
hashWithSalt :: Int -> Group -> Int
hashWithSalt Int
_salt Group' {Maybe Text
Maybe POSIX
Maybe EntityState
state :: Maybe EntityState
name :: Maybe Text
id :: Maybe Text
enabledDate :: Maybe POSIX
email :: Maybe Text
disabledDate :: Maybe POSIX
$sel:state:Group' :: Group -> Maybe EntityState
$sel:name:Group' :: Group -> Maybe Text
$sel:id:Group' :: Group -> Maybe Text
$sel:enabledDate:Group' :: Group -> Maybe POSIX
$sel:email:Group' :: Group -> Maybe Text
$sel:disabledDate:Group' :: Group -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
disabledDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
email
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
enabledDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EntityState
state
instance Prelude.NFData Group where
rnf :: Group -> ()
rnf Group' {Maybe Text
Maybe POSIX
Maybe EntityState
state :: Maybe EntityState
name :: Maybe Text
id :: Maybe Text
enabledDate :: Maybe POSIX
email :: Maybe Text
disabledDate :: Maybe POSIX
$sel:state:Group' :: Group -> Maybe EntityState
$sel:name:Group' :: Group -> Maybe Text
$sel:id:Group' :: Group -> Maybe Text
$sel:enabledDate:Group' :: Group -> Maybe POSIX
$sel:email:Group' :: Group -> Maybe Text
$sel:disabledDate:Group' :: Group -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
disabledDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
email
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
enabledDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EntityState
state