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

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

-- | Guidance for improving Recovery Group resilliancy
--
-- /See:/ 'newRecommendation' smart constructor.
data Recommendation = Recommendation'
  { -- | Guidance text for recommendation
    Recommendation -> Text
recommendationText :: Prelude.Text
  }
  deriving (Recommendation -> Recommendation -> Bool
(Recommendation -> Recommendation -> Bool)
-> (Recommendation -> Recommendation -> Bool) -> Eq Recommendation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Recommendation -> Recommendation -> Bool
$c/= :: Recommendation -> Recommendation -> Bool
== :: Recommendation -> Recommendation -> Bool
$c== :: Recommendation -> Recommendation -> Bool
Prelude.Eq, ReadPrec [Recommendation]
ReadPrec Recommendation
Int -> ReadS Recommendation
ReadS [Recommendation]
(Int -> ReadS Recommendation)
-> ReadS [Recommendation]
-> ReadPrec Recommendation
-> ReadPrec [Recommendation]
-> Read Recommendation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Recommendation]
$creadListPrec :: ReadPrec [Recommendation]
readPrec :: ReadPrec Recommendation
$creadPrec :: ReadPrec Recommendation
readList :: ReadS [Recommendation]
$creadList :: ReadS [Recommendation]
readsPrec :: Int -> ReadS Recommendation
$creadsPrec :: Int -> ReadS Recommendation
Prelude.Read, Int -> Recommendation -> ShowS
[Recommendation] -> ShowS
Recommendation -> String
(Int -> Recommendation -> ShowS)
-> (Recommendation -> String)
-> ([Recommendation] -> ShowS)
-> Show Recommendation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Recommendation] -> ShowS
$cshowList :: [Recommendation] -> ShowS
show :: Recommendation -> String
$cshow :: Recommendation -> String
showsPrec :: Int -> Recommendation -> ShowS
$cshowsPrec :: Int -> Recommendation -> ShowS
Prelude.Show, (forall x. Recommendation -> Rep Recommendation x)
-> (forall x. Rep Recommendation x -> Recommendation)
-> Generic Recommendation
forall x. Rep Recommendation x -> Recommendation
forall x. Recommendation -> Rep Recommendation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Recommendation x -> Recommendation
$cfrom :: forall x. Recommendation -> Rep Recommendation x
Prelude.Generic)

-- |
-- Create a value of 'Recommendation' 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:
--
-- 'recommendationText', 'recommendation_recommendationText' - Guidance text for recommendation
newRecommendation ::
  -- | 'recommendationText'
  Prelude.Text ->
  Recommendation
newRecommendation :: Text -> Recommendation
newRecommendation Text
pRecommendationText_ =
  Recommendation' :: Text -> Recommendation
Recommendation'
    { $sel:recommendationText:Recommendation' :: Text
recommendationText =
        Text
pRecommendationText_
    }

-- | Guidance text for recommendation
recommendation_recommendationText :: Lens.Lens' Recommendation Prelude.Text
recommendation_recommendationText :: (Text -> f Text) -> Recommendation -> f Recommendation
recommendation_recommendationText = (Recommendation -> Text)
-> (Recommendation -> Text -> Recommendation)
-> Lens Recommendation Recommendation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Recommendation' {Text
recommendationText :: Text
$sel:recommendationText:Recommendation' :: Recommendation -> Text
recommendationText} -> Text
recommendationText) (\s :: Recommendation
s@Recommendation' {} Text
a -> Recommendation
s {$sel:recommendationText:Recommendation' :: Text
recommendationText = Text
a} :: Recommendation)

instance Core.FromJSON Recommendation where
  parseJSON :: Value -> Parser Recommendation
parseJSON =
    String
-> (Object -> Parser Recommendation)
-> Value
-> Parser Recommendation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Recommendation"
      ( \Object
x ->
          Text -> Recommendation
Recommendation'
            (Text -> Recommendation) -> Parser Text -> Parser Recommendation
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
"recommendationText")
      )

instance Prelude.Hashable Recommendation

instance Prelude.NFData Recommendation