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

-- | Recommendations that are provided to make an application more recovery
-- resilient.
--
-- /See:/ 'newRecommendation' smart constructor.
data Recommendation = Recommendation'
  { -- | Text of the recommendations that are provided to make an application
    -- more recovery resilient.
    Recommendation -> Text
recommendationText :: Prelude.Text
  }
  deriving (Recommendation -> Recommendation -> Bool
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]
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
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. 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' - Text of the recommendations that are provided to make an application
-- more recovery resilient.
newRecommendation ::
  -- | 'recommendationText'
  Prelude.Text ->
  Recommendation
newRecommendation :: Text -> Recommendation
newRecommendation Text
pRecommendationText_ =
  Recommendation'
    { $sel:recommendationText:Recommendation' :: Text
recommendationText =
        Text
pRecommendationText_
    }

-- | Text of the recommendations that are provided to make an application
-- more recovery resilient.
recommendation_recommendationText :: Lens.Lens' Recommendation Prelude.Text
recommendation_recommendationText :: Lens' Recommendation Text
recommendation_recommendationText = 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 Data.FromJSON Recommendation where
  parseJSON :: Value -> Parser Recommendation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Recommendation"
      ( \Object
x ->
          Text -> Recommendation
Recommendation'
            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
"recommendationText")
      )

instance Prelude.Hashable Recommendation where
  hashWithSalt :: Int -> Recommendation -> Int
hashWithSalt Int
_salt Recommendation' {Text
recommendationText :: Text
$sel:recommendationText:Recommendation' :: Recommendation -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
recommendationText

instance Prelude.NFData Recommendation where
  rnf :: Recommendation -> ()
rnf Recommendation' {Text
recommendationText :: Text
$sel:recommendationText:Recommendation' :: Recommendation -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
recommendationText