{-# 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.CognitoIdentityProvider.Types.GroupType where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data GroupType = GroupType'
{
GroupType -> Maybe POSIX
lastModifiedDate :: Prelude.Maybe Core.POSIX,
GroupType -> Maybe Text
userPoolId :: Prelude.Maybe Prelude.Text,
GroupType -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
GroupType -> Maybe Natural
precedence :: Prelude.Maybe Prelude.Natural,
GroupType -> Maybe Text
groupName :: Prelude.Maybe Prelude.Text,
GroupType -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
GroupType -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text
}
deriving (GroupType -> GroupType -> Bool
(GroupType -> GroupType -> Bool)
-> (GroupType -> GroupType -> Bool) -> Eq GroupType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GroupType -> GroupType -> Bool
$c/= :: GroupType -> GroupType -> Bool
== :: GroupType -> GroupType -> Bool
$c== :: GroupType -> GroupType -> Bool
Prelude.Eq, ReadPrec [GroupType]
ReadPrec GroupType
Int -> ReadS GroupType
ReadS [GroupType]
(Int -> ReadS GroupType)
-> ReadS [GroupType]
-> ReadPrec GroupType
-> ReadPrec [GroupType]
-> Read GroupType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GroupType]
$creadListPrec :: ReadPrec [GroupType]
readPrec :: ReadPrec GroupType
$creadPrec :: ReadPrec GroupType
readList :: ReadS [GroupType]
$creadList :: ReadS [GroupType]
readsPrec :: Int -> ReadS GroupType
$creadsPrec :: Int -> ReadS GroupType
Prelude.Read, Int -> GroupType -> ShowS
[GroupType] -> ShowS
GroupType -> String
(Int -> GroupType -> ShowS)
-> (GroupType -> String)
-> ([GroupType] -> ShowS)
-> Show GroupType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GroupType] -> ShowS
$cshowList :: [GroupType] -> ShowS
show :: GroupType -> String
$cshow :: GroupType -> String
showsPrec :: Int -> GroupType -> ShowS
$cshowsPrec :: Int -> GroupType -> ShowS
Prelude.Show, (forall x. GroupType -> Rep GroupType x)
-> (forall x. Rep GroupType x -> GroupType) -> Generic GroupType
forall x. Rep GroupType x -> GroupType
forall x. GroupType -> Rep GroupType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GroupType x -> GroupType
$cfrom :: forall x. GroupType -> Rep GroupType x
Prelude.Generic)
newGroupType ::
GroupType
newGroupType :: GroupType
newGroupType =
GroupType' :: Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GroupType
GroupType'
{ $sel:lastModifiedDate:GroupType' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:userPoolId:GroupType' :: Maybe Text
userPoolId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creationDate:GroupType' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:precedence:GroupType' :: Maybe Natural
precedence = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:groupName:GroupType' :: Maybe Text
groupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:GroupType' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:GroupType' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
groupType_lastModifiedDate :: Lens.Lens' GroupType (Prelude.Maybe Prelude.UTCTime)
groupType_lastModifiedDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> GroupType -> f GroupType
groupType_lastModifiedDate = (GroupType -> Maybe POSIX)
-> (GroupType -> Maybe POSIX -> GroupType)
-> Lens GroupType GroupType (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupType' {Maybe POSIX
lastModifiedDate :: Maybe POSIX
$sel:lastModifiedDate:GroupType' :: GroupType -> Maybe POSIX
lastModifiedDate} -> Maybe POSIX
lastModifiedDate) (\s :: GroupType
s@GroupType' {} Maybe POSIX
a -> GroupType
s {$sel:lastModifiedDate:GroupType' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
a} :: GroupType) ((Maybe POSIX -> f (Maybe POSIX)) -> GroupType -> f GroupType)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GroupType
-> f GroupType
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
groupType_userPoolId :: Lens.Lens' GroupType (Prelude.Maybe Prelude.Text)
groupType_userPoolId :: (Maybe Text -> f (Maybe Text)) -> GroupType -> f GroupType
groupType_userPoolId = (GroupType -> Maybe Text)
-> (GroupType -> Maybe Text -> GroupType)
-> Lens GroupType GroupType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupType' {Maybe Text
userPoolId :: Maybe Text
$sel:userPoolId:GroupType' :: GroupType -> Maybe Text
userPoolId} -> Maybe Text
userPoolId) (\s :: GroupType
s@GroupType' {} Maybe Text
a -> GroupType
s {$sel:userPoolId:GroupType' :: Maybe Text
userPoolId = Maybe Text
a} :: GroupType)
groupType_creationDate :: Lens.Lens' GroupType (Prelude.Maybe Prelude.UTCTime)
groupType_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> GroupType -> f GroupType
groupType_creationDate = (GroupType -> Maybe POSIX)
-> (GroupType -> Maybe POSIX -> GroupType)
-> Lens GroupType GroupType (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupType' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:GroupType' :: GroupType -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: GroupType
s@GroupType' {} Maybe POSIX
a -> GroupType
s {$sel:creationDate:GroupType' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: GroupType) ((Maybe POSIX -> f (Maybe POSIX)) -> GroupType -> f GroupType)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GroupType
-> f GroupType
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
groupType_precedence :: Lens.Lens' GroupType (Prelude.Maybe Prelude.Natural)
groupType_precedence :: (Maybe Natural -> f (Maybe Natural)) -> GroupType -> f GroupType
groupType_precedence = (GroupType -> Maybe Natural)
-> (GroupType -> Maybe Natural -> GroupType)
-> Lens GroupType GroupType (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupType' {Maybe Natural
precedence :: Maybe Natural
$sel:precedence:GroupType' :: GroupType -> Maybe Natural
precedence} -> Maybe Natural
precedence) (\s :: GroupType
s@GroupType' {} Maybe Natural
a -> GroupType
s {$sel:precedence:GroupType' :: Maybe Natural
precedence = Maybe Natural
a} :: GroupType)
groupType_groupName :: Lens.Lens' GroupType (Prelude.Maybe Prelude.Text)
groupType_groupName :: (Maybe Text -> f (Maybe Text)) -> GroupType -> f GroupType
groupType_groupName = (GroupType -> Maybe Text)
-> (GroupType -> Maybe Text -> GroupType)
-> Lens GroupType GroupType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupType' {Maybe Text
groupName :: Maybe Text
$sel:groupName:GroupType' :: GroupType -> Maybe Text
groupName} -> Maybe Text
groupName) (\s :: GroupType
s@GroupType' {} Maybe Text
a -> GroupType
s {$sel:groupName:GroupType' :: Maybe Text
groupName = Maybe Text
a} :: GroupType)
groupType_description :: Lens.Lens' GroupType (Prelude.Maybe Prelude.Text)
groupType_description :: (Maybe Text -> f (Maybe Text)) -> GroupType -> f GroupType
groupType_description = (GroupType -> Maybe Text)
-> (GroupType -> Maybe Text -> GroupType)
-> Lens GroupType GroupType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupType' {Maybe Text
description :: Maybe Text
$sel:description:GroupType' :: GroupType -> Maybe Text
description} -> Maybe Text
description) (\s :: GroupType
s@GroupType' {} Maybe Text
a -> GroupType
s {$sel:description:GroupType' :: Maybe Text
description = Maybe Text
a} :: GroupType)
groupType_roleArn :: Lens.Lens' GroupType (Prelude.Maybe Prelude.Text)
groupType_roleArn :: (Maybe Text -> f (Maybe Text)) -> GroupType -> f GroupType
groupType_roleArn = (GroupType -> Maybe Text)
-> (GroupType -> Maybe Text -> GroupType)
-> Lens GroupType GroupType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupType' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:GroupType' :: GroupType -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: GroupType
s@GroupType' {} Maybe Text
a -> GroupType
s {$sel:roleArn:GroupType' :: Maybe Text
roleArn = Maybe Text
a} :: GroupType)
instance Core.FromJSON GroupType where
parseJSON :: Value -> Parser GroupType
parseJSON =
String -> (Object -> Parser GroupType) -> Value -> Parser GroupType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"GroupType"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GroupType
GroupType'
(Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GroupType)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GroupType)
forall (f :: * -> *) a b. Functor 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
"LastModifiedDate")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GroupType)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GroupType)
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
"UserPoolId")
Parser
(Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GroupType)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Natural
-> Maybe Text -> Maybe Text -> Maybe Text -> GroupType)
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
"CreationDate")
Parser
(Maybe Natural
-> Maybe Text -> Maybe Text -> Maybe Text -> GroupType)
-> Parser (Maybe Natural)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> GroupType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Precedence")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> GroupType)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> GroupType)
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
"GroupName")
Parser (Maybe Text -> Maybe Text -> GroupType)
-> Parser (Maybe Text) -> Parser (Maybe Text -> GroupType)
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
"Description")
Parser (Maybe Text -> GroupType)
-> Parser (Maybe Text) -> Parser GroupType
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
"RoleArn")
)
instance Prelude.Hashable GroupType
instance Prelude.NFData GroupType