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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A collection of rules used in a readiness check
--
-- /See:/ 'newListRulesOutput' smart constructor.
data ListRulesOutput = ListRulesOutput'
  { -- | A description of the rule
    ListRulesOutput -> Text
ruleDescription :: Prelude.Text,
    -- | The Rule\'s ID.
    ListRulesOutput -> Text
ruleId :: Prelude.Text,
    -- | The resource type the rule applies to.
    ListRulesOutput -> Text
resourceType :: Prelude.Text
  }
  deriving (ListRulesOutput -> ListRulesOutput -> Bool
(ListRulesOutput -> ListRulesOutput -> Bool)
-> (ListRulesOutput -> ListRulesOutput -> Bool)
-> Eq ListRulesOutput
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]
(Int -> ReadS ListRulesOutput)
-> ReadS [ListRulesOutput]
-> ReadPrec ListRulesOutput
-> ReadPrec [ListRulesOutput]
-> Read 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
(Int -> ListRulesOutput -> ShowS)
-> (ListRulesOutput -> String)
-> ([ListRulesOutput] -> ShowS)
-> Show ListRulesOutput
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. ListRulesOutput -> Rep ListRulesOutput x)
-> (forall x. Rep ListRulesOutput x -> ListRulesOutput)
-> Generic ListRulesOutput
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' - A description of the rule
--
-- 'ruleId', 'listRulesOutput_ruleId' - The Rule\'s ID.
--
-- 'resourceType', 'listRulesOutput_resourceType' - The resource type the 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' :: Text -> Text -> Text -> ListRulesOutput
ListRulesOutput'
      { $sel:ruleDescription:ListRulesOutput' :: Text
ruleDescription =
          Text
pRuleDescription_,
        $sel:ruleId:ListRulesOutput' :: Text
ruleId = Text
pRuleId_,
        $sel:resourceType:ListRulesOutput' :: Text
resourceType = Text
pResourceType_
      }

-- | A description of the rule
listRulesOutput_ruleDescription :: Lens.Lens' ListRulesOutput Prelude.Text
listRulesOutput_ruleDescription :: (Text -> f Text) -> ListRulesOutput -> f ListRulesOutput
listRulesOutput_ruleDescription = (ListRulesOutput -> Text)
-> (ListRulesOutput -> Text -> ListRulesOutput)
-> Lens ListRulesOutput ListRulesOutput Text Text
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 Rule\'s ID.
listRulesOutput_ruleId :: Lens.Lens' ListRulesOutput Prelude.Text
listRulesOutput_ruleId :: (Text -> f Text) -> ListRulesOutput -> f ListRulesOutput
listRulesOutput_ruleId = (ListRulesOutput -> Text)
-> (ListRulesOutput -> Text -> ListRulesOutput)
-> Lens ListRulesOutput ListRulesOutput Text Text
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 the rule applies to.
listRulesOutput_resourceType :: Lens.Lens' ListRulesOutput Prelude.Text
listRulesOutput_resourceType :: (Text -> f Text) -> ListRulesOutput -> f ListRulesOutput
listRulesOutput_resourceType = (ListRulesOutput -> Text)
-> (ListRulesOutput -> Text -> ListRulesOutput)
-> Lens ListRulesOutput ListRulesOutput Text Text
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 Core.FromJSON ListRulesOutput where
  parseJSON :: Value -> Parser ListRulesOutput
parseJSON =
    String
-> (Object -> Parser ListRulesOutput)
-> Value
-> Parser ListRulesOutput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ListRulesOutput"
      ( \Object
x ->
          Text -> Text -> Text -> ListRulesOutput
ListRulesOutput'
            (Text -> Text -> Text -> ListRulesOutput)
-> Parser Text -> Parser (Text -> Text -> ListRulesOutput)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ruleDescription")
            Parser (Text -> Text -> ListRulesOutput)
-> Parser Text -> Parser (Text -> ListRulesOutput)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ruleId")
            Parser (Text -> ListRulesOutput)
-> Parser Text -> Parser ListRulesOutput
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"resourceType")
      )

instance Prelude.Hashable ListRulesOutput

instance Prelude.NFData ListRulesOutput