{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.UserProfileDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 Data.POSIX,
    -- | The domain ID.
    UserProfileDetails -> Maybe Text
domainId :: Prelude.Maybe Prelude.Text,
    -- | The last modified time.
    UserProfileDetails -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Data.POSIX,
    -- | The status.
    UserProfileDetails -> Maybe UserProfileStatus
status :: Prelude.Maybe UserProfileStatus,
    -- | The user profile name.
    UserProfileDetails -> Maybe Text
userProfileName :: Prelude.Maybe Prelude.Text
  }
  deriving (UserProfileDetails -> UserProfileDetails -> Bool
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]
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
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. 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.
--
-- 'domainId', 'userProfileDetails_domainId' - The domain ID.
--
-- 'lastModifiedTime', 'userProfileDetails_lastModifiedTime' - The last modified time.
--
-- 'status', 'userProfileDetails_status' - The status.
--
-- 'userProfileName', 'userProfileDetails_userProfileName' - The user profile name.
newUserProfileDetails ::
  UserProfileDetails
newUserProfileDetails :: UserProfileDetails
newUserProfileDetails =
  UserProfileDetails'
    { $sel:creationTime:UserProfileDetails' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:domainId:UserProfileDetails' :: Maybe Text
domainId = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:UserProfileDetails' :: Maybe POSIX
lastModifiedTime = forall a. Maybe a
Prelude.Nothing,
      $sel:status:UserProfileDetails' :: Maybe UserProfileStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:userProfileName:UserProfileDetails' :: Maybe Text
userProfileName = forall a. Maybe a
Prelude.Nothing
    }

-- | The creation time.
userProfileDetails_creationTime :: Lens.Lens' UserProfileDetails (Prelude.Maybe Prelude.UTCTime)
userProfileDetails_creationTime :: Lens' UserProfileDetails (Maybe UTCTime)
userProfileDetails_creationTime = 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) 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 :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The domain ID.
userProfileDetails_domainId :: Lens.Lens' UserProfileDetails (Prelude.Maybe Prelude.Text)
userProfileDetails_domainId :: Lens' UserProfileDetails (Maybe Text)
userProfileDetails_domainId = 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)

-- | The last modified time.
userProfileDetails_lastModifiedTime :: Lens.Lens' UserProfileDetails (Prelude.Maybe Prelude.UTCTime)
userProfileDetails_lastModifiedTime :: Lens' UserProfileDetails (Maybe UTCTime)
userProfileDetails_lastModifiedTime = 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) 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 :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The status.
userProfileDetails_status :: Lens.Lens' UserProfileDetails (Prelude.Maybe UserProfileStatus)
userProfileDetails_status :: Lens' UserProfileDetails (Maybe UserProfileStatus)
userProfileDetails_status = 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 :: Lens' UserProfileDetails (Maybe Text)
userProfileDetails_userProfileName = 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)

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

instance Prelude.Hashable UserProfileDetails where
  hashWithSalt :: Int -> UserProfileDetails -> Int
hashWithSalt Int
_salt UserProfileDetails' {Maybe Text
Maybe POSIX
Maybe UserProfileStatus
userProfileName :: Maybe Text
status :: Maybe UserProfileStatus
lastModifiedTime :: Maybe POSIX
domainId :: Maybe Text
creationTime :: Maybe POSIX
$sel:userProfileName:UserProfileDetails' :: UserProfileDetails -> Maybe Text
$sel:status:UserProfileDetails' :: UserProfileDetails -> Maybe UserProfileStatus
$sel:lastModifiedTime:UserProfileDetails' :: UserProfileDetails -> Maybe POSIX
$sel:domainId:UserProfileDetails' :: UserProfileDetails -> Maybe Text
$sel:creationTime:UserProfileDetails' :: UserProfileDetails -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
domainId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModifiedTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UserProfileStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
userProfileName

instance Prelude.NFData UserProfileDetails where
  rnf :: UserProfileDetails -> ()
rnf UserProfileDetails' {Maybe Text
Maybe POSIX
Maybe UserProfileStatus
userProfileName :: Maybe Text
status :: Maybe UserProfileStatus
lastModifiedTime :: Maybe POSIX
domainId :: Maybe Text
creationTime :: Maybe POSIX
$sel:userProfileName:UserProfileDetails' :: UserProfileDetails -> Maybe Text
$sel:status:UserProfileDetails' :: UserProfileDetails -> Maybe UserProfileStatus
$sel:lastModifiedTime:UserProfileDetails' :: UserProfileDetails -> Maybe POSIX
$sel:domainId:UserProfileDetails' :: UserProfileDetails -> Maybe Text
$sel:creationTime:UserProfileDetails' :: UserProfileDetails -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
domainId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UserProfileStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userProfileName