{-# 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.DevOpsGuru.Types.TagHealth
-- 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.DevOpsGuru.Types.TagHealth where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DevOpsGuru.Types.InsightHealth
import qualified Amazonka.Prelude as Prelude

-- | Information about the health of Amazon Web Services resources in your
-- account that are specified by an Amazon Web Services tag /key/.
--
-- /See:/ 'newTagHealth' smart constructor.
data TagHealth = TagHealth'
  { -- | Number of resources that DevOps Guru is monitoring in your account that
    -- are specified by an Amazon Web Services tag.
    TagHealth -> Maybe Integer
analyzedResourceCount :: Prelude.Maybe Prelude.Integer,
    -- | An Amazon Web Services tag /key/ that is used to identify the Amazon Web
    -- Services resources that DevOps Guru analyzes. All Amazon Web Services
    -- resources in your account and Region tagged with this /key/ make up your
    -- DevOps Guru application and analysis boundary.
    --
    -- The string used for a /key/ in a tag that you use to define your
    -- resource coverage must begin with the prefix @Devops-guru-@. The tag
    -- /key/ might be @DevOps-Guru-deployment-application@ or
    -- @devops-guru-rds-application@. When you create a /key/, the case of
    -- characters in the /key/ can be whatever you choose. After you create a
    -- /key/, it is case-sensitive. For example, DevOps Guru works with a /key/
    -- named @devops-guru-rds@ and a /key/ named @DevOps-Guru-RDS@, and these
    -- act as two different /keys/. Possible /key/\//value/ pairs in your
    -- application might be @Devops-Guru-production-application\/RDS@ or
    -- @Devops-Guru-production-application\/containers@.
    TagHealth -> Maybe Text
appBoundaryKey :: Prelude.Maybe Prelude.Text,
    -- | Information about the health of the Amazon Web Services resources in
    -- your account that are specified by an Amazon Web Services tag, including
    -- the number of open proactive, open reactive insights, and the Mean Time
    -- to Recover (MTTR) of closed insights.
    TagHealth -> Maybe InsightHealth
insight :: Prelude.Maybe InsightHealth,
    -- | The value in an Amazon Web Services tag.
    --
    -- The tag\'s /value/ is an optional field used to associate a string with
    -- the tag /key/ (for example, @111122223333@, @Production@, or a team
    -- name). The /key/ and /value/ are the tag\'s /key/ pair. Omitting the tag
    -- /value/ is the same as using an empty string. Like tag /keys/, tag
    -- /values/ are case-sensitive. You can specify a maximum of 256 characters
    -- for a tag value.
    TagHealth -> Maybe Text
tagValue :: Prelude.Maybe Prelude.Text
  }
  deriving (TagHealth -> TagHealth -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TagHealth -> TagHealth -> Bool
$c/= :: TagHealth -> TagHealth -> Bool
== :: TagHealth -> TagHealth -> Bool
$c== :: TagHealth -> TagHealth -> Bool
Prelude.Eq, ReadPrec [TagHealth]
ReadPrec TagHealth
Int -> ReadS TagHealth
ReadS [TagHealth]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TagHealth]
$creadListPrec :: ReadPrec [TagHealth]
readPrec :: ReadPrec TagHealth
$creadPrec :: ReadPrec TagHealth
readList :: ReadS [TagHealth]
$creadList :: ReadS [TagHealth]
readsPrec :: Int -> ReadS TagHealth
$creadsPrec :: Int -> ReadS TagHealth
Prelude.Read, Int -> TagHealth -> ShowS
[TagHealth] -> ShowS
TagHealth -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TagHealth] -> ShowS
$cshowList :: [TagHealth] -> ShowS
show :: TagHealth -> String
$cshow :: TagHealth -> String
showsPrec :: Int -> TagHealth -> ShowS
$cshowsPrec :: Int -> TagHealth -> ShowS
Prelude.Show, forall x. Rep TagHealth x -> TagHealth
forall x. TagHealth -> Rep TagHealth x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TagHealth x -> TagHealth
$cfrom :: forall x. TagHealth -> Rep TagHealth x
Prelude.Generic)

-- |
-- Create a value of 'TagHealth' 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:
--
-- 'analyzedResourceCount', 'tagHealth_analyzedResourceCount' - Number of resources that DevOps Guru is monitoring in your account that
-- are specified by an Amazon Web Services tag.
--
-- 'appBoundaryKey', 'tagHealth_appBoundaryKey' - An Amazon Web Services tag /key/ that is used to identify the Amazon Web
-- Services resources that DevOps Guru analyzes. All Amazon Web Services
-- resources in your account and Region tagged with this /key/ make up your
-- DevOps Guru application and analysis boundary.
--
-- The string used for a /key/ in a tag that you use to define your
-- resource coverage must begin with the prefix @Devops-guru-@. The tag
-- /key/ might be @DevOps-Guru-deployment-application@ or
-- @devops-guru-rds-application@. When you create a /key/, the case of
-- characters in the /key/ can be whatever you choose. After you create a
-- /key/, it is case-sensitive. For example, DevOps Guru works with a /key/
-- named @devops-guru-rds@ and a /key/ named @DevOps-Guru-RDS@, and these
-- act as two different /keys/. Possible /key/\//value/ pairs in your
-- application might be @Devops-Guru-production-application\/RDS@ or
-- @Devops-Guru-production-application\/containers@.
--
-- 'insight', 'tagHealth_insight' - Information about the health of the Amazon Web Services resources in
-- your account that are specified by an Amazon Web Services tag, including
-- the number of open proactive, open reactive insights, and the Mean Time
-- to Recover (MTTR) of closed insights.
--
-- 'tagValue', 'tagHealth_tagValue' - The value in an Amazon Web Services tag.
--
-- The tag\'s /value/ is an optional field used to associate a string with
-- the tag /key/ (for example, @111122223333@, @Production@, or a team
-- name). The /key/ and /value/ are the tag\'s /key/ pair. Omitting the tag
-- /value/ is the same as using an empty string. Like tag /keys/, tag
-- /values/ are case-sensitive. You can specify a maximum of 256 characters
-- for a tag value.
newTagHealth ::
  TagHealth
newTagHealth :: TagHealth
newTagHealth =
  TagHealth'
    { $sel:analyzedResourceCount:TagHealth' :: Maybe Integer
analyzedResourceCount = forall a. Maybe a
Prelude.Nothing,
      $sel:appBoundaryKey:TagHealth' :: Maybe Text
appBoundaryKey = forall a. Maybe a
Prelude.Nothing,
      $sel:insight:TagHealth' :: Maybe InsightHealth
insight = forall a. Maybe a
Prelude.Nothing,
      $sel:tagValue:TagHealth' :: Maybe Text
tagValue = forall a. Maybe a
Prelude.Nothing
    }

-- | Number of resources that DevOps Guru is monitoring in your account that
-- are specified by an Amazon Web Services tag.
tagHealth_analyzedResourceCount :: Lens.Lens' TagHealth (Prelude.Maybe Prelude.Integer)
tagHealth_analyzedResourceCount :: Lens' TagHealth (Maybe Integer)
tagHealth_analyzedResourceCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagHealth' {Maybe Integer
analyzedResourceCount :: Maybe Integer
$sel:analyzedResourceCount:TagHealth' :: TagHealth -> Maybe Integer
analyzedResourceCount} -> Maybe Integer
analyzedResourceCount) (\s :: TagHealth
s@TagHealth' {} Maybe Integer
a -> TagHealth
s {$sel:analyzedResourceCount:TagHealth' :: Maybe Integer
analyzedResourceCount = Maybe Integer
a} :: TagHealth)

-- | An Amazon Web Services tag /key/ that is used to identify the Amazon Web
-- Services resources that DevOps Guru analyzes. All Amazon Web Services
-- resources in your account and Region tagged with this /key/ make up your
-- DevOps Guru application and analysis boundary.
--
-- The string used for a /key/ in a tag that you use to define your
-- resource coverage must begin with the prefix @Devops-guru-@. The tag
-- /key/ might be @DevOps-Guru-deployment-application@ or
-- @devops-guru-rds-application@. When you create a /key/, the case of
-- characters in the /key/ can be whatever you choose. After you create a
-- /key/, it is case-sensitive. For example, DevOps Guru works with a /key/
-- named @devops-guru-rds@ and a /key/ named @DevOps-Guru-RDS@, and these
-- act as two different /keys/. Possible /key/\//value/ pairs in your
-- application might be @Devops-Guru-production-application\/RDS@ or
-- @Devops-Guru-production-application\/containers@.
tagHealth_appBoundaryKey :: Lens.Lens' TagHealth (Prelude.Maybe Prelude.Text)
tagHealth_appBoundaryKey :: Lens' TagHealth (Maybe Text)
tagHealth_appBoundaryKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagHealth' {Maybe Text
appBoundaryKey :: Maybe Text
$sel:appBoundaryKey:TagHealth' :: TagHealth -> Maybe Text
appBoundaryKey} -> Maybe Text
appBoundaryKey) (\s :: TagHealth
s@TagHealth' {} Maybe Text
a -> TagHealth
s {$sel:appBoundaryKey:TagHealth' :: Maybe Text
appBoundaryKey = Maybe Text
a} :: TagHealth)

-- | Information about the health of the Amazon Web Services resources in
-- your account that are specified by an Amazon Web Services tag, including
-- the number of open proactive, open reactive insights, and the Mean Time
-- to Recover (MTTR) of closed insights.
tagHealth_insight :: Lens.Lens' TagHealth (Prelude.Maybe InsightHealth)
tagHealth_insight :: Lens' TagHealth (Maybe InsightHealth)
tagHealth_insight = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagHealth' {Maybe InsightHealth
insight :: Maybe InsightHealth
$sel:insight:TagHealth' :: TagHealth -> Maybe InsightHealth
insight} -> Maybe InsightHealth
insight) (\s :: TagHealth
s@TagHealth' {} Maybe InsightHealth
a -> TagHealth
s {$sel:insight:TagHealth' :: Maybe InsightHealth
insight = Maybe InsightHealth
a} :: TagHealth)

-- | The value in an Amazon Web Services tag.
--
-- The tag\'s /value/ is an optional field used to associate a string with
-- the tag /key/ (for example, @111122223333@, @Production@, or a team
-- name). The /key/ and /value/ are the tag\'s /key/ pair. Omitting the tag
-- /value/ is the same as using an empty string. Like tag /keys/, tag
-- /values/ are case-sensitive. You can specify a maximum of 256 characters
-- for a tag value.
tagHealth_tagValue :: Lens.Lens' TagHealth (Prelude.Maybe Prelude.Text)
tagHealth_tagValue :: Lens' TagHealth (Maybe Text)
tagHealth_tagValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagHealth' {Maybe Text
tagValue :: Maybe Text
$sel:tagValue:TagHealth' :: TagHealth -> Maybe Text
tagValue} -> Maybe Text
tagValue) (\s :: TagHealth
s@TagHealth' {} Maybe Text
a -> TagHealth
s {$sel:tagValue:TagHealth' :: Maybe Text
tagValue = Maybe Text
a} :: TagHealth)

instance Data.FromJSON TagHealth where
  parseJSON :: Value -> Parser TagHealth
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"TagHealth"
      ( \Object
x ->
          Maybe Integer
-> Maybe Text -> Maybe InsightHealth -> Maybe Text -> TagHealth
TagHealth'
            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
"AnalyzedResourceCount")
            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
"AppBoundaryKey")
            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
"Insight")
            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
"TagValue")
      )

instance Prelude.Hashable TagHealth where
  hashWithSalt :: Int -> TagHealth -> Int
hashWithSalt Int
_salt TagHealth' {Maybe Integer
Maybe Text
Maybe InsightHealth
tagValue :: Maybe Text
insight :: Maybe InsightHealth
appBoundaryKey :: Maybe Text
analyzedResourceCount :: Maybe Integer
$sel:tagValue:TagHealth' :: TagHealth -> Maybe Text
$sel:insight:TagHealth' :: TagHealth -> Maybe InsightHealth
$sel:appBoundaryKey:TagHealth' :: TagHealth -> Maybe Text
$sel:analyzedResourceCount:TagHealth' :: TagHealth -> Maybe Integer
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
analyzedResourceCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
appBoundaryKey
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InsightHealth
insight
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
tagValue

instance Prelude.NFData TagHealth where
  rnf :: TagHealth -> ()
rnf TagHealth' {Maybe Integer
Maybe Text
Maybe InsightHealth
tagValue :: Maybe Text
insight :: Maybe InsightHealth
appBoundaryKey :: Maybe Text
analyzedResourceCount :: Maybe Integer
$sel:tagValue:TagHealth' :: TagHealth -> Maybe Text
$sel:insight:TagHealth' :: TagHealth -> Maybe InsightHealth
$sel:appBoundaryKey:TagHealth' :: TagHealth -> Maybe Text
$sel:analyzedResourceCount:TagHealth' :: TagHealth -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
analyzedResourceCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
appBoundaryKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InsightHealth
insight
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
tagValue