{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data TestResult = TestResult'
{
TestResult -> Maybe Text
computeUtilization :: Prelude.Maybe Prelude.Text,
TestResult -> Maybe (Sensitive Text)
functionErrorMessage :: Prelude.Maybe (Data.Sensitive Prelude.Text),
TestResult -> Maybe (Sensitive [Text])
functionExecutionLogs :: Prelude.Maybe (Data.Sensitive [Prelude.Text]),
TestResult -> Maybe (Sensitive Text)
functionOutput :: Prelude.Maybe (Data.Sensitive Prelude.Text),
TestResult -> Maybe FunctionSummary
functionSummary :: Prelude.Maybe FunctionSummary
}
deriving (TestResult -> TestResult -> Bool
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, Int -> TestResult -> ShowS
[TestResult] -> ShowS
TestResult -> String
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. 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'
{ $sel:computeUtilization:TestResult' :: Maybe Text
computeUtilization = forall a. Maybe a
Prelude.Nothing,
$sel:functionErrorMessage:TestResult' :: Maybe (Sensitive Text)
functionErrorMessage = forall a. Maybe a
Prelude.Nothing,
$sel:functionExecutionLogs:TestResult' :: Maybe (Sensitive [Text])
functionExecutionLogs = forall a. Maybe a
Prelude.Nothing,
$sel:functionOutput:TestResult' :: Maybe (Sensitive Text)
functionOutput = forall a. Maybe a
Prelude.Nothing,
$sel:functionSummary:TestResult' :: Maybe FunctionSummary
functionSummary = forall a. Maybe a
Prelude.Nothing
}
testResult_computeUtilization :: Lens.Lens' TestResult (Prelude.Maybe Prelude.Text)
testResult_computeUtilization :: Lens' TestResult (Maybe Text)
testResult_computeUtilization = 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_functionErrorMessage :: Lens.Lens' TestResult (Prelude.Maybe Prelude.Text)
testResult_functionErrorMessage :: Lens' TestResult (Maybe Text)
testResult_functionErrorMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestResult' {Maybe (Sensitive Text)
functionErrorMessage :: Maybe (Sensitive Text)
$sel:functionErrorMessage:TestResult' :: TestResult -> Maybe (Sensitive Text)
functionErrorMessage} -> Maybe (Sensitive Text)
functionErrorMessage) (\s :: TestResult
s@TestResult' {} Maybe (Sensitive Text)
a -> TestResult
s {$sel:functionErrorMessage:TestResult' :: Maybe (Sensitive Text)
functionErrorMessage = Maybe (Sensitive Text)
a} :: TestResult) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
testResult_functionExecutionLogs :: Lens.Lens' TestResult (Prelude.Maybe [Prelude.Text])
testResult_functionExecutionLogs :: Lens' TestResult (Maybe [Text])
testResult_functionExecutionLogs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestResult' {Maybe (Sensitive [Text])
functionExecutionLogs :: Maybe (Sensitive [Text])
$sel:functionExecutionLogs:TestResult' :: TestResult -> Maybe (Sensitive [Text])
functionExecutionLogs} -> Maybe (Sensitive [Text])
functionExecutionLogs) (\s :: TestResult
s@TestResult' {} Maybe (Sensitive [Text])
a -> TestResult
s {$sel:functionExecutionLogs:TestResult' :: Maybe (Sensitive [Text])
functionExecutionLogs = Maybe (Sensitive [Text])
a} :: TestResult) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 (forall a. Iso' (Sensitive a) a
Data._Sensitive forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 :: Lens' TestResult (Maybe Text)
testResult_functionOutput = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestResult' {Maybe (Sensitive Text)
functionOutput :: Maybe (Sensitive Text)
$sel:functionOutput:TestResult' :: TestResult -> Maybe (Sensitive Text)
functionOutput} -> Maybe (Sensitive Text)
functionOutput) (\s :: TestResult
s@TestResult' {} Maybe (Sensitive Text)
a -> TestResult
s {$sel:functionOutput:TestResult' :: Maybe (Sensitive Text)
functionOutput = Maybe (Sensitive Text)
a} :: TestResult) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
testResult_functionSummary :: Lens.Lens' TestResult (Prelude.Maybe FunctionSummary)
testResult_functionSummary :: Lens' TestResult (Maybe FunctionSummary)
testResult_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)
instance Data.FromXML TestResult where
parseXML :: [Node] -> Either String TestResult
parseXML [Node]
x =
Maybe Text
-> Maybe (Sensitive Text)
-> Maybe (Sensitive [Text])
-> Maybe (Sensitive Text)
-> Maybe FunctionSummary
-> TestResult
TestResult'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ComputeUtilization")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"FunctionErrorMessage")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"FunctionExecutionLogs"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may
( forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.fmap
(forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.fmap forall a. a -> Sensitive a
Data.Sensitive)
(forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
)
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"FunctionOutput")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"FunctionSummary")
instance Prelude.Hashable TestResult where
hashWithSalt :: Int -> TestResult -> Int
hashWithSalt Int
_salt TestResult' {Maybe Text
Maybe (Sensitive [Text])
Maybe (Sensitive Text)
Maybe FunctionSummary
functionSummary :: Maybe FunctionSummary
functionOutput :: Maybe (Sensitive Text)
functionExecutionLogs :: Maybe (Sensitive [Text])
functionErrorMessage :: Maybe (Sensitive Text)
computeUtilization :: Maybe Text
$sel:functionSummary:TestResult' :: TestResult -> Maybe FunctionSummary
$sel:functionOutput:TestResult' :: TestResult -> Maybe (Sensitive Text)
$sel:functionExecutionLogs:TestResult' :: TestResult -> Maybe (Sensitive [Text])
$sel:functionErrorMessage:TestResult' :: TestResult -> Maybe (Sensitive Text)
$sel:computeUtilization:TestResult' :: TestResult -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
computeUtilization
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
functionErrorMessage
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive [Text])
functionExecutionLogs
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
functionOutput
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FunctionSummary
functionSummary
instance Prelude.NFData TestResult where
rnf :: TestResult -> ()
rnf TestResult' {Maybe Text
Maybe (Sensitive [Text])
Maybe (Sensitive Text)
Maybe FunctionSummary
functionSummary :: Maybe FunctionSummary
functionOutput :: Maybe (Sensitive Text)
functionExecutionLogs :: Maybe (Sensitive [Text])
functionErrorMessage :: Maybe (Sensitive Text)
computeUtilization :: Maybe Text
$sel:functionSummary:TestResult' :: TestResult -> Maybe FunctionSummary
$sel:functionOutput:TestResult' :: TestResult -> Maybe (Sensitive Text)
$sel:functionExecutionLogs:TestResult' :: TestResult -> Maybe (Sensitive [Text])
$sel:functionErrorMessage:TestResult' :: TestResult -> Maybe (Sensitive Text)
$sel:computeUtilization:TestResult' :: TestResult -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
computeUtilization
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
functionErrorMessage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive [Text])
functionExecutionLogs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
functionOutput
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FunctionSummary
functionSummary