{-# 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.Route53RecoveryReadiness.Types.ReadinessCheckSummary
-- 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.Route53RecoveryReadiness.Types.ReadinessCheckSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53RecoveryReadiness.Types.Readiness

-- | Summary of ReadinessCheck status, paginated in
-- GetRecoveryGroupReadinessSummary and GetCellReadinessSummary
--
-- /See:/ 'newReadinessCheckSummary' smart constructor.
data ReadinessCheckSummary = ReadinessCheckSummary'
  { -- | The readiness of this ReadinessCheck
    ReadinessCheckSummary -> Maybe Readiness
readiness :: Prelude.Maybe Readiness,
    -- | The name of a ReadinessCheck which is part of the given RecoveryGroup or
    -- Cell
    ReadinessCheckSummary -> Maybe Text
readinessCheckName :: Prelude.Maybe Prelude.Text
  }
  deriving (ReadinessCheckSummary -> ReadinessCheckSummary -> Bool
(ReadinessCheckSummary -> ReadinessCheckSummary -> Bool)
-> (ReadinessCheckSummary -> ReadinessCheckSummary -> Bool)
-> Eq ReadinessCheckSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReadinessCheckSummary -> ReadinessCheckSummary -> Bool
$c/= :: ReadinessCheckSummary -> ReadinessCheckSummary -> Bool
== :: ReadinessCheckSummary -> ReadinessCheckSummary -> Bool
$c== :: ReadinessCheckSummary -> ReadinessCheckSummary -> Bool
Prelude.Eq, ReadPrec [ReadinessCheckSummary]
ReadPrec ReadinessCheckSummary
Int -> ReadS ReadinessCheckSummary
ReadS [ReadinessCheckSummary]
(Int -> ReadS ReadinessCheckSummary)
-> ReadS [ReadinessCheckSummary]
-> ReadPrec ReadinessCheckSummary
-> ReadPrec [ReadinessCheckSummary]
-> Read ReadinessCheckSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReadinessCheckSummary]
$creadListPrec :: ReadPrec [ReadinessCheckSummary]
readPrec :: ReadPrec ReadinessCheckSummary
$creadPrec :: ReadPrec ReadinessCheckSummary
readList :: ReadS [ReadinessCheckSummary]
$creadList :: ReadS [ReadinessCheckSummary]
readsPrec :: Int -> ReadS ReadinessCheckSummary
$creadsPrec :: Int -> ReadS ReadinessCheckSummary
Prelude.Read, Int -> ReadinessCheckSummary -> ShowS
[ReadinessCheckSummary] -> ShowS
ReadinessCheckSummary -> String
(Int -> ReadinessCheckSummary -> ShowS)
-> (ReadinessCheckSummary -> String)
-> ([ReadinessCheckSummary] -> ShowS)
-> Show ReadinessCheckSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReadinessCheckSummary] -> ShowS
$cshowList :: [ReadinessCheckSummary] -> ShowS
show :: ReadinessCheckSummary -> String
$cshow :: ReadinessCheckSummary -> String
showsPrec :: Int -> ReadinessCheckSummary -> ShowS
$cshowsPrec :: Int -> ReadinessCheckSummary -> ShowS
Prelude.Show, (forall x. ReadinessCheckSummary -> Rep ReadinessCheckSummary x)
-> (forall x. Rep ReadinessCheckSummary x -> ReadinessCheckSummary)
-> Generic ReadinessCheckSummary
forall x. Rep ReadinessCheckSummary x -> ReadinessCheckSummary
forall x. ReadinessCheckSummary -> Rep ReadinessCheckSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReadinessCheckSummary x -> ReadinessCheckSummary
$cfrom :: forall x. ReadinessCheckSummary -> Rep ReadinessCheckSummary x
Prelude.Generic)

-- |
-- Create a value of 'ReadinessCheckSummary' 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:
--
-- 'readiness', 'readinessCheckSummary_readiness' - The readiness of this ReadinessCheck
--
-- 'readinessCheckName', 'readinessCheckSummary_readinessCheckName' - The name of a ReadinessCheck which is part of the given RecoveryGroup or
-- Cell
newReadinessCheckSummary ::
  ReadinessCheckSummary
newReadinessCheckSummary :: ReadinessCheckSummary
newReadinessCheckSummary =
  ReadinessCheckSummary' :: Maybe Readiness -> Maybe Text -> ReadinessCheckSummary
ReadinessCheckSummary'
    { $sel:readiness:ReadinessCheckSummary' :: Maybe Readiness
readiness = Maybe Readiness
forall a. Maybe a
Prelude.Nothing,
      $sel:readinessCheckName:ReadinessCheckSummary' :: Maybe Text
readinessCheckName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The readiness of this ReadinessCheck
readinessCheckSummary_readiness :: Lens.Lens' ReadinessCheckSummary (Prelude.Maybe Readiness)
readinessCheckSummary_readiness :: (Maybe Readiness -> f (Maybe Readiness))
-> ReadinessCheckSummary -> f ReadinessCheckSummary
readinessCheckSummary_readiness = (ReadinessCheckSummary -> Maybe Readiness)
-> (ReadinessCheckSummary
    -> Maybe Readiness -> ReadinessCheckSummary)
-> Lens
     ReadinessCheckSummary
     ReadinessCheckSummary
     (Maybe Readiness)
     (Maybe Readiness)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReadinessCheckSummary' {Maybe Readiness
readiness :: Maybe Readiness
$sel:readiness:ReadinessCheckSummary' :: ReadinessCheckSummary -> Maybe Readiness
readiness} -> Maybe Readiness
readiness) (\s :: ReadinessCheckSummary
s@ReadinessCheckSummary' {} Maybe Readiness
a -> ReadinessCheckSummary
s {$sel:readiness:ReadinessCheckSummary' :: Maybe Readiness
readiness = Maybe Readiness
a} :: ReadinessCheckSummary)

-- | The name of a ReadinessCheck which is part of the given RecoveryGroup or
-- Cell
readinessCheckSummary_readinessCheckName :: Lens.Lens' ReadinessCheckSummary (Prelude.Maybe Prelude.Text)
readinessCheckSummary_readinessCheckName :: (Maybe Text -> f (Maybe Text))
-> ReadinessCheckSummary -> f ReadinessCheckSummary
readinessCheckSummary_readinessCheckName = (ReadinessCheckSummary -> Maybe Text)
-> (ReadinessCheckSummary -> Maybe Text -> ReadinessCheckSummary)
-> Lens
     ReadinessCheckSummary
     ReadinessCheckSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReadinessCheckSummary' {Maybe Text
readinessCheckName :: Maybe Text
$sel:readinessCheckName:ReadinessCheckSummary' :: ReadinessCheckSummary -> Maybe Text
readinessCheckName} -> Maybe Text
readinessCheckName) (\s :: ReadinessCheckSummary
s@ReadinessCheckSummary' {} Maybe Text
a -> ReadinessCheckSummary
s {$sel:readinessCheckName:ReadinessCheckSummary' :: Maybe Text
readinessCheckName = Maybe Text
a} :: ReadinessCheckSummary)

instance Core.FromJSON ReadinessCheckSummary where
  parseJSON :: Value -> Parser ReadinessCheckSummary
parseJSON =
    String
-> (Object -> Parser ReadinessCheckSummary)
-> Value
-> Parser ReadinessCheckSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ReadinessCheckSummary"
      ( \Object
x ->
          Maybe Readiness -> Maybe Text -> ReadinessCheckSummary
ReadinessCheckSummary'
            (Maybe Readiness -> Maybe Text -> ReadinessCheckSummary)
-> Parser (Maybe Readiness)
-> Parser (Maybe Text -> ReadinessCheckSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Readiness)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"readiness")
            Parser (Maybe Text -> ReadinessCheckSummary)
-> Parser (Maybe Text) -> Parser ReadinessCheckSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"readinessCheckName")
      )

instance Prelude.Hashable ReadinessCheckSummary

instance Prelude.NFData ReadinessCheckSummary