{-# 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.ListRulesOutput
-- 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.ListRulesOutput 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

-- | Readiness rule information, including the resource type, rule ID, and
-- rule description.
--
-- /See:/ 'newListRulesOutput' smart constructor.
data ListRulesOutput = ListRulesOutput'
  { -- | The description of a readiness rule.
    ListRulesOutput -> Text
ruleDescription :: Prelude.Text,
    -- | The ID for the readiness rule.
    ListRulesOutput -> Text
ruleId :: Prelude.Text,
    -- | The resource type that the readiness rule applies to.
    ListRulesOutput -> Text
resourceType :: Prelude.Text
  }
  deriving (ListRulesOutput -> ListRulesOutput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRulesOutput -> ListRulesOutput -> Bool
$c/= :: ListRulesOutput -> ListRulesOutput -> Bool
== :: ListRulesOutput -> ListRulesOutput -> Bool
$c== :: ListRulesOutput -> ListRulesOutput -> Bool
Prelude.Eq, ReadPrec [ListRulesOutput]
ReadPrec ListRulesOutput
Int -> ReadS ListRulesOutput
ReadS [ListRulesOutput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRulesOutput]
$creadListPrec :: ReadPrec [ListRulesOutput]
readPrec :: ReadPrec ListRulesOutput
$creadPrec :: ReadPrec ListRulesOutput
readList :: ReadS [ListRulesOutput]
$creadList :: ReadS [ListRulesOutput]
readsPrec :: Int -> ReadS ListRulesOutput
$creadsPrec :: Int -> ReadS ListRulesOutput
Prelude.Read, Int -> ListRulesOutput -> ShowS
[ListRulesOutput] -> ShowS
ListRulesOutput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRulesOutput] -> ShowS
$cshowList :: [ListRulesOutput] -> ShowS
show :: ListRulesOutput -> String
$cshow :: ListRulesOutput -> String
showsPrec :: Int -> ListRulesOutput -> ShowS
$cshowsPrec :: Int -> ListRulesOutput -> ShowS
Prelude.Show, forall x. Rep ListRulesOutput x -> ListRulesOutput
forall x. ListRulesOutput -> Rep ListRulesOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRulesOutput x -> ListRulesOutput
$cfrom :: forall x. ListRulesOutput -> Rep ListRulesOutput x
Prelude.Generic)

-- |
-- Create a value of 'ListRulesOutput' 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:
--
-- 'ruleDescription', 'listRulesOutput_ruleDescription' - The description of a readiness rule.
--
-- 'ruleId', 'listRulesOutput_ruleId' - The ID for the readiness rule.
--
-- 'resourceType', 'listRulesOutput_resourceType' - The resource type that the readiness rule applies to.
newListRulesOutput ::
  -- | 'ruleDescription'
  Prelude.Text ->
  -- | 'ruleId'
  Prelude.Text ->
  -- | 'resourceType'
  Prelude.Text ->
  ListRulesOutput
newListRulesOutput :: Text -> Text -> Text -> ListRulesOutput
newListRulesOutput
  Text
pRuleDescription_
  Text
pRuleId_
  Text
pResourceType_ =
    ListRulesOutput'
      { $sel:ruleDescription:ListRulesOutput' :: Text
ruleDescription =
          Text
pRuleDescription_,
        $sel:ruleId:ListRulesOutput' :: Text
ruleId = Text
pRuleId_,
        $sel:resourceType:ListRulesOutput' :: Text
resourceType = Text
pResourceType_
      }

-- | The description of a readiness rule.
listRulesOutput_ruleDescription :: Lens.Lens' ListRulesOutput Prelude.Text
listRulesOutput_ruleDescription :: Lens' ListRulesOutput Text
listRulesOutput_ruleDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRulesOutput' {Text
ruleDescription :: Text
$sel:ruleDescription:ListRulesOutput' :: ListRulesOutput -> Text
ruleDescription} -> Text
ruleDescription) (\s :: ListRulesOutput
s@ListRulesOutput' {} Text
a -> ListRulesOutput
s {$sel:ruleDescription:ListRulesOutput' :: Text
ruleDescription = Text
a} :: ListRulesOutput)

-- | The ID for the readiness rule.
listRulesOutput_ruleId :: Lens.Lens' ListRulesOutput Prelude.Text
listRulesOutput_ruleId :: Lens' ListRulesOutput Text
listRulesOutput_ruleId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRulesOutput' {Text
ruleId :: Text
$sel:ruleId:ListRulesOutput' :: ListRulesOutput -> Text
ruleId} -> Text
ruleId) (\s :: ListRulesOutput
s@ListRulesOutput' {} Text
a -> ListRulesOutput
s {$sel:ruleId:ListRulesOutput' :: Text
ruleId = Text
a} :: ListRulesOutput)

-- | The resource type that the readiness rule applies to.
listRulesOutput_resourceType :: Lens.Lens' ListRulesOutput Prelude.Text
listRulesOutput_resourceType :: Lens' ListRulesOutput Text
listRulesOutput_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRulesOutput' {Text
resourceType :: Text
$sel:resourceType:ListRulesOutput' :: ListRulesOutput -> Text
resourceType} -> Text
resourceType) (\s :: ListRulesOutput
s@ListRulesOutput' {} Text
a -> ListRulesOutput
s {$sel:resourceType:ListRulesOutput' :: Text
resourceType = Text
a} :: ListRulesOutput)

instance Data.FromJSON ListRulesOutput where
  parseJSON :: Value -> Parser ListRulesOutput
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ListRulesOutput"
      ( \Object
x ->
          Text -> Text -> Text -> ListRulesOutput
ListRulesOutput'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ruleDescription")
            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
"ruleId")
            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
"resourceType")
      )

instance Prelude.Hashable ListRulesOutput where
  hashWithSalt :: Int -> ListRulesOutput -> Int
hashWithSalt Int
_salt ListRulesOutput' {Text
resourceType :: Text
ruleId :: Text
ruleDescription :: Text
$sel:resourceType:ListRulesOutput' :: ListRulesOutput -> Text
$sel:ruleId:ListRulesOutput' :: ListRulesOutput -> Text
$sel:ruleDescription:ListRulesOutput' :: ListRulesOutput -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceType

instance Prelude.NFData ListRulesOutput where
  rnf :: ListRulesOutput -> ()
rnf ListRulesOutput' {Text
resourceType :: Text
ruleId :: Text
ruleDescription :: Text
$sel:resourceType:ListRulesOutput' :: ListRulesOutput -> Text
$sel:ruleId:ListRulesOutput' :: ListRulesOutput -> Text
$sel:ruleDescription:ListRulesOutput' :: ListRulesOutput -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
ruleDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ruleId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceType