{-# 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.AppDetails
-- 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.AppDetails 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.AppStatus
import Amazonka.SageMaker.Types.AppType

-- | Details about an Amazon SageMaker app.
--
-- /See:/ 'newAppDetails' smart constructor.
data AppDetails = AppDetails'
  { -- | The name of the app.
    AppDetails -> Maybe Text
appName :: Prelude.Maybe Prelude.Text,
    -- | The type of app.
    AppDetails -> Maybe AppType
appType :: Prelude.Maybe AppType,
    -- | The creation time.
    AppDetails -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
    -- | The domain ID.
    AppDetails -> Maybe Text
domainId :: Prelude.Maybe Prelude.Text,
    -- | The name of the space.
    AppDetails -> Maybe Text
spaceName :: Prelude.Maybe Prelude.Text,
    -- | The status.
    AppDetails -> Maybe AppStatus
status :: Prelude.Maybe AppStatus,
    -- | The user profile name.
    AppDetails -> Maybe Text
userProfileName :: Prelude.Maybe Prelude.Text
  }
  deriving (AppDetails -> AppDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AppDetails -> AppDetails -> Bool
$c/= :: AppDetails -> AppDetails -> Bool
== :: AppDetails -> AppDetails -> Bool
$c== :: AppDetails -> AppDetails -> Bool
Prelude.Eq, ReadPrec [AppDetails]
ReadPrec AppDetails
Int -> ReadS AppDetails
ReadS [AppDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AppDetails]
$creadListPrec :: ReadPrec [AppDetails]
readPrec :: ReadPrec AppDetails
$creadPrec :: ReadPrec AppDetails
readList :: ReadS [AppDetails]
$creadList :: ReadS [AppDetails]
readsPrec :: Int -> ReadS AppDetails
$creadsPrec :: Int -> ReadS AppDetails
Prelude.Read, Int -> AppDetails -> ShowS
[AppDetails] -> ShowS
AppDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AppDetails] -> ShowS
$cshowList :: [AppDetails] -> ShowS
show :: AppDetails -> String
$cshow :: AppDetails -> String
showsPrec :: Int -> AppDetails -> ShowS
$cshowsPrec :: Int -> AppDetails -> ShowS
Prelude.Show, forall x. Rep AppDetails x -> AppDetails
forall x. AppDetails -> Rep AppDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AppDetails x -> AppDetails
$cfrom :: forall x. AppDetails -> Rep AppDetails x
Prelude.Generic)

-- |
-- Create a value of 'AppDetails' 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:
--
-- 'appName', 'appDetails_appName' - The name of the app.
--
-- 'appType', 'appDetails_appType' - The type of app.
--
-- 'creationTime', 'appDetails_creationTime' - The creation time.
--
-- 'domainId', 'appDetails_domainId' - The domain ID.
--
-- 'spaceName', 'appDetails_spaceName' - The name of the space.
--
-- 'status', 'appDetails_status' - The status.
--
-- 'userProfileName', 'appDetails_userProfileName' - The user profile name.
newAppDetails ::
  AppDetails
newAppDetails :: AppDetails
newAppDetails =
  AppDetails'
    { $sel:appName:AppDetails' :: Maybe Text
appName = forall a. Maybe a
Prelude.Nothing,
      $sel:appType:AppDetails' :: Maybe AppType
appType = forall a. Maybe a
Prelude.Nothing,
      $sel:creationTime:AppDetails' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:domainId:AppDetails' :: Maybe Text
domainId = forall a. Maybe a
Prelude.Nothing,
      $sel:spaceName:AppDetails' :: Maybe Text
spaceName = forall a. Maybe a
Prelude.Nothing,
      $sel:status:AppDetails' :: Maybe AppStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:userProfileName:AppDetails' :: Maybe Text
userProfileName = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the app.
appDetails_appName :: Lens.Lens' AppDetails (Prelude.Maybe Prelude.Text)
appDetails_appName :: Lens' AppDetails (Maybe Text)
appDetails_appName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppDetails' {Maybe Text
appName :: Maybe Text
$sel:appName:AppDetails' :: AppDetails -> Maybe Text
appName} -> Maybe Text
appName) (\s :: AppDetails
s@AppDetails' {} Maybe Text
a -> AppDetails
s {$sel:appName:AppDetails' :: Maybe Text
appName = Maybe Text
a} :: AppDetails)

-- | The type of app.
appDetails_appType :: Lens.Lens' AppDetails (Prelude.Maybe AppType)
appDetails_appType :: Lens' AppDetails (Maybe AppType)
appDetails_appType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppDetails' {Maybe AppType
appType :: Maybe AppType
$sel:appType:AppDetails' :: AppDetails -> Maybe AppType
appType} -> Maybe AppType
appType) (\s :: AppDetails
s@AppDetails' {} Maybe AppType
a -> AppDetails
s {$sel:appType:AppDetails' :: Maybe AppType
appType = Maybe AppType
a} :: AppDetails)

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

-- | The name of the space.
appDetails_spaceName :: Lens.Lens' AppDetails (Prelude.Maybe Prelude.Text)
appDetails_spaceName :: Lens' AppDetails (Maybe Text)
appDetails_spaceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppDetails' {Maybe Text
spaceName :: Maybe Text
$sel:spaceName:AppDetails' :: AppDetails -> Maybe Text
spaceName} -> Maybe Text
spaceName) (\s :: AppDetails
s@AppDetails' {} Maybe Text
a -> AppDetails
s {$sel:spaceName:AppDetails' :: Maybe Text
spaceName = Maybe Text
a} :: AppDetails)

-- | The status.
appDetails_status :: Lens.Lens' AppDetails (Prelude.Maybe AppStatus)
appDetails_status :: Lens' AppDetails (Maybe AppStatus)
appDetails_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppDetails' {Maybe AppStatus
status :: Maybe AppStatus
$sel:status:AppDetails' :: AppDetails -> Maybe AppStatus
status} -> Maybe AppStatus
status) (\s :: AppDetails
s@AppDetails' {} Maybe AppStatus
a -> AppDetails
s {$sel:status:AppDetails' :: Maybe AppStatus
status = Maybe AppStatus
a} :: AppDetails)

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

instance Data.FromJSON AppDetails where
  parseJSON :: Value -> Parser AppDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AppDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe AppType
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe AppStatus
-> Maybe Text
-> AppDetails
AppDetails'
            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
"AppName")
            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
"AppType")
            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
"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
"SpaceName")
            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 AppDetails where
  hashWithSalt :: Int -> AppDetails -> Int
hashWithSalt Int
_salt AppDetails' {Maybe Text
Maybe POSIX
Maybe AppStatus
Maybe AppType
userProfileName :: Maybe Text
status :: Maybe AppStatus
spaceName :: Maybe Text
domainId :: Maybe Text
creationTime :: Maybe POSIX
appType :: Maybe AppType
appName :: Maybe Text
$sel:userProfileName:AppDetails' :: AppDetails -> Maybe Text
$sel:status:AppDetails' :: AppDetails -> Maybe AppStatus
$sel:spaceName:AppDetails' :: AppDetails -> Maybe Text
$sel:domainId:AppDetails' :: AppDetails -> Maybe Text
$sel:creationTime:AppDetails' :: AppDetails -> Maybe POSIX
$sel:appType:AppDetails' :: AppDetails -> Maybe AppType
$sel:appName:AppDetails' :: AppDetails -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
appName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AppType
appType
      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 Text
spaceName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AppStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
userProfileName

instance Prelude.NFData AppDetails where
  rnf :: AppDetails -> ()
rnf AppDetails' {Maybe Text
Maybe POSIX
Maybe AppStatus
Maybe AppType
userProfileName :: Maybe Text
status :: Maybe AppStatus
spaceName :: Maybe Text
domainId :: Maybe Text
creationTime :: Maybe POSIX
appType :: Maybe AppType
appName :: Maybe Text
$sel:userProfileName:AppDetails' :: AppDetails -> Maybe Text
$sel:status:AppDetails' :: AppDetails -> Maybe AppStatus
$sel:spaceName:AppDetails' :: AppDetails -> Maybe Text
$sel:domainId:AppDetails' :: AppDetails -> Maybe Text
$sel:creationTime:AppDetails' :: AppDetails -> Maybe POSIX
$sel:appType:AppDetails' :: AppDetails -> Maybe AppType
$sel:appName:AppDetails' :: AppDetails -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
appName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AppType
appType
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Text
spaceName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AppStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userProfileName