{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.DescribeResourceCollectionHealth
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns the number of open proactive insights, open reactive insights,
-- and the Mean Time to Recover (MTTR) for all closed insights in resource
-- collections in your account. You specify the type of Amazon Web Services
-- resources collection. The two types of Amazon Web Services resource
-- collections supported are Amazon Web Services CloudFormation stacks and
-- Amazon Web Services resources that contain the same Amazon Web Services
-- tag. DevOps Guru can be configured to analyze the Amazon Web Services
-- resources that are defined in the stacks or that are tagged using the
-- same tag /key/. You can specify up to 500 Amazon Web Services
-- CloudFormation stacks.
--
-- This operation returns paginated results.
module Amazonka.DevOpsGuru.DescribeResourceCollectionHealth
  ( -- * Creating a Request
    DescribeResourceCollectionHealth (..),
    newDescribeResourceCollectionHealth,

    -- * Request Lenses
    describeResourceCollectionHealth_nextToken,
    describeResourceCollectionHealth_resourceCollectionType,

    -- * Destructuring the Response
    DescribeResourceCollectionHealthResponse (..),
    newDescribeResourceCollectionHealthResponse,

    -- * Response Lenses
    describeResourceCollectionHealthResponse_cloudFormation,
    describeResourceCollectionHealthResponse_nextToken,
    describeResourceCollectionHealthResponse_service,
    describeResourceCollectionHealthResponse_tags,
    describeResourceCollectionHealthResponse_httpStatus,
  )
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
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeResourceCollectionHealth' smart constructor.
data DescribeResourceCollectionHealth = DescribeResourceCollectionHealth'
  { -- | The pagination token to use to retrieve the next page of results for
    -- this operation. If this value is null, it retrieves the first page.
    DescribeResourceCollectionHealth -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An Amazon Web Services resource collection type. This type specifies how
    -- analyzed Amazon Web Services resources are defined. The two types of
    -- Amazon Web Services resource collections supported are Amazon Web
    -- Services CloudFormation stacks and Amazon Web Services resources that
    -- contain the same Amazon Web Services tag. DevOps Guru can be configured
    -- to analyze the Amazon Web Services resources that are defined in the
    -- stacks or that are tagged using the same tag /key/. You can specify up
    -- to 500 Amazon Web Services CloudFormation stacks.
    DescribeResourceCollectionHealth -> ResourceCollectionType
resourceCollectionType :: ResourceCollectionType
  }
  deriving (DescribeResourceCollectionHealth
-> DescribeResourceCollectionHealth -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeResourceCollectionHealth
-> DescribeResourceCollectionHealth -> Bool
$c/= :: DescribeResourceCollectionHealth
-> DescribeResourceCollectionHealth -> Bool
== :: DescribeResourceCollectionHealth
-> DescribeResourceCollectionHealth -> Bool
$c== :: DescribeResourceCollectionHealth
-> DescribeResourceCollectionHealth -> Bool
Prelude.Eq, ReadPrec [DescribeResourceCollectionHealth]
ReadPrec DescribeResourceCollectionHealth
Int -> ReadS DescribeResourceCollectionHealth
ReadS [DescribeResourceCollectionHealth]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeResourceCollectionHealth]
$creadListPrec :: ReadPrec [DescribeResourceCollectionHealth]
readPrec :: ReadPrec DescribeResourceCollectionHealth
$creadPrec :: ReadPrec DescribeResourceCollectionHealth
readList :: ReadS [DescribeResourceCollectionHealth]
$creadList :: ReadS [DescribeResourceCollectionHealth]
readsPrec :: Int -> ReadS DescribeResourceCollectionHealth
$creadsPrec :: Int -> ReadS DescribeResourceCollectionHealth
Prelude.Read, Int -> DescribeResourceCollectionHealth -> ShowS
[DescribeResourceCollectionHealth] -> ShowS
DescribeResourceCollectionHealth -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeResourceCollectionHealth] -> ShowS
$cshowList :: [DescribeResourceCollectionHealth] -> ShowS
show :: DescribeResourceCollectionHealth -> String
$cshow :: DescribeResourceCollectionHealth -> String
showsPrec :: Int -> DescribeResourceCollectionHealth -> ShowS
$cshowsPrec :: Int -> DescribeResourceCollectionHealth -> ShowS
Prelude.Show, forall x.
Rep DescribeResourceCollectionHealth x
-> DescribeResourceCollectionHealth
forall x.
DescribeResourceCollectionHealth
-> Rep DescribeResourceCollectionHealth x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeResourceCollectionHealth x
-> DescribeResourceCollectionHealth
$cfrom :: forall x.
DescribeResourceCollectionHealth
-> Rep DescribeResourceCollectionHealth x
Prelude.Generic)

-- |
-- Create a value of 'DescribeResourceCollectionHealth' 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:
--
-- 'nextToken', 'describeResourceCollectionHealth_nextToken' - The pagination token to use to retrieve the next page of results for
-- this operation. If this value is null, it retrieves the first page.
--
-- 'resourceCollectionType', 'describeResourceCollectionHealth_resourceCollectionType' - An Amazon Web Services resource collection type. This type specifies how
-- analyzed Amazon Web Services resources are defined. The two types of
-- Amazon Web Services resource collections supported are Amazon Web
-- Services CloudFormation stacks and Amazon Web Services resources that
-- contain the same Amazon Web Services tag. DevOps Guru can be configured
-- to analyze the Amazon Web Services resources that are defined in the
-- stacks or that are tagged using the same tag /key/. You can specify up
-- to 500 Amazon Web Services CloudFormation stacks.
newDescribeResourceCollectionHealth ::
  -- | 'resourceCollectionType'
  ResourceCollectionType ->
  DescribeResourceCollectionHealth
newDescribeResourceCollectionHealth :: ResourceCollectionType -> DescribeResourceCollectionHealth
newDescribeResourceCollectionHealth
  ResourceCollectionType
pResourceCollectionType_ =
    DescribeResourceCollectionHealth'
      { $sel:nextToken:DescribeResourceCollectionHealth' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:resourceCollectionType:DescribeResourceCollectionHealth' :: ResourceCollectionType
resourceCollectionType =
          ResourceCollectionType
pResourceCollectionType_
      }

-- | The pagination token to use to retrieve the next page of results for
-- this operation. If this value is null, it retrieves the first page.
describeResourceCollectionHealth_nextToken :: Lens.Lens' DescribeResourceCollectionHealth (Prelude.Maybe Prelude.Text)
describeResourceCollectionHealth_nextToken :: Lens' DescribeResourceCollectionHealth (Maybe Text)
describeResourceCollectionHealth_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResourceCollectionHealth' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeResourceCollectionHealth' :: DescribeResourceCollectionHealth -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeResourceCollectionHealth
s@DescribeResourceCollectionHealth' {} Maybe Text
a -> DescribeResourceCollectionHealth
s {$sel:nextToken:DescribeResourceCollectionHealth' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeResourceCollectionHealth)

-- | An Amazon Web Services resource collection type. This type specifies how
-- analyzed Amazon Web Services resources are defined. The two types of
-- Amazon Web Services resource collections supported are Amazon Web
-- Services CloudFormation stacks and Amazon Web Services resources that
-- contain the same Amazon Web Services tag. DevOps Guru can be configured
-- to analyze the Amazon Web Services resources that are defined in the
-- stacks or that are tagged using the same tag /key/. You can specify up
-- to 500 Amazon Web Services CloudFormation stacks.
describeResourceCollectionHealth_resourceCollectionType :: Lens.Lens' DescribeResourceCollectionHealth ResourceCollectionType
describeResourceCollectionHealth_resourceCollectionType :: Lens' DescribeResourceCollectionHealth ResourceCollectionType
describeResourceCollectionHealth_resourceCollectionType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResourceCollectionHealth' {ResourceCollectionType
resourceCollectionType :: ResourceCollectionType
$sel:resourceCollectionType:DescribeResourceCollectionHealth' :: DescribeResourceCollectionHealth -> ResourceCollectionType
resourceCollectionType} -> ResourceCollectionType
resourceCollectionType) (\s :: DescribeResourceCollectionHealth
s@DescribeResourceCollectionHealth' {} ResourceCollectionType
a -> DescribeResourceCollectionHealth
s {$sel:resourceCollectionType:DescribeResourceCollectionHealth' :: ResourceCollectionType
resourceCollectionType = ResourceCollectionType
a} :: DescribeResourceCollectionHealth)

instance
  Core.AWSPager
    DescribeResourceCollectionHealth
  where
  page :: DescribeResourceCollectionHealth
-> AWSResponse DescribeResourceCollectionHealth
-> Maybe DescribeResourceCollectionHealth
page DescribeResourceCollectionHealth
rq AWSResponse DescribeResourceCollectionHealth
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeResourceCollectionHealth
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeResourceCollectionHealthResponse (Maybe Text)
describeResourceCollectionHealthResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeResourceCollectionHealth
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeResourceCollectionHealthResponse
  (Maybe [CloudFormationHealth])
describeResourceCollectionHealthResponse_cloudFormation
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeResourceCollectionHealth
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeResourceCollectionHealthResponse (Maybe [ServiceHealth])
describeResourceCollectionHealthResponse_service
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeResourceCollectionHealth
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeResourceCollectionHealthResponse (Maybe [TagHealth])
describeResourceCollectionHealthResponse_tags
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeResourceCollectionHealth
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeResourceCollectionHealth (Maybe Text)
describeResourceCollectionHealth_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeResourceCollectionHealth
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeResourceCollectionHealthResponse (Maybe Text)
describeResourceCollectionHealthResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance
  Core.AWSRequest
    DescribeResourceCollectionHealth
  where
  type
    AWSResponse DescribeResourceCollectionHealth =
      DescribeResourceCollectionHealthResponse
  request :: (Service -> Service)
-> DescribeResourceCollectionHealth
-> Request DescribeResourceCollectionHealth
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeResourceCollectionHealth
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribeResourceCollectionHealth)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [CloudFormationHealth]
-> Maybe Text
-> Maybe [ServiceHealth]
-> Maybe [TagHealth]
-> Int
-> DescribeResourceCollectionHealthResponse
DescribeResourceCollectionHealthResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CloudFormation" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Service" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Tags" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    DescribeResourceCollectionHealth
  where
  hashWithSalt :: Int -> DescribeResourceCollectionHealth -> Int
hashWithSalt
    Int
_salt
    DescribeResourceCollectionHealth' {Maybe Text
ResourceCollectionType
resourceCollectionType :: ResourceCollectionType
nextToken :: Maybe Text
$sel:resourceCollectionType:DescribeResourceCollectionHealth' :: DescribeResourceCollectionHealth -> ResourceCollectionType
$sel:nextToken:DescribeResourceCollectionHealth' :: DescribeResourceCollectionHealth -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ResourceCollectionType
resourceCollectionType

instance
  Prelude.NFData
    DescribeResourceCollectionHealth
  where
  rnf :: DescribeResourceCollectionHealth -> ()
rnf DescribeResourceCollectionHealth' {Maybe Text
ResourceCollectionType
resourceCollectionType :: ResourceCollectionType
nextToken :: Maybe Text
$sel:resourceCollectionType:DescribeResourceCollectionHealth' :: DescribeResourceCollectionHealth -> ResourceCollectionType
$sel:nextToken:DescribeResourceCollectionHealth' :: DescribeResourceCollectionHealth -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ResourceCollectionType
resourceCollectionType

instance
  Data.ToHeaders
    DescribeResourceCollectionHealth
  where
  toHeaders :: DescribeResourceCollectionHealth -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToPath DescribeResourceCollectionHealth where
  toPath :: DescribeResourceCollectionHealth -> ByteString
toPath DescribeResourceCollectionHealth' {Maybe Text
ResourceCollectionType
resourceCollectionType :: ResourceCollectionType
nextToken :: Maybe Text
$sel:resourceCollectionType:DescribeResourceCollectionHealth' :: DescribeResourceCollectionHealth -> ResourceCollectionType
$sel:nextToken:DescribeResourceCollectionHealth' :: DescribeResourceCollectionHealth -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/accounts/health/resource-collection/",
        forall a. ToByteString a => a -> ByteString
Data.toBS ResourceCollectionType
resourceCollectionType
      ]

instance
  Data.ToQuery
    DescribeResourceCollectionHealth
  where
  toQuery :: DescribeResourceCollectionHealth -> QueryString
toQuery DescribeResourceCollectionHealth' {Maybe Text
ResourceCollectionType
resourceCollectionType :: ResourceCollectionType
nextToken :: Maybe Text
$sel:resourceCollectionType:DescribeResourceCollectionHealth' :: DescribeResourceCollectionHealth -> ResourceCollectionType
$sel:nextToken:DescribeResourceCollectionHealth' :: DescribeResourceCollectionHealth -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken]

-- | /See:/ 'newDescribeResourceCollectionHealthResponse' smart constructor.
data DescribeResourceCollectionHealthResponse = DescribeResourceCollectionHealthResponse'
  { -- | The returned @CloudFormationHealthOverview@ object that contains an
    -- @InsightHealthOverview@ object with the requested system health
    -- information.
    DescribeResourceCollectionHealthResponse
-> Maybe [CloudFormationHealth]
cloudFormation :: Prelude.Maybe [CloudFormationHealth],
    -- | The pagination token to use to retrieve the next page of results for
    -- this operation. If there are no more pages, this value is null.
    DescribeResourceCollectionHealthResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array of @ServiceHealth@ objects that describes the health of the
    -- Amazon Web Services services associated with the resources in the
    -- collection.
    DescribeResourceCollectionHealthResponse -> Maybe [ServiceHealth]
service :: Prelude.Maybe [ServiceHealth],
    -- | The Amazon Web Services tags that are used by resources in the resource
    -- collection.
    --
    -- Tags help you identify and organize your Amazon Web Services resources.
    -- Many Amazon Web Services services support tagging, so you can assign the
    -- same tag to resources from different services to indicate that the
    -- resources are related. For example, you can assign the same tag to an
    -- Amazon DynamoDB table resource that you assign to an Lambda function.
    -- For more information about using tags, see the
    -- <https://d1.awsstatic.com/whitepapers/aws-tagging-best-practices.pdf Tagging best practices>
    -- whitepaper.
    --
    -- Each Amazon Web Services tag has two parts.
    --
    -- -   A tag /key/ (for example, @CostCenter@, @Environment@, @Project@, or
    --     @Secret@). Tag /keys/ are case-sensitive.
    --
    -- -   An optional field known as a tag /value/ (for example,
    --     @111122223333@, @Production@, or a team name). Omitting the tag
    --     /value/ is the same as using an empty string. Like tag /keys/, tag
    --     /values/ are case-sensitive.
    --
    -- Together these are known as /key/-/value/ pairs.
    --
    -- 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@.
    DescribeResourceCollectionHealthResponse -> Maybe [TagHealth]
tags :: Prelude.Maybe [TagHealth],
    -- | The response's http status code.
    DescribeResourceCollectionHealthResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeResourceCollectionHealthResponse
-> DescribeResourceCollectionHealthResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeResourceCollectionHealthResponse
-> DescribeResourceCollectionHealthResponse -> Bool
$c/= :: DescribeResourceCollectionHealthResponse
-> DescribeResourceCollectionHealthResponse -> Bool
== :: DescribeResourceCollectionHealthResponse
-> DescribeResourceCollectionHealthResponse -> Bool
$c== :: DescribeResourceCollectionHealthResponse
-> DescribeResourceCollectionHealthResponse -> Bool
Prelude.Eq, ReadPrec [DescribeResourceCollectionHealthResponse]
ReadPrec DescribeResourceCollectionHealthResponse
Int -> ReadS DescribeResourceCollectionHealthResponse
ReadS [DescribeResourceCollectionHealthResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeResourceCollectionHealthResponse]
$creadListPrec :: ReadPrec [DescribeResourceCollectionHealthResponse]
readPrec :: ReadPrec DescribeResourceCollectionHealthResponse
$creadPrec :: ReadPrec DescribeResourceCollectionHealthResponse
readList :: ReadS [DescribeResourceCollectionHealthResponse]
$creadList :: ReadS [DescribeResourceCollectionHealthResponse]
readsPrec :: Int -> ReadS DescribeResourceCollectionHealthResponse
$creadsPrec :: Int -> ReadS DescribeResourceCollectionHealthResponse
Prelude.Read, Int -> DescribeResourceCollectionHealthResponse -> ShowS
[DescribeResourceCollectionHealthResponse] -> ShowS
DescribeResourceCollectionHealthResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeResourceCollectionHealthResponse] -> ShowS
$cshowList :: [DescribeResourceCollectionHealthResponse] -> ShowS
show :: DescribeResourceCollectionHealthResponse -> String
$cshow :: DescribeResourceCollectionHealthResponse -> String
showsPrec :: Int -> DescribeResourceCollectionHealthResponse -> ShowS
$cshowsPrec :: Int -> DescribeResourceCollectionHealthResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeResourceCollectionHealthResponse x
-> DescribeResourceCollectionHealthResponse
forall x.
DescribeResourceCollectionHealthResponse
-> Rep DescribeResourceCollectionHealthResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeResourceCollectionHealthResponse x
-> DescribeResourceCollectionHealthResponse
$cfrom :: forall x.
DescribeResourceCollectionHealthResponse
-> Rep DescribeResourceCollectionHealthResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeResourceCollectionHealthResponse' 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:
--
-- 'cloudFormation', 'describeResourceCollectionHealthResponse_cloudFormation' - The returned @CloudFormationHealthOverview@ object that contains an
-- @InsightHealthOverview@ object with the requested system health
-- information.
--
-- 'nextToken', 'describeResourceCollectionHealthResponse_nextToken' - The pagination token to use to retrieve the next page of results for
-- this operation. If there are no more pages, this value is null.
--
-- 'service', 'describeResourceCollectionHealthResponse_service' - An array of @ServiceHealth@ objects that describes the health of the
-- Amazon Web Services services associated with the resources in the
-- collection.
--
-- 'tags', 'describeResourceCollectionHealthResponse_tags' - The Amazon Web Services tags that are used by resources in the resource
-- collection.
--
-- Tags help you identify and organize your Amazon Web Services resources.
-- Many Amazon Web Services services support tagging, so you can assign the
-- same tag to resources from different services to indicate that the
-- resources are related. For example, you can assign the same tag to an
-- Amazon DynamoDB table resource that you assign to an Lambda function.
-- For more information about using tags, see the
-- <https://d1.awsstatic.com/whitepapers/aws-tagging-best-practices.pdf Tagging best practices>
-- whitepaper.
--
-- Each Amazon Web Services tag has two parts.
--
-- -   A tag /key/ (for example, @CostCenter@, @Environment@, @Project@, or
--     @Secret@). Tag /keys/ are case-sensitive.
--
-- -   An optional field known as a tag /value/ (for example,
--     @111122223333@, @Production@, or a team name). Omitting the tag
--     /value/ is the same as using an empty string. Like tag /keys/, tag
--     /values/ are case-sensitive.
--
-- Together these are known as /key/-/value/ pairs.
--
-- 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@.
--
-- 'httpStatus', 'describeResourceCollectionHealthResponse_httpStatus' - The response's http status code.
newDescribeResourceCollectionHealthResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeResourceCollectionHealthResponse
newDescribeResourceCollectionHealthResponse :: Int -> DescribeResourceCollectionHealthResponse
newDescribeResourceCollectionHealthResponse
  Int
pHttpStatus_ =
    DescribeResourceCollectionHealthResponse'
      { $sel:cloudFormation:DescribeResourceCollectionHealthResponse' :: Maybe [CloudFormationHealth]
cloudFormation =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeResourceCollectionHealthResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:service:DescribeResourceCollectionHealthResponse' :: Maybe [ServiceHealth]
service = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:DescribeResourceCollectionHealthResponse' :: Maybe [TagHealth]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeResourceCollectionHealthResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The returned @CloudFormationHealthOverview@ object that contains an
-- @InsightHealthOverview@ object with the requested system health
-- information.
describeResourceCollectionHealthResponse_cloudFormation :: Lens.Lens' DescribeResourceCollectionHealthResponse (Prelude.Maybe [CloudFormationHealth])
describeResourceCollectionHealthResponse_cloudFormation :: Lens'
  DescribeResourceCollectionHealthResponse
  (Maybe [CloudFormationHealth])
describeResourceCollectionHealthResponse_cloudFormation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResourceCollectionHealthResponse' {Maybe [CloudFormationHealth]
cloudFormation :: Maybe [CloudFormationHealth]
$sel:cloudFormation:DescribeResourceCollectionHealthResponse' :: DescribeResourceCollectionHealthResponse
-> Maybe [CloudFormationHealth]
cloudFormation} -> Maybe [CloudFormationHealth]
cloudFormation) (\s :: DescribeResourceCollectionHealthResponse
s@DescribeResourceCollectionHealthResponse' {} Maybe [CloudFormationHealth]
a -> DescribeResourceCollectionHealthResponse
s {$sel:cloudFormation:DescribeResourceCollectionHealthResponse' :: Maybe [CloudFormationHealth]
cloudFormation = Maybe [CloudFormationHealth]
a} :: DescribeResourceCollectionHealthResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The pagination token to use to retrieve the next page of results for
-- this operation. If there are no more pages, this value is null.
describeResourceCollectionHealthResponse_nextToken :: Lens.Lens' DescribeResourceCollectionHealthResponse (Prelude.Maybe Prelude.Text)
describeResourceCollectionHealthResponse_nextToken :: Lens' DescribeResourceCollectionHealthResponse (Maybe Text)
describeResourceCollectionHealthResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResourceCollectionHealthResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeResourceCollectionHealthResponse' :: DescribeResourceCollectionHealthResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeResourceCollectionHealthResponse
s@DescribeResourceCollectionHealthResponse' {} Maybe Text
a -> DescribeResourceCollectionHealthResponse
s {$sel:nextToken:DescribeResourceCollectionHealthResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeResourceCollectionHealthResponse)

-- | An array of @ServiceHealth@ objects that describes the health of the
-- Amazon Web Services services associated with the resources in the
-- collection.
describeResourceCollectionHealthResponse_service :: Lens.Lens' DescribeResourceCollectionHealthResponse (Prelude.Maybe [ServiceHealth])
describeResourceCollectionHealthResponse_service :: Lens'
  DescribeResourceCollectionHealthResponse (Maybe [ServiceHealth])
describeResourceCollectionHealthResponse_service = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResourceCollectionHealthResponse' {Maybe [ServiceHealth]
service :: Maybe [ServiceHealth]
$sel:service:DescribeResourceCollectionHealthResponse' :: DescribeResourceCollectionHealthResponse -> Maybe [ServiceHealth]
service} -> Maybe [ServiceHealth]
service) (\s :: DescribeResourceCollectionHealthResponse
s@DescribeResourceCollectionHealthResponse' {} Maybe [ServiceHealth]
a -> DescribeResourceCollectionHealthResponse
s {$sel:service:DescribeResourceCollectionHealthResponse' :: Maybe [ServiceHealth]
service = Maybe [ServiceHealth]
a} :: DescribeResourceCollectionHealthResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Web Services tags that are used by resources in the resource
-- collection.
--
-- Tags help you identify and organize your Amazon Web Services resources.
-- Many Amazon Web Services services support tagging, so you can assign the
-- same tag to resources from different services to indicate that the
-- resources are related. For example, you can assign the same tag to an
-- Amazon DynamoDB table resource that you assign to an Lambda function.
-- For more information about using tags, see the
-- <https://d1.awsstatic.com/whitepapers/aws-tagging-best-practices.pdf Tagging best practices>
-- whitepaper.
--
-- Each Amazon Web Services tag has two parts.
--
-- -   A tag /key/ (for example, @CostCenter@, @Environment@, @Project@, or
--     @Secret@). Tag /keys/ are case-sensitive.
--
-- -   An optional field known as a tag /value/ (for example,
--     @111122223333@, @Production@, or a team name). Omitting the tag
--     /value/ is the same as using an empty string. Like tag /keys/, tag
--     /values/ are case-sensitive.
--
-- Together these are known as /key/-/value/ pairs.
--
-- 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@.
describeResourceCollectionHealthResponse_tags :: Lens.Lens' DescribeResourceCollectionHealthResponse (Prelude.Maybe [TagHealth])
describeResourceCollectionHealthResponse_tags :: Lens' DescribeResourceCollectionHealthResponse (Maybe [TagHealth])
describeResourceCollectionHealthResponse_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResourceCollectionHealthResponse' {Maybe [TagHealth]
tags :: Maybe [TagHealth]
$sel:tags:DescribeResourceCollectionHealthResponse' :: DescribeResourceCollectionHealthResponse -> Maybe [TagHealth]
tags} -> Maybe [TagHealth]
tags) (\s :: DescribeResourceCollectionHealthResponse
s@DescribeResourceCollectionHealthResponse' {} Maybe [TagHealth]
a -> DescribeResourceCollectionHealthResponse
s {$sel:tags:DescribeResourceCollectionHealthResponse' :: Maybe [TagHealth]
tags = Maybe [TagHealth]
a} :: DescribeResourceCollectionHealthResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
describeResourceCollectionHealthResponse_httpStatus :: Lens.Lens' DescribeResourceCollectionHealthResponse Prelude.Int
describeResourceCollectionHealthResponse_httpStatus :: Lens' DescribeResourceCollectionHealthResponse Int
describeResourceCollectionHealthResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResourceCollectionHealthResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeResourceCollectionHealthResponse' :: DescribeResourceCollectionHealthResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeResourceCollectionHealthResponse
s@DescribeResourceCollectionHealthResponse' {} Int
a -> DescribeResourceCollectionHealthResponse
s {$sel:httpStatus:DescribeResourceCollectionHealthResponse' :: Int
httpStatus = Int
a} :: DescribeResourceCollectionHealthResponse)

instance
  Prelude.NFData
    DescribeResourceCollectionHealthResponse
  where
  rnf :: DescribeResourceCollectionHealthResponse -> ()
rnf DescribeResourceCollectionHealthResponse' {Int
Maybe [CloudFormationHealth]
Maybe [ServiceHealth]
Maybe [TagHealth]
Maybe Text
httpStatus :: Int
tags :: Maybe [TagHealth]
service :: Maybe [ServiceHealth]
nextToken :: Maybe Text
cloudFormation :: Maybe [CloudFormationHealth]
$sel:httpStatus:DescribeResourceCollectionHealthResponse' :: DescribeResourceCollectionHealthResponse -> Int
$sel:tags:DescribeResourceCollectionHealthResponse' :: DescribeResourceCollectionHealthResponse -> Maybe [TagHealth]
$sel:service:DescribeResourceCollectionHealthResponse' :: DescribeResourceCollectionHealthResponse -> Maybe [ServiceHealth]
$sel:nextToken:DescribeResourceCollectionHealthResponse' :: DescribeResourceCollectionHealthResponse -> Maybe Text
$sel:cloudFormation:DescribeResourceCollectionHealthResponse' :: DescribeResourceCollectionHealthResponse
-> Maybe [CloudFormationHealth]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [CloudFormationHealth]
cloudFormation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ServiceHealth]
service
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TagHealth]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus