{-# 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.ChoiceAnswerSummary
-- 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.ChoiceAnswerSummary 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.ChoiceReason
import Amazonka.WellArchitected.Types.ChoiceStatus

-- | A choice summary that has been answered on a question in your workload.
--
-- /See:/ 'newChoiceAnswerSummary' smart constructor.
data ChoiceAnswerSummary = ChoiceAnswerSummary'
  { ChoiceAnswerSummary -> Maybe Text
choiceId :: Prelude.Maybe Prelude.Text,
    -- | The reason why a choice is non-applicable to a question in your
    -- workload.
    ChoiceAnswerSummary -> Maybe ChoiceReason
reason :: Prelude.Maybe ChoiceReason,
    -- | The status of a choice.
    ChoiceAnswerSummary -> Maybe ChoiceStatus
status :: Prelude.Maybe ChoiceStatus
  }
  deriving (ChoiceAnswerSummary -> ChoiceAnswerSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChoiceAnswerSummary -> ChoiceAnswerSummary -> Bool
$c/= :: ChoiceAnswerSummary -> ChoiceAnswerSummary -> Bool
== :: ChoiceAnswerSummary -> ChoiceAnswerSummary -> Bool
$c== :: ChoiceAnswerSummary -> ChoiceAnswerSummary -> Bool
Prelude.Eq, ReadPrec [ChoiceAnswerSummary]
ReadPrec ChoiceAnswerSummary
Int -> ReadS ChoiceAnswerSummary
ReadS [ChoiceAnswerSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChoiceAnswerSummary]
$creadListPrec :: ReadPrec [ChoiceAnswerSummary]
readPrec :: ReadPrec ChoiceAnswerSummary
$creadPrec :: ReadPrec ChoiceAnswerSummary
readList :: ReadS [ChoiceAnswerSummary]
$creadList :: ReadS [ChoiceAnswerSummary]
readsPrec :: Int -> ReadS ChoiceAnswerSummary
$creadsPrec :: Int -> ReadS ChoiceAnswerSummary
Prelude.Read, Int -> ChoiceAnswerSummary -> ShowS
[ChoiceAnswerSummary] -> ShowS
ChoiceAnswerSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChoiceAnswerSummary] -> ShowS
$cshowList :: [ChoiceAnswerSummary] -> ShowS
show :: ChoiceAnswerSummary -> String
$cshow :: ChoiceAnswerSummary -> String
showsPrec :: Int -> ChoiceAnswerSummary -> ShowS
$cshowsPrec :: Int -> ChoiceAnswerSummary -> ShowS
Prelude.Show, forall x. Rep ChoiceAnswerSummary x -> ChoiceAnswerSummary
forall x. ChoiceAnswerSummary -> Rep ChoiceAnswerSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChoiceAnswerSummary x -> ChoiceAnswerSummary
$cfrom :: forall x. ChoiceAnswerSummary -> Rep ChoiceAnswerSummary x
Prelude.Generic)

-- |
-- Create a value of 'ChoiceAnswerSummary' 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:
--
-- 'choiceId', 'choiceAnswerSummary_choiceId' - Undocumented member.
--
-- 'reason', 'choiceAnswerSummary_reason' - The reason why a choice is non-applicable to a question in your
-- workload.
--
-- 'status', 'choiceAnswerSummary_status' - The status of a choice.
newChoiceAnswerSummary ::
  ChoiceAnswerSummary
newChoiceAnswerSummary :: ChoiceAnswerSummary
newChoiceAnswerSummary =
  ChoiceAnswerSummary'
    { $sel:choiceId:ChoiceAnswerSummary' :: Maybe Text
choiceId = forall a. Maybe a
Prelude.Nothing,
      $sel:reason:ChoiceAnswerSummary' :: Maybe ChoiceReason
reason = forall a. Maybe a
Prelude.Nothing,
      $sel:status:ChoiceAnswerSummary' :: Maybe ChoiceStatus
status = forall a. Maybe a
Prelude.Nothing
    }

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

-- | The reason why a choice is non-applicable to a question in your
-- workload.
choiceAnswerSummary_reason :: Lens.Lens' ChoiceAnswerSummary (Prelude.Maybe ChoiceReason)
choiceAnswerSummary_reason :: Lens' ChoiceAnswerSummary (Maybe ChoiceReason)
choiceAnswerSummary_reason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChoiceAnswerSummary' {Maybe ChoiceReason
reason :: Maybe ChoiceReason
$sel:reason:ChoiceAnswerSummary' :: ChoiceAnswerSummary -> Maybe ChoiceReason
reason} -> Maybe ChoiceReason
reason) (\s :: ChoiceAnswerSummary
s@ChoiceAnswerSummary' {} Maybe ChoiceReason
a -> ChoiceAnswerSummary
s {$sel:reason:ChoiceAnswerSummary' :: Maybe ChoiceReason
reason = Maybe ChoiceReason
a} :: ChoiceAnswerSummary)

-- | The status of a choice.
choiceAnswerSummary_status :: Lens.Lens' ChoiceAnswerSummary (Prelude.Maybe ChoiceStatus)
choiceAnswerSummary_status :: Lens' ChoiceAnswerSummary (Maybe ChoiceStatus)
choiceAnswerSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChoiceAnswerSummary' {Maybe ChoiceStatus
status :: Maybe ChoiceStatus
$sel:status:ChoiceAnswerSummary' :: ChoiceAnswerSummary -> Maybe ChoiceStatus
status} -> Maybe ChoiceStatus
status) (\s :: ChoiceAnswerSummary
s@ChoiceAnswerSummary' {} Maybe ChoiceStatus
a -> ChoiceAnswerSummary
s {$sel:status:ChoiceAnswerSummary' :: Maybe ChoiceStatus
status = Maybe ChoiceStatus
a} :: ChoiceAnswerSummary)

instance Data.FromJSON ChoiceAnswerSummary where
  parseJSON :: Value -> Parser ChoiceAnswerSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ChoiceAnswerSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe ChoiceReason -> Maybe ChoiceStatus -> ChoiceAnswerSummary
ChoiceAnswerSummary'
            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
"ChoiceId")
            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
"Reason")
            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
"Status")
      )

instance Prelude.Hashable ChoiceAnswerSummary where
  hashWithSalt :: Int -> ChoiceAnswerSummary -> Int
hashWithSalt Int
_salt ChoiceAnswerSummary' {Maybe Text
Maybe ChoiceReason
Maybe ChoiceStatus
status :: Maybe ChoiceStatus
reason :: Maybe ChoiceReason
choiceId :: Maybe Text
$sel:status:ChoiceAnswerSummary' :: ChoiceAnswerSummary -> Maybe ChoiceStatus
$sel:reason:ChoiceAnswerSummary' :: ChoiceAnswerSummary -> Maybe ChoiceReason
$sel:choiceId:ChoiceAnswerSummary' :: ChoiceAnswerSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
choiceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ChoiceReason
reason
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ChoiceStatus
status

instance Prelude.NFData ChoiceAnswerSummary where
  rnf :: ChoiceAnswerSummary -> ()
rnf ChoiceAnswerSummary' {Maybe Text
Maybe ChoiceReason
Maybe ChoiceStatus
status :: Maybe ChoiceStatus
reason :: Maybe ChoiceReason
choiceId :: Maybe Text
$sel:status:ChoiceAnswerSummary' :: ChoiceAnswerSummary -> Maybe ChoiceStatus
$sel:reason:ChoiceAnswerSummary' :: ChoiceAnswerSummary -> Maybe ChoiceReason
$sel:choiceId:ChoiceAnswerSummary' :: ChoiceAnswerSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
choiceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ChoiceReason
reason
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ChoiceStatus
status