{-# 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.Answer where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WellArchitected.Types.AnswerReason
import Amazonka.WellArchitected.Types.Choice
import Amazonka.WellArchitected.Types.ChoiceAnswer
import Amazonka.WellArchitected.Types.Risk
data Answer = Answer'
{
Answer -> Maybe [ChoiceAnswer]
choiceAnswers :: Prelude.Maybe [ChoiceAnswer],
Answer -> Maybe Text
helpfulResourceUrl :: Prelude.Maybe Prelude.Text,
Answer -> Maybe Bool
isApplicable :: Prelude.Maybe Prelude.Bool,
Answer -> Maybe Text
pillarId :: Prelude.Maybe Prelude.Text,
Answer -> Maybe Text
improvementPlanUrl :: Prelude.Maybe Prelude.Text,
Answer -> Maybe Text
questionDescription :: Prelude.Maybe Prelude.Text,
Answer -> Maybe Risk
risk :: Prelude.Maybe Risk,
Answer -> Maybe Text
questionTitle :: Prelude.Maybe Prelude.Text,
Answer -> Maybe [Text]
selectedChoices :: Prelude.Maybe [Prelude.Text],
Answer -> Maybe AnswerReason
reason :: Prelude.Maybe AnswerReason,
Answer -> Maybe [Choice]
choices :: Prelude.Maybe [Choice],
Answer -> Maybe Text
questionId :: Prelude.Maybe Prelude.Text,
Answer -> Maybe Text
notes :: Prelude.Maybe Prelude.Text
}
deriving (Answer -> Answer -> Bool
(Answer -> Answer -> Bool)
-> (Answer -> Answer -> Bool) -> Eq Answer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Answer -> Answer -> Bool
$c/= :: Answer -> Answer -> Bool
== :: Answer -> Answer -> Bool
$c== :: Answer -> Answer -> Bool
Prelude.Eq, ReadPrec [Answer]
ReadPrec Answer
Int -> ReadS Answer
ReadS [Answer]
(Int -> ReadS Answer)
-> ReadS [Answer]
-> ReadPrec Answer
-> ReadPrec [Answer]
-> Read Answer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Answer]
$creadListPrec :: ReadPrec [Answer]
readPrec :: ReadPrec Answer
$creadPrec :: ReadPrec Answer
readList :: ReadS [Answer]
$creadList :: ReadS [Answer]
readsPrec :: Int -> ReadS Answer
$creadsPrec :: Int -> ReadS Answer
Prelude.Read, Int -> Answer -> ShowS
[Answer] -> ShowS
Answer -> String
(Int -> Answer -> ShowS)
-> (Answer -> String) -> ([Answer] -> ShowS) -> Show Answer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Answer] -> ShowS
$cshowList :: [Answer] -> ShowS
show :: Answer -> String
$cshow :: Answer -> String
showsPrec :: Int -> Answer -> ShowS
$cshowsPrec :: Int -> Answer -> ShowS
Prelude.Show, (forall x. Answer -> Rep Answer x)
-> (forall x. Rep Answer x -> Answer) -> Generic Answer
forall x. Rep Answer x -> Answer
forall x. Answer -> Rep Answer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Answer x -> Answer
$cfrom :: forall x. Answer -> Rep Answer x
Prelude.Generic)
newAnswer ::
Answer
newAnswer :: Answer
newAnswer =
Answer' :: Maybe [ChoiceAnswer]
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Risk
-> Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer
Answer'
{ $sel:choiceAnswers:Answer' :: Maybe [ChoiceAnswer]
choiceAnswers = Maybe [ChoiceAnswer]
forall a. Maybe a
Prelude.Nothing,
$sel:helpfulResourceUrl:Answer' :: Maybe Text
helpfulResourceUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:isApplicable:Answer' :: Maybe Bool
isApplicable = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:pillarId:Answer' :: Maybe Text
pillarId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:improvementPlanUrl:Answer' :: Maybe Text
improvementPlanUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:questionDescription:Answer' :: Maybe Text
questionDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:risk:Answer' :: Maybe Risk
risk = Maybe Risk
forall a. Maybe a
Prelude.Nothing,
$sel:questionTitle:Answer' :: Maybe Text
questionTitle = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:selectedChoices:Answer' :: Maybe [Text]
selectedChoices = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:reason:Answer' :: Maybe AnswerReason
reason = Maybe AnswerReason
forall a. Maybe a
Prelude.Nothing,
$sel:choices:Answer' :: Maybe [Choice]
choices = Maybe [Choice]
forall a. Maybe a
Prelude.Nothing,
$sel:questionId:Answer' :: Maybe Text
questionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:notes:Answer' :: Maybe Text
notes = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
answer_choiceAnswers :: Lens.Lens' Answer (Prelude.Maybe [ChoiceAnswer])
answer_choiceAnswers :: (Maybe [ChoiceAnswer] -> f (Maybe [ChoiceAnswer]))
-> Answer -> f Answer
answer_choiceAnswers = (Answer -> Maybe [ChoiceAnswer])
-> (Answer -> Maybe [ChoiceAnswer] -> Answer)
-> Lens Answer Answer (Maybe [ChoiceAnswer]) (Maybe [ChoiceAnswer])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Answer' {Maybe [ChoiceAnswer]
choiceAnswers :: Maybe [ChoiceAnswer]
$sel:choiceAnswers:Answer' :: Answer -> Maybe [ChoiceAnswer]
choiceAnswers} -> Maybe [ChoiceAnswer]
choiceAnswers) (\s :: Answer
s@Answer' {} Maybe [ChoiceAnswer]
a -> Answer
s {$sel:choiceAnswers:Answer' :: Maybe [ChoiceAnswer]
choiceAnswers = Maybe [ChoiceAnswer]
a} :: Answer) ((Maybe [ChoiceAnswer] -> f (Maybe [ChoiceAnswer]))
-> Answer -> f Answer)
-> ((Maybe [ChoiceAnswer] -> f (Maybe [ChoiceAnswer]))
-> Maybe [ChoiceAnswer] -> f (Maybe [ChoiceAnswer]))
-> (Maybe [ChoiceAnswer] -> f (Maybe [ChoiceAnswer]))
-> Answer
-> f Answer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ChoiceAnswer] [ChoiceAnswer] [ChoiceAnswer] [ChoiceAnswer]
-> Iso
(Maybe [ChoiceAnswer])
(Maybe [ChoiceAnswer])
(Maybe [ChoiceAnswer])
(Maybe [ChoiceAnswer])
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 AnIso [ChoiceAnswer] [ChoiceAnswer] [ChoiceAnswer] [ChoiceAnswer]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
answer_helpfulResourceUrl :: Lens.Lens' Answer (Prelude.Maybe Prelude.Text)
answer_helpfulResourceUrl :: (Maybe Text -> f (Maybe Text)) -> Answer -> f Answer
answer_helpfulResourceUrl = (Answer -> Maybe Text)
-> (Answer -> Maybe Text -> Answer)
-> Lens Answer Answer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Answer' {Maybe Text
helpfulResourceUrl :: Maybe Text
$sel:helpfulResourceUrl:Answer' :: Answer -> Maybe Text
helpfulResourceUrl} -> Maybe Text
helpfulResourceUrl) (\s :: Answer
s@Answer' {} Maybe Text
a -> Answer
s {$sel:helpfulResourceUrl:Answer' :: Maybe Text
helpfulResourceUrl = Maybe Text
a} :: Answer)
answer_isApplicable :: Lens.Lens' Answer (Prelude.Maybe Prelude.Bool)
answer_isApplicable :: (Maybe Bool -> f (Maybe Bool)) -> Answer -> f Answer
answer_isApplicable = (Answer -> Maybe Bool)
-> (Answer -> Maybe Bool -> Answer)
-> Lens Answer Answer (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Answer' {Maybe Bool
isApplicable :: Maybe Bool
$sel:isApplicable:Answer' :: Answer -> Maybe Bool
isApplicable} -> Maybe Bool
isApplicable) (\s :: Answer
s@Answer' {} Maybe Bool
a -> Answer
s {$sel:isApplicable:Answer' :: Maybe Bool
isApplicable = Maybe Bool
a} :: Answer)
answer_pillarId :: Lens.Lens' Answer (Prelude.Maybe Prelude.Text)
answer_pillarId :: (Maybe Text -> f (Maybe Text)) -> Answer -> f Answer
answer_pillarId = (Answer -> Maybe Text)
-> (Answer -> Maybe Text -> Answer)
-> Lens Answer Answer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Answer' {Maybe Text
pillarId :: Maybe Text
$sel:pillarId:Answer' :: Answer -> Maybe Text
pillarId} -> Maybe Text
pillarId) (\s :: Answer
s@Answer' {} Maybe Text
a -> Answer
s {$sel:pillarId:Answer' :: Maybe Text
pillarId = Maybe Text
a} :: Answer)
answer_improvementPlanUrl :: Lens.Lens' Answer (Prelude.Maybe Prelude.Text)
answer_improvementPlanUrl :: (Maybe Text -> f (Maybe Text)) -> Answer -> f Answer
answer_improvementPlanUrl = (Answer -> Maybe Text)
-> (Answer -> Maybe Text -> Answer)
-> Lens Answer Answer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Answer' {Maybe Text
improvementPlanUrl :: Maybe Text
$sel:improvementPlanUrl:Answer' :: Answer -> Maybe Text
improvementPlanUrl} -> Maybe Text
improvementPlanUrl) (\s :: Answer
s@Answer' {} Maybe Text
a -> Answer
s {$sel:improvementPlanUrl:Answer' :: Maybe Text
improvementPlanUrl = Maybe Text
a} :: Answer)
answer_questionDescription :: Lens.Lens' Answer (Prelude.Maybe Prelude.Text)
answer_questionDescription :: (Maybe Text -> f (Maybe Text)) -> Answer -> f Answer
answer_questionDescription = (Answer -> Maybe Text)
-> (Answer -> Maybe Text -> Answer)
-> Lens Answer Answer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Answer' {Maybe Text
questionDescription :: Maybe Text
$sel:questionDescription:Answer' :: Answer -> Maybe Text
questionDescription} -> Maybe Text
questionDescription) (\s :: Answer
s@Answer' {} Maybe Text
a -> Answer
s {$sel:questionDescription:Answer' :: Maybe Text
questionDescription = Maybe Text
a} :: Answer)
answer_risk :: Lens.Lens' Answer (Prelude.Maybe Risk)
answer_risk :: (Maybe Risk -> f (Maybe Risk)) -> Answer -> f Answer
answer_risk = (Answer -> Maybe Risk)
-> (Answer -> Maybe Risk -> Answer)
-> Lens Answer Answer (Maybe Risk) (Maybe Risk)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Answer' {Maybe Risk
risk :: Maybe Risk
$sel:risk:Answer' :: Answer -> Maybe Risk
risk} -> Maybe Risk
risk) (\s :: Answer
s@Answer' {} Maybe Risk
a -> Answer
s {$sel:risk:Answer' :: Maybe Risk
risk = Maybe Risk
a} :: Answer)
answer_questionTitle :: Lens.Lens' Answer (Prelude.Maybe Prelude.Text)
answer_questionTitle :: (Maybe Text -> f (Maybe Text)) -> Answer -> f Answer
answer_questionTitle = (Answer -> Maybe Text)
-> (Answer -> Maybe Text -> Answer)
-> Lens Answer Answer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Answer' {Maybe Text
questionTitle :: Maybe Text
$sel:questionTitle:Answer' :: Answer -> Maybe Text
questionTitle} -> Maybe Text
questionTitle) (\s :: Answer
s@Answer' {} Maybe Text
a -> Answer
s {$sel:questionTitle:Answer' :: Maybe Text
questionTitle = Maybe Text
a} :: Answer)
answer_selectedChoices :: Lens.Lens' Answer (Prelude.Maybe [Prelude.Text])
answer_selectedChoices :: (Maybe [Text] -> f (Maybe [Text])) -> Answer -> f Answer
answer_selectedChoices = (Answer -> Maybe [Text])
-> (Answer -> Maybe [Text] -> Answer)
-> Lens Answer Answer (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Answer' {Maybe [Text]
selectedChoices :: Maybe [Text]
$sel:selectedChoices:Answer' :: Answer -> Maybe [Text]
selectedChoices} -> Maybe [Text]
selectedChoices) (\s :: Answer
s@Answer' {} Maybe [Text]
a -> Answer
s {$sel:selectedChoices:Answer' :: Maybe [Text]
selectedChoices = Maybe [Text]
a} :: Answer) ((Maybe [Text] -> f (Maybe [Text])) -> Answer -> f Answer)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Answer
-> f Answer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
answer_reason :: Lens.Lens' Answer (Prelude.Maybe AnswerReason)
answer_reason :: (Maybe AnswerReason -> f (Maybe AnswerReason))
-> Answer -> f Answer
answer_reason = (Answer -> Maybe AnswerReason)
-> (Answer -> Maybe AnswerReason -> Answer)
-> Lens Answer Answer (Maybe AnswerReason) (Maybe AnswerReason)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Answer' {Maybe AnswerReason
reason :: Maybe AnswerReason
$sel:reason:Answer' :: Answer -> Maybe AnswerReason
reason} -> Maybe AnswerReason
reason) (\s :: Answer
s@Answer' {} Maybe AnswerReason
a -> Answer
s {$sel:reason:Answer' :: Maybe AnswerReason
reason = Maybe AnswerReason
a} :: Answer)
answer_choices :: Lens.Lens' Answer (Prelude.Maybe [Choice])
answer_choices :: (Maybe [Choice] -> f (Maybe [Choice])) -> Answer -> f Answer
answer_choices = (Answer -> Maybe [Choice])
-> (Answer -> Maybe [Choice] -> Answer)
-> Lens Answer Answer (Maybe [Choice]) (Maybe [Choice])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Answer' {Maybe [Choice]
choices :: Maybe [Choice]
$sel:choices:Answer' :: Answer -> Maybe [Choice]
choices} -> Maybe [Choice]
choices) (\s :: Answer
s@Answer' {} Maybe [Choice]
a -> Answer
s {$sel:choices:Answer' :: Maybe [Choice]
choices = Maybe [Choice]
a} :: Answer) ((Maybe [Choice] -> f (Maybe [Choice])) -> Answer -> f Answer)
-> ((Maybe [Choice] -> f (Maybe [Choice]))
-> Maybe [Choice] -> f (Maybe [Choice]))
-> (Maybe [Choice] -> f (Maybe [Choice]))
-> Answer
-> f Answer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Choice] [Choice] [Choice] [Choice]
-> Iso
(Maybe [Choice]) (Maybe [Choice]) (Maybe [Choice]) (Maybe [Choice])
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 AnIso [Choice] [Choice] [Choice] [Choice]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
answer_questionId :: Lens.Lens' Answer (Prelude.Maybe Prelude.Text)
answer_questionId :: (Maybe Text -> f (Maybe Text)) -> Answer -> f Answer
answer_questionId = (Answer -> Maybe Text)
-> (Answer -> Maybe Text -> Answer)
-> Lens Answer Answer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Answer' {Maybe Text
questionId :: Maybe Text
$sel:questionId:Answer' :: Answer -> Maybe Text
questionId} -> Maybe Text
questionId) (\s :: Answer
s@Answer' {} Maybe Text
a -> Answer
s {$sel:questionId:Answer' :: Maybe Text
questionId = Maybe Text
a} :: Answer)
answer_notes :: Lens.Lens' Answer (Prelude.Maybe Prelude.Text)
answer_notes :: (Maybe Text -> f (Maybe Text)) -> Answer -> f Answer
answer_notes = (Answer -> Maybe Text)
-> (Answer -> Maybe Text -> Answer)
-> Lens Answer Answer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Answer' {Maybe Text
notes :: Maybe Text
$sel:notes:Answer' :: Answer -> Maybe Text
notes} -> Maybe Text
notes) (\s :: Answer
s@Answer' {} Maybe Text
a -> Answer
s {$sel:notes:Answer' :: Maybe Text
notes = Maybe Text
a} :: Answer)
instance Core.FromJSON Answer where
parseJSON :: Value -> Parser Answer
parseJSON =
String -> (Object -> Parser Answer) -> Value -> Parser Answer
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Answer"
( \Object
x ->
Maybe [ChoiceAnswer]
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Risk
-> Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer
Answer'
(Maybe [ChoiceAnswer]
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Risk
-> Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer)
-> Parser (Maybe [ChoiceAnswer])
-> Parser
(Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Risk
-> Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [ChoiceAnswer]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ChoiceAnswers" Parser (Maybe (Maybe [ChoiceAnswer]))
-> Maybe [ChoiceAnswer] -> Parser (Maybe [ChoiceAnswer])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ChoiceAnswer]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Risk
-> Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Risk
-> Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer)
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
"HelpfulResourceUrl")
Parser
(Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Risk
-> Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Risk
-> Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IsApplicable")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Risk
-> Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Risk
-> Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer)
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
"PillarId")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Risk
-> Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Risk
-> Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer)
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
"ImprovementPlanUrl")
Parser
(Maybe Text
-> Maybe Risk
-> Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer)
-> Parser (Maybe Text)
-> Parser
(Maybe Risk
-> Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer)
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
"QuestionDescription")
Parser
(Maybe Risk
-> Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer)
-> Parser (Maybe Risk)
-> Parser
(Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Risk)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Risk")
Parser
(Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer)
-> Parser (Maybe Text)
-> Parser
(Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer)
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
"QuestionTitle")
Parser
(Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> Maybe Text
-> Answer)
-> Parser (Maybe [Text])
-> Parser
(Maybe AnswerReason
-> Maybe [Choice] -> Maybe Text -> Maybe Text -> Answer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SelectedChoices"
Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe AnswerReason
-> Maybe [Choice] -> Maybe Text -> Maybe Text -> Answer)
-> Parser (Maybe AnswerReason)
-> Parser (Maybe [Choice] -> Maybe Text -> Maybe Text -> Answer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AnswerReason)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Reason")
Parser (Maybe [Choice] -> Maybe Text -> Maybe Text -> Answer)
-> Parser (Maybe [Choice])
-> Parser (Maybe Text -> Maybe Text -> Answer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Choice]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Choices" Parser (Maybe (Maybe [Choice]))
-> Maybe [Choice] -> Parser (Maybe [Choice])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Choice]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> Maybe Text -> Answer)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Answer)
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
"QuestionId")
Parser (Maybe Text -> Answer)
-> Parser (Maybe Text) -> Parser Answer
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")
)
instance Prelude.Hashable Answer
instance Prelude.NFData Answer