{-# 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.KinesisAnalyticsV2.Types.CodeContentUpdate where
import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalyticsV2.Types.S3ContentLocationUpdate
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CodeContentUpdate = CodeContentUpdate'
{
CodeContentUpdate -> Maybe Text
textContentUpdate :: Prelude.Maybe Prelude.Text,
CodeContentUpdate -> Maybe Base64
zipFileContentUpdate :: Prelude.Maybe Core.Base64,
CodeContentUpdate -> Maybe S3ContentLocationUpdate
s3ContentLocationUpdate :: Prelude.Maybe S3ContentLocationUpdate
}
deriving (CodeContentUpdate -> CodeContentUpdate -> Bool
(CodeContentUpdate -> CodeContentUpdate -> Bool)
-> (CodeContentUpdate -> CodeContentUpdate -> Bool)
-> Eq CodeContentUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CodeContentUpdate -> CodeContentUpdate -> Bool
$c/= :: CodeContentUpdate -> CodeContentUpdate -> Bool
== :: CodeContentUpdate -> CodeContentUpdate -> Bool
$c== :: CodeContentUpdate -> CodeContentUpdate -> Bool
Prelude.Eq, ReadPrec [CodeContentUpdate]
ReadPrec CodeContentUpdate
Int -> ReadS CodeContentUpdate
ReadS [CodeContentUpdate]
(Int -> ReadS CodeContentUpdate)
-> ReadS [CodeContentUpdate]
-> ReadPrec CodeContentUpdate
-> ReadPrec [CodeContentUpdate]
-> Read CodeContentUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CodeContentUpdate]
$creadListPrec :: ReadPrec [CodeContentUpdate]
readPrec :: ReadPrec CodeContentUpdate
$creadPrec :: ReadPrec CodeContentUpdate
readList :: ReadS [CodeContentUpdate]
$creadList :: ReadS [CodeContentUpdate]
readsPrec :: Int -> ReadS CodeContentUpdate
$creadsPrec :: Int -> ReadS CodeContentUpdate
Prelude.Read, Int -> CodeContentUpdate -> ShowS
[CodeContentUpdate] -> ShowS
CodeContentUpdate -> String
(Int -> CodeContentUpdate -> ShowS)
-> (CodeContentUpdate -> String)
-> ([CodeContentUpdate] -> ShowS)
-> Show CodeContentUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CodeContentUpdate] -> ShowS
$cshowList :: [CodeContentUpdate] -> ShowS
show :: CodeContentUpdate -> String
$cshow :: CodeContentUpdate -> String
showsPrec :: Int -> CodeContentUpdate -> ShowS
$cshowsPrec :: Int -> CodeContentUpdate -> ShowS
Prelude.Show, (forall x. CodeContentUpdate -> Rep CodeContentUpdate x)
-> (forall x. Rep CodeContentUpdate x -> CodeContentUpdate)
-> Generic CodeContentUpdate
forall x. Rep CodeContentUpdate x -> CodeContentUpdate
forall x. CodeContentUpdate -> Rep CodeContentUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CodeContentUpdate x -> CodeContentUpdate
$cfrom :: forall x. CodeContentUpdate -> Rep CodeContentUpdate x
Prelude.Generic)
newCodeContentUpdate ::
CodeContentUpdate
newCodeContentUpdate :: CodeContentUpdate
newCodeContentUpdate =
CodeContentUpdate' :: Maybe Text
-> Maybe Base64
-> Maybe S3ContentLocationUpdate
-> CodeContentUpdate
CodeContentUpdate'
{ $sel:textContentUpdate:CodeContentUpdate' :: Maybe Text
textContentUpdate =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:zipFileContentUpdate:CodeContentUpdate' :: Maybe Base64
zipFileContentUpdate = Maybe Base64
forall a. Maybe a
Prelude.Nothing,
$sel:s3ContentLocationUpdate:CodeContentUpdate' :: Maybe S3ContentLocationUpdate
s3ContentLocationUpdate = Maybe S3ContentLocationUpdate
forall a. Maybe a
Prelude.Nothing
}
codeContentUpdate_textContentUpdate :: Lens.Lens' CodeContentUpdate (Prelude.Maybe Prelude.Text)
codeContentUpdate_textContentUpdate :: (Maybe Text -> f (Maybe Text))
-> CodeContentUpdate -> f CodeContentUpdate
codeContentUpdate_textContentUpdate = (CodeContentUpdate -> Maybe Text)
-> (CodeContentUpdate -> Maybe Text -> CodeContentUpdate)
-> Lens
CodeContentUpdate CodeContentUpdate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeContentUpdate' {Maybe Text
textContentUpdate :: Maybe Text
$sel:textContentUpdate:CodeContentUpdate' :: CodeContentUpdate -> Maybe Text
textContentUpdate} -> Maybe Text
textContentUpdate) (\s :: CodeContentUpdate
s@CodeContentUpdate' {} Maybe Text
a -> CodeContentUpdate
s {$sel:textContentUpdate:CodeContentUpdate' :: Maybe Text
textContentUpdate = Maybe Text
a} :: CodeContentUpdate)
codeContentUpdate_zipFileContentUpdate :: Lens.Lens' CodeContentUpdate (Prelude.Maybe Prelude.ByteString)
codeContentUpdate_zipFileContentUpdate :: (Maybe ByteString -> f (Maybe ByteString))
-> CodeContentUpdate -> f CodeContentUpdate
codeContentUpdate_zipFileContentUpdate = (CodeContentUpdate -> Maybe Base64)
-> (CodeContentUpdate -> Maybe Base64 -> CodeContentUpdate)
-> Lens
CodeContentUpdate CodeContentUpdate (Maybe Base64) (Maybe Base64)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeContentUpdate' {Maybe Base64
zipFileContentUpdate :: Maybe Base64
$sel:zipFileContentUpdate:CodeContentUpdate' :: CodeContentUpdate -> Maybe Base64
zipFileContentUpdate} -> Maybe Base64
zipFileContentUpdate) (\s :: CodeContentUpdate
s@CodeContentUpdate' {} Maybe Base64
a -> CodeContentUpdate
s {$sel:zipFileContentUpdate:CodeContentUpdate' :: Maybe Base64
zipFileContentUpdate = Maybe Base64
a} :: CodeContentUpdate) ((Maybe Base64 -> f (Maybe Base64))
-> CodeContentUpdate -> f CodeContentUpdate)
-> ((Maybe ByteString -> f (Maybe ByteString))
-> Maybe Base64 -> f (Maybe Base64))
-> (Maybe ByteString -> f (Maybe ByteString))
-> CodeContentUpdate
-> f CodeContentUpdate
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
codeContentUpdate_s3ContentLocationUpdate :: Lens.Lens' CodeContentUpdate (Prelude.Maybe S3ContentLocationUpdate)
codeContentUpdate_s3ContentLocationUpdate :: (Maybe S3ContentLocationUpdate
-> f (Maybe S3ContentLocationUpdate))
-> CodeContentUpdate -> f CodeContentUpdate
codeContentUpdate_s3ContentLocationUpdate = (CodeContentUpdate -> Maybe S3ContentLocationUpdate)
-> (CodeContentUpdate
-> Maybe S3ContentLocationUpdate -> CodeContentUpdate)
-> Lens
CodeContentUpdate
CodeContentUpdate
(Maybe S3ContentLocationUpdate)
(Maybe S3ContentLocationUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeContentUpdate' {Maybe S3ContentLocationUpdate
s3ContentLocationUpdate :: Maybe S3ContentLocationUpdate
$sel:s3ContentLocationUpdate:CodeContentUpdate' :: CodeContentUpdate -> Maybe S3ContentLocationUpdate
s3ContentLocationUpdate} -> Maybe S3ContentLocationUpdate
s3ContentLocationUpdate) (\s :: CodeContentUpdate
s@CodeContentUpdate' {} Maybe S3ContentLocationUpdate
a -> CodeContentUpdate
s {$sel:s3ContentLocationUpdate:CodeContentUpdate' :: Maybe S3ContentLocationUpdate
s3ContentLocationUpdate = Maybe S3ContentLocationUpdate
a} :: CodeContentUpdate)
instance Prelude.Hashable CodeContentUpdate
instance Prelude.NFData CodeContentUpdate
instance Core.ToJSON CodeContentUpdate where
toJSON :: CodeContentUpdate -> Value
toJSON CodeContentUpdate' {Maybe Text
Maybe Base64
Maybe S3ContentLocationUpdate
s3ContentLocationUpdate :: Maybe S3ContentLocationUpdate
zipFileContentUpdate :: Maybe Base64
textContentUpdate :: Maybe Text
$sel:s3ContentLocationUpdate:CodeContentUpdate' :: CodeContentUpdate -> Maybe S3ContentLocationUpdate
$sel:zipFileContentUpdate:CodeContentUpdate' :: CodeContentUpdate -> Maybe Base64
$sel:textContentUpdate:CodeContentUpdate' :: CodeContentUpdate -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"TextContentUpdate" 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
textContentUpdate,
(Text
"ZipFileContentUpdate" 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
zipFileContentUpdate,
(Text
"S3ContentLocationUpdate" Text -> S3ContentLocationUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(S3ContentLocationUpdate -> Pair)
-> Maybe S3ContentLocationUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3ContentLocationUpdate
s3ContentLocationUpdate
]
)