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

import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalytics.Types.ApplicationStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | This documentation is for version 1 of the Amazon Kinesis Data Analytics
-- API, which only supports SQL applications. Version 2 of the API supports
-- SQL and Java applications. For more information about version 2, see
-- </kinesisanalytics/latest/apiv2/Welcome.html Amazon Kinesis Data Analytics API V2 Documentation>.
--
-- Provides application summary information, including the application
-- Amazon Resource Name (ARN), name, and status.
--
-- /See:/ 'newApplicationSummary' smart constructor.
data ApplicationSummary = ApplicationSummary'
  { -- | Name of the application.
    ApplicationSummary -> Text
applicationName :: Prelude.Text,
    -- | ARN of the application.
    ApplicationSummary -> Text
applicationARN :: Prelude.Text,
    -- | Status of the application.
    ApplicationSummary -> ApplicationStatus
applicationStatus :: ApplicationStatus
  }
  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:
--
-- 'applicationName', 'applicationSummary_applicationName' - Name of the application.
--
-- 'applicationARN', 'applicationSummary_applicationARN' - ARN of the application.
--
-- 'applicationStatus', 'applicationSummary_applicationStatus' - Status of the application.
newApplicationSummary ::
  -- | 'applicationName'
  Prelude.Text ->
  -- | 'applicationARN'
  Prelude.Text ->
  -- | 'applicationStatus'
  ApplicationStatus ->
  ApplicationSummary
newApplicationSummary :: Text -> Text -> ApplicationStatus -> ApplicationSummary
newApplicationSummary
  Text
pApplicationName_
  Text
pApplicationARN_
  ApplicationStatus
pApplicationStatus_ =
    ApplicationSummary' :: Text -> Text -> ApplicationStatus -> ApplicationSummary
ApplicationSummary'
      { $sel:applicationName:ApplicationSummary' :: Text
applicationName =
          Text
pApplicationName_,
        $sel:applicationARN:ApplicationSummary' :: Text
applicationARN = Text
pApplicationARN_,
        $sel:applicationStatus:ApplicationSummary' :: ApplicationStatus
applicationStatus = ApplicationStatus
pApplicationStatus_
      }

-- | 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)

-- | 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)

-- | 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)

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 ->
          Text -> Text -> ApplicationStatus -> ApplicationSummary
ApplicationSummary'
            (Text -> Text -> ApplicationStatus -> ApplicationSummary)
-> Parser Text
-> Parser (Text -> ApplicationStatus -> ApplicationSummary)
forall (f :: * -> *) a b. Functor 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 -> ApplicationSummary)
-> Parser Text -> Parser (ApplicationStatus -> 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 -> ApplicationSummary)
-> Parser ApplicationStatus -> Parser 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")
      )

instance Prelude.Hashable ApplicationSummary

instance Prelude.NFData ApplicationSummary