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

-- | An answer summary of a lens review in a workload.
--
-- /See:/ 'newAnswerSummary' smart constructor.
data AnswerSummary = AnswerSummary'
  { AnswerSummary -> Maybe Bool
isApplicable :: Prelude.Maybe Prelude.Bool,
    AnswerSummary -> Maybe Text
pillarId :: Prelude.Maybe Prelude.Text,
    -- | A list of selected choices to a question in your workload.
    AnswerSummary -> Maybe [ChoiceAnswerSummary]
choiceAnswerSummaries :: Prelude.Maybe [ChoiceAnswerSummary],
    AnswerSummary -> Maybe Risk
risk :: Prelude.Maybe Risk,
    AnswerSummary -> Maybe Text
questionTitle :: Prelude.Maybe Prelude.Text,
    AnswerSummary -> Maybe [Text]
selectedChoices :: Prelude.Maybe [Prelude.Text],
    -- | The reason why a choice is non-applicable to a question in your
    -- workload.
    AnswerSummary -> Maybe AnswerReason
reason :: Prelude.Maybe AnswerReason,
    AnswerSummary -> Maybe [Choice]
choices :: Prelude.Maybe [Choice],
    AnswerSummary -> Maybe Text
questionId :: Prelude.Maybe Prelude.Text
  }
  deriving (AnswerSummary -> AnswerSummary -> Bool
(AnswerSummary -> AnswerSummary -> Bool)
-> (AnswerSummary -> AnswerSummary -> Bool) -> Eq AnswerSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnswerSummary -> AnswerSummary -> Bool
$c/= :: AnswerSummary -> AnswerSummary -> Bool
== :: AnswerSummary -> AnswerSummary -> Bool
$c== :: AnswerSummary -> AnswerSummary -> Bool
Prelude.Eq, ReadPrec [AnswerSummary]
ReadPrec AnswerSummary
Int -> ReadS AnswerSummary
ReadS [AnswerSummary]
(Int -> ReadS AnswerSummary)
-> ReadS [AnswerSummary]
-> ReadPrec AnswerSummary
-> ReadPrec [AnswerSummary]
-> Read AnswerSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AnswerSummary]
$creadListPrec :: ReadPrec [AnswerSummary]
readPrec :: ReadPrec AnswerSummary
$creadPrec :: ReadPrec AnswerSummary
readList :: ReadS [AnswerSummary]
$creadList :: ReadS [AnswerSummary]
readsPrec :: Int -> ReadS AnswerSummary
$creadsPrec :: Int -> ReadS AnswerSummary
Prelude.Read, Int -> AnswerSummary -> ShowS
[AnswerSummary] -> ShowS
AnswerSummary -> String
(Int -> AnswerSummary -> ShowS)
-> (AnswerSummary -> String)
-> ([AnswerSummary] -> ShowS)
-> Show AnswerSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnswerSummary] -> ShowS
$cshowList :: [AnswerSummary] -> ShowS
show :: AnswerSummary -> String
$cshow :: AnswerSummary -> String
showsPrec :: Int -> AnswerSummary -> ShowS
$cshowsPrec :: Int -> AnswerSummary -> ShowS
Prelude.Show, (forall x. AnswerSummary -> Rep AnswerSummary x)
-> (forall x. Rep AnswerSummary x -> AnswerSummary)
-> Generic AnswerSummary
forall x. Rep AnswerSummary x -> AnswerSummary
forall x. AnswerSummary -> Rep AnswerSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AnswerSummary x -> AnswerSummary
$cfrom :: forall x. AnswerSummary -> Rep AnswerSummary x
Prelude.Generic)

-- |
-- Create a value of 'AnswerSummary' 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:
--
-- 'isApplicable', 'answerSummary_isApplicable' - Undocumented member.
--
-- 'pillarId', 'answerSummary_pillarId' - Undocumented member.
--
-- 'choiceAnswerSummaries', 'answerSummary_choiceAnswerSummaries' - A list of selected choices to a question in your workload.
--
-- 'risk', 'answerSummary_risk' - Undocumented member.
--
-- 'questionTitle', 'answerSummary_questionTitle' - Undocumented member.
--
-- 'selectedChoices', 'answerSummary_selectedChoices' - Undocumented member.
--
-- 'reason', 'answerSummary_reason' - The reason why a choice is non-applicable to a question in your
-- workload.
--
-- 'choices', 'answerSummary_choices' - Undocumented member.
--
-- 'questionId', 'answerSummary_questionId' - Undocumented member.
newAnswerSummary ::
  AnswerSummary
newAnswerSummary :: AnswerSummary
newAnswerSummary =
  AnswerSummary' :: Maybe Bool
-> Maybe Text
-> Maybe [ChoiceAnswerSummary]
-> Maybe Risk
-> Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> AnswerSummary
AnswerSummary'
    { $sel:isApplicable:AnswerSummary' :: Maybe Bool
isApplicable = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:pillarId:AnswerSummary' :: Maybe Text
pillarId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:choiceAnswerSummaries:AnswerSummary' :: Maybe [ChoiceAnswerSummary]
choiceAnswerSummaries = Maybe [ChoiceAnswerSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:risk:AnswerSummary' :: Maybe Risk
risk = Maybe Risk
forall a. Maybe a
Prelude.Nothing,
      $sel:questionTitle:AnswerSummary' :: Maybe Text
questionTitle = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:selectedChoices:AnswerSummary' :: Maybe [Text]
selectedChoices = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:reason:AnswerSummary' :: Maybe AnswerReason
reason = Maybe AnswerReason
forall a. Maybe a
Prelude.Nothing,
      $sel:choices:AnswerSummary' :: Maybe [Choice]
choices = Maybe [Choice]
forall a. Maybe a
Prelude.Nothing,
      $sel:questionId:AnswerSummary' :: Maybe Text
questionId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
answerSummary_isApplicable :: Lens.Lens' AnswerSummary (Prelude.Maybe Prelude.Bool)
answerSummary_isApplicable :: (Maybe Bool -> f (Maybe Bool)) -> AnswerSummary -> f AnswerSummary
answerSummary_isApplicable = (AnswerSummary -> Maybe Bool)
-> (AnswerSummary -> Maybe Bool -> AnswerSummary)
-> Lens AnswerSummary AnswerSummary (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnswerSummary' {Maybe Bool
isApplicable :: Maybe Bool
$sel:isApplicable:AnswerSummary' :: AnswerSummary -> Maybe Bool
isApplicable} -> Maybe Bool
isApplicable) (\s :: AnswerSummary
s@AnswerSummary' {} Maybe Bool
a -> AnswerSummary
s {$sel:isApplicable:AnswerSummary' :: Maybe Bool
isApplicable = Maybe Bool
a} :: AnswerSummary)

-- | Undocumented member.
answerSummary_pillarId :: Lens.Lens' AnswerSummary (Prelude.Maybe Prelude.Text)
answerSummary_pillarId :: (Maybe Text -> f (Maybe Text)) -> AnswerSummary -> f AnswerSummary
answerSummary_pillarId = (AnswerSummary -> Maybe Text)
-> (AnswerSummary -> Maybe Text -> AnswerSummary)
-> Lens AnswerSummary AnswerSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnswerSummary' {Maybe Text
pillarId :: Maybe Text
$sel:pillarId:AnswerSummary' :: AnswerSummary -> Maybe Text
pillarId} -> Maybe Text
pillarId) (\s :: AnswerSummary
s@AnswerSummary' {} Maybe Text
a -> AnswerSummary
s {$sel:pillarId:AnswerSummary' :: Maybe Text
pillarId = Maybe Text
a} :: AnswerSummary)

-- | A list of selected choices to a question in your workload.
answerSummary_choiceAnswerSummaries :: Lens.Lens' AnswerSummary (Prelude.Maybe [ChoiceAnswerSummary])
answerSummary_choiceAnswerSummaries :: (Maybe [ChoiceAnswerSummary] -> f (Maybe [ChoiceAnswerSummary]))
-> AnswerSummary -> f AnswerSummary
answerSummary_choiceAnswerSummaries = (AnswerSummary -> Maybe [ChoiceAnswerSummary])
-> (AnswerSummary -> Maybe [ChoiceAnswerSummary] -> AnswerSummary)
-> Lens
     AnswerSummary
     AnswerSummary
     (Maybe [ChoiceAnswerSummary])
     (Maybe [ChoiceAnswerSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnswerSummary' {Maybe [ChoiceAnswerSummary]
choiceAnswerSummaries :: Maybe [ChoiceAnswerSummary]
$sel:choiceAnswerSummaries:AnswerSummary' :: AnswerSummary -> Maybe [ChoiceAnswerSummary]
choiceAnswerSummaries} -> Maybe [ChoiceAnswerSummary]
choiceAnswerSummaries) (\s :: AnswerSummary
s@AnswerSummary' {} Maybe [ChoiceAnswerSummary]
a -> AnswerSummary
s {$sel:choiceAnswerSummaries:AnswerSummary' :: Maybe [ChoiceAnswerSummary]
choiceAnswerSummaries = Maybe [ChoiceAnswerSummary]
a} :: AnswerSummary) ((Maybe [ChoiceAnswerSummary] -> f (Maybe [ChoiceAnswerSummary]))
 -> AnswerSummary -> f AnswerSummary)
-> ((Maybe [ChoiceAnswerSummary]
     -> f (Maybe [ChoiceAnswerSummary]))
    -> Maybe [ChoiceAnswerSummary] -> f (Maybe [ChoiceAnswerSummary]))
-> (Maybe [ChoiceAnswerSummary] -> f (Maybe [ChoiceAnswerSummary]))
-> AnswerSummary
-> f AnswerSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ChoiceAnswerSummary]
  [ChoiceAnswerSummary]
  [ChoiceAnswerSummary]
  [ChoiceAnswerSummary]
-> Iso
     (Maybe [ChoiceAnswerSummary])
     (Maybe [ChoiceAnswerSummary])
     (Maybe [ChoiceAnswerSummary])
     (Maybe [ChoiceAnswerSummary])
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
  [ChoiceAnswerSummary]
  [ChoiceAnswerSummary]
  [ChoiceAnswerSummary]
  [ChoiceAnswerSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
answerSummary_risk :: Lens.Lens' AnswerSummary (Prelude.Maybe Risk)
answerSummary_risk :: (Maybe Risk -> f (Maybe Risk)) -> AnswerSummary -> f AnswerSummary
answerSummary_risk = (AnswerSummary -> Maybe Risk)
-> (AnswerSummary -> Maybe Risk -> AnswerSummary)
-> Lens AnswerSummary AnswerSummary (Maybe Risk) (Maybe Risk)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnswerSummary' {Maybe Risk
risk :: Maybe Risk
$sel:risk:AnswerSummary' :: AnswerSummary -> Maybe Risk
risk} -> Maybe Risk
risk) (\s :: AnswerSummary
s@AnswerSummary' {} Maybe Risk
a -> AnswerSummary
s {$sel:risk:AnswerSummary' :: Maybe Risk
risk = Maybe Risk
a} :: AnswerSummary)

-- | Undocumented member.
answerSummary_questionTitle :: Lens.Lens' AnswerSummary (Prelude.Maybe Prelude.Text)
answerSummary_questionTitle :: (Maybe Text -> f (Maybe Text)) -> AnswerSummary -> f AnswerSummary
answerSummary_questionTitle = (AnswerSummary -> Maybe Text)
-> (AnswerSummary -> Maybe Text -> AnswerSummary)
-> Lens AnswerSummary AnswerSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnswerSummary' {Maybe Text
questionTitle :: Maybe Text
$sel:questionTitle:AnswerSummary' :: AnswerSummary -> Maybe Text
questionTitle} -> Maybe Text
questionTitle) (\s :: AnswerSummary
s@AnswerSummary' {} Maybe Text
a -> AnswerSummary
s {$sel:questionTitle:AnswerSummary' :: Maybe Text
questionTitle = Maybe Text
a} :: AnswerSummary)

-- | Undocumented member.
answerSummary_selectedChoices :: Lens.Lens' AnswerSummary (Prelude.Maybe [Prelude.Text])
answerSummary_selectedChoices :: (Maybe [Text] -> f (Maybe [Text]))
-> AnswerSummary -> f AnswerSummary
answerSummary_selectedChoices = (AnswerSummary -> Maybe [Text])
-> (AnswerSummary -> Maybe [Text] -> AnswerSummary)
-> Lens AnswerSummary AnswerSummary (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnswerSummary' {Maybe [Text]
selectedChoices :: Maybe [Text]
$sel:selectedChoices:AnswerSummary' :: AnswerSummary -> Maybe [Text]
selectedChoices} -> Maybe [Text]
selectedChoices) (\s :: AnswerSummary
s@AnswerSummary' {} Maybe [Text]
a -> AnswerSummary
s {$sel:selectedChoices:AnswerSummary' :: Maybe [Text]
selectedChoices = Maybe [Text]
a} :: AnswerSummary) ((Maybe [Text] -> f (Maybe [Text]))
 -> AnswerSummary -> f AnswerSummary)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AnswerSummary
-> f AnswerSummary
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

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

-- | Undocumented member.
answerSummary_choices :: Lens.Lens' AnswerSummary (Prelude.Maybe [Choice])
answerSummary_choices :: (Maybe [Choice] -> f (Maybe [Choice]))
-> AnswerSummary -> f AnswerSummary
answerSummary_choices = (AnswerSummary -> Maybe [Choice])
-> (AnswerSummary -> Maybe [Choice] -> AnswerSummary)
-> Lens
     AnswerSummary AnswerSummary (Maybe [Choice]) (Maybe [Choice])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnswerSummary' {Maybe [Choice]
choices :: Maybe [Choice]
$sel:choices:AnswerSummary' :: AnswerSummary -> Maybe [Choice]
choices} -> Maybe [Choice]
choices) (\s :: AnswerSummary
s@AnswerSummary' {} Maybe [Choice]
a -> AnswerSummary
s {$sel:choices:AnswerSummary' :: Maybe [Choice]
choices = Maybe [Choice]
a} :: AnswerSummary) ((Maybe [Choice] -> f (Maybe [Choice]))
 -> AnswerSummary -> f AnswerSummary)
-> ((Maybe [Choice] -> f (Maybe [Choice]))
    -> Maybe [Choice] -> f (Maybe [Choice]))
-> (Maybe [Choice] -> f (Maybe [Choice]))
-> AnswerSummary
-> f AnswerSummary
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

-- | Undocumented member.
answerSummary_questionId :: Lens.Lens' AnswerSummary (Prelude.Maybe Prelude.Text)
answerSummary_questionId :: (Maybe Text -> f (Maybe Text)) -> AnswerSummary -> f AnswerSummary
answerSummary_questionId = (AnswerSummary -> Maybe Text)
-> (AnswerSummary -> Maybe Text -> AnswerSummary)
-> Lens AnswerSummary AnswerSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnswerSummary' {Maybe Text
questionId :: Maybe Text
$sel:questionId:AnswerSummary' :: AnswerSummary -> Maybe Text
questionId} -> Maybe Text
questionId) (\s :: AnswerSummary
s@AnswerSummary' {} Maybe Text
a -> AnswerSummary
s {$sel:questionId:AnswerSummary' :: Maybe Text
questionId = Maybe Text
a} :: AnswerSummary)

instance Core.FromJSON AnswerSummary where
  parseJSON :: Value -> Parser AnswerSummary
parseJSON =
    String
-> (Object -> Parser AnswerSummary)
-> Value
-> Parser AnswerSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AnswerSummary"
      ( \Object
x ->
          Maybe Bool
-> Maybe Text
-> Maybe [ChoiceAnswerSummary]
-> Maybe Risk
-> Maybe Text
-> Maybe [Text]
-> Maybe AnswerReason
-> Maybe [Choice]
-> Maybe Text
-> AnswerSummary
AnswerSummary'
            (Maybe Bool
 -> Maybe Text
 -> Maybe [ChoiceAnswerSummary]
 -> Maybe Risk
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe AnswerReason
 -> Maybe [Choice]
 -> Maybe Text
 -> AnswerSummary)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe [ChoiceAnswerSummary]
      -> Maybe Risk
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe AnswerReason
      -> Maybe [Choice]
      -> Maybe Text
      -> AnswerSummary)
forall (f :: * -> *) a b. Functor 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 [ChoiceAnswerSummary]
   -> Maybe Risk
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe AnswerReason
   -> Maybe [Choice]
   -> Maybe Text
   -> AnswerSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe [ChoiceAnswerSummary]
      -> Maybe Risk
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe AnswerReason
      -> Maybe [Choice]
      -> Maybe Text
      -> AnswerSummary)
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 [ChoiceAnswerSummary]
   -> Maybe Risk
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe AnswerReason
   -> Maybe [Choice]
   -> Maybe Text
   -> AnswerSummary)
-> Parser (Maybe [ChoiceAnswerSummary])
-> Parser
     (Maybe Risk
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe AnswerReason
      -> Maybe [Choice]
      -> Maybe Text
      -> AnswerSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [ChoiceAnswerSummary]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ChoiceAnswerSummaries"
                            Parser (Maybe (Maybe [ChoiceAnswerSummary]))
-> Maybe [ChoiceAnswerSummary]
-> Parser (Maybe [ChoiceAnswerSummary])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ChoiceAnswerSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Risk
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe AnswerReason
   -> Maybe [Choice]
   -> Maybe Text
   -> AnswerSummary)
-> Parser (Maybe Risk)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe AnswerReason
      -> Maybe [Choice]
      -> Maybe Text
      -> AnswerSummary)
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
   -> AnswerSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe AnswerReason
      -> Maybe [Choice]
      -> Maybe Text
      -> AnswerSummary)
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
   -> AnswerSummary)
-> Parser (Maybe [Text])
-> Parser
     (Maybe AnswerReason
      -> Maybe [Choice] -> Maybe Text -> AnswerSummary)
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 -> AnswerSummary)
-> Parser (Maybe AnswerReason)
-> Parser (Maybe [Choice] -> Maybe Text -> AnswerSummary)
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 -> AnswerSummary)
-> Parser (Maybe [Choice]) -> Parser (Maybe Text -> AnswerSummary)
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 -> AnswerSummary)
-> Parser (Maybe Text) -> Parser AnswerSummary
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")
      )

instance Prelude.Hashable AnswerSummary

instance Prelude.NFData AnswerSummary