{-# 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.CanaryRun where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Synthetics.Types.CanaryRunStatus
import Amazonka.Synthetics.Types.CanaryRunTimeline
data CanaryRun = CanaryRun'
{
CanaryRun -> Maybe CanaryRunStatus
status :: Prelude.Maybe CanaryRunStatus,
CanaryRun -> Maybe Text
artifactS3Location :: Prelude.Maybe Prelude.Text,
CanaryRun -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
CanaryRun -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
CanaryRun -> Maybe CanaryRunTimeline
timeline :: Prelude.Maybe CanaryRunTimeline
}
deriving (CanaryRun -> CanaryRun -> Bool
(CanaryRun -> CanaryRun -> Bool)
-> (CanaryRun -> CanaryRun -> Bool) -> Eq CanaryRun
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CanaryRun -> CanaryRun -> Bool
$c/= :: CanaryRun -> CanaryRun -> Bool
== :: CanaryRun -> CanaryRun -> Bool
$c== :: CanaryRun -> CanaryRun -> Bool
Prelude.Eq, ReadPrec [CanaryRun]
ReadPrec CanaryRun
Int -> ReadS CanaryRun
ReadS [CanaryRun]
(Int -> ReadS CanaryRun)
-> ReadS [CanaryRun]
-> ReadPrec CanaryRun
-> ReadPrec [CanaryRun]
-> Read CanaryRun
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CanaryRun]
$creadListPrec :: ReadPrec [CanaryRun]
readPrec :: ReadPrec CanaryRun
$creadPrec :: ReadPrec CanaryRun
readList :: ReadS [CanaryRun]
$creadList :: ReadS [CanaryRun]
readsPrec :: Int -> ReadS CanaryRun
$creadsPrec :: Int -> ReadS CanaryRun
Prelude.Read, Int -> CanaryRun -> ShowS
[CanaryRun] -> ShowS
CanaryRun -> String
(Int -> CanaryRun -> ShowS)
-> (CanaryRun -> String)
-> ([CanaryRun] -> ShowS)
-> Show CanaryRun
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CanaryRun] -> ShowS
$cshowList :: [CanaryRun] -> ShowS
show :: CanaryRun -> String
$cshow :: CanaryRun -> String
showsPrec :: Int -> CanaryRun -> ShowS
$cshowsPrec :: Int -> CanaryRun -> ShowS
Prelude.Show, (forall x. CanaryRun -> Rep CanaryRun x)
-> (forall x. Rep CanaryRun x -> CanaryRun) -> Generic CanaryRun
forall x. Rep CanaryRun x -> CanaryRun
forall x. CanaryRun -> Rep CanaryRun x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CanaryRun x -> CanaryRun
$cfrom :: forall x. CanaryRun -> Rep CanaryRun x
Prelude.Generic)
newCanaryRun ::
CanaryRun
newCanaryRun :: CanaryRun
newCanaryRun =
CanaryRun' :: Maybe CanaryRunStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CanaryRunTimeline
-> CanaryRun
CanaryRun'
{ $sel:status:CanaryRun' :: Maybe CanaryRunStatus
status = Maybe CanaryRunStatus
forall a. Maybe a
Prelude.Nothing,
$sel:artifactS3Location:CanaryRun' :: Maybe Text
artifactS3Location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:CanaryRun' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:CanaryRun' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:timeline:CanaryRun' :: Maybe CanaryRunTimeline
timeline = Maybe CanaryRunTimeline
forall a. Maybe a
Prelude.Nothing
}
canaryRun_status :: Lens.Lens' CanaryRun (Prelude.Maybe CanaryRunStatus)
canaryRun_status :: (Maybe CanaryRunStatus -> f (Maybe CanaryRunStatus))
-> CanaryRun -> f CanaryRun
canaryRun_status = (CanaryRun -> Maybe CanaryRunStatus)
-> (CanaryRun -> Maybe CanaryRunStatus -> CanaryRun)
-> Lens
CanaryRun CanaryRun (Maybe CanaryRunStatus) (Maybe CanaryRunStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryRun' {Maybe CanaryRunStatus
status :: Maybe CanaryRunStatus
$sel:status:CanaryRun' :: CanaryRun -> Maybe CanaryRunStatus
status} -> Maybe CanaryRunStatus
status) (\s :: CanaryRun
s@CanaryRun' {} Maybe CanaryRunStatus
a -> CanaryRun
s {$sel:status:CanaryRun' :: Maybe CanaryRunStatus
status = Maybe CanaryRunStatus
a} :: CanaryRun)
canaryRun_artifactS3Location :: Lens.Lens' CanaryRun (Prelude.Maybe Prelude.Text)
canaryRun_artifactS3Location :: (Maybe Text -> f (Maybe Text)) -> CanaryRun -> f CanaryRun
canaryRun_artifactS3Location = (CanaryRun -> Maybe Text)
-> (CanaryRun -> Maybe Text -> CanaryRun)
-> Lens CanaryRun CanaryRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryRun' {Maybe Text
artifactS3Location :: Maybe Text
$sel:artifactS3Location:CanaryRun' :: CanaryRun -> Maybe Text
artifactS3Location} -> Maybe Text
artifactS3Location) (\s :: CanaryRun
s@CanaryRun' {} Maybe Text
a -> CanaryRun
s {$sel:artifactS3Location:CanaryRun' :: Maybe Text
artifactS3Location = Maybe Text
a} :: CanaryRun)
canaryRun_name :: Lens.Lens' CanaryRun (Prelude.Maybe Prelude.Text)
canaryRun_name :: (Maybe Text -> f (Maybe Text)) -> CanaryRun -> f CanaryRun
canaryRun_name = (CanaryRun -> Maybe Text)
-> (CanaryRun -> Maybe Text -> CanaryRun)
-> Lens CanaryRun CanaryRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryRun' {Maybe Text
name :: Maybe Text
$sel:name:CanaryRun' :: CanaryRun -> Maybe Text
name} -> Maybe Text
name) (\s :: CanaryRun
s@CanaryRun' {} Maybe Text
a -> CanaryRun
s {$sel:name:CanaryRun' :: Maybe Text
name = Maybe Text
a} :: CanaryRun)
canaryRun_id :: Lens.Lens' CanaryRun (Prelude.Maybe Prelude.Text)
canaryRun_id :: (Maybe Text -> f (Maybe Text)) -> CanaryRun -> f CanaryRun
canaryRun_id = (CanaryRun -> Maybe Text)
-> (CanaryRun -> Maybe Text -> CanaryRun)
-> Lens CanaryRun CanaryRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryRun' {Maybe Text
id :: Maybe Text
$sel:id:CanaryRun' :: CanaryRun -> Maybe Text
id} -> Maybe Text
id) (\s :: CanaryRun
s@CanaryRun' {} Maybe Text
a -> CanaryRun
s {$sel:id:CanaryRun' :: Maybe Text
id = Maybe Text
a} :: CanaryRun)
canaryRun_timeline :: Lens.Lens' CanaryRun (Prelude.Maybe CanaryRunTimeline)
canaryRun_timeline :: (Maybe CanaryRunTimeline -> f (Maybe CanaryRunTimeline))
-> CanaryRun -> f CanaryRun
canaryRun_timeline = (CanaryRun -> Maybe CanaryRunTimeline)
-> (CanaryRun -> Maybe CanaryRunTimeline -> CanaryRun)
-> Lens
CanaryRun
CanaryRun
(Maybe CanaryRunTimeline)
(Maybe CanaryRunTimeline)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryRun' {Maybe CanaryRunTimeline
timeline :: Maybe CanaryRunTimeline
$sel:timeline:CanaryRun' :: CanaryRun -> Maybe CanaryRunTimeline
timeline} -> Maybe CanaryRunTimeline
timeline) (\s :: CanaryRun
s@CanaryRun' {} Maybe CanaryRunTimeline
a -> CanaryRun
s {$sel:timeline:CanaryRun' :: Maybe CanaryRunTimeline
timeline = Maybe CanaryRunTimeline
a} :: CanaryRun)
instance Core.FromJSON CanaryRun where
parseJSON :: Value -> Parser CanaryRun
parseJSON =
String -> (Object -> Parser CanaryRun) -> Value -> Parser CanaryRun
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CanaryRun"
( \Object
x ->
Maybe CanaryRunStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CanaryRunTimeline
-> CanaryRun
CanaryRun'
(Maybe CanaryRunStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CanaryRunTimeline
-> CanaryRun)
-> Parser (Maybe CanaryRunStatus)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CanaryRunTimeline
-> CanaryRun)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe CanaryRunStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CanaryRunTimeline
-> CanaryRun)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe CanaryRunTimeline -> CanaryRun)
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
"ArtifactS3Location")
Parser
(Maybe Text -> Maybe Text -> Maybe CanaryRunTimeline -> CanaryRun)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe CanaryRunTimeline -> CanaryRun)
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")
Parser (Maybe Text -> Maybe CanaryRunTimeline -> CanaryRun)
-> Parser (Maybe Text)
-> Parser (Maybe CanaryRunTimeline -> CanaryRun)
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
"Id")
Parser (Maybe CanaryRunTimeline -> CanaryRun)
-> Parser (Maybe CanaryRunTimeline) -> Parser CanaryRun
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CanaryRunTimeline)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Timeline")
)
instance Prelude.Hashable CanaryRun
instance Prelude.NFData CanaryRun