{-# 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.ProblemDetail where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ProblemDetail = ProblemDetail'
{
ProblemDetail -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
ProblemDetail -> Maybe Text
name :: Prelude.Maybe Prelude.Text
}
deriving (ProblemDetail -> ProblemDetail -> Bool
(ProblemDetail -> ProblemDetail -> Bool)
-> (ProblemDetail -> ProblemDetail -> Bool) -> Eq ProblemDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProblemDetail -> ProblemDetail -> Bool
$c/= :: ProblemDetail -> ProblemDetail -> Bool
== :: ProblemDetail -> ProblemDetail -> Bool
$c== :: ProblemDetail -> ProblemDetail -> Bool
Prelude.Eq, ReadPrec [ProblemDetail]
ReadPrec ProblemDetail
Int -> ReadS ProblemDetail
ReadS [ProblemDetail]
(Int -> ReadS ProblemDetail)
-> ReadS [ProblemDetail]
-> ReadPrec ProblemDetail
-> ReadPrec [ProblemDetail]
-> Read ProblemDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProblemDetail]
$creadListPrec :: ReadPrec [ProblemDetail]
readPrec :: ReadPrec ProblemDetail
$creadPrec :: ReadPrec ProblemDetail
readList :: ReadS [ProblemDetail]
$creadList :: ReadS [ProblemDetail]
readsPrec :: Int -> ReadS ProblemDetail
$creadsPrec :: Int -> ReadS ProblemDetail
Prelude.Read, Int -> ProblemDetail -> ShowS
[ProblemDetail] -> ShowS
ProblemDetail -> String
(Int -> ProblemDetail -> ShowS)
-> (ProblemDetail -> String)
-> ([ProblemDetail] -> ShowS)
-> Show ProblemDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProblemDetail] -> ShowS
$cshowList :: [ProblemDetail] -> ShowS
show :: ProblemDetail -> String
$cshow :: ProblemDetail -> String
showsPrec :: Int -> ProblemDetail -> ShowS
$cshowsPrec :: Int -> ProblemDetail -> ShowS
Prelude.Show, (forall x. ProblemDetail -> Rep ProblemDetail x)
-> (forall x. Rep ProblemDetail x -> ProblemDetail)
-> Generic ProblemDetail
forall x. Rep ProblemDetail x -> ProblemDetail
forall x. ProblemDetail -> Rep ProblemDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProblemDetail x -> ProblemDetail
$cfrom :: forall x. ProblemDetail -> Rep ProblemDetail x
Prelude.Generic)
newProblemDetail ::
ProblemDetail
newProblemDetail :: ProblemDetail
newProblemDetail =
ProblemDetail' :: Maybe Text -> Maybe Text -> ProblemDetail
ProblemDetail'
{ $sel:arn:ProblemDetail' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:ProblemDetail' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
problemDetail_arn :: Lens.Lens' ProblemDetail (Prelude.Maybe Prelude.Text)
problemDetail_arn :: (Maybe Text -> f (Maybe Text)) -> ProblemDetail -> f ProblemDetail
problemDetail_arn = (ProblemDetail -> Maybe Text)
-> (ProblemDetail -> Maybe Text -> ProblemDetail)
-> Lens ProblemDetail ProblemDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProblemDetail' {Maybe Text
arn :: Maybe Text
$sel:arn:ProblemDetail' :: ProblemDetail -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ProblemDetail
s@ProblemDetail' {} Maybe Text
a -> ProblemDetail
s {$sel:arn:ProblemDetail' :: Maybe Text
arn = Maybe Text
a} :: ProblemDetail)
problemDetail_name :: Lens.Lens' ProblemDetail (Prelude.Maybe Prelude.Text)
problemDetail_name :: (Maybe Text -> f (Maybe Text)) -> ProblemDetail -> f ProblemDetail
problemDetail_name = (ProblemDetail -> Maybe Text)
-> (ProblemDetail -> Maybe Text -> ProblemDetail)
-> Lens ProblemDetail ProblemDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProblemDetail' {Maybe Text
name :: Maybe Text
$sel:name:ProblemDetail' :: ProblemDetail -> Maybe Text
name} -> Maybe Text
name) (\s :: ProblemDetail
s@ProblemDetail' {} Maybe Text
a -> ProblemDetail
s {$sel:name:ProblemDetail' :: Maybe Text
name = Maybe Text
a} :: ProblemDetail)
instance Core.FromJSON ProblemDetail where
parseJSON :: Value -> Parser ProblemDetail
parseJSON =
String
-> (Object -> Parser ProblemDetail)
-> Value
-> Parser ProblemDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ProblemDetail"
( \Object
x ->
Maybe Text -> Maybe Text -> ProblemDetail
ProblemDetail'
(Maybe Text -> Maybe Text -> ProblemDetail)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ProblemDetail)
forall (f :: * -> *) a b. Functor 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
"arn") Parser (Maybe Text -> ProblemDetail)
-> Parser (Maybe Text) -> Parser ProblemDetail
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
"name")
)
instance Prelude.Hashable ProblemDetail
instance Prelude.NFData ProblemDetail