{-# 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.ApplicationInsights.Types.Problem
-- 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.ApplicationInsights.Types.Problem where

import Amazonka.ApplicationInsights.Types.FeedbackKey
import Amazonka.ApplicationInsights.Types.FeedbackValue
import Amazonka.ApplicationInsights.Types.SeverityLevel
import Amazonka.ApplicationInsights.Types.Status
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes a problem that is detected by correlating observations.
--
-- /See:/ 'newProblem' smart constructor.
data Problem = Problem'
  { -- | The status of the problem.
    Problem -> Maybe Status
status :: Prelude.Maybe Status,
    -- | The name of the resource group affected by the problem.
    Problem -> Maybe Text
resourceGroupName :: Prelude.Maybe Prelude.Text,
    -- | The time when the problem started, in epoch seconds.
    Problem -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
    -- | A detailed analysis of the problem using machine learning.
    Problem -> Maybe Text
insights :: Prelude.Maybe Prelude.Text,
    -- | The time when the problem ended, in epoch seconds.
    Problem -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
    -- | The ID of the problem.
    Problem -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | A measure of the level of impact of the problem.
    Problem -> Maybe SeverityLevel
severityLevel :: Prelude.Maybe SeverityLevel,
    -- | The name of the problem.
    Problem -> Maybe Text
title :: Prelude.Maybe Prelude.Text,
    -- | The resource affected by the problem.
    Problem -> Maybe Text
affectedResource :: Prelude.Maybe Prelude.Text,
    -- | Feedback provided by the user about the problem.
    Problem -> Maybe (HashMap FeedbackKey FeedbackValue)
feedback :: Prelude.Maybe (Prelude.HashMap FeedbackKey FeedbackValue)
  }
  deriving (Problem -> Problem -> Bool
(Problem -> Problem -> Bool)
-> (Problem -> Problem -> Bool) -> Eq Problem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Problem -> Problem -> Bool
$c/= :: Problem -> Problem -> Bool
== :: Problem -> Problem -> Bool
$c== :: Problem -> Problem -> Bool
Prelude.Eq, ReadPrec [Problem]
ReadPrec Problem
Int -> ReadS Problem
ReadS [Problem]
(Int -> ReadS Problem)
-> ReadS [Problem]
-> ReadPrec Problem
-> ReadPrec [Problem]
-> Read Problem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Problem]
$creadListPrec :: ReadPrec [Problem]
readPrec :: ReadPrec Problem
$creadPrec :: ReadPrec Problem
readList :: ReadS [Problem]
$creadList :: ReadS [Problem]
readsPrec :: Int -> ReadS Problem
$creadsPrec :: Int -> ReadS Problem
Prelude.Read, Int -> Problem -> ShowS
[Problem] -> ShowS
Problem -> String
(Int -> Problem -> ShowS)
-> (Problem -> String) -> ([Problem] -> ShowS) -> Show Problem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Problem] -> ShowS
$cshowList :: [Problem] -> ShowS
show :: Problem -> String
$cshow :: Problem -> String
showsPrec :: Int -> Problem -> ShowS
$cshowsPrec :: Int -> Problem -> ShowS
Prelude.Show, (forall x. Problem -> Rep Problem x)
-> (forall x. Rep Problem x -> Problem) -> Generic Problem
forall x. Rep Problem x -> Problem
forall x. Problem -> Rep Problem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Problem x -> Problem
$cfrom :: forall x. Problem -> Rep Problem x
Prelude.Generic)

-- |
-- Create a value of 'Problem' 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', 'problem_status' - The status of the problem.
--
-- 'resourceGroupName', 'problem_resourceGroupName' - The name of the resource group affected by the problem.
--
-- 'startTime', 'problem_startTime' - The time when the problem started, in epoch seconds.
--
-- 'insights', 'problem_insights' - A detailed analysis of the problem using machine learning.
--
-- 'endTime', 'problem_endTime' - The time when the problem ended, in epoch seconds.
--
-- 'id', 'problem_id' - The ID of the problem.
--
-- 'severityLevel', 'problem_severityLevel' - A measure of the level of impact of the problem.
--
-- 'title', 'problem_title' - The name of the problem.
--
-- 'affectedResource', 'problem_affectedResource' - The resource affected by the problem.
--
-- 'feedback', 'problem_feedback' - Feedback provided by the user about the problem.
newProblem ::
  Problem
newProblem :: Problem
newProblem =
  Problem' :: Maybe Status
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe SeverityLevel
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap FeedbackKey FeedbackValue)
-> Problem
Problem'
    { $sel:status:Problem' :: Maybe Status
status = Maybe Status
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceGroupName:Problem' :: Maybe Text
resourceGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:Problem' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:insights:Problem' :: Maybe Text
insights = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:Problem' :: Maybe POSIX
endTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:id:Problem' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:severityLevel:Problem' :: Maybe SeverityLevel
severityLevel = Maybe SeverityLevel
forall a. Maybe a
Prelude.Nothing,
      $sel:title:Problem' :: Maybe Text
title = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:affectedResource:Problem' :: Maybe Text
affectedResource = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:feedback:Problem' :: Maybe (HashMap FeedbackKey FeedbackValue)
feedback = Maybe (HashMap FeedbackKey FeedbackValue)
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the problem.
problem_status :: Lens.Lens' Problem (Prelude.Maybe Status)
problem_status :: (Maybe Status -> f (Maybe Status)) -> Problem -> f Problem
problem_status = (Problem -> Maybe Status)
-> (Problem -> Maybe Status -> Problem)
-> Lens Problem Problem (Maybe Status) (Maybe Status)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Problem' {Maybe Status
status :: Maybe Status
$sel:status:Problem' :: Problem -> Maybe Status
status} -> Maybe Status
status) (\s :: Problem
s@Problem' {} Maybe Status
a -> Problem
s {$sel:status:Problem' :: Maybe Status
status = Maybe Status
a} :: Problem)

-- | The name of the resource group affected by the problem.
problem_resourceGroupName :: Lens.Lens' Problem (Prelude.Maybe Prelude.Text)
problem_resourceGroupName :: (Maybe Text -> f (Maybe Text)) -> Problem -> f Problem
problem_resourceGroupName = (Problem -> Maybe Text)
-> (Problem -> Maybe Text -> Problem)
-> Lens Problem Problem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Problem' {Maybe Text
resourceGroupName :: Maybe Text
$sel:resourceGroupName:Problem' :: Problem -> Maybe Text
resourceGroupName} -> Maybe Text
resourceGroupName) (\s :: Problem
s@Problem' {} Maybe Text
a -> Problem
s {$sel:resourceGroupName:Problem' :: Maybe Text
resourceGroupName = Maybe Text
a} :: Problem)

-- | The time when the problem started, in epoch seconds.
problem_startTime :: Lens.Lens' Problem (Prelude.Maybe Prelude.UTCTime)
problem_startTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Problem -> f Problem
problem_startTime = (Problem -> Maybe POSIX)
-> (Problem -> Maybe POSIX -> Problem)
-> Lens Problem Problem (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Problem' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:Problem' :: Problem -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: Problem
s@Problem' {} Maybe POSIX
a -> Problem
s {$sel:startTime:Problem' :: Maybe POSIX
startTime = Maybe POSIX
a} :: Problem) ((Maybe POSIX -> f (Maybe POSIX)) -> Problem -> f Problem)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Problem
-> f Problem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A detailed analysis of the problem using machine learning.
problem_insights :: Lens.Lens' Problem (Prelude.Maybe Prelude.Text)
problem_insights :: (Maybe Text -> f (Maybe Text)) -> Problem -> f Problem
problem_insights = (Problem -> Maybe Text)
-> (Problem -> Maybe Text -> Problem)
-> Lens Problem Problem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Problem' {Maybe Text
insights :: Maybe Text
$sel:insights:Problem' :: Problem -> Maybe Text
insights} -> Maybe Text
insights) (\s :: Problem
s@Problem' {} Maybe Text
a -> Problem
s {$sel:insights:Problem' :: Maybe Text
insights = Maybe Text
a} :: Problem)

-- | The time when the problem ended, in epoch seconds.
problem_endTime :: Lens.Lens' Problem (Prelude.Maybe Prelude.UTCTime)
problem_endTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Problem -> f Problem
problem_endTime = (Problem -> Maybe POSIX)
-> (Problem -> Maybe POSIX -> Problem)
-> Lens Problem Problem (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Problem' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:Problem' :: Problem -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: Problem
s@Problem' {} Maybe POSIX
a -> Problem
s {$sel:endTime:Problem' :: Maybe POSIX
endTime = Maybe POSIX
a} :: Problem) ((Maybe POSIX -> f (Maybe POSIX)) -> Problem -> f Problem)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Problem
-> f Problem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The ID of the problem.
problem_id :: Lens.Lens' Problem (Prelude.Maybe Prelude.Text)
problem_id :: (Maybe Text -> f (Maybe Text)) -> Problem -> f Problem
problem_id = (Problem -> Maybe Text)
-> (Problem -> Maybe Text -> Problem)
-> Lens Problem Problem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Problem' {Maybe Text
id :: Maybe Text
$sel:id:Problem' :: Problem -> Maybe Text
id} -> Maybe Text
id) (\s :: Problem
s@Problem' {} Maybe Text
a -> Problem
s {$sel:id:Problem' :: Maybe Text
id = Maybe Text
a} :: Problem)

-- | A measure of the level of impact of the problem.
problem_severityLevel :: Lens.Lens' Problem (Prelude.Maybe SeverityLevel)
problem_severityLevel :: (Maybe SeverityLevel -> f (Maybe SeverityLevel))
-> Problem -> f Problem
problem_severityLevel = (Problem -> Maybe SeverityLevel)
-> (Problem -> Maybe SeverityLevel -> Problem)
-> Lens Problem Problem (Maybe SeverityLevel) (Maybe SeverityLevel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Problem' {Maybe SeverityLevel
severityLevel :: Maybe SeverityLevel
$sel:severityLevel:Problem' :: Problem -> Maybe SeverityLevel
severityLevel} -> Maybe SeverityLevel
severityLevel) (\s :: Problem
s@Problem' {} Maybe SeverityLevel
a -> Problem
s {$sel:severityLevel:Problem' :: Maybe SeverityLevel
severityLevel = Maybe SeverityLevel
a} :: Problem)

-- | The name of the problem.
problem_title :: Lens.Lens' Problem (Prelude.Maybe Prelude.Text)
problem_title :: (Maybe Text -> f (Maybe Text)) -> Problem -> f Problem
problem_title = (Problem -> Maybe Text)
-> (Problem -> Maybe Text -> Problem)
-> Lens Problem Problem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Problem' {Maybe Text
title :: Maybe Text
$sel:title:Problem' :: Problem -> Maybe Text
title} -> Maybe Text
title) (\s :: Problem
s@Problem' {} Maybe Text
a -> Problem
s {$sel:title:Problem' :: Maybe Text
title = Maybe Text
a} :: Problem)

-- | The resource affected by the problem.
problem_affectedResource :: Lens.Lens' Problem (Prelude.Maybe Prelude.Text)
problem_affectedResource :: (Maybe Text -> f (Maybe Text)) -> Problem -> f Problem
problem_affectedResource = (Problem -> Maybe Text)
-> (Problem -> Maybe Text -> Problem)
-> Lens Problem Problem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Problem' {Maybe Text
affectedResource :: Maybe Text
$sel:affectedResource:Problem' :: Problem -> Maybe Text
affectedResource} -> Maybe Text
affectedResource) (\s :: Problem
s@Problem' {} Maybe Text
a -> Problem
s {$sel:affectedResource:Problem' :: Maybe Text
affectedResource = Maybe Text
a} :: Problem)

-- | Feedback provided by the user about the problem.
problem_feedback :: Lens.Lens' Problem (Prelude.Maybe (Prelude.HashMap FeedbackKey FeedbackValue))
problem_feedback :: (Maybe (HashMap FeedbackKey FeedbackValue)
 -> f (Maybe (HashMap FeedbackKey FeedbackValue)))
-> Problem -> f Problem
problem_feedback = (Problem -> Maybe (HashMap FeedbackKey FeedbackValue))
-> (Problem
    -> Maybe (HashMap FeedbackKey FeedbackValue) -> Problem)
-> Lens
     Problem
     Problem
     (Maybe (HashMap FeedbackKey FeedbackValue))
     (Maybe (HashMap FeedbackKey FeedbackValue))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Problem' {Maybe (HashMap FeedbackKey FeedbackValue)
feedback :: Maybe (HashMap FeedbackKey FeedbackValue)
$sel:feedback:Problem' :: Problem -> Maybe (HashMap FeedbackKey FeedbackValue)
feedback} -> Maybe (HashMap FeedbackKey FeedbackValue)
feedback) (\s :: Problem
s@Problem' {} Maybe (HashMap FeedbackKey FeedbackValue)
a -> Problem
s {$sel:feedback:Problem' :: Maybe (HashMap FeedbackKey FeedbackValue)
feedback = Maybe (HashMap FeedbackKey FeedbackValue)
a} :: Problem) ((Maybe (HashMap FeedbackKey FeedbackValue)
  -> f (Maybe (HashMap FeedbackKey FeedbackValue)))
 -> Problem -> f Problem)
-> ((Maybe (HashMap FeedbackKey FeedbackValue)
     -> f (Maybe (HashMap FeedbackKey FeedbackValue)))
    -> Maybe (HashMap FeedbackKey FeedbackValue)
    -> f (Maybe (HashMap FeedbackKey FeedbackValue)))
-> (Maybe (HashMap FeedbackKey FeedbackValue)
    -> f (Maybe (HashMap FeedbackKey FeedbackValue)))
-> Problem
-> f Problem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap FeedbackKey FeedbackValue)
  (HashMap FeedbackKey FeedbackValue)
  (HashMap FeedbackKey FeedbackValue)
  (HashMap FeedbackKey FeedbackValue)
-> Iso
     (Maybe (HashMap FeedbackKey FeedbackValue))
     (Maybe (HashMap FeedbackKey FeedbackValue))
     (Maybe (HashMap FeedbackKey FeedbackValue))
     (Maybe (HashMap FeedbackKey FeedbackValue))
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
  (HashMap FeedbackKey FeedbackValue)
  (HashMap FeedbackKey FeedbackValue)
  (HashMap FeedbackKey FeedbackValue)
  (HashMap FeedbackKey FeedbackValue)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON Problem where
  parseJSON :: Value -> Parser Problem
parseJSON =
    String -> (Object -> Parser Problem) -> Value -> Parser Problem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Problem"
      ( \Object
x ->
          Maybe Status
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe SeverityLevel
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap FeedbackKey FeedbackValue)
-> Problem
Problem'
            (Maybe Status
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe SeverityLevel
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap FeedbackKey FeedbackValue)
 -> Problem)
-> Parser (Maybe Status)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe SeverityLevel
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap FeedbackKey FeedbackValue)
      -> Problem)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Status)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe SeverityLevel
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap FeedbackKey FeedbackValue)
   -> Problem)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe SeverityLevel
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap FeedbackKey FeedbackValue)
      -> Problem)
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
"ResourceGroupName")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe SeverityLevel
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap FeedbackKey FeedbackValue)
   -> Problem)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe SeverityLevel
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap FeedbackKey FeedbackValue)
      -> Problem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StartTime")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe SeverityLevel
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap FeedbackKey FeedbackValue)
   -> Problem)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe SeverityLevel
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap FeedbackKey FeedbackValue)
      -> Problem)
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
"Insights")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe SeverityLevel
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap FeedbackKey FeedbackValue)
   -> Problem)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe SeverityLevel
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap FeedbackKey FeedbackValue)
      -> Problem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndTime")
            Parser
  (Maybe Text
   -> Maybe SeverityLevel
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap FeedbackKey FeedbackValue)
   -> Problem)
-> Parser (Maybe Text)
-> Parser
     (Maybe SeverityLevel
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap FeedbackKey FeedbackValue)
      -> Problem)
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
"Id")
            Parser
  (Maybe SeverityLevel
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap FeedbackKey FeedbackValue)
   -> Problem)
-> Parser (Maybe SeverityLevel)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe (HashMap FeedbackKey FeedbackValue)
      -> Problem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SeverityLevel)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SeverityLevel")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe (HashMap FeedbackKey FeedbackValue)
   -> Problem)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe (HashMap FeedbackKey FeedbackValue) -> Problem)
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
"Title")
            Parser
  (Maybe Text
   -> Maybe (HashMap FeedbackKey FeedbackValue) -> Problem)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap FeedbackKey FeedbackValue) -> Problem)
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
"AffectedResource")
            Parser (Maybe (HashMap FeedbackKey FeedbackValue) -> Problem)
-> Parser (Maybe (HashMap FeedbackKey FeedbackValue))
-> Parser Problem
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Parser (Maybe (Maybe (HashMap FeedbackKey FeedbackValue)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Feedback" Parser (Maybe (Maybe (HashMap FeedbackKey FeedbackValue)))
-> Maybe (HashMap FeedbackKey FeedbackValue)
-> Parser (Maybe (HashMap FeedbackKey FeedbackValue))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap FeedbackKey FeedbackValue)
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable Problem

instance Prelude.NFData Problem