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

-- | A readiness check.
--
-- /See:/ 'newReadinessCheckOutput' smart constructor.
data ReadinessCheckOutput = ReadinessCheckOutput'
  { -- | Name of a readiness check.
    ReadinessCheckOutput -> Maybe Text
readinessCheckName :: Prelude.Maybe Prelude.Text,
    ReadinessCheckOutput -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The Amazon Resource Name (ARN) associated with a readiness check.
    ReadinessCheckOutput -> Text
readinessCheckArn :: Prelude.Text,
    -- | Name of the resource set to be checked.
    ReadinessCheckOutput -> Text
resourceSet :: Prelude.Text
  }
  deriving (ReadinessCheckOutput -> ReadinessCheckOutput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReadinessCheckOutput -> ReadinessCheckOutput -> Bool
$c/= :: ReadinessCheckOutput -> ReadinessCheckOutput -> Bool
== :: ReadinessCheckOutput -> ReadinessCheckOutput -> Bool
$c== :: ReadinessCheckOutput -> ReadinessCheckOutput -> Bool
Prelude.Eq, ReadPrec [ReadinessCheckOutput]
ReadPrec ReadinessCheckOutput
Int -> ReadS ReadinessCheckOutput
ReadS [ReadinessCheckOutput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReadinessCheckOutput]
$creadListPrec :: ReadPrec [ReadinessCheckOutput]
readPrec :: ReadPrec ReadinessCheckOutput
$creadPrec :: ReadPrec ReadinessCheckOutput
readList :: ReadS [ReadinessCheckOutput]
$creadList :: ReadS [ReadinessCheckOutput]
readsPrec :: Int -> ReadS ReadinessCheckOutput
$creadsPrec :: Int -> ReadS ReadinessCheckOutput
Prelude.Read, Int -> ReadinessCheckOutput -> ShowS
[ReadinessCheckOutput] -> ShowS
ReadinessCheckOutput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReadinessCheckOutput] -> ShowS
$cshowList :: [ReadinessCheckOutput] -> ShowS
show :: ReadinessCheckOutput -> String
$cshow :: ReadinessCheckOutput -> String
showsPrec :: Int -> ReadinessCheckOutput -> ShowS
$cshowsPrec :: Int -> ReadinessCheckOutput -> ShowS
Prelude.Show, forall x. Rep ReadinessCheckOutput x -> ReadinessCheckOutput
forall x. ReadinessCheckOutput -> Rep ReadinessCheckOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReadinessCheckOutput x -> ReadinessCheckOutput
$cfrom :: forall x. ReadinessCheckOutput -> Rep ReadinessCheckOutput x
Prelude.Generic)

-- |
-- Create a value of 'ReadinessCheckOutput' 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:
--
-- 'readinessCheckName', 'readinessCheckOutput_readinessCheckName' - Name of a readiness check.
--
-- 'tags', 'readinessCheckOutput_tags' - Undocumented member.
--
-- 'readinessCheckArn', 'readinessCheckOutput_readinessCheckArn' - The Amazon Resource Name (ARN) associated with a readiness check.
--
-- 'resourceSet', 'readinessCheckOutput_resourceSet' - Name of the resource set to be checked.
newReadinessCheckOutput ::
  -- | 'readinessCheckArn'
  Prelude.Text ->
  -- | 'resourceSet'
  Prelude.Text ->
  ReadinessCheckOutput
newReadinessCheckOutput :: Text -> Text -> ReadinessCheckOutput
newReadinessCheckOutput
  Text
pReadinessCheckArn_
  Text
pResourceSet_ =
    ReadinessCheckOutput'
      { $sel:readinessCheckName:ReadinessCheckOutput' :: Maybe Text
readinessCheckName =
          forall a. Maybe a
Prelude.Nothing,
        $sel:tags:ReadinessCheckOutput' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:readinessCheckArn:ReadinessCheckOutput' :: Text
readinessCheckArn = Text
pReadinessCheckArn_,
        $sel:resourceSet:ReadinessCheckOutput' :: Text
resourceSet = Text
pResourceSet_
      }

-- | Name of a readiness check.
readinessCheckOutput_readinessCheckName :: Lens.Lens' ReadinessCheckOutput (Prelude.Maybe Prelude.Text)
readinessCheckOutput_readinessCheckName :: Lens' ReadinessCheckOutput (Maybe Text)
readinessCheckOutput_readinessCheckName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReadinessCheckOutput' {Maybe Text
readinessCheckName :: Maybe Text
$sel:readinessCheckName:ReadinessCheckOutput' :: ReadinessCheckOutput -> Maybe Text
readinessCheckName} -> Maybe Text
readinessCheckName) (\s :: ReadinessCheckOutput
s@ReadinessCheckOutput' {} Maybe Text
a -> ReadinessCheckOutput
s {$sel:readinessCheckName:ReadinessCheckOutput' :: Maybe Text
readinessCheckName = Maybe Text
a} :: ReadinessCheckOutput)

-- | Undocumented member.
readinessCheckOutput_tags :: Lens.Lens' ReadinessCheckOutput (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
readinessCheckOutput_tags :: Lens' ReadinessCheckOutput (Maybe (HashMap Text Text))
readinessCheckOutput_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReadinessCheckOutput' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ReadinessCheckOutput' :: ReadinessCheckOutput -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ReadinessCheckOutput
s@ReadinessCheckOutput' {} Maybe (HashMap Text Text)
a -> ReadinessCheckOutput
s {$sel:tags:ReadinessCheckOutput' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ReadinessCheckOutput) 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 Resource Name (ARN) associated with a readiness check.
readinessCheckOutput_readinessCheckArn :: Lens.Lens' ReadinessCheckOutput Prelude.Text
readinessCheckOutput_readinessCheckArn :: Lens' ReadinessCheckOutput Text
readinessCheckOutput_readinessCheckArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReadinessCheckOutput' {Text
readinessCheckArn :: Text
$sel:readinessCheckArn:ReadinessCheckOutput' :: ReadinessCheckOutput -> Text
readinessCheckArn} -> Text
readinessCheckArn) (\s :: ReadinessCheckOutput
s@ReadinessCheckOutput' {} Text
a -> ReadinessCheckOutput
s {$sel:readinessCheckArn:ReadinessCheckOutput' :: Text
readinessCheckArn = Text
a} :: ReadinessCheckOutput)

-- | Name of the resource set to be checked.
readinessCheckOutput_resourceSet :: Lens.Lens' ReadinessCheckOutput Prelude.Text
readinessCheckOutput_resourceSet :: Lens' ReadinessCheckOutput Text
readinessCheckOutput_resourceSet = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReadinessCheckOutput' {Text
resourceSet :: Text
$sel:resourceSet:ReadinessCheckOutput' :: ReadinessCheckOutput -> Text
resourceSet} -> Text
resourceSet) (\s :: ReadinessCheckOutput
s@ReadinessCheckOutput' {} Text
a -> ReadinessCheckOutput
s {$sel:resourceSet:ReadinessCheckOutput' :: Text
resourceSet = Text
a} :: ReadinessCheckOutput)

instance Data.FromJSON ReadinessCheckOutput where
  parseJSON :: Value -> Parser ReadinessCheckOutput
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ReadinessCheckOutput"
      ( \Object
x ->
          Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> ReadinessCheckOutput
ReadinessCheckOutput'
            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
"readinessCheckName")
            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
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= 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 -> Parser a
Data..: Key
"readinessCheckArn")
            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
"resourceSet")
      )

instance Prelude.Hashable ReadinessCheckOutput where
  hashWithSalt :: Int -> ReadinessCheckOutput -> Int
hashWithSalt Int
_salt ReadinessCheckOutput' {Maybe Text
Maybe (HashMap Text Text)
Text
resourceSet :: Text
readinessCheckArn :: Text
tags :: Maybe (HashMap Text Text)
readinessCheckName :: Maybe Text
$sel:resourceSet:ReadinessCheckOutput' :: ReadinessCheckOutput -> Text
$sel:readinessCheckArn:ReadinessCheckOutput' :: ReadinessCheckOutput -> Text
$sel:tags:ReadinessCheckOutput' :: ReadinessCheckOutput -> Maybe (HashMap Text Text)
$sel:readinessCheckName:ReadinessCheckOutput' :: ReadinessCheckOutput -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
readinessCheckName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
readinessCheckArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceSet

instance Prelude.NFData ReadinessCheckOutput where
  rnf :: ReadinessCheckOutput -> ()
rnf ReadinessCheckOutput' {Maybe Text
Maybe (HashMap Text Text)
Text
resourceSet :: Text
readinessCheckArn :: Text
tags :: Maybe (HashMap Text Text)
readinessCheckName :: Maybe Text
$sel:resourceSet:ReadinessCheckOutput' :: ReadinessCheckOutput -> Text
$sel:readinessCheckArn:ReadinessCheckOutput' :: ReadinessCheckOutput -> Text
$sel:tags:ReadinessCheckOutput' :: ReadinessCheckOutput -> Maybe (HashMap Text Text)
$sel:readinessCheckName:ReadinessCheckOutput' :: ReadinessCheckOutput -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
readinessCheckName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
readinessCheckArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceSet