{-# 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.DeviceFarm.Types.Problem where
import qualified Amazonka.Core as Core
import Amazonka.DeviceFarm.Types.Device
import Amazonka.DeviceFarm.Types.ExecutionResult
import Amazonka.DeviceFarm.Types.ProblemDetail
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Problem = Problem'
{
Problem -> Maybe Device
device :: Prelude.Maybe Device,
Problem -> Maybe ProblemDetail
test :: Prelude.Maybe ProblemDetail,
Problem -> Maybe ExecutionResult
result :: Prelude.Maybe ExecutionResult,
Problem -> Maybe ProblemDetail
run :: Prelude.Maybe ProblemDetail,
Problem -> Maybe ProblemDetail
job :: Prelude.Maybe ProblemDetail,
Problem -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
Problem -> Maybe ProblemDetail
suite :: Prelude.Maybe ProblemDetail
}
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)
newProblem ::
Problem
newProblem :: Problem
newProblem =
Problem' :: Maybe Device
-> Maybe ProblemDetail
-> Maybe ExecutionResult
-> Maybe ProblemDetail
-> Maybe ProblemDetail
-> Maybe Text
-> Maybe ProblemDetail
-> Problem
Problem'
{ $sel:device:Problem' :: Maybe Device
device = Maybe Device
forall a. Maybe a
Prelude.Nothing,
$sel:test:Problem' :: Maybe ProblemDetail
test = Maybe ProblemDetail
forall a. Maybe a
Prelude.Nothing,
$sel:result:Problem' :: Maybe ExecutionResult
result = Maybe ExecutionResult
forall a. Maybe a
Prelude.Nothing,
$sel:run:Problem' :: Maybe ProblemDetail
run = Maybe ProblemDetail
forall a. Maybe a
Prelude.Nothing,
$sel:job:Problem' :: Maybe ProblemDetail
job = Maybe ProblemDetail
forall a. Maybe a
Prelude.Nothing,
$sel:message:Problem' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:suite:Problem' :: Maybe ProblemDetail
suite = Maybe ProblemDetail
forall a. Maybe a
Prelude.Nothing
}
problem_device :: Lens.Lens' Problem (Prelude.Maybe Device)
problem_device :: (Maybe Device -> f (Maybe Device)) -> Problem -> f Problem
problem_device = (Problem -> Maybe Device)
-> (Problem -> Maybe Device -> Problem)
-> Lens Problem Problem (Maybe Device) (Maybe Device)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Problem' {Maybe Device
device :: Maybe Device
$sel:device:Problem' :: Problem -> Maybe Device
device} -> Maybe Device
device) (\s :: Problem
s@Problem' {} Maybe Device
a -> Problem
s {$sel:device:Problem' :: Maybe Device
device = Maybe Device
a} :: Problem)
problem_test :: Lens.Lens' Problem (Prelude.Maybe ProblemDetail)
problem_test :: (Maybe ProblemDetail -> f (Maybe ProblemDetail))
-> Problem -> f Problem
problem_test = (Problem -> Maybe ProblemDetail)
-> (Problem -> Maybe ProblemDetail -> Problem)
-> Lens Problem Problem (Maybe ProblemDetail) (Maybe ProblemDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Problem' {Maybe ProblemDetail
test :: Maybe ProblemDetail
$sel:test:Problem' :: Problem -> Maybe ProblemDetail
test} -> Maybe ProblemDetail
test) (\s :: Problem
s@Problem' {} Maybe ProblemDetail
a -> Problem
s {$sel:test:Problem' :: Maybe ProblemDetail
test = Maybe ProblemDetail
a} :: Problem)
problem_result :: Lens.Lens' Problem (Prelude.Maybe ExecutionResult)
problem_result :: (Maybe ExecutionResult -> f (Maybe ExecutionResult))
-> Problem -> f Problem
problem_result = (Problem -> Maybe ExecutionResult)
-> (Problem -> Maybe ExecutionResult -> Problem)
-> Lens
Problem Problem (Maybe ExecutionResult) (Maybe ExecutionResult)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Problem' {Maybe ExecutionResult
result :: Maybe ExecutionResult
$sel:result:Problem' :: Problem -> Maybe ExecutionResult
result} -> Maybe ExecutionResult
result) (\s :: Problem
s@Problem' {} Maybe ExecutionResult
a -> Problem
s {$sel:result:Problem' :: Maybe ExecutionResult
result = Maybe ExecutionResult
a} :: Problem)
problem_run :: Lens.Lens' Problem (Prelude.Maybe ProblemDetail)
problem_run :: (Maybe ProblemDetail -> f (Maybe ProblemDetail))
-> Problem -> f Problem
problem_run = (Problem -> Maybe ProblemDetail)
-> (Problem -> Maybe ProblemDetail -> Problem)
-> Lens Problem Problem (Maybe ProblemDetail) (Maybe ProblemDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Problem' {Maybe ProblemDetail
run :: Maybe ProblemDetail
$sel:run:Problem' :: Problem -> Maybe ProblemDetail
run} -> Maybe ProblemDetail
run) (\s :: Problem
s@Problem' {} Maybe ProblemDetail
a -> Problem
s {$sel:run:Problem' :: Maybe ProblemDetail
run = Maybe ProblemDetail
a} :: Problem)
problem_job :: Lens.Lens' Problem (Prelude.Maybe ProblemDetail)
problem_job :: (Maybe ProblemDetail -> f (Maybe ProblemDetail))
-> Problem -> f Problem
problem_job = (Problem -> Maybe ProblemDetail)
-> (Problem -> Maybe ProblemDetail -> Problem)
-> Lens Problem Problem (Maybe ProblemDetail) (Maybe ProblemDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Problem' {Maybe ProblemDetail
job :: Maybe ProblemDetail
$sel:job:Problem' :: Problem -> Maybe ProblemDetail
job} -> Maybe ProblemDetail
job) (\s :: Problem
s@Problem' {} Maybe ProblemDetail
a -> Problem
s {$sel:job:Problem' :: Maybe ProblemDetail
job = Maybe ProblemDetail
a} :: Problem)
problem_message :: Lens.Lens' Problem (Prelude.Maybe Prelude.Text)
problem_message :: (Maybe Text -> f (Maybe Text)) -> Problem -> f Problem
problem_message = (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
message :: Maybe Text
$sel:message:Problem' :: Problem -> Maybe Text
message} -> Maybe Text
message) (\s :: Problem
s@Problem' {} Maybe Text
a -> Problem
s {$sel:message:Problem' :: Maybe Text
message = Maybe Text
a} :: Problem)
problem_suite :: Lens.Lens' Problem (Prelude.Maybe ProblemDetail)
problem_suite :: (Maybe ProblemDetail -> f (Maybe ProblemDetail))
-> Problem -> f Problem
problem_suite = (Problem -> Maybe ProblemDetail)
-> (Problem -> Maybe ProblemDetail -> Problem)
-> Lens Problem Problem (Maybe ProblemDetail) (Maybe ProblemDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Problem' {Maybe ProblemDetail
suite :: Maybe ProblemDetail
$sel:suite:Problem' :: Problem -> Maybe ProblemDetail
suite} -> Maybe ProblemDetail
suite) (\s :: Problem
s@Problem' {} Maybe ProblemDetail
a -> Problem
s {$sel:suite:Problem' :: Maybe ProblemDetail
suite = Maybe ProblemDetail
a} :: Problem)
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 Device
-> Maybe ProblemDetail
-> Maybe ExecutionResult
-> Maybe ProblemDetail
-> Maybe ProblemDetail
-> Maybe Text
-> Maybe ProblemDetail
-> Problem
Problem'
(Maybe Device
-> Maybe ProblemDetail
-> Maybe ExecutionResult
-> Maybe ProblemDetail
-> Maybe ProblemDetail
-> Maybe Text
-> Maybe ProblemDetail
-> Problem)
-> Parser (Maybe Device)
-> Parser
(Maybe ProblemDetail
-> Maybe ExecutionResult
-> Maybe ProblemDetail
-> Maybe ProblemDetail
-> Maybe Text
-> Maybe ProblemDetail
-> Problem)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Device)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"device")
Parser
(Maybe ProblemDetail
-> Maybe ExecutionResult
-> Maybe ProblemDetail
-> Maybe ProblemDetail
-> Maybe Text
-> Maybe ProblemDetail
-> Problem)
-> Parser (Maybe ProblemDetail)
-> Parser
(Maybe ExecutionResult
-> Maybe ProblemDetail
-> Maybe ProblemDetail
-> Maybe Text
-> Maybe ProblemDetail
-> Problem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ProblemDetail)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"test")
Parser
(Maybe ExecutionResult
-> Maybe ProblemDetail
-> Maybe ProblemDetail
-> Maybe Text
-> Maybe ProblemDetail
-> Problem)
-> Parser (Maybe ExecutionResult)
-> Parser
(Maybe ProblemDetail
-> Maybe ProblemDetail
-> Maybe Text
-> Maybe ProblemDetail
-> Problem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ExecutionResult)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"result")
Parser
(Maybe ProblemDetail
-> Maybe ProblemDetail
-> Maybe Text
-> Maybe ProblemDetail
-> Problem)
-> Parser (Maybe ProblemDetail)
-> Parser
(Maybe ProblemDetail
-> Maybe Text -> Maybe ProblemDetail -> Problem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ProblemDetail)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"run")
Parser
(Maybe ProblemDetail
-> Maybe Text -> Maybe ProblemDetail -> Problem)
-> Parser (Maybe ProblemDetail)
-> Parser (Maybe Text -> Maybe ProblemDetail -> Problem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ProblemDetail)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"job")
Parser (Maybe Text -> Maybe ProblemDetail -> Problem)
-> Parser (Maybe Text) -> Parser (Maybe ProblemDetail -> 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
"message")
Parser (Maybe ProblemDetail -> Problem)
-> Parser (Maybe ProblemDetail) -> Parser Problem
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ProblemDetail)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"suite")
)
instance Prelude.Hashable Problem
instance Prelude.NFData Problem