{-# 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.UserContext where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UserContext = UserContext'
{
UserContext -> Maybe Text
userProfileName :: Prelude.Maybe Prelude.Text,
UserContext -> Maybe Text
userProfileArn :: Prelude.Maybe Prelude.Text,
UserContext -> Maybe Text
domainId :: Prelude.Maybe Prelude.Text
}
deriving (UserContext -> UserContext -> Bool
(UserContext -> UserContext -> Bool)
-> (UserContext -> UserContext -> Bool) -> Eq UserContext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserContext -> UserContext -> Bool
$c/= :: UserContext -> UserContext -> Bool
== :: UserContext -> UserContext -> Bool
$c== :: UserContext -> UserContext -> Bool
Prelude.Eq, ReadPrec [UserContext]
ReadPrec UserContext
Int -> ReadS UserContext
ReadS [UserContext]
(Int -> ReadS UserContext)
-> ReadS [UserContext]
-> ReadPrec UserContext
-> ReadPrec [UserContext]
-> Read UserContext
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserContext]
$creadListPrec :: ReadPrec [UserContext]
readPrec :: ReadPrec UserContext
$creadPrec :: ReadPrec UserContext
readList :: ReadS [UserContext]
$creadList :: ReadS [UserContext]
readsPrec :: Int -> ReadS UserContext
$creadsPrec :: Int -> ReadS UserContext
Prelude.Read, Int -> UserContext -> ShowS
[UserContext] -> ShowS
UserContext -> String
(Int -> UserContext -> ShowS)
-> (UserContext -> String)
-> ([UserContext] -> ShowS)
-> Show UserContext
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserContext] -> ShowS
$cshowList :: [UserContext] -> ShowS
show :: UserContext -> String
$cshow :: UserContext -> String
showsPrec :: Int -> UserContext -> ShowS
$cshowsPrec :: Int -> UserContext -> ShowS
Prelude.Show, (forall x. UserContext -> Rep UserContext x)
-> (forall x. Rep UserContext x -> UserContext)
-> Generic UserContext
forall x. Rep UserContext x -> UserContext
forall x. UserContext -> Rep UserContext x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserContext x -> UserContext
$cfrom :: forall x. UserContext -> Rep UserContext x
Prelude.Generic)
newUserContext ::
UserContext
newUserContext :: UserContext
newUserContext =
UserContext' :: Maybe Text -> Maybe Text -> Maybe Text -> UserContext
UserContext'
{ $sel:userProfileName:UserContext' :: Maybe Text
userProfileName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:userProfileArn:UserContext' :: Maybe Text
userProfileArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:domainId:UserContext' :: Maybe Text
domainId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
userContext_userProfileName :: Lens.Lens' UserContext (Prelude.Maybe Prelude.Text)
userContext_userProfileName :: (Maybe Text -> f (Maybe Text)) -> UserContext -> f UserContext
userContext_userProfileName = (UserContext -> Maybe Text)
-> (UserContext -> Maybe Text -> UserContext)
-> Lens UserContext UserContext (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserContext' {Maybe Text
userProfileName :: Maybe Text
$sel:userProfileName:UserContext' :: UserContext -> Maybe Text
userProfileName} -> Maybe Text
userProfileName) (\s :: UserContext
s@UserContext' {} Maybe Text
a -> UserContext
s {$sel:userProfileName:UserContext' :: Maybe Text
userProfileName = Maybe Text
a} :: UserContext)
userContext_userProfileArn :: Lens.Lens' UserContext (Prelude.Maybe Prelude.Text)
userContext_userProfileArn :: (Maybe Text -> f (Maybe Text)) -> UserContext -> f UserContext
userContext_userProfileArn = (UserContext -> Maybe Text)
-> (UserContext -> Maybe Text -> UserContext)
-> Lens UserContext UserContext (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserContext' {Maybe Text
userProfileArn :: Maybe Text
$sel:userProfileArn:UserContext' :: UserContext -> Maybe Text
userProfileArn} -> Maybe Text
userProfileArn) (\s :: UserContext
s@UserContext' {} Maybe Text
a -> UserContext
s {$sel:userProfileArn:UserContext' :: Maybe Text
userProfileArn = Maybe Text
a} :: UserContext)
userContext_domainId :: Lens.Lens' UserContext (Prelude.Maybe Prelude.Text)
userContext_domainId :: (Maybe Text -> f (Maybe Text)) -> UserContext -> f UserContext
userContext_domainId = (UserContext -> Maybe Text)
-> (UserContext -> Maybe Text -> UserContext)
-> Lens UserContext UserContext (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserContext' {Maybe Text
domainId :: Maybe Text
$sel:domainId:UserContext' :: UserContext -> Maybe Text
domainId} -> Maybe Text
domainId) (\s :: UserContext
s@UserContext' {} Maybe Text
a -> UserContext
s {$sel:domainId:UserContext' :: Maybe Text
domainId = Maybe Text
a} :: UserContext)
instance Core.FromJSON UserContext where
parseJSON :: Value -> Parser UserContext
parseJSON =
String
-> (Object -> Parser UserContext) -> Value -> Parser UserContext
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UserContext"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> UserContext
UserContext'
(Maybe Text -> Maybe Text -> Maybe Text -> UserContext)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> UserContext)
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
"UserProfileName")
Parser (Maybe Text -> Maybe Text -> UserContext)
-> Parser (Maybe Text) -> Parser (Maybe Text -> UserContext)
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
"UserProfileArn")
Parser (Maybe Text -> UserContext)
-> Parser (Maybe Text) -> Parser UserContext
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
"DomainId")
)
instance Prelude.Hashable UserContext
instance Prelude.NFData UserContext