{-# 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.Wisdom.Types.NotifyRecommendationsReceivedError
-- 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.Wisdom.Types.NotifyRecommendationsReceivedError 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

-- | An error occurred when creating a recommendation.
--
-- /See:/ 'newNotifyRecommendationsReceivedError' smart constructor.
data NotifyRecommendationsReceivedError = NotifyRecommendationsReceivedError'
  { -- | A recommendation is causing an error.
    NotifyRecommendationsReceivedError -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the recommendation that is in error.
    NotifyRecommendationsReceivedError -> Maybe Text
recommendationId :: Prelude.Maybe Prelude.Text
  }
  deriving (NotifyRecommendationsReceivedError
-> NotifyRecommendationsReceivedError -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NotifyRecommendationsReceivedError
-> NotifyRecommendationsReceivedError -> Bool
$c/= :: NotifyRecommendationsReceivedError
-> NotifyRecommendationsReceivedError -> Bool
== :: NotifyRecommendationsReceivedError
-> NotifyRecommendationsReceivedError -> Bool
$c== :: NotifyRecommendationsReceivedError
-> NotifyRecommendationsReceivedError -> Bool
Prelude.Eq, ReadPrec [NotifyRecommendationsReceivedError]
ReadPrec NotifyRecommendationsReceivedError
Int -> ReadS NotifyRecommendationsReceivedError
ReadS [NotifyRecommendationsReceivedError]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NotifyRecommendationsReceivedError]
$creadListPrec :: ReadPrec [NotifyRecommendationsReceivedError]
readPrec :: ReadPrec NotifyRecommendationsReceivedError
$creadPrec :: ReadPrec NotifyRecommendationsReceivedError
readList :: ReadS [NotifyRecommendationsReceivedError]
$creadList :: ReadS [NotifyRecommendationsReceivedError]
readsPrec :: Int -> ReadS NotifyRecommendationsReceivedError
$creadsPrec :: Int -> ReadS NotifyRecommendationsReceivedError
Prelude.Read, Int -> NotifyRecommendationsReceivedError -> ShowS
[NotifyRecommendationsReceivedError] -> ShowS
NotifyRecommendationsReceivedError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NotifyRecommendationsReceivedError] -> ShowS
$cshowList :: [NotifyRecommendationsReceivedError] -> ShowS
show :: NotifyRecommendationsReceivedError -> String
$cshow :: NotifyRecommendationsReceivedError -> String
showsPrec :: Int -> NotifyRecommendationsReceivedError -> ShowS
$cshowsPrec :: Int -> NotifyRecommendationsReceivedError -> ShowS
Prelude.Show, forall x.
Rep NotifyRecommendationsReceivedError x
-> NotifyRecommendationsReceivedError
forall x.
NotifyRecommendationsReceivedError
-> Rep NotifyRecommendationsReceivedError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NotifyRecommendationsReceivedError x
-> NotifyRecommendationsReceivedError
$cfrom :: forall x.
NotifyRecommendationsReceivedError
-> Rep NotifyRecommendationsReceivedError x
Prelude.Generic)

-- |
-- Create a value of 'NotifyRecommendationsReceivedError' 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:
--
-- 'message', 'notifyRecommendationsReceivedError_message' - A recommendation is causing an error.
--
-- 'recommendationId', 'notifyRecommendationsReceivedError_recommendationId' - The identifier of the recommendation that is in error.
newNotifyRecommendationsReceivedError ::
  NotifyRecommendationsReceivedError
newNotifyRecommendationsReceivedError :: NotifyRecommendationsReceivedError
newNotifyRecommendationsReceivedError =
  NotifyRecommendationsReceivedError'
    { $sel:message:NotifyRecommendationsReceivedError' :: Maybe Text
message =
        forall a. Maybe a
Prelude.Nothing,
      $sel:recommendationId:NotifyRecommendationsReceivedError' :: Maybe Text
recommendationId = forall a. Maybe a
Prelude.Nothing
    }

-- | A recommendation is causing an error.
notifyRecommendationsReceivedError_message :: Lens.Lens' NotifyRecommendationsReceivedError (Prelude.Maybe Prelude.Text)
notifyRecommendationsReceivedError_message :: Lens' NotifyRecommendationsReceivedError (Maybe Text)
notifyRecommendationsReceivedError_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotifyRecommendationsReceivedError' {Maybe Text
message :: Maybe Text
$sel:message:NotifyRecommendationsReceivedError' :: NotifyRecommendationsReceivedError -> Maybe Text
message} -> Maybe Text
message) (\s :: NotifyRecommendationsReceivedError
s@NotifyRecommendationsReceivedError' {} Maybe Text
a -> NotifyRecommendationsReceivedError
s {$sel:message:NotifyRecommendationsReceivedError' :: Maybe Text
message = Maybe Text
a} :: NotifyRecommendationsReceivedError)

-- | The identifier of the recommendation that is in error.
notifyRecommendationsReceivedError_recommendationId :: Lens.Lens' NotifyRecommendationsReceivedError (Prelude.Maybe Prelude.Text)
notifyRecommendationsReceivedError_recommendationId :: Lens' NotifyRecommendationsReceivedError (Maybe Text)
notifyRecommendationsReceivedError_recommendationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotifyRecommendationsReceivedError' {Maybe Text
recommendationId :: Maybe Text
$sel:recommendationId:NotifyRecommendationsReceivedError' :: NotifyRecommendationsReceivedError -> Maybe Text
recommendationId} -> Maybe Text
recommendationId) (\s :: NotifyRecommendationsReceivedError
s@NotifyRecommendationsReceivedError' {} Maybe Text
a -> NotifyRecommendationsReceivedError
s {$sel:recommendationId:NotifyRecommendationsReceivedError' :: Maybe Text
recommendationId = Maybe Text
a} :: NotifyRecommendationsReceivedError)

instance
  Data.FromJSON
    NotifyRecommendationsReceivedError
  where
  parseJSON :: Value -> Parser NotifyRecommendationsReceivedError
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"NotifyRecommendationsReceivedError"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> NotifyRecommendationsReceivedError
NotifyRecommendationsReceivedError'
            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
"message")
            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
"recommendationId")
      )

instance
  Prelude.Hashable
    NotifyRecommendationsReceivedError
  where
  hashWithSalt :: Int -> NotifyRecommendationsReceivedError -> Int
hashWithSalt
    Int
_salt
    NotifyRecommendationsReceivedError' {Maybe Text
recommendationId :: Maybe Text
message :: Maybe Text
$sel:recommendationId:NotifyRecommendationsReceivedError' :: NotifyRecommendationsReceivedError -> Maybe Text
$sel:message:NotifyRecommendationsReceivedError' :: NotifyRecommendationsReceivedError -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
recommendationId

instance
  Prelude.NFData
    NotifyRecommendationsReceivedError
  where
  rnf :: NotifyRecommendationsReceivedError -> ()
rnf NotifyRecommendationsReceivedError' {Maybe Text
recommendationId :: Maybe Text
message :: Maybe Text
$sel:recommendationId:NotifyRecommendationsReceivedError' :: NotifyRecommendationsReceivedError -> Maybe Text
$sel:message:NotifyRecommendationsReceivedError' :: NotifyRecommendationsReceivedError -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
recommendationId