{-# 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-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.AppDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 creation time.
    AppDetails -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The status.
    AppDetails -> Maybe AppStatus
status :: Prelude.Maybe AppStatus,
    -- | The user profile name.
    AppDetails -> Maybe Text
userProfileName :: Prelude.Maybe Prelude.Text,
    -- | The name of the app.
    AppDetails -> Maybe Text
appName :: Prelude.Maybe Prelude.Text,
    -- | The domain ID.
    AppDetails -> Maybe Text
domainId :: Prelude.Maybe Prelude.Text,
    -- | The type of app.
    AppDetails -> Maybe AppType
appType :: Prelude.Maybe AppType
  }
  deriving (AppDetails -> AppDetails -> Bool
(AppDetails -> AppDetails -> Bool)
-> (AppDetails -> AppDetails -> Bool) -> Eq AppDetails
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]
(Int -> ReadS AppDetails)
-> ReadS [AppDetails]
-> ReadPrec AppDetails
-> ReadPrec [AppDetails]
-> Read 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
(Int -> AppDetails -> ShowS)
-> (AppDetails -> String)
-> ([AppDetails] -> ShowS)
-> Show AppDetails
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. AppDetails -> Rep AppDetails x)
-> (forall x. Rep AppDetails x -> AppDetails) -> Generic AppDetails
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:
--
-- 'creationTime', 'appDetails_creationTime' - The creation time.
--
-- 'status', 'appDetails_status' - The status.
--
-- 'userProfileName', 'appDetails_userProfileName' - The user profile name.
--
-- 'appName', 'appDetails_appName' - The name of the app.
--
-- 'domainId', 'appDetails_domainId' - The domain ID.
--
-- 'appType', 'appDetails_appType' - The type of app.
newAppDetails ::
  AppDetails
newAppDetails :: AppDetails
newAppDetails =
  AppDetails' :: Maybe POSIX
-> Maybe AppStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AppType
-> AppDetails
AppDetails'
    { $sel:creationTime:AppDetails' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:AppDetails' :: Maybe AppStatus
status = Maybe AppStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:userProfileName:AppDetails' :: Maybe Text
userProfileName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appName:AppDetails' :: Maybe Text
appName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainId:AppDetails' :: Maybe Text
domainId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appType:AppDetails' :: Maybe AppType
appType = Maybe AppType
forall a. Maybe a
Prelude.Nothing
    }

-- | The creation time.
appDetails_creationTime :: Lens.Lens' AppDetails (Prelude.Maybe Prelude.UTCTime)
appDetails_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> AppDetails -> f AppDetails
appDetails_creationTime = (AppDetails -> Maybe POSIX)
-> (AppDetails -> Maybe POSIX -> AppDetails)
-> Lens AppDetails AppDetails (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX)) -> AppDetails -> f AppDetails)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AppDetails
-> f AppDetails
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.
appDetails_status :: Lens.Lens' AppDetails (Prelude.Maybe AppStatus)
appDetails_status :: (Maybe AppStatus -> f (Maybe AppStatus))
-> AppDetails -> f AppDetails
appDetails_status = (AppDetails -> Maybe AppStatus)
-> (AppDetails -> Maybe AppStatus -> AppDetails)
-> Lens AppDetails AppDetails (Maybe AppStatus) (Maybe AppStatus)
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 :: (Maybe Text -> f (Maybe Text)) -> AppDetails -> f AppDetails
appDetails_userProfileName = (AppDetails -> Maybe Text)
-> (AppDetails -> Maybe Text -> AppDetails)
-> Lens AppDetails AppDetails (Maybe Text) (Maybe Text)
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)

-- | The name of the app.
appDetails_appName :: Lens.Lens' AppDetails (Prelude.Maybe Prelude.Text)
appDetails_appName :: (Maybe Text -> f (Maybe Text)) -> AppDetails -> f AppDetails
appDetails_appName = (AppDetails -> Maybe Text)
-> (AppDetails -> Maybe Text -> AppDetails)
-> Lens AppDetails AppDetails (Maybe Text) (Maybe Text)
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 domain ID.
appDetails_domainId :: Lens.Lens' AppDetails (Prelude.Maybe Prelude.Text)
appDetails_domainId :: (Maybe Text -> f (Maybe Text)) -> AppDetails -> f AppDetails
appDetails_domainId = (AppDetails -> Maybe Text)
-> (AppDetails -> Maybe Text -> AppDetails)
-> Lens AppDetails AppDetails (Maybe Text) (Maybe Text)
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 type of app.
appDetails_appType :: Lens.Lens' AppDetails (Prelude.Maybe AppType)
appDetails_appType :: (Maybe AppType -> f (Maybe AppType)) -> AppDetails -> f AppDetails
appDetails_appType = (AppDetails -> Maybe AppType)
-> (AppDetails -> Maybe AppType -> AppDetails)
-> Lens AppDetails AppDetails (Maybe AppType) (Maybe 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)

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

instance Prelude.Hashable AppDetails

instance Prelude.NFData AppDetails