{-# 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.KinesisAnalyticsV2.Types.ApplicationSummary
-- 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.KinesisAnalyticsV2.Types.ApplicationSummary where

import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalyticsV2.Types.ApplicationMode
import Amazonka.KinesisAnalyticsV2.Types.ApplicationStatus
import Amazonka.KinesisAnalyticsV2.Types.RuntimeEnvironment
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides application summary information, including the application
-- Amazon Resource Name (ARN), name, and status.
--
-- /See:/ 'newApplicationSummary' smart constructor.
data ApplicationSummary = ApplicationSummary'
  { -- | For a Kinesis Data Analytics for Apache Flink application, the mode is
    -- @STREAMING@. For a Kinesis Data Analytics Studio notebook, it is
    -- @INTERACTIVE@.
    ApplicationSummary -> Maybe ApplicationMode
applicationMode :: Prelude.Maybe ApplicationMode,
    -- | The name of the application.
    ApplicationSummary -> Text
applicationName :: Prelude.Text,
    -- | The ARN of the application.
    ApplicationSummary -> Text
applicationARN :: Prelude.Text,
    -- | The status of the application.
    ApplicationSummary -> ApplicationStatus
applicationStatus :: ApplicationStatus,
    -- | Provides the current application version.
    ApplicationSummary -> Natural
applicationVersionId :: Prelude.Natural,
    -- | The runtime environment for the application.
    ApplicationSummary -> RuntimeEnvironment
runtimeEnvironment :: RuntimeEnvironment
  }
  deriving (ApplicationSummary -> ApplicationSummary -> Bool
(ApplicationSummary -> ApplicationSummary -> Bool)
-> (ApplicationSummary -> ApplicationSummary -> Bool)
-> Eq ApplicationSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplicationSummary -> ApplicationSummary -> Bool
$c/= :: ApplicationSummary -> ApplicationSummary -> Bool
== :: ApplicationSummary -> ApplicationSummary -> Bool
$c== :: ApplicationSummary -> ApplicationSummary -> Bool
Prelude.Eq, ReadPrec [ApplicationSummary]
ReadPrec ApplicationSummary
Int -> ReadS ApplicationSummary
ReadS [ApplicationSummary]
(Int -> ReadS ApplicationSummary)
-> ReadS [ApplicationSummary]
-> ReadPrec ApplicationSummary
-> ReadPrec [ApplicationSummary]
-> Read ApplicationSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplicationSummary]
$creadListPrec :: ReadPrec [ApplicationSummary]
readPrec :: ReadPrec ApplicationSummary
$creadPrec :: ReadPrec ApplicationSummary
readList :: ReadS [ApplicationSummary]
$creadList :: ReadS [ApplicationSummary]
readsPrec :: Int -> ReadS ApplicationSummary
$creadsPrec :: Int -> ReadS ApplicationSummary
Prelude.Read, Int -> ApplicationSummary -> ShowS
[ApplicationSummary] -> ShowS
ApplicationSummary -> String
(Int -> ApplicationSummary -> ShowS)
-> (ApplicationSummary -> String)
-> ([ApplicationSummary] -> ShowS)
-> Show ApplicationSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplicationSummary] -> ShowS
$cshowList :: [ApplicationSummary] -> ShowS
show :: ApplicationSummary -> String
$cshow :: ApplicationSummary -> String
showsPrec :: Int -> ApplicationSummary -> ShowS
$cshowsPrec :: Int -> ApplicationSummary -> ShowS
Prelude.Show, (forall x. ApplicationSummary -> Rep ApplicationSummary x)
-> (forall x. Rep ApplicationSummary x -> ApplicationSummary)
-> Generic ApplicationSummary
forall x. Rep ApplicationSummary x -> ApplicationSummary
forall x. ApplicationSummary -> Rep ApplicationSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ApplicationSummary x -> ApplicationSummary
$cfrom :: forall x. ApplicationSummary -> Rep ApplicationSummary x
Prelude.Generic)

-- |
-- Create a value of 'ApplicationSummary' 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:
--
-- 'applicationMode', 'applicationSummary_applicationMode' - For a Kinesis Data Analytics for Apache Flink application, the mode is
-- @STREAMING@. For a Kinesis Data Analytics Studio notebook, it is
-- @INTERACTIVE@.
--
-- 'applicationName', 'applicationSummary_applicationName' - The name of the application.
--
-- 'applicationARN', 'applicationSummary_applicationARN' - The ARN of the application.
--
-- 'applicationStatus', 'applicationSummary_applicationStatus' - The status of the application.
--
-- 'applicationVersionId', 'applicationSummary_applicationVersionId' - Provides the current application version.
--
-- 'runtimeEnvironment', 'applicationSummary_runtimeEnvironment' - The runtime environment for the application.
newApplicationSummary ::
  -- | 'applicationName'
  Prelude.Text ->
  -- | 'applicationARN'
  Prelude.Text ->
  -- | 'applicationStatus'
  ApplicationStatus ->
  -- | 'applicationVersionId'
  Prelude.Natural ->
  -- | 'runtimeEnvironment'
  RuntimeEnvironment ->
  ApplicationSummary
newApplicationSummary :: Text
-> Text
-> ApplicationStatus
-> Natural
-> RuntimeEnvironment
-> ApplicationSummary
newApplicationSummary
  Text
pApplicationName_
  Text
pApplicationARN_
  ApplicationStatus
pApplicationStatus_
  Natural
pApplicationVersionId_
  RuntimeEnvironment
pRuntimeEnvironment_ =
    ApplicationSummary' :: Maybe ApplicationMode
-> Text
-> Text
-> ApplicationStatus
-> Natural
-> RuntimeEnvironment
-> ApplicationSummary
ApplicationSummary'
      { $sel:applicationMode:ApplicationSummary' :: Maybe ApplicationMode
applicationMode =
          Maybe ApplicationMode
forall a. Maybe a
Prelude.Nothing,
        $sel:applicationName:ApplicationSummary' :: Text
applicationName = Text
pApplicationName_,
        $sel:applicationARN:ApplicationSummary' :: Text
applicationARN = Text
pApplicationARN_,
        $sel:applicationStatus:ApplicationSummary' :: ApplicationStatus
applicationStatus = ApplicationStatus
pApplicationStatus_,
        $sel:applicationVersionId:ApplicationSummary' :: Natural
applicationVersionId = Natural
pApplicationVersionId_,
        $sel:runtimeEnvironment:ApplicationSummary' :: RuntimeEnvironment
runtimeEnvironment = RuntimeEnvironment
pRuntimeEnvironment_
      }

-- | For a Kinesis Data Analytics for Apache Flink application, the mode is
-- @STREAMING@. For a Kinesis Data Analytics Studio notebook, it is
-- @INTERACTIVE@.
applicationSummary_applicationMode :: Lens.Lens' ApplicationSummary (Prelude.Maybe ApplicationMode)
applicationSummary_applicationMode :: (Maybe ApplicationMode -> f (Maybe ApplicationMode))
-> ApplicationSummary -> f ApplicationSummary
applicationSummary_applicationMode = (ApplicationSummary -> Maybe ApplicationMode)
-> (ApplicationSummary
    -> Maybe ApplicationMode -> ApplicationSummary)
-> Lens
     ApplicationSummary
     ApplicationSummary
     (Maybe ApplicationMode)
     (Maybe ApplicationMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Maybe ApplicationMode
applicationMode :: Maybe ApplicationMode
$sel:applicationMode:ApplicationSummary' :: ApplicationSummary -> Maybe ApplicationMode
applicationMode} -> Maybe ApplicationMode
applicationMode) (\s :: ApplicationSummary
s@ApplicationSummary' {} Maybe ApplicationMode
a -> ApplicationSummary
s {$sel:applicationMode:ApplicationSummary' :: Maybe ApplicationMode
applicationMode = Maybe ApplicationMode
a} :: ApplicationSummary)

-- | The name of the application.
applicationSummary_applicationName :: Lens.Lens' ApplicationSummary Prelude.Text
applicationSummary_applicationName :: (Text -> f Text) -> ApplicationSummary -> f ApplicationSummary
applicationSummary_applicationName = (ApplicationSummary -> Text)
-> (ApplicationSummary -> Text -> ApplicationSummary)
-> Lens ApplicationSummary ApplicationSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Text
applicationName :: Text
$sel:applicationName:ApplicationSummary' :: ApplicationSummary -> Text
applicationName} -> Text
applicationName) (\s :: ApplicationSummary
s@ApplicationSummary' {} Text
a -> ApplicationSummary
s {$sel:applicationName:ApplicationSummary' :: Text
applicationName = Text
a} :: ApplicationSummary)

-- | The ARN of the application.
applicationSummary_applicationARN :: Lens.Lens' ApplicationSummary Prelude.Text
applicationSummary_applicationARN :: (Text -> f Text) -> ApplicationSummary -> f ApplicationSummary
applicationSummary_applicationARN = (ApplicationSummary -> Text)
-> (ApplicationSummary -> Text -> ApplicationSummary)
-> Lens ApplicationSummary ApplicationSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Text
applicationARN :: Text
$sel:applicationARN:ApplicationSummary' :: ApplicationSummary -> Text
applicationARN} -> Text
applicationARN) (\s :: ApplicationSummary
s@ApplicationSummary' {} Text
a -> ApplicationSummary
s {$sel:applicationARN:ApplicationSummary' :: Text
applicationARN = Text
a} :: ApplicationSummary)

-- | The status of the application.
applicationSummary_applicationStatus :: Lens.Lens' ApplicationSummary ApplicationStatus
applicationSummary_applicationStatus :: (ApplicationStatus -> f ApplicationStatus)
-> ApplicationSummary -> f ApplicationSummary
applicationSummary_applicationStatus = (ApplicationSummary -> ApplicationStatus)
-> (ApplicationSummary -> ApplicationStatus -> ApplicationSummary)
-> Lens
     ApplicationSummary
     ApplicationSummary
     ApplicationStatus
     ApplicationStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {ApplicationStatus
applicationStatus :: ApplicationStatus
$sel:applicationStatus:ApplicationSummary' :: ApplicationSummary -> ApplicationStatus
applicationStatus} -> ApplicationStatus
applicationStatus) (\s :: ApplicationSummary
s@ApplicationSummary' {} ApplicationStatus
a -> ApplicationSummary
s {$sel:applicationStatus:ApplicationSummary' :: ApplicationStatus
applicationStatus = ApplicationStatus
a} :: ApplicationSummary)

-- | Provides the current application version.
applicationSummary_applicationVersionId :: Lens.Lens' ApplicationSummary Prelude.Natural
applicationSummary_applicationVersionId :: (Natural -> f Natural)
-> ApplicationSummary -> f ApplicationSummary
applicationSummary_applicationVersionId = (ApplicationSummary -> Natural)
-> (ApplicationSummary -> Natural -> ApplicationSummary)
-> Lens ApplicationSummary ApplicationSummary Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Natural
applicationVersionId :: Natural
$sel:applicationVersionId:ApplicationSummary' :: ApplicationSummary -> Natural
applicationVersionId} -> Natural
applicationVersionId) (\s :: ApplicationSummary
s@ApplicationSummary' {} Natural
a -> ApplicationSummary
s {$sel:applicationVersionId:ApplicationSummary' :: Natural
applicationVersionId = Natural
a} :: ApplicationSummary)

-- | The runtime environment for the application.
applicationSummary_runtimeEnvironment :: Lens.Lens' ApplicationSummary RuntimeEnvironment
applicationSummary_runtimeEnvironment :: (RuntimeEnvironment -> f RuntimeEnvironment)
-> ApplicationSummary -> f ApplicationSummary
applicationSummary_runtimeEnvironment = (ApplicationSummary -> RuntimeEnvironment)
-> (ApplicationSummary -> RuntimeEnvironment -> ApplicationSummary)
-> Lens
     ApplicationSummary
     ApplicationSummary
     RuntimeEnvironment
     RuntimeEnvironment
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {RuntimeEnvironment
runtimeEnvironment :: RuntimeEnvironment
$sel:runtimeEnvironment:ApplicationSummary' :: ApplicationSummary -> RuntimeEnvironment
runtimeEnvironment} -> RuntimeEnvironment
runtimeEnvironment) (\s :: ApplicationSummary
s@ApplicationSummary' {} RuntimeEnvironment
a -> ApplicationSummary
s {$sel:runtimeEnvironment:ApplicationSummary' :: RuntimeEnvironment
runtimeEnvironment = RuntimeEnvironment
a} :: ApplicationSummary)

instance Core.FromJSON ApplicationSummary where
  parseJSON :: Value -> Parser ApplicationSummary
parseJSON =
    String
-> (Object -> Parser ApplicationSummary)
-> Value
-> Parser ApplicationSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ApplicationSummary"
      ( \Object
x ->
          Maybe ApplicationMode
-> Text
-> Text
-> ApplicationStatus
-> Natural
-> RuntimeEnvironment
-> ApplicationSummary
ApplicationSummary'
            (Maybe ApplicationMode
 -> Text
 -> Text
 -> ApplicationStatus
 -> Natural
 -> RuntimeEnvironment
 -> ApplicationSummary)
-> Parser (Maybe ApplicationMode)
-> Parser
     (Text
      -> Text
      -> ApplicationStatus
      -> Natural
      -> RuntimeEnvironment
      -> ApplicationSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ApplicationMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ApplicationMode")
            Parser
  (Text
   -> Text
   -> ApplicationStatus
   -> Natural
   -> RuntimeEnvironment
   -> ApplicationSummary)
-> Parser Text
-> Parser
     (Text
      -> ApplicationStatus
      -> Natural
      -> RuntimeEnvironment
      -> ApplicationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ApplicationName")
            Parser
  (Text
   -> ApplicationStatus
   -> Natural
   -> RuntimeEnvironment
   -> ApplicationSummary)
-> Parser Text
-> Parser
     (ApplicationStatus
      -> Natural -> RuntimeEnvironment -> ApplicationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ApplicationARN")
            Parser
  (ApplicationStatus
   -> Natural -> RuntimeEnvironment -> ApplicationSummary)
-> Parser ApplicationStatus
-> Parser (Natural -> RuntimeEnvironment -> ApplicationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ApplicationStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ApplicationStatus")
            Parser (Natural -> RuntimeEnvironment -> ApplicationSummary)
-> Parser Natural
-> Parser (RuntimeEnvironment -> ApplicationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ApplicationVersionId")
            Parser (RuntimeEnvironment -> ApplicationSummary)
-> Parser RuntimeEnvironment -> Parser ApplicationSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser RuntimeEnvironment
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RuntimeEnvironment")
      )

instance Prelude.Hashable ApplicationSummary

instance Prelude.NFData ApplicationSummary