{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SageMaker.Types.UserProfileDetails
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.UserProfileDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.UserProfileStatus

-- | The user profile details.
--
-- /See:/ 'newUserProfileDetails' smart constructor.
data UserProfileDetails = UserProfileDetails'
  { -- | The creation time.
    UserProfileDetails -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The status.
    UserProfileDetails -> Maybe UserProfileStatus
status :: Prelude.Maybe UserProfileStatus,
    -- | The user profile name.
    UserProfileDetails -> Maybe Text
userProfileName :: Prelude.Maybe Prelude.Text,
    -- | The last modified time.
    UserProfileDetails -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
    -- | The domain ID.
    UserProfileDetails -> Maybe Text
domainId :: Prelude.Maybe Prelude.Text
  }
  deriving (UserProfileDetails -> UserProfileDetails -> Bool
(UserProfileDetails -> UserProfileDetails -> Bool)
-> (UserProfileDetails -> UserProfileDetails -> Bool)
-> Eq UserProfileDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserProfileDetails -> UserProfileDetails -> Bool
$c/= :: UserProfileDetails -> UserProfileDetails -> Bool
== :: UserProfileDetails -> UserProfileDetails -> Bool
$c== :: UserProfileDetails -> UserProfileDetails -> Bool
Prelude.Eq, ReadPrec [UserProfileDetails]
ReadPrec UserProfileDetails
Int -> ReadS UserProfileDetails
ReadS [UserProfileDetails]
(Int -> ReadS UserProfileDetails)
-> ReadS [UserProfileDetails]
-> ReadPrec UserProfileDetails
-> ReadPrec [UserProfileDetails]
-> Read UserProfileDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserProfileDetails]
$creadListPrec :: ReadPrec [UserProfileDetails]
readPrec :: ReadPrec UserProfileDetails
$creadPrec :: ReadPrec UserProfileDetails
readList :: ReadS [UserProfileDetails]
$creadList :: ReadS [UserProfileDetails]
readsPrec :: Int -> ReadS UserProfileDetails
$creadsPrec :: Int -> ReadS UserProfileDetails
Prelude.Read, Int -> UserProfileDetails -> ShowS
[UserProfileDetails] -> ShowS
UserProfileDetails -> String
(Int -> UserProfileDetails -> ShowS)
-> (UserProfileDetails -> String)
-> ([UserProfileDetails] -> ShowS)
-> Show UserProfileDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserProfileDetails] -> ShowS
$cshowList :: [UserProfileDetails] -> ShowS
show :: UserProfileDetails -> String
$cshow :: UserProfileDetails -> String
showsPrec :: Int -> UserProfileDetails -> ShowS
$cshowsPrec :: Int -> UserProfileDetails -> ShowS
Prelude.Show, (forall x. UserProfileDetails -> Rep UserProfileDetails x)
-> (forall x. Rep UserProfileDetails x -> UserProfileDetails)
-> Generic UserProfileDetails
forall x. Rep UserProfileDetails x -> UserProfileDetails
forall x. UserProfileDetails -> Rep UserProfileDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserProfileDetails x -> UserProfileDetails
$cfrom :: forall x. UserProfileDetails -> Rep UserProfileDetails x
Prelude.Generic)

-- |
-- Create a value of 'UserProfileDetails' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'creationTime', 'userProfileDetails_creationTime' - The creation time.
--
-- 'status', 'userProfileDetails_status' - The status.
--
-- 'userProfileName', 'userProfileDetails_userProfileName' - The user profile name.
--
-- 'lastModifiedTime', 'userProfileDetails_lastModifiedTime' - The last modified time.
--
-- 'domainId', 'userProfileDetails_domainId' - The domain ID.
newUserProfileDetails ::
  UserProfileDetails
newUserProfileDetails :: UserProfileDetails
newUserProfileDetails =
  UserProfileDetails' :: Maybe POSIX
-> Maybe UserProfileStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> UserProfileDetails
UserProfileDetails'
    { $sel:creationTime:UserProfileDetails' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:UserProfileDetails' :: Maybe UserProfileStatus
status = Maybe UserProfileStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:userProfileName:UserProfileDetails' :: Maybe Text
userProfileName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:UserProfileDetails' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:domainId:UserProfileDetails' :: Maybe Text
domainId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The creation time.
userProfileDetails_creationTime :: Lens.Lens' UserProfileDetails (Prelude.Maybe Prelude.UTCTime)
userProfileDetails_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UserProfileDetails -> f UserProfileDetails
userProfileDetails_creationTime = (UserProfileDetails -> Maybe POSIX)
-> (UserProfileDetails -> Maybe POSIX -> UserProfileDetails)
-> Lens
     UserProfileDetails UserProfileDetails (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserProfileDetails' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:UserProfileDetails' :: UserProfileDetails -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: UserProfileDetails
s@UserProfileDetails' {} Maybe POSIX
a -> UserProfileDetails
s {$sel:creationTime:UserProfileDetails' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: UserProfileDetails) ((Maybe POSIX -> f (Maybe POSIX))
 -> UserProfileDetails -> f UserProfileDetails)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UserProfileDetails
-> f UserProfileDetails
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

-- | The status.
userProfileDetails_status :: Lens.Lens' UserProfileDetails (Prelude.Maybe UserProfileStatus)
userProfileDetails_status :: (Maybe UserProfileStatus -> f (Maybe UserProfileStatus))
-> UserProfileDetails -> f UserProfileDetails
userProfileDetails_status = (UserProfileDetails -> Maybe UserProfileStatus)
-> (UserProfileDetails
    -> Maybe UserProfileStatus -> UserProfileDetails)
-> Lens
     UserProfileDetails
     UserProfileDetails
     (Maybe UserProfileStatus)
     (Maybe UserProfileStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserProfileDetails' {Maybe UserProfileStatus
status :: Maybe UserProfileStatus
$sel:status:UserProfileDetails' :: UserProfileDetails -> Maybe UserProfileStatus
status} -> Maybe UserProfileStatus
status) (\s :: UserProfileDetails
s@UserProfileDetails' {} Maybe UserProfileStatus
a -> UserProfileDetails
s {$sel:status:UserProfileDetails' :: Maybe UserProfileStatus
status = Maybe UserProfileStatus
a} :: UserProfileDetails)

-- | The user profile name.
userProfileDetails_userProfileName :: Lens.Lens' UserProfileDetails (Prelude.Maybe Prelude.Text)
userProfileDetails_userProfileName :: (Maybe Text -> f (Maybe Text))
-> UserProfileDetails -> f UserProfileDetails
userProfileDetails_userProfileName = (UserProfileDetails -> Maybe Text)
-> (UserProfileDetails -> Maybe Text -> UserProfileDetails)
-> Lens
     UserProfileDetails UserProfileDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserProfileDetails' {Maybe Text
userProfileName :: Maybe Text
$sel:userProfileName:UserProfileDetails' :: UserProfileDetails -> Maybe Text
userProfileName} -> Maybe Text
userProfileName) (\s :: UserProfileDetails
s@UserProfileDetails' {} Maybe Text
a -> UserProfileDetails
s {$sel:userProfileName:UserProfileDetails' :: Maybe Text
userProfileName = Maybe Text
a} :: UserProfileDetails)

-- | The last modified time.
userProfileDetails_lastModifiedTime :: Lens.Lens' UserProfileDetails (Prelude.Maybe Prelude.UTCTime)
userProfileDetails_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UserProfileDetails -> f UserProfileDetails
userProfileDetails_lastModifiedTime = (UserProfileDetails -> Maybe POSIX)
-> (UserProfileDetails -> Maybe POSIX -> UserProfileDetails)
-> Lens
     UserProfileDetails UserProfileDetails (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserProfileDetails' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:UserProfileDetails' :: UserProfileDetails -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: UserProfileDetails
s@UserProfileDetails' {} Maybe POSIX
a -> UserProfileDetails
s {$sel:lastModifiedTime:UserProfileDetails' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: UserProfileDetails) ((Maybe POSIX -> f (Maybe POSIX))
 -> UserProfileDetails -> f UserProfileDetails)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UserProfileDetails
-> f UserProfileDetails
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

-- | The domain ID.
userProfileDetails_domainId :: Lens.Lens' UserProfileDetails (Prelude.Maybe Prelude.Text)
userProfileDetails_domainId :: (Maybe Text -> f (Maybe Text))
-> UserProfileDetails -> f UserProfileDetails
userProfileDetails_domainId = (UserProfileDetails -> Maybe Text)
-> (UserProfileDetails -> Maybe Text -> UserProfileDetails)
-> Lens
     UserProfileDetails UserProfileDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserProfileDetails' {Maybe Text
domainId :: Maybe Text
$sel:domainId:UserProfileDetails' :: UserProfileDetails -> Maybe Text
domainId} -> Maybe Text
domainId) (\s :: UserProfileDetails
s@UserProfileDetails' {} Maybe Text
a -> UserProfileDetails
s {$sel:domainId:UserProfileDetails' :: Maybe Text
domainId = Maybe Text
a} :: UserProfileDetails)

instance Core.FromJSON UserProfileDetails where
  parseJSON :: Value -> Parser UserProfileDetails
parseJSON =
    String
-> (Object -> Parser UserProfileDetails)
-> Value
-> Parser UserProfileDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"UserProfileDetails"
      ( \Object
x ->
          Maybe POSIX
-> Maybe UserProfileStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> UserProfileDetails
UserProfileDetails'
            (Maybe POSIX
 -> Maybe UserProfileStatus
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> UserProfileDetails)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe UserProfileStatus
      -> Maybe Text -> Maybe POSIX -> Maybe Text -> UserProfileDetails)
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
"CreationTime")
            Parser
  (Maybe UserProfileStatus
   -> Maybe Text -> Maybe POSIX -> Maybe Text -> UserProfileDetails)
-> Parser (Maybe UserProfileStatus)
-> Parser
     (Maybe Text -> Maybe POSIX -> Maybe Text -> UserProfileDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe UserProfileStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Text -> Maybe POSIX -> Maybe Text -> UserProfileDetails)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> UserProfileDetails)
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
"UserProfileName")
            Parser (Maybe POSIX -> Maybe Text -> UserProfileDetails)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> UserProfileDetails)
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
"LastModifiedTime")
            Parser (Maybe Text -> UserProfileDetails)
-> Parser (Maybe Text) -> Parser UserProfileDetails
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 UserProfileDetails

instance Prelude.NFData UserProfileDetails