{-# 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.EMRServerless.Types.ApplicationSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EMRServerless.Types.ApplicationSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EMRServerless.Types.ApplicationState
import Amazonka.EMRServerless.Types.Architecture
import qualified Amazonka.Prelude as Prelude

-- | The summary of attributes associated with an application.
--
-- /See:/ 'newApplicationSummary' smart constructor.
data ApplicationSummary = ApplicationSummary'
  { -- | The CPU architecture of an application.
    ApplicationSummary -> Maybe Architecture
architecture :: Prelude.Maybe Architecture,
    -- | The name of the application.
    ApplicationSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The state details of the application.
    ApplicationSummary -> Maybe Text
stateDetails :: Prelude.Maybe Prelude.Text,
    -- | The ID of the application.
    ApplicationSummary -> Text
id :: Prelude.Text,
    -- | The ARN of the application.
    ApplicationSummary -> Text
arn :: Prelude.Text,
    -- | The EMR release associated with the application.
    ApplicationSummary -> Text
releaseLabel :: Prelude.Text,
    -- | The type of application, such as Spark or Hive.
    ApplicationSummary -> Text
type' :: Prelude.Text,
    -- | The state of the application.
    ApplicationSummary -> ApplicationState
state :: ApplicationState,
    -- | The date and time when the application was created.
    ApplicationSummary -> POSIX
createdAt :: Data.POSIX,
    -- | The date and time when the application was last updated.
    ApplicationSummary -> POSIX
updatedAt :: Data.POSIX
  }
  deriving (ApplicationSummary -> ApplicationSummary -> Bool
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]
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
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. 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:
--
-- 'architecture', 'applicationSummary_architecture' - The CPU architecture of an application.
--
-- 'name', 'applicationSummary_name' - The name of the application.
--
-- 'stateDetails', 'applicationSummary_stateDetails' - The state details of the application.
--
-- 'id', 'applicationSummary_id' - The ID of the application.
--
-- 'arn', 'applicationSummary_arn' - The ARN of the application.
--
-- 'releaseLabel', 'applicationSummary_releaseLabel' - The EMR release associated with the application.
--
-- 'type'', 'applicationSummary_type' - The type of application, such as Spark or Hive.
--
-- 'state', 'applicationSummary_state' - The state of the application.
--
-- 'createdAt', 'applicationSummary_createdAt' - The date and time when the application was created.
--
-- 'updatedAt', 'applicationSummary_updatedAt' - The date and time when the application was last updated.
newApplicationSummary ::
  -- | 'id'
  Prelude.Text ->
  -- | 'arn'
  Prelude.Text ->
  -- | 'releaseLabel'
  Prelude.Text ->
  -- | 'type''
  Prelude.Text ->
  -- | 'state'
  ApplicationState ->
  -- | 'createdAt'
  Prelude.UTCTime ->
  -- | 'updatedAt'
  Prelude.UTCTime ->
  ApplicationSummary
newApplicationSummary :: Text
-> Text
-> Text
-> Text
-> ApplicationState
-> UTCTime
-> UTCTime
-> ApplicationSummary
newApplicationSummary
  Text
pId_
  Text
pArn_
  Text
pReleaseLabel_
  Text
pType_
  ApplicationState
pState_
  UTCTime
pCreatedAt_
  UTCTime
pUpdatedAt_ =
    ApplicationSummary'
      { $sel:architecture:ApplicationSummary' :: Maybe Architecture
architecture = forall a. Maybe a
Prelude.Nothing,
        $sel:name:ApplicationSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
        $sel:stateDetails:ApplicationSummary' :: Maybe Text
stateDetails = forall a. Maybe a
Prelude.Nothing,
        $sel:id:ApplicationSummary' :: Text
id = Text
pId_,
        $sel:arn:ApplicationSummary' :: Text
arn = Text
pArn_,
        $sel:releaseLabel:ApplicationSummary' :: Text
releaseLabel = Text
pReleaseLabel_,
        $sel:type':ApplicationSummary' :: Text
type' = Text
pType_,
        $sel:state:ApplicationSummary' :: ApplicationState
state = ApplicationState
pState_,
        $sel:createdAt:ApplicationSummary' :: POSIX
createdAt = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_,
        $sel:updatedAt:ApplicationSummary' :: POSIX
updatedAt = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdatedAt_
      }

-- | The CPU architecture of an application.
applicationSummary_architecture :: Lens.Lens' ApplicationSummary (Prelude.Maybe Architecture)
applicationSummary_architecture :: Lens' ApplicationSummary (Maybe Architecture)
applicationSummary_architecture = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Maybe Architecture
architecture :: Maybe Architecture
$sel:architecture:ApplicationSummary' :: ApplicationSummary -> Maybe Architecture
architecture} -> Maybe Architecture
architecture) (\s :: ApplicationSummary
s@ApplicationSummary' {} Maybe Architecture
a -> ApplicationSummary
s {$sel:architecture:ApplicationSummary' :: Maybe Architecture
architecture = Maybe Architecture
a} :: ApplicationSummary)

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

-- | The state details of the application.
applicationSummary_stateDetails :: Lens.Lens' ApplicationSummary (Prelude.Maybe Prelude.Text)
applicationSummary_stateDetails :: Lens' ApplicationSummary (Maybe Text)
applicationSummary_stateDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Maybe Text
stateDetails :: Maybe Text
$sel:stateDetails:ApplicationSummary' :: ApplicationSummary -> Maybe Text
stateDetails} -> Maybe Text
stateDetails) (\s :: ApplicationSummary
s@ApplicationSummary' {} Maybe Text
a -> ApplicationSummary
s {$sel:stateDetails:ApplicationSummary' :: Maybe Text
stateDetails = Maybe Text
a} :: ApplicationSummary)

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

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

-- | The EMR release associated with the application.
applicationSummary_releaseLabel :: Lens.Lens' ApplicationSummary Prelude.Text
applicationSummary_releaseLabel :: Lens' ApplicationSummary Text
applicationSummary_releaseLabel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Text
releaseLabel :: Text
$sel:releaseLabel:ApplicationSummary' :: ApplicationSummary -> Text
releaseLabel} -> Text
releaseLabel) (\s :: ApplicationSummary
s@ApplicationSummary' {} Text
a -> ApplicationSummary
s {$sel:releaseLabel:ApplicationSummary' :: Text
releaseLabel = Text
a} :: ApplicationSummary)

-- | The type of application, such as Spark or Hive.
applicationSummary_type :: Lens.Lens' ApplicationSummary Prelude.Text
applicationSummary_type :: Lens' ApplicationSummary Text
applicationSummary_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Text
type' :: Text
$sel:type':ApplicationSummary' :: ApplicationSummary -> Text
type'} -> Text
type') (\s :: ApplicationSummary
s@ApplicationSummary' {} Text
a -> ApplicationSummary
s {$sel:type':ApplicationSummary' :: Text
type' = Text
a} :: ApplicationSummary)

-- | The state of the application.
applicationSummary_state :: Lens.Lens' ApplicationSummary ApplicationState
applicationSummary_state :: Lens' ApplicationSummary ApplicationState
applicationSummary_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {ApplicationState
state :: ApplicationState
$sel:state:ApplicationSummary' :: ApplicationSummary -> ApplicationState
state} -> ApplicationState
state) (\s :: ApplicationSummary
s@ApplicationSummary' {} ApplicationState
a -> ApplicationSummary
s {$sel:state:ApplicationSummary' :: ApplicationState
state = ApplicationState
a} :: ApplicationSummary)

-- | The date and time when the application was created.
applicationSummary_createdAt :: Lens.Lens' ApplicationSummary Prelude.UTCTime
applicationSummary_createdAt :: Lens' ApplicationSummary UTCTime
applicationSummary_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {POSIX
createdAt :: POSIX
$sel:createdAt:ApplicationSummary' :: ApplicationSummary -> POSIX
createdAt} -> POSIX
createdAt) (\s :: ApplicationSummary
s@ApplicationSummary' {} POSIX
a -> ApplicationSummary
s {$sel:createdAt:ApplicationSummary' :: POSIX
createdAt = POSIX
a} :: ApplicationSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The date and time when the application was last updated.
applicationSummary_updatedAt :: Lens.Lens' ApplicationSummary Prelude.UTCTime
applicationSummary_updatedAt :: Lens' ApplicationSummary UTCTime
applicationSummary_updatedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {POSIX
updatedAt :: POSIX
$sel:updatedAt:ApplicationSummary' :: ApplicationSummary -> POSIX
updatedAt} -> POSIX
updatedAt) (\s :: ApplicationSummary
s@ApplicationSummary' {} POSIX
a -> ApplicationSummary
s {$sel:updatedAt:ApplicationSummary' :: POSIX
updatedAt = POSIX
a} :: ApplicationSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON ApplicationSummary where
  parseJSON :: Value -> Parser ApplicationSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ApplicationSummary"
      ( \Object
x ->
          Maybe Architecture
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> Text
-> Text
-> ApplicationState
-> POSIX
-> POSIX
-> ApplicationSummary
ApplicationSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"architecture")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"stateDetails")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"releaseLabel")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"type")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"state")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"createdAt")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"updatedAt")
      )

instance Prelude.Hashable ApplicationSummary where
  hashWithSalt :: Int -> ApplicationSummary -> Int
hashWithSalt Int
_salt ApplicationSummary' {Maybe Text
Maybe Architecture
Text
POSIX
ApplicationState
updatedAt :: POSIX
createdAt :: POSIX
state :: ApplicationState
type' :: Text
releaseLabel :: Text
arn :: Text
id :: Text
stateDetails :: Maybe Text
name :: Maybe Text
architecture :: Maybe Architecture
$sel:updatedAt:ApplicationSummary' :: ApplicationSummary -> POSIX
$sel:createdAt:ApplicationSummary' :: ApplicationSummary -> POSIX
$sel:state:ApplicationSummary' :: ApplicationSummary -> ApplicationState
$sel:type':ApplicationSummary' :: ApplicationSummary -> Text
$sel:releaseLabel:ApplicationSummary' :: ApplicationSummary -> Text
$sel:arn:ApplicationSummary' :: ApplicationSummary -> Text
$sel:id:ApplicationSummary' :: ApplicationSummary -> Text
$sel:stateDetails:ApplicationSummary' :: ApplicationSummary -> Maybe Text
$sel:name:ApplicationSummary' :: ApplicationSummary -> Maybe Text
$sel:architecture:ApplicationSummary' :: ApplicationSummary -> Maybe Architecture
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Architecture
architecture
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stateDetails
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
releaseLabel
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
type'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ApplicationState
state
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
createdAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
updatedAt

instance Prelude.NFData ApplicationSummary where
  rnf :: ApplicationSummary -> ()
rnf ApplicationSummary' {Maybe Text
Maybe Architecture
Text
POSIX
ApplicationState
updatedAt :: POSIX
createdAt :: POSIX
state :: ApplicationState
type' :: Text
releaseLabel :: Text
arn :: Text
id :: Text
stateDetails :: Maybe Text
name :: Maybe Text
architecture :: Maybe Architecture
$sel:updatedAt:ApplicationSummary' :: ApplicationSummary -> POSIX
$sel:createdAt:ApplicationSummary' :: ApplicationSummary -> POSIX
$sel:state:ApplicationSummary' :: ApplicationSummary -> ApplicationState
$sel:type':ApplicationSummary' :: ApplicationSummary -> Text
$sel:releaseLabel:ApplicationSummary' :: ApplicationSummary -> Text
$sel:arn:ApplicationSummary' :: ApplicationSummary -> Text
$sel:id:ApplicationSummary' :: ApplicationSummary -> Text
$sel:stateDetails:ApplicationSummary' :: ApplicationSummary -> Maybe Text
$sel:name:ApplicationSummary' :: ApplicationSummary -> Maybe Text
$sel:architecture:ApplicationSummary' :: ApplicationSummary -> Maybe Architecture
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Architecture
architecture
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stateDetails
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
releaseLabel
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
type'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ApplicationState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
createdAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
updatedAt