{-# 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.PillarDifference
-- 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.WellArchitected.Types.PillarDifference 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
import Amazonka.WellArchitected.Types.DifferenceStatus
import Amazonka.WellArchitected.Types.QuestionDifference

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

-- |
-- Create a value of 'PillarDifference' 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:
--
-- 'differenceStatus', 'pillarDifference_differenceStatus' - Indicates the type of change to the pillar.
--
-- 'pillarId', 'pillarDifference_pillarId' - Undocumented member.
--
-- 'pillarName', 'pillarDifference_pillarName' - Undocumented member.
--
-- 'questionDifferences', 'pillarDifference_questionDifferences' - List of question differences.
newPillarDifference ::
  PillarDifference
newPillarDifference :: PillarDifference
newPillarDifference =
  PillarDifference'
    { $sel:differenceStatus:PillarDifference' :: Maybe DifferenceStatus
differenceStatus =
        forall a. Maybe a
Prelude.Nothing,
      $sel:pillarId:PillarDifference' :: Maybe Text
pillarId = forall a. Maybe a
Prelude.Nothing,
      $sel:pillarName:PillarDifference' :: Maybe Text
pillarName = forall a. Maybe a
Prelude.Nothing,
      $sel:questionDifferences:PillarDifference' :: Maybe [QuestionDifference]
questionDifferences = forall a. Maybe a
Prelude.Nothing
    }

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

-- | Undocumented member.
pillarDifference_pillarId :: Lens.Lens' PillarDifference (Prelude.Maybe Prelude.Text)
pillarDifference_pillarId :: Lens' PillarDifference (Maybe Text)
pillarDifference_pillarId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PillarDifference' {Maybe Text
pillarId :: Maybe Text
$sel:pillarId:PillarDifference' :: PillarDifference -> Maybe Text
pillarId} -> Maybe Text
pillarId) (\s :: PillarDifference
s@PillarDifference' {} Maybe Text
a -> PillarDifference
s {$sel:pillarId:PillarDifference' :: Maybe Text
pillarId = Maybe Text
a} :: PillarDifference)

-- | Undocumented member.
pillarDifference_pillarName :: Lens.Lens' PillarDifference (Prelude.Maybe Prelude.Text)
pillarDifference_pillarName :: Lens' PillarDifference (Maybe Text)
pillarDifference_pillarName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PillarDifference' {Maybe Text
pillarName :: Maybe Text
$sel:pillarName:PillarDifference' :: PillarDifference -> Maybe Text
pillarName} -> Maybe Text
pillarName) (\s :: PillarDifference
s@PillarDifference' {} Maybe Text
a -> PillarDifference
s {$sel:pillarName:PillarDifference' :: Maybe Text
pillarName = Maybe Text
a} :: PillarDifference)

-- | List of question differences.
pillarDifference_questionDifferences :: Lens.Lens' PillarDifference (Prelude.Maybe [QuestionDifference])
pillarDifference_questionDifferences :: Lens' PillarDifference (Maybe [QuestionDifference])
pillarDifference_questionDifferences = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PillarDifference' {Maybe [QuestionDifference]
questionDifferences :: Maybe [QuestionDifference]
$sel:questionDifferences:PillarDifference' :: PillarDifference -> Maybe [QuestionDifference]
questionDifferences} -> Maybe [QuestionDifference]
questionDifferences) (\s :: PillarDifference
s@PillarDifference' {} Maybe [QuestionDifference]
a -> PillarDifference
s {$sel:questionDifferences:PillarDifference' :: Maybe [QuestionDifference]
questionDifferences = Maybe [QuestionDifference]
a} :: PillarDifference) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON PillarDifference where
  parseJSON :: Value -> Parser PillarDifference
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PillarDifference"
      ( \Object
x ->
          Maybe DifferenceStatus
-> Maybe Text
-> Maybe Text
-> Maybe [QuestionDifference]
-> PillarDifference
PillarDifference'
            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
"DifferenceStatus")
            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
"PillarId")
            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
"PillarName")
            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
"QuestionDifferences"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable PillarDifference where
  hashWithSalt :: Int -> PillarDifference -> Int
hashWithSalt Int
_salt PillarDifference' {Maybe [QuestionDifference]
Maybe Text
Maybe DifferenceStatus
questionDifferences :: Maybe [QuestionDifference]
pillarName :: Maybe Text
pillarId :: Maybe Text
differenceStatus :: Maybe DifferenceStatus
$sel:questionDifferences:PillarDifference' :: PillarDifference -> Maybe [QuestionDifference]
$sel:pillarName:PillarDifference' :: PillarDifference -> Maybe Text
$sel:pillarId:PillarDifference' :: PillarDifference -> Maybe Text
$sel:differenceStatus:PillarDifference' :: PillarDifference -> Maybe DifferenceStatus
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DifferenceStatus
differenceStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pillarId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pillarName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [QuestionDifference]
questionDifferences

instance Prelude.NFData PillarDifference where
  rnf :: PillarDifference -> ()
rnf PillarDifference' {Maybe [QuestionDifference]
Maybe Text
Maybe DifferenceStatus
questionDifferences :: Maybe [QuestionDifference]
pillarName :: Maybe Text
pillarId :: Maybe Text
differenceStatus :: Maybe DifferenceStatus
$sel:questionDifferences:PillarDifference' :: PillarDifference -> Maybe [QuestionDifference]
$sel:pillarName:PillarDifference' :: PillarDifference -> Maybe Text
$sel:pillarId:PillarDifference' :: PillarDifference -> Maybe Text
$sel:differenceStatus:PillarDifference' :: PillarDifference -> Maybe DifferenceStatus
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe DifferenceStatus
differenceStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pillarId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pillarName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [QuestionDifference]
questionDifferences