{-# 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.SageMaker.Types.CognitoMemberDefinition where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CognitoMemberDefinition = CognitoMemberDefinition'
{
CognitoMemberDefinition -> Text
userPool :: Prelude.Text,
CognitoMemberDefinition -> Text
userGroup :: Prelude.Text,
CognitoMemberDefinition -> Text
clientId :: Prelude.Text
}
deriving (CognitoMemberDefinition -> CognitoMemberDefinition -> Bool
(CognitoMemberDefinition -> CognitoMemberDefinition -> Bool)
-> (CognitoMemberDefinition -> CognitoMemberDefinition -> Bool)
-> Eq CognitoMemberDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CognitoMemberDefinition -> CognitoMemberDefinition -> Bool
$c/= :: CognitoMemberDefinition -> CognitoMemberDefinition -> Bool
== :: CognitoMemberDefinition -> CognitoMemberDefinition -> Bool
$c== :: CognitoMemberDefinition -> CognitoMemberDefinition -> Bool
Prelude.Eq, ReadPrec [CognitoMemberDefinition]
ReadPrec CognitoMemberDefinition
Int -> ReadS CognitoMemberDefinition
ReadS [CognitoMemberDefinition]
(Int -> ReadS CognitoMemberDefinition)
-> ReadS [CognitoMemberDefinition]
-> ReadPrec CognitoMemberDefinition
-> ReadPrec [CognitoMemberDefinition]
-> Read CognitoMemberDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CognitoMemberDefinition]
$creadListPrec :: ReadPrec [CognitoMemberDefinition]
readPrec :: ReadPrec CognitoMemberDefinition
$creadPrec :: ReadPrec CognitoMemberDefinition
readList :: ReadS [CognitoMemberDefinition]
$creadList :: ReadS [CognitoMemberDefinition]
readsPrec :: Int -> ReadS CognitoMemberDefinition
$creadsPrec :: Int -> ReadS CognitoMemberDefinition
Prelude.Read, Int -> CognitoMemberDefinition -> ShowS
[CognitoMemberDefinition] -> ShowS
CognitoMemberDefinition -> String
(Int -> CognitoMemberDefinition -> ShowS)
-> (CognitoMemberDefinition -> String)
-> ([CognitoMemberDefinition] -> ShowS)
-> Show CognitoMemberDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CognitoMemberDefinition] -> ShowS
$cshowList :: [CognitoMemberDefinition] -> ShowS
show :: CognitoMemberDefinition -> String
$cshow :: CognitoMemberDefinition -> String
showsPrec :: Int -> CognitoMemberDefinition -> ShowS
$cshowsPrec :: Int -> CognitoMemberDefinition -> ShowS
Prelude.Show, (forall x.
CognitoMemberDefinition -> Rep CognitoMemberDefinition x)
-> (forall x.
Rep CognitoMemberDefinition x -> CognitoMemberDefinition)
-> Generic CognitoMemberDefinition
forall x. Rep CognitoMemberDefinition x -> CognitoMemberDefinition
forall x. CognitoMemberDefinition -> Rep CognitoMemberDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CognitoMemberDefinition x -> CognitoMemberDefinition
$cfrom :: forall x. CognitoMemberDefinition -> Rep CognitoMemberDefinition x
Prelude.Generic)
newCognitoMemberDefinition ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
CognitoMemberDefinition
newCognitoMemberDefinition :: Text -> Text -> Text -> CognitoMemberDefinition
newCognitoMemberDefinition
Text
pUserPool_
Text
pUserGroup_
Text
pClientId_ =
CognitoMemberDefinition' :: Text -> Text -> Text -> CognitoMemberDefinition
CognitoMemberDefinition'
{ $sel:userPool:CognitoMemberDefinition' :: Text
userPool = Text
pUserPool_,
$sel:userGroup:CognitoMemberDefinition' :: Text
userGroup = Text
pUserGroup_,
$sel:clientId:CognitoMemberDefinition' :: Text
clientId = Text
pClientId_
}
cognitoMemberDefinition_userPool :: Lens.Lens' CognitoMemberDefinition Prelude.Text
cognitoMemberDefinition_userPool :: (Text -> f Text)
-> CognitoMemberDefinition -> f CognitoMemberDefinition
cognitoMemberDefinition_userPool = (CognitoMemberDefinition -> Text)
-> (CognitoMemberDefinition -> Text -> CognitoMemberDefinition)
-> Lens CognitoMemberDefinition CognitoMemberDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CognitoMemberDefinition' {Text
userPool :: Text
$sel:userPool:CognitoMemberDefinition' :: CognitoMemberDefinition -> Text
userPool} -> Text
userPool) (\s :: CognitoMemberDefinition
s@CognitoMemberDefinition' {} Text
a -> CognitoMemberDefinition
s {$sel:userPool:CognitoMemberDefinition' :: Text
userPool = Text
a} :: CognitoMemberDefinition)
cognitoMemberDefinition_userGroup :: Lens.Lens' CognitoMemberDefinition Prelude.Text
cognitoMemberDefinition_userGroup :: (Text -> f Text)
-> CognitoMemberDefinition -> f CognitoMemberDefinition
cognitoMemberDefinition_userGroup = (CognitoMemberDefinition -> Text)
-> (CognitoMemberDefinition -> Text -> CognitoMemberDefinition)
-> Lens CognitoMemberDefinition CognitoMemberDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CognitoMemberDefinition' {Text
userGroup :: Text
$sel:userGroup:CognitoMemberDefinition' :: CognitoMemberDefinition -> Text
userGroup} -> Text
userGroup) (\s :: CognitoMemberDefinition
s@CognitoMemberDefinition' {} Text
a -> CognitoMemberDefinition
s {$sel:userGroup:CognitoMemberDefinition' :: Text
userGroup = Text
a} :: CognitoMemberDefinition)
cognitoMemberDefinition_clientId :: Lens.Lens' CognitoMemberDefinition Prelude.Text
cognitoMemberDefinition_clientId :: (Text -> f Text)
-> CognitoMemberDefinition -> f CognitoMemberDefinition
cognitoMemberDefinition_clientId = (CognitoMemberDefinition -> Text)
-> (CognitoMemberDefinition -> Text -> CognitoMemberDefinition)
-> Lens CognitoMemberDefinition CognitoMemberDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CognitoMemberDefinition' {Text
clientId :: Text
$sel:clientId:CognitoMemberDefinition' :: CognitoMemberDefinition -> Text
clientId} -> Text
clientId) (\s :: CognitoMemberDefinition
s@CognitoMemberDefinition' {} Text
a -> CognitoMemberDefinition
s {$sel:clientId:CognitoMemberDefinition' :: Text
clientId = Text
a} :: CognitoMemberDefinition)
instance Core.FromJSON CognitoMemberDefinition where
parseJSON :: Value -> Parser CognitoMemberDefinition
parseJSON =
String
-> (Object -> Parser CognitoMemberDefinition)
-> Value
-> Parser CognitoMemberDefinition
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CognitoMemberDefinition"
( \Object
x ->
Text -> Text -> Text -> CognitoMemberDefinition
CognitoMemberDefinition'
(Text -> Text -> Text -> CognitoMemberDefinition)
-> Parser Text -> Parser (Text -> Text -> CognitoMemberDefinition)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"UserPool")
Parser (Text -> Text -> CognitoMemberDefinition)
-> Parser Text -> Parser (Text -> CognitoMemberDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"UserGroup")
Parser (Text -> CognitoMemberDefinition)
-> Parser Text -> Parser CognitoMemberDefinition
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ClientId")
)
instance Prelude.Hashable CognitoMemberDefinition
instance Prelude.NFData CognitoMemberDefinition
instance Core.ToJSON CognitoMemberDefinition where
toJSON :: CognitoMemberDefinition -> Value
toJSON CognitoMemberDefinition' {Text
clientId :: Text
userGroup :: Text
userPool :: Text
$sel:clientId:CognitoMemberDefinition' :: CognitoMemberDefinition -> Text
$sel:userGroup:CognitoMemberDefinition' :: CognitoMemberDefinition -> Text
$sel:userPool:CognitoMemberDefinition' :: CognitoMemberDefinition -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserPool" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userPool),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserGroup" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userGroup),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClientId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientId)
]
)