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

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

-- | The summary of the application version.
--
-- /See:/ 'newApplicationVersionSummary' smart constructor.
data ApplicationVersionSummary = ApplicationVersionSummary'
  { -- | The ID of the application version. Kinesis Data Analytics updates the
    -- @ApplicationVersionId@ each time you update the application.
    ApplicationVersionSummary -> Natural
applicationVersionId :: Prelude.Natural,
    -- | The status of the application.
    ApplicationVersionSummary -> ApplicationStatus
applicationStatus :: ApplicationStatus
  }
  deriving (ApplicationVersionSummary -> ApplicationVersionSummary -> Bool
(ApplicationVersionSummary -> ApplicationVersionSummary -> Bool)
-> (ApplicationVersionSummary -> ApplicationVersionSummary -> Bool)
-> Eq ApplicationVersionSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplicationVersionSummary -> ApplicationVersionSummary -> Bool
$c/= :: ApplicationVersionSummary -> ApplicationVersionSummary -> Bool
== :: ApplicationVersionSummary -> ApplicationVersionSummary -> Bool
$c== :: ApplicationVersionSummary -> ApplicationVersionSummary -> Bool
Prelude.Eq, ReadPrec [ApplicationVersionSummary]
ReadPrec ApplicationVersionSummary
Int -> ReadS ApplicationVersionSummary
ReadS [ApplicationVersionSummary]
(Int -> ReadS ApplicationVersionSummary)
-> ReadS [ApplicationVersionSummary]
-> ReadPrec ApplicationVersionSummary
-> ReadPrec [ApplicationVersionSummary]
-> Read ApplicationVersionSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplicationVersionSummary]
$creadListPrec :: ReadPrec [ApplicationVersionSummary]
readPrec :: ReadPrec ApplicationVersionSummary
$creadPrec :: ReadPrec ApplicationVersionSummary
readList :: ReadS [ApplicationVersionSummary]
$creadList :: ReadS [ApplicationVersionSummary]
readsPrec :: Int -> ReadS ApplicationVersionSummary
$creadsPrec :: Int -> ReadS ApplicationVersionSummary
Prelude.Read, Int -> ApplicationVersionSummary -> ShowS
[ApplicationVersionSummary] -> ShowS
ApplicationVersionSummary -> String
(Int -> ApplicationVersionSummary -> ShowS)
-> (ApplicationVersionSummary -> String)
-> ([ApplicationVersionSummary] -> ShowS)
-> Show ApplicationVersionSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplicationVersionSummary] -> ShowS
$cshowList :: [ApplicationVersionSummary] -> ShowS
show :: ApplicationVersionSummary -> String
$cshow :: ApplicationVersionSummary -> String
showsPrec :: Int -> ApplicationVersionSummary -> ShowS
$cshowsPrec :: Int -> ApplicationVersionSummary -> ShowS
Prelude.Show, (forall x.
 ApplicationVersionSummary -> Rep ApplicationVersionSummary x)
-> (forall x.
    Rep ApplicationVersionSummary x -> ApplicationVersionSummary)
-> Generic ApplicationVersionSummary
forall x.
Rep ApplicationVersionSummary x -> ApplicationVersionSummary
forall x.
ApplicationVersionSummary -> Rep ApplicationVersionSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ApplicationVersionSummary x -> ApplicationVersionSummary
$cfrom :: forall x.
ApplicationVersionSummary -> Rep ApplicationVersionSummary x
Prelude.Generic)

-- |
-- Create a value of 'ApplicationVersionSummary' 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:
--
-- 'applicationVersionId', 'applicationVersionSummary_applicationVersionId' - The ID of the application version. Kinesis Data Analytics updates the
-- @ApplicationVersionId@ each time you update the application.
--
-- 'applicationStatus', 'applicationVersionSummary_applicationStatus' - The status of the application.
newApplicationVersionSummary ::
  -- | 'applicationVersionId'
  Prelude.Natural ->
  -- | 'applicationStatus'
  ApplicationStatus ->
  ApplicationVersionSummary
newApplicationVersionSummary :: Natural -> ApplicationStatus -> ApplicationVersionSummary
newApplicationVersionSummary
  Natural
pApplicationVersionId_
  ApplicationStatus
pApplicationStatus_ =
    ApplicationVersionSummary' :: Natural -> ApplicationStatus -> ApplicationVersionSummary
ApplicationVersionSummary'
      { $sel:applicationVersionId:ApplicationVersionSummary' :: Natural
applicationVersionId =
          Natural
pApplicationVersionId_,
        $sel:applicationStatus:ApplicationVersionSummary' :: ApplicationStatus
applicationStatus = ApplicationStatus
pApplicationStatus_
      }

-- | The ID of the application version. Kinesis Data Analytics updates the
-- @ApplicationVersionId@ each time you update the application.
applicationVersionSummary_applicationVersionId :: Lens.Lens' ApplicationVersionSummary Prelude.Natural
applicationVersionSummary_applicationVersionId :: (Natural -> f Natural)
-> ApplicationVersionSummary -> f ApplicationVersionSummary
applicationVersionSummary_applicationVersionId = (ApplicationVersionSummary -> Natural)
-> (ApplicationVersionSummary
    -> Natural -> ApplicationVersionSummary)
-> Lens
     ApplicationVersionSummary ApplicationVersionSummary Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationVersionSummary' {Natural
applicationVersionId :: Natural
$sel:applicationVersionId:ApplicationVersionSummary' :: ApplicationVersionSummary -> Natural
applicationVersionId} -> Natural
applicationVersionId) (\s :: ApplicationVersionSummary
s@ApplicationVersionSummary' {} Natural
a -> ApplicationVersionSummary
s {$sel:applicationVersionId:ApplicationVersionSummary' :: Natural
applicationVersionId = Natural
a} :: ApplicationVersionSummary)

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

instance Core.FromJSON ApplicationVersionSummary where
  parseJSON :: Value -> Parser ApplicationVersionSummary
parseJSON =
    String
-> (Object -> Parser ApplicationVersionSummary)
-> Value
-> Parser ApplicationVersionSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ApplicationVersionSummary"
      ( \Object
x ->
          Natural -> ApplicationStatus -> ApplicationVersionSummary
ApplicationVersionSummary'
            (Natural -> ApplicationStatus -> ApplicationVersionSummary)
-> Parser Natural
-> Parser (ApplicationStatus -> ApplicationVersionSummary)
forall (f :: * -> *) a b. Functor 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 (ApplicationStatus -> ApplicationVersionSummary)
-> Parser ApplicationStatus -> Parser ApplicationVersionSummary
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 ApplicationVersionSummary

instance Prelude.NFData ApplicationVersionSummary