{-# 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-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.ChoiceAnswerSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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'
  { -- | The status of a choice.
    ChoiceAnswerSummary -> Maybe ChoiceStatus
status :: Prelude.Maybe ChoiceStatus,
    -- | The reason why a choice is non-applicable to a question in your
    -- workload.
    ChoiceAnswerSummary -> Maybe ChoiceReason
reason :: Prelude.Maybe ChoiceReason,
    ChoiceAnswerSummary -> Maybe Text
choiceId :: Prelude.Maybe Prelude.Text
  }
  deriving (ChoiceAnswerSummary -> ChoiceAnswerSummary -> Bool
(ChoiceAnswerSummary -> ChoiceAnswerSummary -> Bool)
-> (ChoiceAnswerSummary -> ChoiceAnswerSummary -> Bool)
-> Eq ChoiceAnswerSummary
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]
(Int -> ReadS ChoiceAnswerSummary)
-> ReadS [ChoiceAnswerSummary]
-> ReadPrec ChoiceAnswerSummary
-> ReadPrec [ChoiceAnswerSummary]
-> Read 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
(Int -> ChoiceAnswerSummary -> ShowS)
-> (ChoiceAnswerSummary -> String)
-> ([ChoiceAnswerSummary] -> ShowS)
-> Show ChoiceAnswerSummary
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. ChoiceAnswerSummary -> Rep ChoiceAnswerSummary x)
-> (forall x. Rep ChoiceAnswerSummary x -> ChoiceAnswerSummary)
-> Generic ChoiceAnswerSummary
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:
--
-- 'status', 'choiceAnswerSummary_status' - The status of a choice.
--
-- 'reason', 'choiceAnswerSummary_reason' - The reason why a choice is non-applicable to a question in your
-- workload.
--
-- 'choiceId', 'choiceAnswerSummary_choiceId' - Undocumented member.
newChoiceAnswerSummary ::
  ChoiceAnswerSummary
newChoiceAnswerSummary :: ChoiceAnswerSummary
newChoiceAnswerSummary =
  ChoiceAnswerSummary' :: Maybe ChoiceStatus
-> Maybe ChoiceReason -> Maybe Text -> ChoiceAnswerSummary
ChoiceAnswerSummary'
    { $sel:status:ChoiceAnswerSummary' :: Maybe ChoiceStatus
status = Maybe ChoiceStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:reason:ChoiceAnswerSummary' :: Maybe ChoiceReason
reason = Maybe ChoiceReason
forall a. Maybe a
Prelude.Nothing,
      $sel:choiceId:ChoiceAnswerSummary' :: Maybe Text
choiceId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of a choice.
choiceAnswerSummary_status :: Lens.Lens' ChoiceAnswerSummary (Prelude.Maybe ChoiceStatus)
choiceAnswerSummary_status :: (Maybe ChoiceStatus -> f (Maybe ChoiceStatus))
-> ChoiceAnswerSummary -> f ChoiceAnswerSummary
choiceAnswerSummary_status = (ChoiceAnswerSummary -> Maybe ChoiceStatus)
-> (ChoiceAnswerSummary
    -> Maybe ChoiceStatus -> ChoiceAnswerSummary)
-> Lens
     ChoiceAnswerSummary
     ChoiceAnswerSummary
     (Maybe ChoiceStatus)
     (Maybe ChoiceStatus)
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)

-- | The reason why a choice is non-applicable to a question in your
-- workload.
choiceAnswerSummary_reason :: Lens.Lens' ChoiceAnswerSummary (Prelude.Maybe ChoiceReason)
choiceAnswerSummary_reason :: (Maybe ChoiceReason -> f (Maybe ChoiceReason))
-> ChoiceAnswerSummary -> f ChoiceAnswerSummary
choiceAnswerSummary_reason = (ChoiceAnswerSummary -> Maybe ChoiceReason)
-> (ChoiceAnswerSummary
    -> Maybe ChoiceReason -> ChoiceAnswerSummary)
-> Lens
     ChoiceAnswerSummary
     ChoiceAnswerSummary
     (Maybe ChoiceReason)
     (Maybe ChoiceReason)
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)

-- | Undocumented member.
choiceAnswerSummary_choiceId :: Lens.Lens' ChoiceAnswerSummary (Prelude.Maybe Prelude.Text)
choiceAnswerSummary_choiceId :: (Maybe Text -> f (Maybe Text))
-> ChoiceAnswerSummary -> f ChoiceAnswerSummary
choiceAnswerSummary_choiceId = (ChoiceAnswerSummary -> Maybe Text)
-> (ChoiceAnswerSummary -> Maybe Text -> ChoiceAnswerSummary)
-> Lens
     ChoiceAnswerSummary ChoiceAnswerSummary (Maybe Text) (Maybe Text)
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)

instance Core.FromJSON ChoiceAnswerSummary where
  parseJSON :: Value -> Parser ChoiceAnswerSummary
parseJSON =
    String
-> (Object -> Parser ChoiceAnswerSummary)
-> Value
-> Parser ChoiceAnswerSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ChoiceAnswerSummary"
      ( \Object
x ->
          Maybe ChoiceStatus
-> Maybe ChoiceReason -> Maybe Text -> ChoiceAnswerSummary
ChoiceAnswerSummary'
            (Maybe ChoiceStatus
 -> Maybe ChoiceReason -> Maybe Text -> ChoiceAnswerSummary)
-> Parser (Maybe ChoiceStatus)
-> Parser (Maybe ChoiceReason -> Maybe Text -> ChoiceAnswerSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ChoiceStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser (Maybe ChoiceReason -> Maybe Text -> ChoiceAnswerSummary)
-> Parser (Maybe ChoiceReason)
-> Parser (Maybe Text -> ChoiceAnswerSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ChoiceReason)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Reason")
            Parser (Maybe Text -> ChoiceAnswerSummary)
-> Parser (Maybe Text) -> Parser ChoiceAnswerSummary
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
"ChoiceId")
      )

instance Prelude.Hashable ChoiceAnswerSummary

instance Prelude.NFData ChoiceAnswerSummary