{-# 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 #-}
module Amazonka.WellArchitected.Types.ChoiceAnswer 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
data ChoiceAnswer = ChoiceAnswer'
{
ChoiceAnswer -> Maybe ChoiceStatus
status :: Prelude.Maybe ChoiceStatus,
ChoiceAnswer -> Maybe ChoiceReason
reason :: Prelude.Maybe ChoiceReason,
ChoiceAnswer -> Maybe Text
notes :: Prelude.Maybe Prelude.Text,
ChoiceAnswer -> Maybe Text
choiceId :: Prelude.Maybe Prelude.Text
}
deriving (ChoiceAnswer -> ChoiceAnswer -> Bool
(ChoiceAnswer -> ChoiceAnswer -> Bool)
-> (ChoiceAnswer -> ChoiceAnswer -> Bool) -> Eq ChoiceAnswer
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]
(Int -> ReadS ChoiceAnswer)
-> ReadS [ChoiceAnswer]
-> ReadPrec ChoiceAnswer
-> ReadPrec [ChoiceAnswer]
-> Read 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
(Int -> ChoiceAnswer -> ShowS)
-> (ChoiceAnswer -> String)
-> ([ChoiceAnswer] -> ShowS)
-> Show ChoiceAnswer
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. ChoiceAnswer -> Rep ChoiceAnswer x)
-> (forall x. Rep ChoiceAnswer x -> ChoiceAnswer)
-> Generic ChoiceAnswer
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)
newChoiceAnswer ::
ChoiceAnswer
newChoiceAnswer :: ChoiceAnswer
newChoiceAnswer =
ChoiceAnswer' :: Maybe ChoiceStatus
-> Maybe ChoiceReason -> Maybe Text -> Maybe Text -> ChoiceAnswer
ChoiceAnswer'
{ $sel:status:ChoiceAnswer' :: Maybe ChoiceStatus
status = Maybe ChoiceStatus
forall a. Maybe a
Prelude.Nothing,
$sel:reason:ChoiceAnswer' :: Maybe ChoiceReason
reason = Maybe ChoiceReason
forall a. Maybe a
Prelude.Nothing,
$sel:notes:ChoiceAnswer' :: Maybe Text
notes = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:choiceId:ChoiceAnswer' :: Maybe Text
choiceId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
choiceAnswer_status :: Lens.Lens' ChoiceAnswer (Prelude.Maybe ChoiceStatus)
choiceAnswer_status :: (Maybe ChoiceStatus -> f (Maybe ChoiceStatus))
-> ChoiceAnswer -> f ChoiceAnswer
choiceAnswer_status = (ChoiceAnswer -> Maybe ChoiceStatus)
-> (ChoiceAnswer -> Maybe ChoiceStatus -> ChoiceAnswer)
-> Lens
ChoiceAnswer ChoiceAnswer (Maybe ChoiceStatus) (Maybe ChoiceStatus)
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)
choiceAnswer_reason :: Lens.Lens' ChoiceAnswer (Prelude.Maybe ChoiceReason)
choiceAnswer_reason :: (Maybe ChoiceReason -> f (Maybe ChoiceReason))
-> ChoiceAnswer -> f ChoiceAnswer
choiceAnswer_reason = (ChoiceAnswer -> Maybe ChoiceReason)
-> (ChoiceAnswer -> Maybe ChoiceReason -> ChoiceAnswer)
-> Lens
ChoiceAnswer ChoiceAnswer (Maybe ChoiceReason) (Maybe ChoiceReason)
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)
choiceAnswer_notes :: Lens.Lens' ChoiceAnswer (Prelude.Maybe Prelude.Text)
choiceAnswer_notes :: (Maybe Text -> f (Maybe Text)) -> ChoiceAnswer -> f ChoiceAnswer
choiceAnswer_notes = (ChoiceAnswer -> Maybe Text)
-> (ChoiceAnswer -> Maybe Text -> ChoiceAnswer)
-> Lens ChoiceAnswer ChoiceAnswer (Maybe Text) (Maybe Text)
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)
choiceAnswer_choiceId :: Lens.Lens' ChoiceAnswer (Prelude.Maybe Prelude.Text)
choiceAnswer_choiceId :: (Maybe Text -> f (Maybe Text)) -> ChoiceAnswer -> f ChoiceAnswer
choiceAnswer_choiceId = (ChoiceAnswer -> Maybe Text)
-> (ChoiceAnswer -> Maybe Text -> ChoiceAnswer)
-> Lens ChoiceAnswer ChoiceAnswer (Maybe Text) (Maybe Text)
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)
instance Core.FromJSON ChoiceAnswer where
parseJSON :: Value -> Parser ChoiceAnswer
parseJSON =
String
-> (Object -> Parser ChoiceAnswer) -> Value -> Parser ChoiceAnswer
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ChoiceAnswer"
( \Object
x ->
Maybe ChoiceStatus
-> Maybe ChoiceReason -> Maybe Text -> Maybe Text -> ChoiceAnswer
ChoiceAnswer'
(Maybe ChoiceStatus
-> Maybe ChoiceReason -> Maybe Text -> Maybe Text -> ChoiceAnswer)
-> Parser (Maybe ChoiceStatus)
-> Parser
(Maybe ChoiceReason -> Maybe Text -> Maybe Text -> ChoiceAnswer)
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 -> Maybe Text -> ChoiceAnswer)
-> Parser (Maybe ChoiceReason)
-> Parser (Maybe Text -> Maybe Text -> ChoiceAnswer)
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 -> Maybe Text -> ChoiceAnswer)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ChoiceAnswer)
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
"Notes")
Parser (Maybe Text -> ChoiceAnswer)
-> Parser (Maybe Text) -> Parser ChoiceAnswer
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 ChoiceAnswer
instance Prelude.NFData ChoiceAnswer