{-# 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.CanaryCodeInput where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CanaryCodeInput = CanaryCodeInput'
{
CanaryCodeInput -> Maybe Text
s3Key :: Prelude.Maybe Prelude.Text,
CanaryCodeInput -> Maybe Text
s3Version :: Prelude.Maybe Prelude.Text,
CanaryCodeInput -> Maybe Base64
zipFile :: Prelude.Maybe Core.Base64,
CanaryCodeInput -> Maybe Text
s3Bucket :: Prelude.Maybe Prelude.Text,
CanaryCodeInput -> Text
handler :: Prelude.Text
}
deriving (CanaryCodeInput -> CanaryCodeInput -> Bool
(CanaryCodeInput -> CanaryCodeInput -> Bool)
-> (CanaryCodeInput -> CanaryCodeInput -> Bool)
-> Eq CanaryCodeInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CanaryCodeInput -> CanaryCodeInput -> Bool
$c/= :: CanaryCodeInput -> CanaryCodeInput -> Bool
== :: CanaryCodeInput -> CanaryCodeInput -> Bool
$c== :: CanaryCodeInput -> CanaryCodeInput -> Bool
Prelude.Eq, ReadPrec [CanaryCodeInput]
ReadPrec CanaryCodeInput
Int -> ReadS CanaryCodeInput
ReadS [CanaryCodeInput]
(Int -> ReadS CanaryCodeInput)
-> ReadS [CanaryCodeInput]
-> ReadPrec CanaryCodeInput
-> ReadPrec [CanaryCodeInput]
-> Read CanaryCodeInput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CanaryCodeInput]
$creadListPrec :: ReadPrec [CanaryCodeInput]
readPrec :: ReadPrec CanaryCodeInput
$creadPrec :: ReadPrec CanaryCodeInput
readList :: ReadS [CanaryCodeInput]
$creadList :: ReadS [CanaryCodeInput]
readsPrec :: Int -> ReadS CanaryCodeInput
$creadsPrec :: Int -> ReadS CanaryCodeInput
Prelude.Read, Int -> CanaryCodeInput -> ShowS
[CanaryCodeInput] -> ShowS
CanaryCodeInput -> String
(Int -> CanaryCodeInput -> ShowS)
-> (CanaryCodeInput -> String)
-> ([CanaryCodeInput] -> ShowS)
-> Show CanaryCodeInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CanaryCodeInput] -> ShowS
$cshowList :: [CanaryCodeInput] -> ShowS
show :: CanaryCodeInput -> String
$cshow :: CanaryCodeInput -> String
showsPrec :: Int -> CanaryCodeInput -> ShowS
$cshowsPrec :: Int -> CanaryCodeInput -> ShowS
Prelude.Show, (forall x. CanaryCodeInput -> Rep CanaryCodeInput x)
-> (forall x. Rep CanaryCodeInput x -> CanaryCodeInput)
-> Generic CanaryCodeInput
forall x. Rep CanaryCodeInput x -> CanaryCodeInput
forall x. CanaryCodeInput -> Rep CanaryCodeInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CanaryCodeInput x -> CanaryCodeInput
$cfrom :: forall x. CanaryCodeInput -> Rep CanaryCodeInput x
Prelude.Generic)
newCanaryCodeInput ::
Prelude.Text ->
CanaryCodeInput
newCanaryCodeInput :: Text -> CanaryCodeInput
newCanaryCodeInput Text
pHandler_ =
CanaryCodeInput' :: Maybe Text
-> Maybe Text
-> Maybe Base64
-> Maybe Text
-> Text
-> CanaryCodeInput
CanaryCodeInput'
{ $sel:s3Key:CanaryCodeInput' :: Maybe Text
s3Key = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3Version:CanaryCodeInput' :: Maybe Text
s3Version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:zipFile:CanaryCodeInput' :: Maybe Base64
zipFile = Maybe Base64
forall a. Maybe a
Prelude.Nothing,
$sel:s3Bucket:CanaryCodeInput' :: Maybe Text
s3Bucket = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:handler:CanaryCodeInput' :: Text
handler = Text
pHandler_
}
canaryCodeInput_s3Key :: Lens.Lens' CanaryCodeInput (Prelude.Maybe Prelude.Text)
canaryCodeInput_s3Key :: (Maybe Text -> f (Maybe Text))
-> CanaryCodeInput -> f CanaryCodeInput
canaryCodeInput_s3Key = (CanaryCodeInput -> Maybe Text)
-> (CanaryCodeInput -> Maybe Text -> CanaryCodeInput)
-> Lens CanaryCodeInput CanaryCodeInput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryCodeInput' {Maybe Text
s3Key :: Maybe Text
$sel:s3Key:CanaryCodeInput' :: CanaryCodeInput -> Maybe Text
s3Key} -> Maybe Text
s3Key) (\s :: CanaryCodeInput
s@CanaryCodeInput' {} Maybe Text
a -> CanaryCodeInput
s {$sel:s3Key:CanaryCodeInput' :: Maybe Text
s3Key = Maybe Text
a} :: CanaryCodeInput)
canaryCodeInput_s3Version :: Lens.Lens' CanaryCodeInput (Prelude.Maybe Prelude.Text)
canaryCodeInput_s3Version :: (Maybe Text -> f (Maybe Text))
-> CanaryCodeInput -> f CanaryCodeInput
canaryCodeInput_s3Version = (CanaryCodeInput -> Maybe Text)
-> (CanaryCodeInput -> Maybe Text -> CanaryCodeInput)
-> Lens CanaryCodeInput CanaryCodeInput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryCodeInput' {Maybe Text
s3Version :: Maybe Text
$sel:s3Version:CanaryCodeInput' :: CanaryCodeInput -> Maybe Text
s3Version} -> Maybe Text
s3Version) (\s :: CanaryCodeInput
s@CanaryCodeInput' {} Maybe Text
a -> CanaryCodeInput
s {$sel:s3Version:CanaryCodeInput' :: Maybe Text
s3Version = Maybe Text
a} :: CanaryCodeInput)
canaryCodeInput_zipFile :: Lens.Lens' CanaryCodeInput (Prelude.Maybe Prelude.ByteString)
canaryCodeInput_zipFile :: (Maybe ByteString -> f (Maybe ByteString))
-> CanaryCodeInput -> f CanaryCodeInput
canaryCodeInput_zipFile = (CanaryCodeInput -> Maybe Base64)
-> (CanaryCodeInput -> Maybe Base64 -> CanaryCodeInput)
-> Lens
CanaryCodeInput CanaryCodeInput (Maybe Base64) (Maybe Base64)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryCodeInput' {Maybe Base64
zipFile :: Maybe Base64
$sel:zipFile:CanaryCodeInput' :: CanaryCodeInput -> Maybe Base64
zipFile} -> Maybe Base64
zipFile) (\s :: CanaryCodeInput
s@CanaryCodeInput' {} Maybe Base64
a -> CanaryCodeInput
s {$sel:zipFile:CanaryCodeInput' :: Maybe Base64
zipFile = Maybe Base64
a} :: CanaryCodeInput) ((Maybe Base64 -> f (Maybe Base64))
-> CanaryCodeInput -> f CanaryCodeInput)
-> ((Maybe ByteString -> f (Maybe ByteString))
-> Maybe Base64 -> f (Maybe Base64))
-> (Maybe ByteString -> f (Maybe ByteString))
-> CanaryCodeInput
-> f CanaryCodeInput
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso Base64 Base64 ByteString ByteString
-> Iso
(Maybe Base64) (Maybe Base64) (Maybe ByteString) (Maybe ByteString)
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 Base64 Base64 ByteString ByteString
Iso' Base64 ByteString
Core._Base64
canaryCodeInput_s3Bucket :: Lens.Lens' CanaryCodeInput (Prelude.Maybe Prelude.Text)
canaryCodeInput_s3Bucket :: (Maybe Text -> f (Maybe Text))
-> CanaryCodeInput -> f CanaryCodeInput
canaryCodeInput_s3Bucket = (CanaryCodeInput -> Maybe Text)
-> (CanaryCodeInput -> Maybe Text -> CanaryCodeInput)
-> Lens CanaryCodeInput CanaryCodeInput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryCodeInput' {Maybe Text
s3Bucket :: Maybe Text
$sel:s3Bucket:CanaryCodeInput' :: CanaryCodeInput -> Maybe Text
s3Bucket} -> Maybe Text
s3Bucket) (\s :: CanaryCodeInput
s@CanaryCodeInput' {} Maybe Text
a -> CanaryCodeInput
s {$sel:s3Bucket:CanaryCodeInput' :: Maybe Text
s3Bucket = Maybe Text
a} :: CanaryCodeInput)
canaryCodeInput_handler :: Lens.Lens' CanaryCodeInput Prelude.Text
canaryCodeInput_handler :: (Text -> f Text) -> CanaryCodeInput -> f CanaryCodeInput
canaryCodeInput_handler = (CanaryCodeInput -> Text)
-> (CanaryCodeInput -> Text -> CanaryCodeInput)
-> Lens CanaryCodeInput CanaryCodeInput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryCodeInput' {Text
handler :: Text
$sel:handler:CanaryCodeInput' :: CanaryCodeInput -> Text
handler} -> Text
handler) (\s :: CanaryCodeInput
s@CanaryCodeInput' {} Text
a -> CanaryCodeInput
s {$sel:handler:CanaryCodeInput' :: Text
handler = Text
a} :: CanaryCodeInput)
instance Prelude.Hashable CanaryCodeInput
instance Prelude.NFData CanaryCodeInput
instance Core.ToJSON CanaryCodeInput where
toJSON :: CanaryCodeInput -> Value
toJSON CanaryCodeInput' {Maybe Text
Maybe Base64
Text
handler :: Text
s3Bucket :: Maybe Text
zipFile :: Maybe Base64
s3Version :: Maybe Text
s3Key :: Maybe Text
$sel:handler:CanaryCodeInput' :: CanaryCodeInput -> Text
$sel:s3Bucket:CanaryCodeInput' :: CanaryCodeInput -> Maybe Text
$sel:zipFile:CanaryCodeInput' :: CanaryCodeInput -> Maybe Base64
$sel:s3Version:CanaryCodeInput' :: CanaryCodeInput -> Maybe Text
$sel:s3Key:CanaryCodeInput' :: CanaryCodeInput -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"S3Key" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
s3Key,
(Text
"S3Version" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
s3Version,
(Text
"ZipFile" Text -> Base64 -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Base64 -> Pair) -> Maybe Base64 -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Base64
zipFile,
(Text
"S3Bucket" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
s3Bucket,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Handler" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
handler)
]
)