{-# 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.IoTDeviceAdvisor.Types.GroupResult where
import qualified Amazonka.Core as Core
import Amazonka.IoTDeviceAdvisor.Types.TestCaseRun
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data GroupResult = GroupResult'
{
GroupResult -> Maybe [TestCaseRun]
tests :: Prelude.Maybe [TestCaseRun],
GroupResult -> Maybe Text
groupId :: Prelude.Maybe Prelude.Text,
GroupResult -> Maybe Text
groupName :: Prelude.Maybe Prelude.Text
}
deriving (GroupResult -> GroupResult -> Bool
(GroupResult -> GroupResult -> Bool)
-> (GroupResult -> GroupResult -> Bool) -> Eq GroupResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GroupResult -> GroupResult -> Bool
$c/= :: GroupResult -> GroupResult -> Bool
== :: GroupResult -> GroupResult -> Bool
$c== :: GroupResult -> GroupResult -> Bool
Prelude.Eq, ReadPrec [GroupResult]
ReadPrec GroupResult
Int -> ReadS GroupResult
ReadS [GroupResult]
(Int -> ReadS GroupResult)
-> ReadS [GroupResult]
-> ReadPrec GroupResult
-> ReadPrec [GroupResult]
-> Read GroupResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GroupResult]
$creadListPrec :: ReadPrec [GroupResult]
readPrec :: ReadPrec GroupResult
$creadPrec :: ReadPrec GroupResult
readList :: ReadS [GroupResult]
$creadList :: ReadS [GroupResult]
readsPrec :: Int -> ReadS GroupResult
$creadsPrec :: Int -> ReadS GroupResult
Prelude.Read, Int -> GroupResult -> ShowS
[GroupResult] -> ShowS
GroupResult -> String
(Int -> GroupResult -> ShowS)
-> (GroupResult -> String)
-> ([GroupResult] -> ShowS)
-> Show GroupResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GroupResult] -> ShowS
$cshowList :: [GroupResult] -> ShowS
show :: GroupResult -> String
$cshow :: GroupResult -> String
showsPrec :: Int -> GroupResult -> ShowS
$cshowsPrec :: Int -> GroupResult -> ShowS
Prelude.Show, (forall x. GroupResult -> Rep GroupResult x)
-> (forall x. Rep GroupResult x -> GroupResult)
-> Generic GroupResult
forall x. Rep GroupResult x -> GroupResult
forall x. GroupResult -> Rep GroupResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GroupResult x -> GroupResult
$cfrom :: forall x. GroupResult -> Rep GroupResult x
Prelude.Generic)
newGroupResult ::
GroupResult
newGroupResult :: GroupResult
newGroupResult =
GroupResult' :: Maybe [TestCaseRun] -> Maybe Text -> Maybe Text -> GroupResult
GroupResult'
{ $sel:tests:GroupResult' :: Maybe [TestCaseRun]
tests = Maybe [TestCaseRun]
forall a. Maybe a
Prelude.Nothing,
$sel:groupId:GroupResult' :: Maybe Text
groupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:groupName:GroupResult' :: Maybe Text
groupName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
groupResult_tests :: Lens.Lens' GroupResult (Prelude.Maybe [TestCaseRun])
groupResult_tests :: (Maybe [TestCaseRun] -> f (Maybe [TestCaseRun]))
-> GroupResult -> f GroupResult
groupResult_tests = (GroupResult -> Maybe [TestCaseRun])
-> (GroupResult -> Maybe [TestCaseRun] -> GroupResult)
-> Lens
GroupResult GroupResult (Maybe [TestCaseRun]) (Maybe [TestCaseRun])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupResult' {Maybe [TestCaseRun]
tests :: Maybe [TestCaseRun]
$sel:tests:GroupResult' :: GroupResult -> Maybe [TestCaseRun]
tests} -> Maybe [TestCaseRun]
tests) (\s :: GroupResult
s@GroupResult' {} Maybe [TestCaseRun]
a -> GroupResult
s {$sel:tests:GroupResult' :: Maybe [TestCaseRun]
tests = Maybe [TestCaseRun]
a} :: GroupResult) ((Maybe [TestCaseRun] -> f (Maybe [TestCaseRun]))
-> GroupResult -> f GroupResult)
-> ((Maybe [TestCaseRun] -> f (Maybe [TestCaseRun]))
-> Maybe [TestCaseRun] -> f (Maybe [TestCaseRun]))
-> (Maybe [TestCaseRun] -> f (Maybe [TestCaseRun]))
-> GroupResult
-> f GroupResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [TestCaseRun] [TestCaseRun] [TestCaseRun] [TestCaseRun]
-> Iso
(Maybe [TestCaseRun])
(Maybe [TestCaseRun])
(Maybe [TestCaseRun])
(Maybe [TestCaseRun])
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 [TestCaseRun] [TestCaseRun] [TestCaseRun] [TestCaseRun]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
groupResult_groupId :: Lens.Lens' GroupResult (Prelude.Maybe Prelude.Text)
groupResult_groupId :: (Maybe Text -> f (Maybe Text)) -> GroupResult -> f GroupResult
groupResult_groupId = (GroupResult -> Maybe Text)
-> (GroupResult -> Maybe Text -> GroupResult)
-> Lens GroupResult GroupResult (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupResult' {Maybe Text
groupId :: Maybe Text
$sel:groupId:GroupResult' :: GroupResult -> Maybe Text
groupId} -> Maybe Text
groupId) (\s :: GroupResult
s@GroupResult' {} Maybe Text
a -> GroupResult
s {$sel:groupId:GroupResult' :: Maybe Text
groupId = Maybe Text
a} :: GroupResult)
groupResult_groupName :: Lens.Lens' GroupResult (Prelude.Maybe Prelude.Text)
groupResult_groupName :: (Maybe Text -> f (Maybe Text)) -> GroupResult -> f GroupResult
groupResult_groupName = (GroupResult -> Maybe Text)
-> (GroupResult -> Maybe Text -> GroupResult)
-> Lens GroupResult GroupResult (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupResult' {Maybe Text
groupName :: Maybe Text
$sel:groupName:GroupResult' :: GroupResult -> Maybe Text
groupName} -> Maybe Text
groupName) (\s :: GroupResult
s@GroupResult' {} Maybe Text
a -> GroupResult
s {$sel:groupName:GroupResult' :: Maybe Text
groupName = Maybe Text
a} :: GroupResult)
instance Core.FromJSON GroupResult where
parseJSON :: Value -> Parser GroupResult
parseJSON =
String
-> (Object -> Parser GroupResult) -> Value -> Parser GroupResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"GroupResult"
( \Object
x ->
Maybe [TestCaseRun] -> Maybe Text -> Maybe Text -> GroupResult
GroupResult'
(Maybe [TestCaseRun] -> Maybe Text -> Maybe Text -> GroupResult)
-> Parser (Maybe [TestCaseRun])
-> Parser (Maybe Text -> Maybe Text -> GroupResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [TestCaseRun]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tests" Parser (Maybe (Maybe [TestCaseRun]))
-> Maybe [TestCaseRun] -> Parser (Maybe [TestCaseRun])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [TestCaseRun]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> Maybe Text -> GroupResult)
-> Parser (Maybe Text) -> Parser (Maybe Text -> GroupResult)
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
"groupId")
Parser (Maybe Text -> GroupResult)
-> Parser (Maybe Text) -> Parser GroupResult
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
"groupName")
)
instance Prelude.Hashable GroupResult
instance Prelude.NFData GroupResult