{-# 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.CanaryCodeOutput where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CanaryCodeOutput = CanaryCodeOutput'
{
CanaryCodeOutput -> Maybe Text
sourceLocationArn :: Prelude.Maybe Prelude.Text,
CanaryCodeOutput -> Maybe Text
handler :: Prelude.Maybe Prelude.Text
}
deriving (CanaryCodeOutput -> CanaryCodeOutput -> Bool
(CanaryCodeOutput -> CanaryCodeOutput -> Bool)
-> (CanaryCodeOutput -> CanaryCodeOutput -> Bool)
-> Eq CanaryCodeOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CanaryCodeOutput -> CanaryCodeOutput -> Bool
$c/= :: CanaryCodeOutput -> CanaryCodeOutput -> Bool
== :: CanaryCodeOutput -> CanaryCodeOutput -> Bool
$c== :: CanaryCodeOutput -> CanaryCodeOutput -> Bool
Prelude.Eq, ReadPrec [CanaryCodeOutput]
ReadPrec CanaryCodeOutput
Int -> ReadS CanaryCodeOutput
ReadS [CanaryCodeOutput]
(Int -> ReadS CanaryCodeOutput)
-> ReadS [CanaryCodeOutput]
-> ReadPrec CanaryCodeOutput
-> ReadPrec [CanaryCodeOutput]
-> Read CanaryCodeOutput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CanaryCodeOutput]
$creadListPrec :: ReadPrec [CanaryCodeOutput]
readPrec :: ReadPrec CanaryCodeOutput
$creadPrec :: ReadPrec CanaryCodeOutput
readList :: ReadS [CanaryCodeOutput]
$creadList :: ReadS [CanaryCodeOutput]
readsPrec :: Int -> ReadS CanaryCodeOutput
$creadsPrec :: Int -> ReadS CanaryCodeOutput
Prelude.Read, Int -> CanaryCodeOutput -> ShowS
[CanaryCodeOutput] -> ShowS
CanaryCodeOutput -> String
(Int -> CanaryCodeOutput -> ShowS)
-> (CanaryCodeOutput -> String)
-> ([CanaryCodeOutput] -> ShowS)
-> Show CanaryCodeOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CanaryCodeOutput] -> ShowS
$cshowList :: [CanaryCodeOutput] -> ShowS
show :: CanaryCodeOutput -> String
$cshow :: CanaryCodeOutput -> String
showsPrec :: Int -> CanaryCodeOutput -> ShowS
$cshowsPrec :: Int -> CanaryCodeOutput -> ShowS
Prelude.Show, (forall x. CanaryCodeOutput -> Rep CanaryCodeOutput x)
-> (forall x. Rep CanaryCodeOutput x -> CanaryCodeOutput)
-> Generic CanaryCodeOutput
forall x. Rep CanaryCodeOutput x -> CanaryCodeOutput
forall x. CanaryCodeOutput -> Rep CanaryCodeOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CanaryCodeOutput x -> CanaryCodeOutput
$cfrom :: forall x. CanaryCodeOutput -> Rep CanaryCodeOutput x
Prelude.Generic)
newCanaryCodeOutput ::
CanaryCodeOutput
newCanaryCodeOutput :: CanaryCodeOutput
newCanaryCodeOutput =
CanaryCodeOutput' :: Maybe Text -> Maybe Text -> CanaryCodeOutput
CanaryCodeOutput'
{ $sel:sourceLocationArn:CanaryCodeOutput' :: Maybe Text
sourceLocationArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:handler:CanaryCodeOutput' :: Maybe Text
handler = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
canaryCodeOutput_sourceLocationArn :: Lens.Lens' CanaryCodeOutput (Prelude.Maybe Prelude.Text)
canaryCodeOutput_sourceLocationArn :: (Maybe Text -> f (Maybe Text))
-> CanaryCodeOutput -> f CanaryCodeOutput
canaryCodeOutput_sourceLocationArn = (CanaryCodeOutput -> Maybe Text)
-> (CanaryCodeOutput -> Maybe Text -> CanaryCodeOutput)
-> Lens CanaryCodeOutput CanaryCodeOutput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryCodeOutput' {Maybe Text
sourceLocationArn :: Maybe Text
$sel:sourceLocationArn:CanaryCodeOutput' :: CanaryCodeOutput -> Maybe Text
sourceLocationArn} -> Maybe Text
sourceLocationArn) (\s :: CanaryCodeOutput
s@CanaryCodeOutput' {} Maybe Text
a -> CanaryCodeOutput
s {$sel:sourceLocationArn:CanaryCodeOutput' :: Maybe Text
sourceLocationArn = Maybe Text
a} :: CanaryCodeOutput)
canaryCodeOutput_handler :: Lens.Lens' CanaryCodeOutput (Prelude.Maybe Prelude.Text)
canaryCodeOutput_handler :: (Maybe Text -> f (Maybe Text))
-> CanaryCodeOutput -> f CanaryCodeOutput
canaryCodeOutput_handler = (CanaryCodeOutput -> Maybe Text)
-> (CanaryCodeOutput -> Maybe Text -> CanaryCodeOutput)
-> Lens CanaryCodeOutput CanaryCodeOutput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryCodeOutput' {Maybe Text
handler :: Maybe Text
$sel:handler:CanaryCodeOutput' :: CanaryCodeOutput -> Maybe Text
handler} -> Maybe Text
handler) (\s :: CanaryCodeOutput
s@CanaryCodeOutput' {} Maybe Text
a -> CanaryCodeOutput
s {$sel:handler:CanaryCodeOutput' :: Maybe Text
handler = Maybe Text
a} :: CanaryCodeOutput)
instance Core.FromJSON CanaryCodeOutput where
parseJSON :: Value -> Parser CanaryCodeOutput
parseJSON =
String
-> (Object -> Parser CanaryCodeOutput)
-> Value
-> Parser CanaryCodeOutput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CanaryCodeOutput"
( \Object
x ->
Maybe Text -> Maybe Text -> CanaryCodeOutput
CanaryCodeOutput'
(Maybe Text -> Maybe Text -> CanaryCodeOutput)
-> Parser (Maybe Text) -> Parser (Maybe Text -> CanaryCodeOutput)
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
"SourceLocationArn")
Parser (Maybe Text -> CanaryCodeOutput)
-> Parser (Maybe Text) -> Parser CanaryCodeOutput
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
"Handler")
)
instance Prelude.Hashable CanaryCodeOutput
instance Prelude.NFData CanaryCodeOutput