{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.DescribeApp
-- 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)
--
-- Describes the app.
module Amazonka.SageMaker.DescribeApp
  ( -- * Creating a Request
    DescribeApp (..),
    newDescribeApp,

    -- * Request Lenses
    describeApp_domainId,
    describeApp_userProfileName,
    describeApp_appType,
    describeApp_appName,

    -- * Destructuring the Response
    DescribeAppResponse (..),
    newDescribeAppResponse,

    -- * Response Lenses
    describeAppResponse_creationTime,
    describeAppResponse_status,
    describeAppResponse_failureReason,
    describeAppResponse_resourceSpec,
    describeAppResponse_userProfileName,
    describeAppResponse_lastUserActivityTimestamp,
    describeAppResponse_lastHealthCheckTimestamp,
    describeAppResponse_appName,
    describeAppResponse_appArn,
    describeAppResponse_domainId,
    describeAppResponse_appType,
    describeAppResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SageMaker.Types

-- | /See:/ 'newDescribeApp' smart constructor.
data DescribeApp = DescribeApp'
  { -- | The domain ID.
    DescribeApp -> Text
domainId :: Prelude.Text,
    -- | The user profile name.
    DescribeApp -> Text
userProfileName :: Prelude.Text,
    -- | The type of app.
    DescribeApp -> AppType
appType :: AppType,
    -- | The name of the app.
    DescribeApp -> Text
appName :: Prelude.Text
  }
  deriving (DescribeApp -> DescribeApp -> Bool
(DescribeApp -> DescribeApp -> Bool)
-> (DescribeApp -> DescribeApp -> Bool) -> Eq DescribeApp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeApp -> DescribeApp -> Bool
$c/= :: DescribeApp -> DescribeApp -> Bool
== :: DescribeApp -> DescribeApp -> Bool
$c== :: DescribeApp -> DescribeApp -> Bool
Prelude.Eq, ReadPrec [DescribeApp]
ReadPrec DescribeApp
Int -> ReadS DescribeApp
ReadS [DescribeApp]
(Int -> ReadS DescribeApp)
-> ReadS [DescribeApp]
-> ReadPrec DescribeApp
-> ReadPrec [DescribeApp]
-> Read DescribeApp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeApp]
$creadListPrec :: ReadPrec [DescribeApp]
readPrec :: ReadPrec DescribeApp
$creadPrec :: ReadPrec DescribeApp
readList :: ReadS [DescribeApp]
$creadList :: ReadS [DescribeApp]
readsPrec :: Int -> ReadS DescribeApp
$creadsPrec :: Int -> ReadS DescribeApp
Prelude.Read, Int -> DescribeApp -> ShowS
[DescribeApp] -> ShowS
DescribeApp -> String
(Int -> DescribeApp -> ShowS)
-> (DescribeApp -> String)
-> ([DescribeApp] -> ShowS)
-> Show DescribeApp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeApp] -> ShowS
$cshowList :: [DescribeApp] -> ShowS
show :: DescribeApp -> String
$cshow :: DescribeApp -> String
showsPrec :: Int -> DescribeApp -> ShowS
$cshowsPrec :: Int -> DescribeApp -> ShowS
Prelude.Show, (forall x. DescribeApp -> Rep DescribeApp x)
-> (forall x. Rep DescribeApp x -> DescribeApp)
-> Generic DescribeApp
forall x. Rep DescribeApp x -> DescribeApp
forall x. DescribeApp -> Rep DescribeApp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeApp x -> DescribeApp
$cfrom :: forall x. DescribeApp -> Rep DescribeApp x
Prelude.Generic)

-- |
-- Create a value of 'DescribeApp' 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:
--
-- 'domainId', 'describeApp_domainId' - The domain ID.
--
-- 'userProfileName', 'describeApp_userProfileName' - The user profile name.
--
-- 'appType', 'describeApp_appType' - The type of app.
--
-- 'appName', 'describeApp_appName' - The name of the app.
newDescribeApp ::
  -- | 'domainId'
  Prelude.Text ->
  -- | 'userProfileName'
  Prelude.Text ->
  -- | 'appType'
  AppType ->
  -- | 'appName'
  Prelude.Text ->
  DescribeApp
newDescribeApp :: Text -> Text -> AppType -> Text -> DescribeApp
newDescribeApp
  Text
pDomainId_
  Text
pUserProfileName_
  AppType
pAppType_
  Text
pAppName_ =
    DescribeApp' :: Text -> Text -> AppType -> Text -> DescribeApp
DescribeApp'
      { $sel:domainId:DescribeApp' :: Text
domainId = Text
pDomainId_,
        $sel:userProfileName:DescribeApp' :: Text
userProfileName = Text
pUserProfileName_,
        $sel:appType:DescribeApp' :: AppType
appType = AppType
pAppType_,
        $sel:appName:DescribeApp' :: Text
appName = Text
pAppName_
      }

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

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

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

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

instance Core.AWSRequest DescribeApp where
  type AWSResponse DescribeApp = DescribeAppResponse
  request :: DescribeApp -> Request DescribeApp
request = Service -> DescribeApp -> Request DescribeApp
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeApp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeApp)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeApp))
-> Logger
-> Service
-> Proxy DescribeApp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeApp)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe POSIX
-> Maybe AppStatus
-> Maybe Text
-> Maybe ResourceSpec
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AppType
-> Int
-> DescribeAppResponse
DescribeAppResponse'
            (Maybe POSIX
 -> Maybe AppStatus
 -> Maybe Text
 -> Maybe ResourceSpec
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe AppType
 -> Int
 -> DescribeAppResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe AppStatus
      -> Maybe Text
      -> Maybe ResourceSpec
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AppType
      -> Int
      -> DescribeAppResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreationTime")
            Either
  String
  (Maybe AppStatus
   -> Maybe Text
   -> Maybe ResourceSpec
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AppType
   -> Int
   -> DescribeAppResponse)
-> Either String (Maybe AppStatus)
-> Either
     String
     (Maybe Text
      -> Maybe ResourceSpec
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AppType
      -> Int
      -> DescribeAppResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AppStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
            Either
  String
  (Maybe Text
   -> Maybe ResourceSpec
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AppType
   -> Int
   -> DescribeAppResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ResourceSpec
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AppType
      -> Int
      -> DescribeAppResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FailureReason")
            Either
  String
  (Maybe ResourceSpec
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AppType
   -> Int
   -> DescribeAppResponse)
-> Either String (Maybe ResourceSpec)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AppType
      -> Int
      -> DescribeAppResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ResourceSpec)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ResourceSpec")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AppType
   -> Int
   -> DescribeAppResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AppType
      -> Int
      -> DescribeAppResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UserProfileName")
            Either
  String
  (Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AppType
   -> Int
   -> DescribeAppResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AppType
      -> Int
      -> DescribeAppResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LastUserActivityTimestamp")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AppType
   -> Int
   -> DescribeAppResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AppType
      -> Int
      -> DescribeAppResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LastHealthCheckTimestamp")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AppType
   -> Int
   -> DescribeAppResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe AppType -> Int -> DescribeAppResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AppName")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Maybe AppType -> Int -> DescribeAppResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Maybe AppType -> Int -> DescribeAppResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AppArn")
            Either
  String (Maybe Text -> Maybe AppType -> Int -> DescribeAppResponse)
-> Either String (Maybe Text)
-> Either String (Maybe AppType -> Int -> DescribeAppResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DomainId")
            Either String (Maybe AppType -> Int -> DescribeAppResponse)
-> Either String (Maybe AppType)
-> Either String (Int -> DescribeAppResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AppType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AppType")
            Either String (Int -> DescribeAppResponse)
-> Either String Int -> Either String DescribeAppResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeApp

instance Prelude.NFData DescribeApp

instance Core.ToHeaders DescribeApp where
  toHeaders :: DescribeApp -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeApp -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"SageMaker.DescribeApp" :: Prelude.ByteString),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DescribeApp where
  toJSON :: DescribeApp -> Value
toJSON DescribeApp' {Text
AppType
appName :: Text
appType :: AppType
userProfileName :: Text
domainId :: Text
$sel:appName:DescribeApp' :: DescribeApp -> Text
$sel:appType:DescribeApp' :: DescribeApp -> AppType
$sel:userProfileName:DescribeApp' :: DescribeApp -> Text
$sel:domainId:DescribeApp' :: DescribeApp -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DomainId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domainId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"UserProfileName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userProfileName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AppType" Text -> AppType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AppType
appType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AppName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
appName)
          ]
      )

instance Core.ToPath DescribeApp where
  toPath :: DescribeApp -> ByteString
toPath = ByteString -> DescribeApp -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery DescribeApp where
  toQuery :: DescribeApp -> QueryString
toQuery = QueryString -> DescribeApp -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeAppResponse' smart constructor.
data DescribeAppResponse = DescribeAppResponse'
  { -- | The creation time.
    DescribeAppResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The status.
    DescribeAppResponse -> Maybe AppStatus
status :: Prelude.Maybe AppStatus,
    -- | The failure reason.
    DescribeAppResponse -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | The instance type and the Amazon Resource Name (ARN) of the SageMaker
    -- image created on the instance.
    DescribeAppResponse -> Maybe ResourceSpec
resourceSpec :: Prelude.Maybe ResourceSpec,
    -- | The user profile name.
    DescribeAppResponse -> Maybe Text
userProfileName :: Prelude.Maybe Prelude.Text,
    -- | The timestamp of the last user\'s activity. @LastUserActivityTimestamp@
    -- is also updated when SageMaker performs health checks without user
    -- activity. As a result, this value is set to the same value as
    -- @LastHealthCheckTimestamp@.
    DescribeAppResponse -> Maybe POSIX
lastUserActivityTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The timestamp of the last health check.
    DescribeAppResponse -> Maybe POSIX
lastHealthCheckTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The name of the app.
    DescribeAppResponse -> Maybe Text
appName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the app.
    DescribeAppResponse -> Maybe Text
appArn :: Prelude.Maybe Prelude.Text,
    -- | The domain ID.
    DescribeAppResponse -> Maybe Text
domainId :: Prelude.Maybe Prelude.Text,
    -- | The type of app.
    DescribeAppResponse -> Maybe AppType
appType :: Prelude.Maybe AppType,
    -- | The response's http status code.
    DescribeAppResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeAppResponse -> DescribeAppResponse -> Bool
(DescribeAppResponse -> DescribeAppResponse -> Bool)
-> (DescribeAppResponse -> DescribeAppResponse -> Bool)
-> Eq DescribeAppResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAppResponse -> DescribeAppResponse -> Bool
$c/= :: DescribeAppResponse -> DescribeAppResponse -> Bool
== :: DescribeAppResponse -> DescribeAppResponse -> Bool
$c== :: DescribeAppResponse -> DescribeAppResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAppResponse]
ReadPrec DescribeAppResponse
Int -> ReadS DescribeAppResponse
ReadS [DescribeAppResponse]
(Int -> ReadS DescribeAppResponse)
-> ReadS [DescribeAppResponse]
-> ReadPrec DescribeAppResponse
-> ReadPrec [DescribeAppResponse]
-> Read DescribeAppResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAppResponse]
$creadListPrec :: ReadPrec [DescribeAppResponse]
readPrec :: ReadPrec DescribeAppResponse
$creadPrec :: ReadPrec DescribeAppResponse
readList :: ReadS [DescribeAppResponse]
$creadList :: ReadS [DescribeAppResponse]
readsPrec :: Int -> ReadS DescribeAppResponse
$creadsPrec :: Int -> ReadS DescribeAppResponse
Prelude.Read, Int -> DescribeAppResponse -> ShowS
[DescribeAppResponse] -> ShowS
DescribeAppResponse -> String
(Int -> DescribeAppResponse -> ShowS)
-> (DescribeAppResponse -> String)
-> ([DescribeAppResponse] -> ShowS)
-> Show DescribeAppResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAppResponse] -> ShowS
$cshowList :: [DescribeAppResponse] -> ShowS
show :: DescribeAppResponse -> String
$cshow :: DescribeAppResponse -> String
showsPrec :: Int -> DescribeAppResponse -> ShowS
$cshowsPrec :: Int -> DescribeAppResponse -> ShowS
Prelude.Show, (forall x. DescribeAppResponse -> Rep DescribeAppResponse x)
-> (forall x. Rep DescribeAppResponse x -> DescribeAppResponse)
-> Generic DescribeAppResponse
forall x. Rep DescribeAppResponse x -> DescribeAppResponse
forall x. DescribeAppResponse -> Rep DescribeAppResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeAppResponse x -> DescribeAppResponse
$cfrom :: forall x. DescribeAppResponse -> Rep DescribeAppResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAppResponse' 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', 'describeAppResponse_creationTime' - The creation time.
--
-- 'status', 'describeAppResponse_status' - The status.
--
-- 'failureReason', 'describeAppResponse_failureReason' - The failure reason.
--
-- 'resourceSpec', 'describeAppResponse_resourceSpec' - The instance type and the Amazon Resource Name (ARN) of the SageMaker
-- image created on the instance.
--
-- 'userProfileName', 'describeAppResponse_userProfileName' - The user profile name.
--
-- 'lastUserActivityTimestamp', 'describeAppResponse_lastUserActivityTimestamp' - The timestamp of the last user\'s activity. @LastUserActivityTimestamp@
-- is also updated when SageMaker performs health checks without user
-- activity. As a result, this value is set to the same value as
-- @LastHealthCheckTimestamp@.
--
-- 'lastHealthCheckTimestamp', 'describeAppResponse_lastHealthCheckTimestamp' - The timestamp of the last health check.
--
-- 'appName', 'describeAppResponse_appName' - The name of the app.
--
-- 'appArn', 'describeAppResponse_appArn' - The Amazon Resource Name (ARN) of the app.
--
-- 'domainId', 'describeAppResponse_domainId' - The domain ID.
--
-- 'appType', 'describeAppResponse_appType' - The type of app.
--
-- 'httpStatus', 'describeAppResponse_httpStatus' - The response's http status code.
newDescribeAppResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeAppResponse
newDescribeAppResponse :: Int -> DescribeAppResponse
newDescribeAppResponse Int
pHttpStatus_ =
  DescribeAppResponse' :: Maybe POSIX
-> Maybe AppStatus
-> Maybe Text
-> Maybe ResourceSpec
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AppType
-> Int
-> DescribeAppResponse
DescribeAppResponse'
    { $sel:creationTime:DescribeAppResponse' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:DescribeAppResponse' :: Maybe AppStatus
status = Maybe AppStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:failureReason:DescribeAppResponse' :: Maybe Text
failureReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceSpec:DescribeAppResponse' :: Maybe ResourceSpec
resourceSpec = Maybe ResourceSpec
forall a. Maybe a
Prelude.Nothing,
      $sel:userProfileName:DescribeAppResponse' :: Maybe Text
userProfileName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUserActivityTimestamp:DescribeAppResponse' :: Maybe POSIX
lastUserActivityTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:lastHealthCheckTimestamp:DescribeAppResponse' :: Maybe POSIX
lastHealthCheckTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:appName:DescribeAppResponse' :: Maybe Text
appName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appArn:DescribeAppResponse' :: Maybe Text
appArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainId:DescribeAppResponse' :: Maybe Text
domainId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appType:DescribeAppResponse' :: Maybe AppType
appType = Maybe AppType
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeAppResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The failure reason.
describeAppResponse_failureReason :: Lens.Lens' DescribeAppResponse (Prelude.Maybe Prelude.Text)
describeAppResponse_failureReason :: (Maybe Text -> f (Maybe Text))
-> DescribeAppResponse -> f DescribeAppResponse
describeAppResponse_failureReason = (DescribeAppResponse -> Maybe Text)
-> (DescribeAppResponse -> Maybe Text -> DescribeAppResponse)
-> Lens
     DescribeAppResponse DescribeAppResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAppResponse' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:DescribeAppResponse' :: DescribeAppResponse -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: DescribeAppResponse
s@DescribeAppResponse' {} Maybe Text
a -> DescribeAppResponse
s {$sel:failureReason:DescribeAppResponse' :: Maybe Text
failureReason = Maybe Text
a} :: DescribeAppResponse)

-- | The instance type and the Amazon Resource Name (ARN) of the SageMaker
-- image created on the instance.
describeAppResponse_resourceSpec :: Lens.Lens' DescribeAppResponse (Prelude.Maybe ResourceSpec)
describeAppResponse_resourceSpec :: (Maybe ResourceSpec -> f (Maybe ResourceSpec))
-> DescribeAppResponse -> f DescribeAppResponse
describeAppResponse_resourceSpec = (DescribeAppResponse -> Maybe ResourceSpec)
-> (DescribeAppResponse
    -> Maybe ResourceSpec -> DescribeAppResponse)
-> Lens
     DescribeAppResponse
     DescribeAppResponse
     (Maybe ResourceSpec)
     (Maybe ResourceSpec)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAppResponse' {Maybe ResourceSpec
resourceSpec :: Maybe ResourceSpec
$sel:resourceSpec:DescribeAppResponse' :: DescribeAppResponse -> Maybe ResourceSpec
resourceSpec} -> Maybe ResourceSpec
resourceSpec) (\s :: DescribeAppResponse
s@DescribeAppResponse' {} Maybe ResourceSpec
a -> DescribeAppResponse
s {$sel:resourceSpec:DescribeAppResponse' :: Maybe ResourceSpec
resourceSpec = Maybe ResourceSpec
a} :: DescribeAppResponse)

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

-- | The timestamp of the last user\'s activity. @LastUserActivityTimestamp@
-- is also updated when SageMaker performs health checks without user
-- activity. As a result, this value is set to the same value as
-- @LastHealthCheckTimestamp@.
describeAppResponse_lastUserActivityTimestamp :: Lens.Lens' DescribeAppResponse (Prelude.Maybe Prelude.UTCTime)
describeAppResponse_lastUserActivityTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAppResponse -> f DescribeAppResponse
describeAppResponse_lastUserActivityTimestamp = (DescribeAppResponse -> Maybe POSIX)
-> (DescribeAppResponse -> Maybe POSIX -> DescribeAppResponse)
-> Lens
     DescribeAppResponse DescribeAppResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAppResponse' {Maybe POSIX
lastUserActivityTimestamp :: Maybe POSIX
$sel:lastUserActivityTimestamp:DescribeAppResponse' :: DescribeAppResponse -> Maybe POSIX
lastUserActivityTimestamp} -> Maybe POSIX
lastUserActivityTimestamp) (\s :: DescribeAppResponse
s@DescribeAppResponse' {} Maybe POSIX
a -> DescribeAppResponse
s {$sel:lastUserActivityTimestamp:DescribeAppResponse' :: Maybe POSIX
lastUserActivityTimestamp = Maybe POSIX
a} :: DescribeAppResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeAppResponse -> f DescribeAppResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAppResponse
-> f DescribeAppResponse
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 timestamp of the last health check.
describeAppResponse_lastHealthCheckTimestamp :: Lens.Lens' DescribeAppResponse (Prelude.Maybe Prelude.UTCTime)
describeAppResponse_lastHealthCheckTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAppResponse -> f DescribeAppResponse
describeAppResponse_lastHealthCheckTimestamp = (DescribeAppResponse -> Maybe POSIX)
-> (DescribeAppResponse -> Maybe POSIX -> DescribeAppResponse)
-> Lens
     DescribeAppResponse DescribeAppResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAppResponse' {Maybe POSIX
lastHealthCheckTimestamp :: Maybe POSIX
$sel:lastHealthCheckTimestamp:DescribeAppResponse' :: DescribeAppResponse -> Maybe POSIX
lastHealthCheckTimestamp} -> Maybe POSIX
lastHealthCheckTimestamp) (\s :: DescribeAppResponse
s@DescribeAppResponse' {} Maybe POSIX
a -> DescribeAppResponse
s {$sel:lastHealthCheckTimestamp:DescribeAppResponse' :: Maybe POSIX
lastHealthCheckTimestamp = Maybe POSIX
a} :: DescribeAppResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeAppResponse -> f DescribeAppResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAppResponse
-> f DescribeAppResponse
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 app.
describeAppResponse_appName :: Lens.Lens' DescribeAppResponse (Prelude.Maybe Prelude.Text)
describeAppResponse_appName :: (Maybe Text -> f (Maybe Text))
-> DescribeAppResponse -> f DescribeAppResponse
describeAppResponse_appName = (DescribeAppResponse -> Maybe Text)
-> (DescribeAppResponse -> Maybe Text -> DescribeAppResponse)
-> Lens
     DescribeAppResponse DescribeAppResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAppResponse' {Maybe Text
appName :: Maybe Text
$sel:appName:DescribeAppResponse' :: DescribeAppResponse -> Maybe Text
appName} -> Maybe Text
appName) (\s :: DescribeAppResponse
s@DescribeAppResponse' {} Maybe Text
a -> DescribeAppResponse
s {$sel:appName:DescribeAppResponse' :: Maybe Text
appName = Maybe Text
a} :: DescribeAppResponse)

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

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

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

-- | The response's http status code.
describeAppResponse_httpStatus :: Lens.Lens' DescribeAppResponse Prelude.Int
describeAppResponse_httpStatus :: (Int -> f Int) -> DescribeAppResponse -> f DescribeAppResponse
describeAppResponse_httpStatus = (DescribeAppResponse -> Int)
-> (DescribeAppResponse -> Int -> DescribeAppResponse)
-> Lens DescribeAppResponse DescribeAppResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAppResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeAppResponse' :: DescribeAppResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeAppResponse
s@DescribeAppResponse' {} Int
a -> DescribeAppResponse
s {$sel:httpStatus:DescribeAppResponse' :: Int
httpStatus = Int
a} :: DescribeAppResponse)

instance Prelude.NFData DescribeAppResponse