{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data CanaryCodeInput = CanaryCodeInput'
{
CanaryCodeInput -> Maybe Text
s3Bucket :: Prelude.Maybe Prelude.Text,
CanaryCodeInput -> Maybe Text
s3Key :: Prelude.Maybe Prelude.Text,
CanaryCodeInput -> Maybe Text
s3Version :: Prelude.Maybe Prelude.Text,
CanaryCodeInput -> Maybe Base64
zipFile :: Prelude.Maybe Data.Base64,
CanaryCodeInput -> Text
handler :: Prelude.Text
}
deriving (CanaryCodeInput -> CanaryCodeInput -> Bool
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]
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
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. 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'
{ $sel:s3Bucket:CanaryCodeInput' :: Maybe Text
s3Bucket = forall a. Maybe a
Prelude.Nothing,
$sel:s3Key:CanaryCodeInput' :: Maybe Text
s3Key = forall a. Maybe a
Prelude.Nothing,
$sel:s3Version:CanaryCodeInput' :: Maybe Text
s3Version = forall a. Maybe a
Prelude.Nothing,
$sel:zipFile:CanaryCodeInput' :: Maybe Base64
zipFile = forall a. Maybe a
Prelude.Nothing,
$sel:handler:CanaryCodeInput' :: Text
handler = Text
pHandler_
}
canaryCodeInput_s3Bucket :: Lens.Lens' CanaryCodeInput (Prelude.Maybe Prelude.Text)
canaryCodeInput_s3Bucket :: Lens' CanaryCodeInput (Maybe Text)
canaryCodeInput_s3Bucket = 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_s3Key :: Lens.Lens' CanaryCodeInput (Prelude.Maybe Prelude.Text)
canaryCodeInput_s3Key :: Lens' CanaryCodeInput (Maybe Text)
canaryCodeInput_s3Key = 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 :: Lens' CanaryCodeInput (Maybe Text)
canaryCodeInput_s3Version = 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 :: Lens' CanaryCodeInput (Maybe ByteString)
canaryCodeInput_zipFile = 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) 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 Iso' Base64 ByteString
Data._Base64
canaryCodeInput_handler :: Lens.Lens' CanaryCodeInput Prelude.Text
canaryCodeInput_handler :: Lens' CanaryCodeInput Text
canaryCodeInput_handler = 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 where
hashWithSalt :: Int -> CanaryCodeInput -> Int
hashWithSalt Int
_salt CanaryCodeInput' {Maybe Text
Maybe Base64
Text
handler :: Text
zipFile :: Maybe Base64
s3Version :: Maybe Text
s3Key :: Maybe Text
s3Bucket :: Maybe Text
$sel:handler:CanaryCodeInput' :: CanaryCodeInput -> Text
$sel:zipFile:CanaryCodeInput' :: CanaryCodeInput -> Maybe Base64
$sel:s3Version:CanaryCodeInput' :: CanaryCodeInput -> Maybe Text
$sel:s3Key:CanaryCodeInput' :: CanaryCodeInput -> Maybe Text
$sel:s3Bucket:CanaryCodeInput' :: CanaryCodeInput -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3Bucket
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3Key
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3Version
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Base64
zipFile
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
handler
instance Prelude.NFData CanaryCodeInput where
rnf :: CanaryCodeInput -> ()
rnf CanaryCodeInput' {Maybe Text
Maybe Base64
Text
handler :: Text
zipFile :: Maybe Base64
s3Version :: Maybe Text
s3Key :: Maybe Text
s3Bucket :: Maybe Text
$sel:handler:CanaryCodeInput' :: CanaryCodeInput -> Text
$sel:zipFile:CanaryCodeInput' :: CanaryCodeInput -> Maybe Base64
$sel:s3Version:CanaryCodeInput' :: CanaryCodeInput -> Maybe Text
$sel:s3Key:CanaryCodeInput' :: CanaryCodeInput -> Maybe Text
$sel:s3Bucket:CanaryCodeInput' :: CanaryCodeInput -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3Bucket
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3Key
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3Version
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Base64
zipFile
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
handler
instance Data.ToJSON CanaryCodeInput where
toJSON :: CanaryCodeInput -> Value
toJSON CanaryCodeInput' {Maybe Text
Maybe Base64
Text
handler :: Text
zipFile :: Maybe Base64
s3Version :: Maybe Text
s3Key :: Maybe Text
s3Bucket :: Maybe Text
$sel:handler:CanaryCodeInput' :: CanaryCodeInput -> Text
$sel:zipFile:CanaryCodeInput' :: CanaryCodeInput -> Maybe Base64
$sel:s3Version:CanaryCodeInput' :: CanaryCodeInput -> Maybe Text
$sel:s3Key:CanaryCodeInput' :: CanaryCodeInput -> Maybe Text
$sel:s3Bucket:CanaryCodeInput' :: CanaryCodeInput -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"S3Bucket" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
s3Bucket,
(Key
"S3Key" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
s3Key,
(Key
"S3Version" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
s3Version,
(Key
"ZipFile" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Base64
zipFile,
forall a. a -> Maybe a
Prelude.Just (Key
"Handler" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
handler)
]
)