{-# 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.WellArchitected.Types.QuestionDifference
-- 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.WellArchitected.Types.QuestionDifference where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WellArchitected.Types.DifferenceStatus

-- | A question difference return object.
--
-- /See:/ 'newQuestionDifference' smart constructor.
data QuestionDifference = QuestionDifference'
  { QuestionDifference -> Maybe Text
questionTitle :: Prelude.Maybe Prelude.Text,
    -- | Indicates the type of change to the question.
    QuestionDifference -> Maybe DifferenceStatus
differenceStatus :: Prelude.Maybe DifferenceStatus,
    QuestionDifference -> Maybe Text
questionId :: Prelude.Maybe Prelude.Text
  }
  deriving (QuestionDifference -> QuestionDifference -> Bool
(QuestionDifference -> QuestionDifference -> Bool)
-> (QuestionDifference -> QuestionDifference -> Bool)
-> Eq QuestionDifference
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QuestionDifference -> QuestionDifference -> Bool
$c/= :: QuestionDifference -> QuestionDifference -> Bool
== :: QuestionDifference -> QuestionDifference -> Bool
$c== :: QuestionDifference -> QuestionDifference -> Bool
Prelude.Eq, ReadPrec [QuestionDifference]
ReadPrec QuestionDifference
Int -> ReadS QuestionDifference
ReadS [QuestionDifference]
(Int -> ReadS QuestionDifference)
-> ReadS [QuestionDifference]
-> ReadPrec QuestionDifference
-> ReadPrec [QuestionDifference]
-> Read QuestionDifference
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [QuestionDifference]
$creadListPrec :: ReadPrec [QuestionDifference]
readPrec :: ReadPrec QuestionDifference
$creadPrec :: ReadPrec QuestionDifference
readList :: ReadS [QuestionDifference]
$creadList :: ReadS [QuestionDifference]
readsPrec :: Int -> ReadS QuestionDifference
$creadsPrec :: Int -> ReadS QuestionDifference
Prelude.Read, Int -> QuestionDifference -> ShowS
[QuestionDifference] -> ShowS
QuestionDifference -> String
(Int -> QuestionDifference -> ShowS)
-> (QuestionDifference -> String)
-> ([QuestionDifference] -> ShowS)
-> Show QuestionDifference
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QuestionDifference] -> ShowS
$cshowList :: [QuestionDifference] -> ShowS
show :: QuestionDifference -> String
$cshow :: QuestionDifference -> String
showsPrec :: Int -> QuestionDifference -> ShowS
$cshowsPrec :: Int -> QuestionDifference -> ShowS
Prelude.Show, (forall x. QuestionDifference -> Rep QuestionDifference x)
-> (forall x. Rep QuestionDifference x -> QuestionDifference)
-> Generic QuestionDifference
forall x. Rep QuestionDifference x -> QuestionDifference
forall x. QuestionDifference -> Rep QuestionDifference x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep QuestionDifference x -> QuestionDifference
$cfrom :: forall x. QuestionDifference -> Rep QuestionDifference x
Prelude.Generic)

-- |
-- Create a value of 'QuestionDifference' 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:
--
-- 'questionTitle', 'questionDifference_questionTitle' - Undocumented member.
--
-- 'differenceStatus', 'questionDifference_differenceStatus' - Indicates the type of change to the question.
--
-- 'questionId', 'questionDifference_questionId' - Undocumented member.
newQuestionDifference ::
  QuestionDifference
newQuestionDifference :: QuestionDifference
newQuestionDifference =
  QuestionDifference' :: Maybe Text
-> Maybe DifferenceStatus -> Maybe Text -> QuestionDifference
QuestionDifference'
    { $sel:questionTitle:QuestionDifference' :: Maybe Text
questionTitle =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:differenceStatus:QuestionDifference' :: Maybe DifferenceStatus
differenceStatus = Maybe DifferenceStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:questionId:QuestionDifference' :: Maybe Text
questionId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
questionDifference_questionTitle :: Lens.Lens' QuestionDifference (Prelude.Maybe Prelude.Text)
questionDifference_questionTitle :: (Maybe Text -> f (Maybe Text))
-> QuestionDifference -> f QuestionDifference
questionDifference_questionTitle = (QuestionDifference -> Maybe Text)
-> (QuestionDifference -> Maybe Text -> QuestionDifference)
-> Lens
     QuestionDifference QuestionDifference (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuestionDifference' {Maybe Text
questionTitle :: Maybe Text
$sel:questionTitle:QuestionDifference' :: QuestionDifference -> Maybe Text
questionTitle} -> Maybe Text
questionTitle) (\s :: QuestionDifference
s@QuestionDifference' {} Maybe Text
a -> QuestionDifference
s {$sel:questionTitle:QuestionDifference' :: Maybe Text
questionTitle = Maybe Text
a} :: QuestionDifference)

-- | Indicates the type of change to the question.
questionDifference_differenceStatus :: Lens.Lens' QuestionDifference (Prelude.Maybe DifferenceStatus)
questionDifference_differenceStatus :: (Maybe DifferenceStatus -> f (Maybe DifferenceStatus))
-> QuestionDifference -> f QuestionDifference
questionDifference_differenceStatus = (QuestionDifference -> Maybe DifferenceStatus)
-> (QuestionDifference
    -> Maybe DifferenceStatus -> QuestionDifference)
-> Lens
     QuestionDifference
     QuestionDifference
     (Maybe DifferenceStatus)
     (Maybe DifferenceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuestionDifference' {Maybe DifferenceStatus
differenceStatus :: Maybe DifferenceStatus
$sel:differenceStatus:QuestionDifference' :: QuestionDifference -> Maybe DifferenceStatus
differenceStatus} -> Maybe DifferenceStatus
differenceStatus) (\s :: QuestionDifference
s@QuestionDifference' {} Maybe DifferenceStatus
a -> QuestionDifference
s {$sel:differenceStatus:QuestionDifference' :: Maybe DifferenceStatus
differenceStatus = Maybe DifferenceStatus
a} :: QuestionDifference)

-- | Undocumented member.
questionDifference_questionId :: Lens.Lens' QuestionDifference (Prelude.Maybe Prelude.Text)
questionDifference_questionId :: (Maybe Text -> f (Maybe Text))
-> QuestionDifference -> f QuestionDifference
questionDifference_questionId = (QuestionDifference -> Maybe Text)
-> (QuestionDifference -> Maybe Text -> QuestionDifference)
-> Lens
     QuestionDifference QuestionDifference (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuestionDifference' {Maybe Text
questionId :: Maybe Text
$sel:questionId:QuestionDifference' :: QuestionDifference -> Maybe Text
questionId} -> Maybe Text
questionId) (\s :: QuestionDifference
s@QuestionDifference' {} Maybe Text
a -> QuestionDifference
s {$sel:questionId:QuestionDifference' :: Maybe Text
questionId = Maybe Text
a} :: QuestionDifference)

instance Core.FromJSON QuestionDifference where
  parseJSON :: Value -> Parser QuestionDifference
parseJSON =
    String
-> (Object -> Parser QuestionDifference)
-> Value
-> Parser QuestionDifference
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"QuestionDifference"
      ( \Object
x ->
          Maybe Text
-> Maybe DifferenceStatus -> Maybe Text -> QuestionDifference
QuestionDifference'
            (Maybe Text
 -> Maybe DifferenceStatus -> Maybe Text -> QuestionDifference)
-> Parser (Maybe Text)
-> Parser
     (Maybe DifferenceStatus -> Maybe Text -> QuestionDifference)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QuestionTitle")
            Parser (Maybe DifferenceStatus -> Maybe Text -> QuestionDifference)
-> Parser (Maybe DifferenceStatus)
-> Parser (Maybe Text -> QuestionDifference)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DifferenceStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DifferenceStatus")
            Parser (Maybe Text -> QuestionDifference)
-> Parser (Maybe Text) -> Parser QuestionDifference
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QuestionId")
      )

instance Prelude.Hashable QuestionDifference

instance Prelude.NFData QuestionDifference