{-# 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.IdentityStore.Types.Group where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IdentityStore.Types.ExternalId
import qualified Amazonka.Prelude as Prelude
data Group = Group'
{
Group -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Data.Sensitive Prelude.Text),
Group -> Maybe (Sensitive Text)
displayName :: Prelude.Maybe (Data.Sensitive Prelude.Text),
Group -> Maybe (NonEmpty ExternalId)
externalIds :: Prelude.Maybe (Prelude.NonEmpty ExternalId),
Group -> Text
groupId :: Prelude.Text,
Group -> Text
identityStoreId :: Prelude.Text
}
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, 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 ::
Prelude.Text ->
Prelude.Text ->
Group
newGroup :: Text -> Text -> Group
newGroup Text
pGroupId_ Text
pIdentityStoreId_ =
Group'
{ $sel:description:Group' :: Maybe (Sensitive Text)
description = forall a. Maybe a
Prelude.Nothing,
$sel:displayName:Group' :: Maybe (Sensitive Text)
displayName = forall a. Maybe a
Prelude.Nothing,
$sel:externalIds:Group' :: Maybe (NonEmpty ExternalId)
externalIds = forall a. Maybe a
Prelude.Nothing,
$sel:groupId:Group' :: Text
groupId = Text
pGroupId_,
$sel:identityStoreId:Group' :: Text
identityStoreId = Text
pIdentityStoreId_
}
group_description :: Lens.Lens' Group (Prelude.Maybe Prelude.Text)
group_description :: Lens' Group (Maybe Text)
group_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Group' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:Group' :: Group -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: Group
s@Group' {} Maybe (Sensitive Text)
a -> Group
s {$sel:description:Group' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
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. Iso' (Sensitive a) a
Data._Sensitive
group_displayName :: Lens.Lens' Group (Prelude.Maybe Prelude.Text)
group_displayName :: Lens' Group (Maybe Text)
group_displayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Group' {Maybe (Sensitive Text)
displayName :: Maybe (Sensitive Text)
$sel:displayName:Group' :: Group -> Maybe (Sensitive Text)
displayName} -> Maybe (Sensitive Text)
displayName) (\s :: Group
s@Group' {} Maybe (Sensitive Text)
a -> Group
s {$sel:displayName:Group' :: Maybe (Sensitive Text)
displayName = Maybe (Sensitive Text)
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. Iso' (Sensitive a) a
Data._Sensitive
group_externalIds :: Lens.Lens' Group (Prelude.Maybe (Prelude.NonEmpty ExternalId))
group_externalIds :: Lens' Group (Maybe (NonEmpty ExternalId))
group_externalIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Group' {Maybe (NonEmpty ExternalId)
externalIds :: Maybe (NonEmpty ExternalId)
$sel:externalIds:Group' :: Group -> Maybe (NonEmpty ExternalId)
externalIds} -> Maybe (NonEmpty ExternalId)
externalIds) (\s :: Group
s@Group' {} Maybe (NonEmpty ExternalId)
a -> Group
s {$sel:externalIds:Group' :: Maybe (NonEmpty ExternalId)
externalIds = Maybe (NonEmpty ExternalId)
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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
group_groupId :: Lens.Lens' Group Prelude.Text
group_groupId :: Lens' Group Text
group_groupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Group' {Text
groupId :: Text
$sel:groupId:Group' :: Group -> Text
groupId} -> Text
groupId) (\s :: Group
s@Group' {} Text
a -> Group
s {$sel:groupId:Group' :: Text
groupId = Text
a} :: Group)
group_identityStoreId :: Lens.Lens' Group Prelude.Text
group_identityStoreId :: Lens' Group Text
group_identityStoreId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Group' {Text
identityStoreId :: Text
$sel:identityStoreId:Group' :: Group -> Text
identityStoreId} -> Text
identityStoreId) (\s :: Group
s@Group' {} Text
a -> Group
s {$sel:identityStoreId:Group' :: Text
identityStoreId = Text
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 (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (NonEmpty ExternalId)
-> Text
-> Text
-> 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
"Description")
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
"DisplayName")
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
"ExternalIds")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"GroupId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"IdentityStoreId")
)
instance Prelude.Hashable Group where
hashWithSalt :: Int -> Group -> Int
hashWithSalt Int
_salt Group' {Maybe (NonEmpty ExternalId)
Maybe (Sensitive Text)
Text
identityStoreId :: Text
groupId :: Text
externalIds :: Maybe (NonEmpty ExternalId)
displayName :: Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:identityStoreId:Group' :: Group -> Text
$sel:groupId:Group' :: Group -> Text
$sel:externalIds:Group' :: Group -> Maybe (NonEmpty ExternalId)
$sel:displayName:Group' :: Group -> Maybe (Sensitive Text)
$sel:description:Group' :: Group -> Maybe (Sensitive Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
displayName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty ExternalId)
externalIds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
groupId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
identityStoreId
instance Prelude.NFData Group where
rnf :: Group -> ()
rnf Group' {Maybe (NonEmpty ExternalId)
Maybe (Sensitive Text)
Text
identityStoreId :: Text
groupId :: Text
externalIds :: Maybe (NonEmpty ExternalId)
displayName :: Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:identityStoreId:Group' :: Group -> Text
$sel:groupId:Group' :: Group -> Text
$sel:externalIds:Group' :: Group -> Maybe (NonEmpty ExternalId)
$sel:displayName:Group' :: Group -> Maybe (Sensitive Text)
$sel:description:Group' :: Group -> Maybe (Sensitive Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
displayName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty ExternalId)
externalIds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
groupId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
identityStoreId