{-# 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.CloudFront.Types.TestResult where
import Amazonka.CloudFront.Types.FunctionSummary
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TestResult = TestResult'
{
TestResult -> Maybe Text
computeUtilization :: Prelude.Maybe Prelude.Text,
TestResult -> Maybe [Text]
functionExecutionLogs :: Prelude.Maybe [Prelude.Text],
TestResult -> Maybe Text
functionOutput :: Prelude.Maybe Prelude.Text,
TestResult -> Maybe FunctionSummary
functionSummary :: Prelude.Maybe FunctionSummary,
TestResult -> Maybe Text
functionErrorMessage :: Prelude.Maybe Prelude.Text
}
deriving (TestResult -> TestResult -> Bool
(TestResult -> TestResult -> Bool)
-> (TestResult -> TestResult -> Bool) -> Eq TestResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestResult -> TestResult -> Bool
$c/= :: TestResult -> TestResult -> Bool
== :: TestResult -> TestResult -> Bool
$c== :: TestResult -> TestResult -> Bool
Prelude.Eq, ReadPrec [TestResult]
ReadPrec TestResult
Int -> ReadS TestResult
ReadS [TestResult]
(Int -> ReadS TestResult)
-> ReadS [TestResult]
-> ReadPrec TestResult
-> ReadPrec [TestResult]
-> Read TestResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TestResult]
$creadListPrec :: ReadPrec [TestResult]
readPrec :: ReadPrec TestResult
$creadPrec :: ReadPrec TestResult
readList :: ReadS [TestResult]
$creadList :: ReadS [TestResult]
readsPrec :: Int -> ReadS TestResult
$creadsPrec :: Int -> ReadS TestResult
Prelude.Read, Int -> TestResult -> ShowS
[TestResult] -> ShowS
TestResult -> String
(Int -> TestResult -> ShowS)
-> (TestResult -> String)
-> ([TestResult] -> ShowS)
-> Show TestResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestResult] -> ShowS
$cshowList :: [TestResult] -> ShowS
show :: TestResult -> String
$cshow :: TestResult -> String
showsPrec :: Int -> TestResult -> ShowS
$cshowsPrec :: Int -> TestResult -> ShowS
Prelude.Show, (forall x. TestResult -> Rep TestResult x)
-> (forall x. Rep TestResult x -> TestResult) -> Generic TestResult
forall x. Rep TestResult x -> TestResult
forall x. TestResult -> Rep TestResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TestResult x -> TestResult
$cfrom :: forall x. TestResult -> Rep TestResult x
Prelude.Generic)
newTestResult ::
TestResult
newTestResult :: TestResult
newTestResult =
TestResult' :: Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe FunctionSummary
-> Maybe Text
-> TestResult
TestResult'
{ $sel:computeUtilization:TestResult' :: Maybe Text
computeUtilization = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:functionExecutionLogs:TestResult' :: Maybe [Text]
functionExecutionLogs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:functionOutput:TestResult' :: Maybe Text
functionOutput = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:functionSummary:TestResult' :: Maybe FunctionSummary
functionSummary = Maybe FunctionSummary
forall a. Maybe a
Prelude.Nothing,
$sel:functionErrorMessage:TestResult' :: Maybe Text
functionErrorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
testResult_computeUtilization :: Lens.Lens' TestResult (Prelude.Maybe Prelude.Text)
testResult_computeUtilization :: (Maybe Text -> f (Maybe Text)) -> TestResult -> f TestResult
testResult_computeUtilization = (TestResult -> Maybe Text)
-> (TestResult -> Maybe Text -> TestResult)
-> Lens TestResult TestResult (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestResult' {Maybe Text
computeUtilization :: Maybe Text
$sel:computeUtilization:TestResult' :: TestResult -> Maybe Text
computeUtilization} -> Maybe Text
computeUtilization) (\s :: TestResult
s@TestResult' {} Maybe Text
a -> TestResult
s {$sel:computeUtilization:TestResult' :: Maybe Text
computeUtilization = Maybe Text
a} :: TestResult)
testResult_functionExecutionLogs :: Lens.Lens' TestResult (Prelude.Maybe [Prelude.Text])
testResult_functionExecutionLogs :: (Maybe [Text] -> f (Maybe [Text])) -> TestResult -> f TestResult
testResult_functionExecutionLogs = (TestResult -> Maybe [Text])
-> (TestResult -> Maybe [Text] -> TestResult)
-> Lens TestResult TestResult (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestResult' {Maybe [Text]
functionExecutionLogs :: Maybe [Text]
$sel:functionExecutionLogs:TestResult' :: TestResult -> Maybe [Text]
functionExecutionLogs} -> Maybe [Text]
functionExecutionLogs) (\s :: TestResult
s@TestResult' {} Maybe [Text]
a -> TestResult
s {$sel:functionExecutionLogs:TestResult' :: Maybe [Text]
functionExecutionLogs = Maybe [Text]
a} :: TestResult) ((Maybe [Text] -> f (Maybe [Text])) -> TestResult -> f TestResult)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> TestResult
-> f TestResult
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
testResult_functionOutput :: Lens.Lens' TestResult (Prelude.Maybe Prelude.Text)
testResult_functionOutput :: (Maybe Text -> f (Maybe Text)) -> TestResult -> f TestResult
testResult_functionOutput = (TestResult -> Maybe Text)
-> (TestResult -> Maybe Text -> TestResult)
-> Lens TestResult TestResult (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestResult' {Maybe Text
functionOutput :: Maybe Text
$sel:functionOutput:TestResult' :: TestResult -> Maybe Text
functionOutput} -> Maybe Text
functionOutput) (\s :: TestResult
s@TestResult' {} Maybe Text
a -> TestResult
s {$sel:functionOutput:TestResult' :: Maybe Text
functionOutput = Maybe Text
a} :: TestResult)
testResult_functionSummary :: Lens.Lens' TestResult (Prelude.Maybe FunctionSummary)
testResult_functionSummary :: (Maybe FunctionSummary -> f (Maybe FunctionSummary))
-> TestResult -> f TestResult
testResult_functionSummary = (TestResult -> Maybe FunctionSummary)
-> (TestResult -> Maybe FunctionSummary -> TestResult)
-> Lens
TestResult
TestResult
(Maybe FunctionSummary)
(Maybe FunctionSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestResult' {Maybe FunctionSummary
functionSummary :: Maybe FunctionSummary
$sel:functionSummary:TestResult' :: TestResult -> Maybe FunctionSummary
functionSummary} -> Maybe FunctionSummary
functionSummary) (\s :: TestResult
s@TestResult' {} Maybe FunctionSummary
a -> TestResult
s {$sel:functionSummary:TestResult' :: Maybe FunctionSummary
functionSummary = Maybe FunctionSummary
a} :: TestResult)
testResult_functionErrorMessage :: Lens.Lens' TestResult (Prelude.Maybe Prelude.Text)
testResult_functionErrorMessage :: (Maybe Text -> f (Maybe Text)) -> TestResult -> f TestResult
testResult_functionErrorMessage = (TestResult -> Maybe Text)
-> (TestResult -> Maybe Text -> TestResult)
-> Lens TestResult TestResult (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestResult' {Maybe Text
functionErrorMessage :: Maybe Text
$sel:functionErrorMessage:TestResult' :: TestResult -> Maybe Text
functionErrorMessage} -> Maybe Text
functionErrorMessage) (\s :: TestResult
s@TestResult' {} Maybe Text
a -> TestResult
s {$sel:functionErrorMessage:TestResult' :: Maybe Text
functionErrorMessage = Maybe Text
a} :: TestResult)
instance Core.FromXML TestResult where
parseXML :: [Node] -> Either String TestResult
parseXML [Node]
x =
Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe FunctionSummary
-> Maybe Text
-> TestResult
TestResult'
(Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe FunctionSummary
-> Maybe Text
-> TestResult)
-> Either String (Maybe Text)
-> Either
String
(Maybe [Text]
-> Maybe Text -> Maybe FunctionSummary -> Maybe Text -> TestResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ComputeUtilization")
Either
String
(Maybe [Text]
-> Maybe Text -> Maybe FunctionSummary -> Maybe Text -> TestResult)
-> Either String (Maybe [Text])
-> Either
String
(Maybe Text -> Maybe FunctionSummary -> Maybe Text -> TestResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FunctionExecutionLogs"
Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
Either
String
(Maybe Text -> Maybe FunctionSummary -> Maybe Text -> TestResult)
-> Either String (Maybe Text)
-> Either
String (Maybe FunctionSummary -> Maybe Text -> TestResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FunctionOutput")
Either String (Maybe FunctionSummary -> Maybe Text -> TestResult)
-> Either String (Maybe FunctionSummary)
-> Either String (Maybe Text -> TestResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe FunctionSummary)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FunctionSummary")
Either String (Maybe Text -> TestResult)
-> Either String (Maybe Text) -> Either String TestResult
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FunctionErrorMessage")
instance Prelude.Hashable TestResult
instance Prelude.NFData TestResult