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

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

-- | The configuration for running a SageMaker image as a KernelGateway app.
--
-- /See:/ 'newAppImageConfigDetails' smart constructor.
data AppImageConfigDetails = AppImageConfigDetails'
  { -- | When the AppImageConfig was created.
    AppImageConfigDetails -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the AppImageConfig. Must be unique to your account.
    AppImageConfigDetails -> Maybe Text
appImageConfigName :: Prelude.Maybe Prelude.Text,
    -- | When the AppImageConfig was last modified.
    AppImageConfigDetails -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
    -- | The configuration for the file system and kernels in the SageMaker
    -- image.
    AppImageConfigDetails -> Maybe KernelGatewayImageConfig
kernelGatewayImageConfig :: Prelude.Maybe KernelGatewayImageConfig,
    -- | The Amazon Resource Name (ARN) of the AppImageConfig.
    AppImageConfigDetails -> Maybe Text
appImageConfigArn :: Prelude.Maybe Prelude.Text
  }
  deriving (AppImageConfigDetails -> AppImageConfigDetails -> Bool
(AppImageConfigDetails -> AppImageConfigDetails -> Bool)
-> (AppImageConfigDetails -> AppImageConfigDetails -> Bool)
-> Eq AppImageConfigDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AppImageConfigDetails -> AppImageConfigDetails -> Bool
$c/= :: AppImageConfigDetails -> AppImageConfigDetails -> Bool
== :: AppImageConfigDetails -> AppImageConfigDetails -> Bool
$c== :: AppImageConfigDetails -> AppImageConfigDetails -> Bool
Prelude.Eq, ReadPrec [AppImageConfigDetails]
ReadPrec AppImageConfigDetails
Int -> ReadS AppImageConfigDetails
ReadS [AppImageConfigDetails]
(Int -> ReadS AppImageConfigDetails)
-> ReadS [AppImageConfigDetails]
-> ReadPrec AppImageConfigDetails
-> ReadPrec [AppImageConfigDetails]
-> Read AppImageConfigDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AppImageConfigDetails]
$creadListPrec :: ReadPrec [AppImageConfigDetails]
readPrec :: ReadPrec AppImageConfigDetails
$creadPrec :: ReadPrec AppImageConfigDetails
readList :: ReadS [AppImageConfigDetails]
$creadList :: ReadS [AppImageConfigDetails]
readsPrec :: Int -> ReadS AppImageConfigDetails
$creadsPrec :: Int -> ReadS AppImageConfigDetails
Prelude.Read, Int -> AppImageConfigDetails -> ShowS
[AppImageConfigDetails] -> ShowS
AppImageConfigDetails -> String
(Int -> AppImageConfigDetails -> ShowS)
-> (AppImageConfigDetails -> String)
-> ([AppImageConfigDetails] -> ShowS)
-> Show AppImageConfigDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AppImageConfigDetails] -> ShowS
$cshowList :: [AppImageConfigDetails] -> ShowS
show :: AppImageConfigDetails -> String
$cshow :: AppImageConfigDetails -> String
showsPrec :: Int -> AppImageConfigDetails -> ShowS
$cshowsPrec :: Int -> AppImageConfigDetails -> ShowS
Prelude.Show, (forall x. AppImageConfigDetails -> Rep AppImageConfigDetails x)
-> (forall x. Rep AppImageConfigDetails x -> AppImageConfigDetails)
-> Generic AppImageConfigDetails
forall x. Rep AppImageConfigDetails x -> AppImageConfigDetails
forall x. AppImageConfigDetails -> Rep AppImageConfigDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AppImageConfigDetails x -> AppImageConfigDetails
$cfrom :: forall x. AppImageConfigDetails -> Rep AppImageConfigDetails x
Prelude.Generic)

-- |
-- Create a value of 'AppImageConfigDetails' 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', 'appImageConfigDetails_creationTime' - When the AppImageConfig was created.
--
-- 'appImageConfigName', 'appImageConfigDetails_appImageConfigName' - The name of the AppImageConfig. Must be unique to your account.
--
-- 'lastModifiedTime', 'appImageConfigDetails_lastModifiedTime' - When the AppImageConfig was last modified.
--
-- 'kernelGatewayImageConfig', 'appImageConfigDetails_kernelGatewayImageConfig' - The configuration for the file system and kernels in the SageMaker
-- image.
--
-- 'appImageConfigArn', 'appImageConfigDetails_appImageConfigArn' - The Amazon Resource Name (ARN) of the AppImageConfig.
newAppImageConfigDetails ::
  AppImageConfigDetails
newAppImageConfigDetails :: AppImageConfigDetails
newAppImageConfigDetails =
  AppImageConfigDetails' :: Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe KernelGatewayImageConfig
-> Maybe Text
-> AppImageConfigDetails
AppImageConfigDetails'
    { $sel:creationTime:AppImageConfigDetails' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:appImageConfigName:AppImageConfigDetails' :: Maybe Text
appImageConfigName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:AppImageConfigDetails' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:kernelGatewayImageConfig:AppImageConfigDetails' :: Maybe KernelGatewayImageConfig
kernelGatewayImageConfig = Maybe KernelGatewayImageConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:appImageConfigArn:AppImageConfigDetails' :: Maybe Text
appImageConfigArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | When the AppImageConfig was created.
appImageConfigDetails_creationTime :: Lens.Lens' AppImageConfigDetails (Prelude.Maybe Prelude.UTCTime)
appImageConfigDetails_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AppImageConfigDetails -> f AppImageConfigDetails
appImageConfigDetails_creationTime = (AppImageConfigDetails -> Maybe POSIX)
-> (AppImageConfigDetails -> Maybe POSIX -> AppImageConfigDetails)
-> Lens
     AppImageConfigDetails
     AppImageConfigDetails
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppImageConfigDetails' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:AppImageConfigDetails' :: AppImageConfigDetails -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: AppImageConfigDetails
s@AppImageConfigDetails' {} Maybe POSIX
a -> AppImageConfigDetails
s {$sel:creationTime:AppImageConfigDetails' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: AppImageConfigDetails) ((Maybe POSIX -> f (Maybe POSIX))
 -> AppImageConfigDetails -> f AppImageConfigDetails)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AppImageConfigDetails
-> f AppImageConfigDetails
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 name of the AppImageConfig. Must be unique to your account.
appImageConfigDetails_appImageConfigName :: Lens.Lens' AppImageConfigDetails (Prelude.Maybe Prelude.Text)
appImageConfigDetails_appImageConfigName :: (Maybe Text -> f (Maybe Text))
-> AppImageConfigDetails -> f AppImageConfigDetails
appImageConfigDetails_appImageConfigName = (AppImageConfigDetails -> Maybe Text)
-> (AppImageConfigDetails -> Maybe Text -> AppImageConfigDetails)
-> Lens
     AppImageConfigDetails
     AppImageConfigDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppImageConfigDetails' {Maybe Text
appImageConfigName :: Maybe Text
$sel:appImageConfigName:AppImageConfigDetails' :: AppImageConfigDetails -> Maybe Text
appImageConfigName} -> Maybe Text
appImageConfigName) (\s :: AppImageConfigDetails
s@AppImageConfigDetails' {} Maybe Text
a -> AppImageConfigDetails
s {$sel:appImageConfigName:AppImageConfigDetails' :: Maybe Text
appImageConfigName = Maybe Text
a} :: AppImageConfigDetails)

-- | When the AppImageConfig was last modified.
appImageConfigDetails_lastModifiedTime :: Lens.Lens' AppImageConfigDetails (Prelude.Maybe Prelude.UTCTime)
appImageConfigDetails_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AppImageConfigDetails -> f AppImageConfigDetails
appImageConfigDetails_lastModifiedTime = (AppImageConfigDetails -> Maybe POSIX)
-> (AppImageConfigDetails -> Maybe POSIX -> AppImageConfigDetails)
-> Lens
     AppImageConfigDetails
     AppImageConfigDetails
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppImageConfigDetails' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:AppImageConfigDetails' :: AppImageConfigDetails -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: AppImageConfigDetails
s@AppImageConfigDetails' {} Maybe POSIX
a -> AppImageConfigDetails
s {$sel:lastModifiedTime:AppImageConfigDetails' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: AppImageConfigDetails) ((Maybe POSIX -> f (Maybe POSIX))
 -> AppImageConfigDetails -> f AppImageConfigDetails)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AppImageConfigDetails
-> f AppImageConfigDetails
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 configuration for the file system and kernels in the SageMaker
-- image.
appImageConfigDetails_kernelGatewayImageConfig :: Lens.Lens' AppImageConfigDetails (Prelude.Maybe KernelGatewayImageConfig)
appImageConfigDetails_kernelGatewayImageConfig :: (Maybe KernelGatewayImageConfig
 -> f (Maybe KernelGatewayImageConfig))
-> AppImageConfigDetails -> f AppImageConfigDetails
appImageConfigDetails_kernelGatewayImageConfig = (AppImageConfigDetails -> Maybe KernelGatewayImageConfig)
-> (AppImageConfigDetails
    -> Maybe KernelGatewayImageConfig -> AppImageConfigDetails)
-> Lens
     AppImageConfigDetails
     AppImageConfigDetails
     (Maybe KernelGatewayImageConfig)
     (Maybe KernelGatewayImageConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppImageConfigDetails' {Maybe KernelGatewayImageConfig
kernelGatewayImageConfig :: Maybe KernelGatewayImageConfig
$sel:kernelGatewayImageConfig:AppImageConfigDetails' :: AppImageConfigDetails -> Maybe KernelGatewayImageConfig
kernelGatewayImageConfig} -> Maybe KernelGatewayImageConfig
kernelGatewayImageConfig) (\s :: AppImageConfigDetails
s@AppImageConfigDetails' {} Maybe KernelGatewayImageConfig
a -> AppImageConfigDetails
s {$sel:kernelGatewayImageConfig:AppImageConfigDetails' :: Maybe KernelGatewayImageConfig
kernelGatewayImageConfig = Maybe KernelGatewayImageConfig
a} :: AppImageConfigDetails)

-- | The Amazon Resource Name (ARN) of the AppImageConfig.
appImageConfigDetails_appImageConfigArn :: Lens.Lens' AppImageConfigDetails (Prelude.Maybe Prelude.Text)
appImageConfigDetails_appImageConfigArn :: (Maybe Text -> f (Maybe Text))
-> AppImageConfigDetails -> f AppImageConfigDetails
appImageConfigDetails_appImageConfigArn = (AppImageConfigDetails -> Maybe Text)
-> (AppImageConfigDetails -> Maybe Text -> AppImageConfigDetails)
-> Lens
     AppImageConfigDetails
     AppImageConfigDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppImageConfigDetails' {Maybe Text
appImageConfigArn :: Maybe Text
$sel:appImageConfigArn:AppImageConfigDetails' :: AppImageConfigDetails -> Maybe Text
appImageConfigArn} -> Maybe Text
appImageConfigArn) (\s :: AppImageConfigDetails
s@AppImageConfigDetails' {} Maybe Text
a -> AppImageConfigDetails
s {$sel:appImageConfigArn:AppImageConfigDetails' :: Maybe Text
appImageConfigArn = Maybe Text
a} :: AppImageConfigDetails)

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

instance Prelude.Hashable AppImageConfigDetails

instance Prelude.NFData AppImageConfigDetails