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

-- |
-- Create a value of 'ChoiceAnswer' 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', 'choiceAnswer_choiceId' - Undocumented member.
--
-- 'notes', 'choiceAnswer_notes' - The notes associated with a choice.
--
-- 'reason', 'choiceAnswer_reason' - The reason why a choice is non-applicable to a question in your
-- workload.
--
-- 'status', 'choiceAnswer_status' - The status of a choice.
newChoiceAnswer ::
  ChoiceAnswer
newChoiceAnswer :: ChoiceAnswer
newChoiceAnswer =
  ChoiceAnswer'
    { $sel:choiceId:ChoiceAnswer' :: Maybe Text
choiceId = forall a. Maybe a
Prelude.Nothing,
      $sel:notes:ChoiceAnswer' :: Maybe Text
notes = forall a. Maybe a
Prelude.Nothing,
      $sel:reason:ChoiceAnswer' :: Maybe ChoiceReason
reason = forall a. Maybe a
Prelude.Nothing,
      $sel:status:ChoiceAnswer' :: Maybe ChoiceStatus
status = forall a. Maybe a
Prelude.Nothing
    }

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

-- | The notes associated with a choice.
choiceAnswer_notes :: Lens.Lens' ChoiceAnswer (Prelude.Maybe Prelude.Text)
choiceAnswer_notes :: Lens' ChoiceAnswer (Maybe Text)
choiceAnswer_notes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChoiceAnswer' {Maybe Text
notes :: Maybe Text
$sel:notes:ChoiceAnswer' :: ChoiceAnswer -> Maybe Text
notes} -> Maybe Text
notes) (\s :: ChoiceAnswer
s@ChoiceAnswer' {} Maybe Text
a -> ChoiceAnswer
s {$sel:notes:ChoiceAnswer' :: Maybe Text
notes = Maybe Text
a} :: ChoiceAnswer)

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

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

instance Data.FromJSON ChoiceAnswer where
  parseJSON :: Value -> Parser ChoiceAnswer
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ChoiceAnswer"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe ChoiceReason
-> Maybe ChoiceStatus
-> ChoiceAnswer
ChoiceAnswer'
            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
"Notes")
            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 ChoiceAnswer where
  hashWithSalt :: Int -> ChoiceAnswer -> Int
hashWithSalt Int
_salt ChoiceAnswer' {Maybe Text
Maybe ChoiceReason
Maybe ChoiceStatus
status :: Maybe ChoiceStatus
reason :: Maybe ChoiceReason
notes :: Maybe Text
choiceId :: Maybe Text
$sel:status:ChoiceAnswer' :: ChoiceAnswer -> Maybe ChoiceStatus
$sel:reason:ChoiceAnswer' :: ChoiceAnswer -> Maybe ChoiceReason
$sel:notes:ChoiceAnswer' :: ChoiceAnswer -> Maybe Text
$sel:choiceId:ChoiceAnswer' :: ChoiceAnswer -> 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 Text
notes
      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 ChoiceAnswer where
  rnf :: ChoiceAnswer -> ()
rnf ChoiceAnswer' {Maybe Text
Maybe ChoiceReason
Maybe ChoiceStatus
status :: Maybe ChoiceStatus
reason :: Maybe ChoiceReason
notes :: Maybe Text
choiceId :: Maybe Text
$sel:status:ChoiceAnswer' :: ChoiceAnswer -> Maybe ChoiceStatus
$sel:reason:ChoiceAnswer' :: ChoiceAnswer -> Maybe ChoiceReason
$sel:notes:ChoiceAnswer' :: ChoiceAnswer -> Maybe Text
$sel:choiceId:ChoiceAnswer' :: ChoiceAnswer -> 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 Text
notes
      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