{-# 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.ApplicationCodeConfiguration where
import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalyticsV2.Types.CodeContent
import Amazonka.KinesisAnalyticsV2.Types.CodeContentType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ApplicationCodeConfiguration = ApplicationCodeConfiguration'
{
ApplicationCodeConfiguration -> Maybe CodeContent
codeContent :: Prelude.Maybe CodeContent,
ApplicationCodeConfiguration -> CodeContentType
codeContentType :: CodeContentType
}
deriving (ApplicationCodeConfiguration
-> ApplicationCodeConfiguration -> Bool
(ApplicationCodeConfiguration
-> ApplicationCodeConfiguration -> Bool)
-> (ApplicationCodeConfiguration
-> ApplicationCodeConfiguration -> Bool)
-> Eq ApplicationCodeConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplicationCodeConfiguration
-> ApplicationCodeConfiguration -> Bool
$c/= :: ApplicationCodeConfiguration
-> ApplicationCodeConfiguration -> Bool
== :: ApplicationCodeConfiguration
-> ApplicationCodeConfiguration -> Bool
$c== :: ApplicationCodeConfiguration
-> ApplicationCodeConfiguration -> Bool
Prelude.Eq, ReadPrec [ApplicationCodeConfiguration]
ReadPrec ApplicationCodeConfiguration
Int -> ReadS ApplicationCodeConfiguration
ReadS [ApplicationCodeConfiguration]
(Int -> ReadS ApplicationCodeConfiguration)
-> ReadS [ApplicationCodeConfiguration]
-> ReadPrec ApplicationCodeConfiguration
-> ReadPrec [ApplicationCodeConfiguration]
-> Read ApplicationCodeConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplicationCodeConfiguration]
$creadListPrec :: ReadPrec [ApplicationCodeConfiguration]
readPrec :: ReadPrec ApplicationCodeConfiguration
$creadPrec :: ReadPrec ApplicationCodeConfiguration
readList :: ReadS [ApplicationCodeConfiguration]
$creadList :: ReadS [ApplicationCodeConfiguration]
readsPrec :: Int -> ReadS ApplicationCodeConfiguration
$creadsPrec :: Int -> ReadS ApplicationCodeConfiguration
Prelude.Read, Int -> ApplicationCodeConfiguration -> ShowS
[ApplicationCodeConfiguration] -> ShowS
ApplicationCodeConfiguration -> String
(Int -> ApplicationCodeConfiguration -> ShowS)
-> (ApplicationCodeConfiguration -> String)
-> ([ApplicationCodeConfiguration] -> ShowS)
-> Show ApplicationCodeConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplicationCodeConfiguration] -> ShowS
$cshowList :: [ApplicationCodeConfiguration] -> ShowS
show :: ApplicationCodeConfiguration -> String
$cshow :: ApplicationCodeConfiguration -> String
showsPrec :: Int -> ApplicationCodeConfiguration -> ShowS
$cshowsPrec :: Int -> ApplicationCodeConfiguration -> ShowS
Prelude.Show, (forall x.
ApplicationCodeConfiguration -> Rep ApplicationCodeConfiguration x)
-> (forall x.
Rep ApplicationCodeConfiguration x -> ApplicationCodeConfiguration)
-> Generic ApplicationCodeConfiguration
forall x.
Rep ApplicationCodeConfiguration x -> ApplicationCodeConfiguration
forall x.
ApplicationCodeConfiguration -> Rep ApplicationCodeConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ApplicationCodeConfiguration x -> ApplicationCodeConfiguration
$cfrom :: forall x.
ApplicationCodeConfiguration -> Rep ApplicationCodeConfiguration x
Prelude.Generic)
newApplicationCodeConfiguration ::
CodeContentType ->
ApplicationCodeConfiguration
newApplicationCodeConfiguration :: CodeContentType -> ApplicationCodeConfiguration
newApplicationCodeConfiguration CodeContentType
pCodeContentType_ =
ApplicationCodeConfiguration' :: Maybe CodeContent
-> CodeContentType -> ApplicationCodeConfiguration
ApplicationCodeConfiguration'
{ $sel:codeContent:ApplicationCodeConfiguration' :: Maybe CodeContent
codeContent =
Maybe CodeContent
forall a. Maybe a
Prelude.Nothing,
$sel:codeContentType:ApplicationCodeConfiguration' :: CodeContentType
codeContentType = CodeContentType
pCodeContentType_
}
applicationCodeConfiguration_codeContent :: Lens.Lens' ApplicationCodeConfiguration (Prelude.Maybe CodeContent)
applicationCodeConfiguration_codeContent :: (Maybe CodeContent -> f (Maybe CodeContent))
-> ApplicationCodeConfiguration -> f ApplicationCodeConfiguration
applicationCodeConfiguration_codeContent = (ApplicationCodeConfiguration -> Maybe CodeContent)
-> (ApplicationCodeConfiguration
-> Maybe CodeContent -> ApplicationCodeConfiguration)
-> Lens
ApplicationCodeConfiguration
ApplicationCodeConfiguration
(Maybe CodeContent)
(Maybe CodeContent)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationCodeConfiguration' {Maybe CodeContent
codeContent :: Maybe CodeContent
$sel:codeContent:ApplicationCodeConfiguration' :: ApplicationCodeConfiguration -> Maybe CodeContent
codeContent} -> Maybe CodeContent
codeContent) (\s :: ApplicationCodeConfiguration
s@ApplicationCodeConfiguration' {} Maybe CodeContent
a -> ApplicationCodeConfiguration
s {$sel:codeContent:ApplicationCodeConfiguration' :: Maybe CodeContent
codeContent = Maybe CodeContent
a} :: ApplicationCodeConfiguration)
applicationCodeConfiguration_codeContentType :: Lens.Lens' ApplicationCodeConfiguration CodeContentType
applicationCodeConfiguration_codeContentType :: (CodeContentType -> f CodeContentType)
-> ApplicationCodeConfiguration -> f ApplicationCodeConfiguration
applicationCodeConfiguration_codeContentType = (ApplicationCodeConfiguration -> CodeContentType)
-> (ApplicationCodeConfiguration
-> CodeContentType -> ApplicationCodeConfiguration)
-> Lens
ApplicationCodeConfiguration
ApplicationCodeConfiguration
CodeContentType
CodeContentType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationCodeConfiguration' {CodeContentType
codeContentType :: CodeContentType
$sel:codeContentType:ApplicationCodeConfiguration' :: ApplicationCodeConfiguration -> CodeContentType
codeContentType} -> CodeContentType
codeContentType) (\s :: ApplicationCodeConfiguration
s@ApplicationCodeConfiguration' {} CodeContentType
a -> ApplicationCodeConfiguration
s {$sel:codeContentType:ApplicationCodeConfiguration' :: CodeContentType
codeContentType = CodeContentType
a} :: ApplicationCodeConfiguration)
instance
Prelude.Hashable
ApplicationCodeConfiguration
instance Prelude.NFData ApplicationCodeConfiguration
instance Core.ToJSON ApplicationCodeConfiguration where
toJSON :: ApplicationCodeConfiguration -> Value
toJSON ApplicationCodeConfiguration' {Maybe CodeContent
CodeContentType
codeContentType :: CodeContentType
codeContent :: Maybe CodeContent
$sel:codeContentType:ApplicationCodeConfiguration' :: ApplicationCodeConfiguration -> CodeContentType
$sel:codeContent:ApplicationCodeConfiguration' :: ApplicationCodeConfiguration -> Maybe CodeContent
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"CodeContent" Text -> CodeContent -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CodeContent -> Pair) -> Maybe CodeContent -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CodeContent
codeContent,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"CodeContentType" Text -> CodeContentType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= CodeContentType
codeContentType)
]
)