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