{-# 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.ResilienceHub.Types.AppSummary
-- 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.ResilienceHub.Types.AppSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.ResilienceHub.Types.AppAssessmentScheduleType
import Amazonka.ResilienceHub.Types.AppComplianceStatusType
import Amazonka.ResilienceHub.Types.AppStatusType

-- | Defines an application summary.
--
-- /See:/ 'newAppSummary' smart constructor.
data AppSummary = AppSummary'
  { -- | Assessment execution schedule with \'Daily\' or \'Disabled\' values.
    AppSummary -> Maybe AppAssessmentScheduleType
assessmentSchedule :: Prelude.Maybe AppAssessmentScheduleType,
    -- | The current status of compliance for the resiliency policy.
    AppSummary -> Maybe AppComplianceStatusType
complianceStatus :: Prelude.Maybe AppComplianceStatusType,
    -- | The optional description for an app.
    AppSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The current resiliency score for the application.
    AppSummary -> Maybe Double
resiliencyScore :: Prelude.Maybe Prelude.Double,
    -- | The status of the application.
    AppSummary -> Maybe AppStatusType
status :: Prelude.Maybe AppStatusType,
    -- | The Amazon Resource Name (ARN) of the application. The format for this
    -- ARN is: arn:@partition@:resiliencehub:@region@:@account@:app\/@app-id@.
    -- For more information about ARNs, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
    -- in the /AWS General Reference/.
    AppSummary -> Text
appArn :: Prelude.Text,
    -- | The timestamp for when the app was created.
    AppSummary -> POSIX
creationTime :: Data.POSIX,
    -- | The name of the application.
    AppSummary -> Text
name :: Prelude.Text
  }
  deriving (AppSummary -> AppSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AppSummary -> AppSummary -> Bool
$c/= :: AppSummary -> AppSummary -> Bool
== :: AppSummary -> AppSummary -> Bool
$c== :: AppSummary -> AppSummary -> Bool
Prelude.Eq, ReadPrec [AppSummary]
ReadPrec AppSummary
Int -> ReadS AppSummary
ReadS [AppSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AppSummary]
$creadListPrec :: ReadPrec [AppSummary]
readPrec :: ReadPrec AppSummary
$creadPrec :: ReadPrec AppSummary
readList :: ReadS [AppSummary]
$creadList :: ReadS [AppSummary]
readsPrec :: Int -> ReadS AppSummary
$creadsPrec :: Int -> ReadS AppSummary
Prelude.Read, Int -> AppSummary -> ShowS
[AppSummary] -> ShowS
AppSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AppSummary] -> ShowS
$cshowList :: [AppSummary] -> ShowS
show :: AppSummary -> String
$cshow :: AppSummary -> String
showsPrec :: Int -> AppSummary -> ShowS
$cshowsPrec :: Int -> AppSummary -> ShowS
Prelude.Show, forall x. Rep AppSummary x -> AppSummary
forall x. AppSummary -> Rep AppSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AppSummary x -> AppSummary
$cfrom :: forall x. AppSummary -> Rep AppSummary x
Prelude.Generic)

-- |
-- Create a value of 'AppSummary' 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:
--
-- 'assessmentSchedule', 'appSummary_assessmentSchedule' - Assessment execution schedule with \'Daily\' or \'Disabled\' values.
--
-- 'complianceStatus', 'appSummary_complianceStatus' - The current status of compliance for the resiliency policy.
--
-- 'description', 'appSummary_description' - The optional description for an app.
--
-- 'resiliencyScore', 'appSummary_resiliencyScore' - The current resiliency score for the application.
--
-- 'status', 'appSummary_status' - The status of the application.
--
-- 'appArn', 'appSummary_appArn' - The Amazon Resource Name (ARN) of the application. The format for this
-- ARN is: arn:@partition@:resiliencehub:@region@:@account@:app\/@app-id@.
-- For more information about ARNs, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
-- in the /AWS General Reference/.
--
-- 'creationTime', 'appSummary_creationTime' - The timestamp for when the app was created.
--
-- 'name', 'appSummary_name' - The name of the application.
newAppSummary ::
  -- | 'appArn'
  Prelude.Text ->
  -- | 'creationTime'
  Prelude.UTCTime ->
  -- | 'name'
  Prelude.Text ->
  AppSummary
newAppSummary :: Text -> UTCTime -> Text -> AppSummary
newAppSummary Text
pAppArn_ UTCTime
pCreationTime_ Text
pName_ =
  AppSummary'
    { $sel:assessmentSchedule:AppSummary' :: Maybe AppAssessmentScheduleType
assessmentSchedule = forall a. Maybe a
Prelude.Nothing,
      $sel:complianceStatus:AppSummary' :: Maybe AppComplianceStatusType
complianceStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:description:AppSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:resiliencyScore:AppSummary' :: Maybe Double
resiliencyScore = forall a. Maybe a
Prelude.Nothing,
      $sel:status:AppSummary' :: Maybe AppStatusType
status = forall a. Maybe a
Prelude.Nothing,
      $sel:appArn:AppSummary' :: Text
appArn = Text
pAppArn_,
      $sel:creationTime:AppSummary' :: POSIX
creationTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationTime_,
      $sel:name:AppSummary' :: Text
name = Text
pName_
    }

-- | Assessment execution schedule with \'Daily\' or \'Disabled\' values.
appSummary_assessmentSchedule :: Lens.Lens' AppSummary (Prelude.Maybe AppAssessmentScheduleType)
appSummary_assessmentSchedule :: Lens' AppSummary (Maybe AppAssessmentScheduleType)
appSummary_assessmentSchedule = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppSummary' {Maybe AppAssessmentScheduleType
assessmentSchedule :: Maybe AppAssessmentScheduleType
$sel:assessmentSchedule:AppSummary' :: AppSummary -> Maybe AppAssessmentScheduleType
assessmentSchedule} -> Maybe AppAssessmentScheduleType
assessmentSchedule) (\s :: AppSummary
s@AppSummary' {} Maybe AppAssessmentScheduleType
a -> AppSummary
s {$sel:assessmentSchedule:AppSummary' :: Maybe AppAssessmentScheduleType
assessmentSchedule = Maybe AppAssessmentScheduleType
a} :: AppSummary)

-- | The current status of compliance for the resiliency policy.
appSummary_complianceStatus :: Lens.Lens' AppSummary (Prelude.Maybe AppComplianceStatusType)
appSummary_complianceStatus :: Lens' AppSummary (Maybe AppComplianceStatusType)
appSummary_complianceStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppSummary' {Maybe AppComplianceStatusType
complianceStatus :: Maybe AppComplianceStatusType
$sel:complianceStatus:AppSummary' :: AppSummary -> Maybe AppComplianceStatusType
complianceStatus} -> Maybe AppComplianceStatusType
complianceStatus) (\s :: AppSummary
s@AppSummary' {} Maybe AppComplianceStatusType
a -> AppSummary
s {$sel:complianceStatus:AppSummary' :: Maybe AppComplianceStatusType
complianceStatus = Maybe AppComplianceStatusType
a} :: AppSummary)

-- | The optional description for an app.
appSummary_description :: Lens.Lens' AppSummary (Prelude.Maybe Prelude.Text)
appSummary_description :: Lens' AppSummary (Maybe Text)
appSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppSummary' {Maybe Text
description :: Maybe Text
$sel:description:AppSummary' :: AppSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: AppSummary
s@AppSummary' {} Maybe Text
a -> AppSummary
s {$sel:description:AppSummary' :: Maybe Text
description = Maybe Text
a} :: AppSummary)

-- | The current resiliency score for the application.
appSummary_resiliencyScore :: Lens.Lens' AppSummary (Prelude.Maybe Prelude.Double)
appSummary_resiliencyScore :: Lens' AppSummary (Maybe Double)
appSummary_resiliencyScore = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppSummary' {Maybe Double
resiliencyScore :: Maybe Double
$sel:resiliencyScore:AppSummary' :: AppSummary -> Maybe Double
resiliencyScore} -> Maybe Double
resiliencyScore) (\s :: AppSummary
s@AppSummary' {} Maybe Double
a -> AppSummary
s {$sel:resiliencyScore:AppSummary' :: Maybe Double
resiliencyScore = Maybe Double
a} :: AppSummary)

-- | The status of the application.
appSummary_status :: Lens.Lens' AppSummary (Prelude.Maybe AppStatusType)
appSummary_status :: Lens' AppSummary (Maybe AppStatusType)
appSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppSummary' {Maybe AppStatusType
status :: Maybe AppStatusType
$sel:status:AppSummary' :: AppSummary -> Maybe AppStatusType
status} -> Maybe AppStatusType
status) (\s :: AppSummary
s@AppSummary' {} Maybe AppStatusType
a -> AppSummary
s {$sel:status:AppSummary' :: Maybe AppStatusType
status = Maybe AppStatusType
a} :: AppSummary)

-- | The Amazon Resource Name (ARN) of the application. The format for this
-- ARN is: arn:@partition@:resiliencehub:@region@:@account@:app\/@app-id@.
-- For more information about ARNs, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
-- in the /AWS General Reference/.
appSummary_appArn :: Lens.Lens' AppSummary Prelude.Text
appSummary_appArn :: Lens' AppSummary Text
appSummary_appArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppSummary' {Text
appArn :: Text
$sel:appArn:AppSummary' :: AppSummary -> Text
appArn} -> Text
appArn) (\s :: AppSummary
s@AppSummary' {} Text
a -> AppSummary
s {$sel:appArn:AppSummary' :: Text
appArn = Text
a} :: AppSummary)

-- | The timestamp for when the app was created.
appSummary_creationTime :: Lens.Lens' AppSummary Prelude.UTCTime
appSummary_creationTime :: Lens' AppSummary UTCTime
appSummary_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppSummary' {POSIX
creationTime :: POSIX
$sel:creationTime:AppSummary' :: AppSummary -> POSIX
creationTime} -> POSIX
creationTime) (\s :: AppSummary
s@AppSummary' {} POSIX
a -> AppSummary
s {$sel:creationTime:AppSummary' :: POSIX
creationTime = POSIX
a} :: AppSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

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

instance Data.FromJSON AppSummary where
  parseJSON :: Value -> Parser AppSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AppSummary"
      ( \Object
x ->
          Maybe AppAssessmentScheduleType
-> Maybe AppComplianceStatusType
-> Maybe Text
-> Maybe Double
-> Maybe AppStatusType
-> Text
-> POSIX
-> Text
-> AppSummary
AppSummary'
            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
"assessmentSchedule")
            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
"complianceStatus")
            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
"description")
            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
"resiliencyScore")
            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
"status")
            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
"appArn")
            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
"creationTime")
            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
"name")
      )

instance Prelude.Hashable AppSummary where
  hashWithSalt :: Int -> AppSummary -> Int
hashWithSalt Int
_salt AppSummary' {Maybe Double
Maybe Text
Maybe AppAssessmentScheduleType
Maybe AppComplianceStatusType
Maybe AppStatusType
Text
POSIX
name :: Text
creationTime :: POSIX
appArn :: Text
status :: Maybe AppStatusType
resiliencyScore :: Maybe Double
description :: Maybe Text
complianceStatus :: Maybe AppComplianceStatusType
assessmentSchedule :: Maybe AppAssessmentScheduleType
$sel:name:AppSummary' :: AppSummary -> Text
$sel:creationTime:AppSummary' :: AppSummary -> POSIX
$sel:appArn:AppSummary' :: AppSummary -> Text
$sel:status:AppSummary' :: AppSummary -> Maybe AppStatusType
$sel:resiliencyScore:AppSummary' :: AppSummary -> Maybe Double
$sel:description:AppSummary' :: AppSummary -> Maybe Text
$sel:complianceStatus:AppSummary' :: AppSummary -> Maybe AppComplianceStatusType
$sel:assessmentSchedule:AppSummary' :: AppSummary -> Maybe AppAssessmentScheduleType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AppAssessmentScheduleType
assessmentSchedule
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AppComplianceStatusType
complianceStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
resiliencyScore
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AppStatusType
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
appArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData AppSummary where
  rnf :: AppSummary -> ()
rnf AppSummary' {Maybe Double
Maybe Text
Maybe AppAssessmentScheduleType
Maybe AppComplianceStatusType
Maybe AppStatusType
Text
POSIX
name :: Text
creationTime :: POSIX
appArn :: Text
status :: Maybe AppStatusType
resiliencyScore :: Maybe Double
description :: Maybe Text
complianceStatus :: Maybe AppComplianceStatusType
assessmentSchedule :: Maybe AppAssessmentScheduleType
$sel:name:AppSummary' :: AppSummary -> Text
$sel:creationTime:AppSummary' :: AppSummary -> POSIX
$sel:appArn:AppSummary' :: AppSummary -> Text
$sel:status:AppSummary' :: AppSummary -> Maybe AppStatusType
$sel:resiliencyScore:AppSummary' :: AppSummary -> Maybe Double
$sel:description:AppSummary' :: AppSummary -> Maybe Text
$sel:complianceStatus:AppSummary' :: AppSummary -> Maybe AppComplianceStatusType
$sel:assessmentSchedule:AppSummary' :: AppSummary -> Maybe AppAssessmentScheduleType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AppAssessmentScheduleType
assessmentSchedule
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AppComplianceStatusType
complianceStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
resiliencyScore
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AppStatusType
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
appArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name