{-# 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.AppRunner.Types.CodeConfigurationValues where
import Amazonka.AppRunner.Types.Runtime
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CodeConfigurationValues = CodeConfigurationValues'
{
CodeConfigurationValues -> Maybe (Sensitive Text)
startCommand :: Prelude.Maybe (Core.Sensitive Prelude.Text),
CodeConfigurationValues -> Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentVariables :: Prelude.Maybe (Prelude.HashMap Prelude.Text (Core.Sensitive Prelude.Text)),
CodeConfigurationValues -> Maybe (Sensitive Text)
buildCommand :: Prelude.Maybe (Core.Sensitive Prelude.Text),
CodeConfigurationValues -> Maybe Text
port :: Prelude.Maybe Prelude.Text,
CodeConfigurationValues -> Runtime
runtime :: Runtime
}
deriving (CodeConfigurationValues -> CodeConfigurationValues -> Bool
(CodeConfigurationValues -> CodeConfigurationValues -> Bool)
-> (CodeConfigurationValues -> CodeConfigurationValues -> Bool)
-> Eq CodeConfigurationValues
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CodeConfigurationValues -> CodeConfigurationValues -> Bool
$c/= :: CodeConfigurationValues -> CodeConfigurationValues -> Bool
== :: CodeConfigurationValues -> CodeConfigurationValues -> Bool
$c== :: CodeConfigurationValues -> CodeConfigurationValues -> Bool
Prelude.Eq, Int -> CodeConfigurationValues -> ShowS
[CodeConfigurationValues] -> ShowS
CodeConfigurationValues -> String
(Int -> CodeConfigurationValues -> ShowS)
-> (CodeConfigurationValues -> String)
-> ([CodeConfigurationValues] -> ShowS)
-> Show CodeConfigurationValues
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CodeConfigurationValues] -> ShowS
$cshowList :: [CodeConfigurationValues] -> ShowS
show :: CodeConfigurationValues -> String
$cshow :: CodeConfigurationValues -> String
showsPrec :: Int -> CodeConfigurationValues -> ShowS
$cshowsPrec :: Int -> CodeConfigurationValues -> ShowS
Prelude.Show, (forall x.
CodeConfigurationValues -> Rep CodeConfigurationValues x)
-> (forall x.
Rep CodeConfigurationValues x -> CodeConfigurationValues)
-> Generic CodeConfigurationValues
forall x. Rep CodeConfigurationValues x -> CodeConfigurationValues
forall x. CodeConfigurationValues -> Rep CodeConfigurationValues x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CodeConfigurationValues x -> CodeConfigurationValues
$cfrom :: forall x. CodeConfigurationValues -> Rep CodeConfigurationValues x
Prelude.Generic)
newCodeConfigurationValues ::
Runtime ->
CodeConfigurationValues
newCodeConfigurationValues :: Runtime -> CodeConfigurationValues
newCodeConfigurationValues Runtime
pRuntime_ =
CodeConfigurationValues' :: Maybe (Sensitive Text)
-> Maybe (HashMap Text (Sensitive Text))
-> Maybe (Sensitive Text)
-> Maybe Text
-> Runtime
-> CodeConfigurationValues
CodeConfigurationValues'
{ $sel:startCommand:CodeConfigurationValues' :: Maybe (Sensitive Text)
startCommand =
Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:runtimeEnvironmentVariables:CodeConfigurationValues' :: Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentVariables = Maybe (HashMap Text (Sensitive Text))
forall a. Maybe a
Prelude.Nothing,
$sel:buildCommand:CodeConfigurationValues' :: Maybe (Sensitive Text)
buildCommand = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:port:CodeConfigurationValues' :: Maybe Text
port = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:runtime:CodeConfigurationValues' :: Runtime
runtime = Runtime
pRuntime_
}
codeConfigurationValues_startCommand :: Lens.Lens' CodeConfigurationValues (Prelude.Maybe Prelude.Text)
codeConfigurationValues_startCommand :: (Maybe Text -> f (Maybe Text))
-> CodeConfigurationValues -> f CodeConfigurationValues
codeConfigurationValues_startCommand = (CodeConfigurationValues -> Maybe (Sensitive Text))
-> (CodeConfigurationValues
-> Maybe (Sensitive Text) -> CodeConfigurationValues)
-> Lens
CodeConfigurationValues
CodeConfigurationValues
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeConfigurationValues' {Maybe (Sensitive Text)
startCommand :: Maybe (Sensitive Text)
$sel:startCommand:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (Sensitive Text)
startCommand} -> Maybe (Sensitive Text)
startCommand) (\s :: CodeConfigurationValues
s@CodeConfigurationValues' {} Maybe (Sensitive Text)
a -> CodeConfigurationValues
s {$sel:startCommand:CodeConfigurationValues' :: Maybe (Sensitive Text)
startCommand = Maybe (Sensitive Text)
a} :: CodeConfigurationValues) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> CodeConfigurationValues -> f CodeConfigurationValues)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CodeConfigurationValues
-> f CodeConfigurationValues
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
codeConfigurationValues_runtimeEnvironmentVariables :: Lens.Lens' CodeConfigurationValues (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
codeConfigurationValues_runtimeEnvironmentVariables :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CodeConfigurationValues -> f CodeConfigurationValues
codeConfigurationValues_runtimeEnvironmentVariables = (CodeConfigurationValues -> Maybe (HashMap Text (Sensitive Text)))
-> (CodeConfigurationValues
-> Maybe (HashMap Text (Sensitive Text))
-> CodeConfigurationValues)
-> Lens
CodeConfigurationValues
CodeConfigurationValues
(Maybe (HashMap Text (Sensitive Text)))
(Maybe (HashMap Text (Sensitive Text)))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeConfigurationValues' {Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentVariables :: Maybe (HashMap Text (Sensitive Text))
$sel:runtimeEnvironmentVariables:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentVariables} -> Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentVariables) (\s :: CodeConfigurationValues
s@CodeConfigurationValues' {} Maybe (HashMap Text (Sensitive Text))
a -> CodeConfigurationValues
s {$sel:runtimeEnvironmentVariables:CodeConfigurationValues' :: Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentVariables = Maybe (HashMap Text (Sensitive Text))
a} :: CodeConfigurationValues) ((Maybe (HashMap Text (Sensitive Text))
-> f (Maybe (HashMap Text (Sensitive Text))))
-> CodeConfigurationValues -> f CodeConfigurationValues)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text (Sensitive Text))
-> f (Maybe (HashMap Text (Sensitive Text))))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CodeConfigurationValues
-> f CodeConfigurationValues
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text (Sensitive Text))
(HashMap Text (Sensitive Text))
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text (Sensitive Text)))
(Maybe (HashMap Text (Sensitive Text)))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text (Sensitive Text))
(HashMap Text (Sensitive Text))
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
codeConfigurationValues_buildCommand :: Lens.Lens' CodeConfigurationValues (Prelude.Maybe Prelude.Text)
codeConfigurationValues_buildCommand :: (Maybe Text -> f (Maybe Text))
-> CodeConfigurationValues -> f CodeConfigurationValues
codeConfigurationValues_buildCommand = (CodeConfigurationValues -> Maybe (Sensitive Text))
-> (CodeConfigurationValues
-> Maybe (Sensitive Text) -> CodeConfigurationValues)
-> Lens
CodeConfigurationValues
CodeConfigurationValues
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeConfigurationValues' {Maybe (Sensitive Text)
buildCommand :: Maybe (Sensitive Text)
$sel:buildCommand:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (Sensitive Text)
buildCommand} -> Maybe (Sensitive Text)
buildCommand) (\s :: CodeConfigurationValues
s@CodeConfigurationValues' {} Maybe (Sensitive Text)
a -> CodeConfigurationValues
s {$sel:buildCommand:CodeConfigurationValues' :: Maybe (Sensitive Text)
buildCommand = Maybe (Sensitive Text)
a} :: CodeConfigurationValues) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> CodeConfigurationValues -> f CodeConfigurationValues)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CodeConfigurationValues
-> f CodeConfigurationValues
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
codeConfigurationValues_port :: Lens.Lens' CodeConfigurationValues (Prelude.Maybe Prelude.Text)
codeConfigurationValues_port :: (Maybe Text -> f (Maybe Text))
-> CodeConfigurationValues -> f CodeConfigurationValues
codeConfigurationValues_port = (CodeConfigurationValues -> Maybe Text)
-> (CodeConfigurationValues
-> Maybe Text -> CodeConfigurationValues)
-> Lens
CodeConfigurationValues
CodeConfigurationValues
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeConfigurationValues' {Maybe Text
port :: Maybe Text
$sel:port:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe Text
port} -> Maybe Text
port) (\s :: CodeConfigurationValues
s@CodeConfigurationValues' {} Maybe Text
a -> CodeConfigurationValues
s {$sel:port:CodeConfigurationValues' :: Maybe Text
port = Maybe Text
a} :: CodeConfigurationValues)
codeConfigurationValues_runtime :: Lens.Lens' CodeConfigurationValues Runtime
codeConfigurationValues_runtime :: (Runtime -> f Runtime)
-> CodeConfigurationValues -> f CodeConfigurationValues
codeConfigurationValues_runtime = (CodeConfigurationValues -> Runtime)
-> (CodeConfigurationValues -> Runtime -> CodeConfigurationValues)
-> Lens
CodeConfigurationValues CodeConfigurationValues Runtime Runtime
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeConfigurationValues' {Runtime
runtime :: Runtime
$sel:runtime:CodeConfigurationValues' :: CodeConfigurationValues -> Runtime
runtime} -> Runtime
runtime) (\s :: CodeConfigurationValues
s@CodeConfigurationValues' {} Runtime
a -> CodeConfigurationValues
s {$sel:runtime:CodeConfigurationValues' :: Runtime
runtime = Runtime
a} :: CodeConfigurationValues)
instance Core.FromJSON CodeConfigurationValues where
parseJSON :: Value -> Parser CodeConfigurationValues
parseJSON =
String
-> (Object -> Parser CodeConfigurationValues)
-> Value
-> Parser CodeConfigurationValues
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CodeConfigurationValues"
( \Object
x ->
Maybe (Sensitive Text)
-> Maybe (HashMap Text (Sensitive Text))
-> Maybe (Sensitive Text)
-> Maybe Text
-> Runtime
-> CodeConfigurationValues
CodeConfigurationValues'
(Maybe (Sensitive Text)
-> Maybe (HashMap Text (Sensitive Text))
-> Maybe (Sensitive Text)
-> Maybe Text
-> Runtime
-> CodeConfigurationValues)
-> Parser (Maybe (Sensitive Text))
-> Parser
(Maybe (HashMap Text (Sensitive Text))
-> Maybe (Sensitive Text)
-> Maybe Text
-> Runtime
-> CodeConfigurationValues)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StartCommand")
Parser
(Maybe (HashMap Text (Sensitive Text))
-> Maybe (Sensitive Text)
-> Maybe Text
-> Runtime
-> CodeConfigurationValues)
-> Parser (Maybe (HashMap Text (Sensitive Text)))
-> Parser
(Maybe (Sensitive Text)
-> Maybe Text -> Runtime -> CodeConfigurationValues)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Parser (Maybe (Maybe (HashMap Text (Sensitive Text))))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RuntimeEnvironmentVariables"
Parser (Maybe (Maybe (HashMap Text (Sensitive Text))))
-> Maybe (HashMap Text (Sensitive Text))
-> Parser (Maybe (HashMap Text (Sensitive Text)))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text (Sensitive Text))
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe (Sensitive Text)
-> Maybe Text -> Runtime -> CodeConfigurationValues)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe Text -> Runtime -> CodeConfigurationValues)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BuildCommand")
Parser (Maybe Text -> Runtime -> CodeConfigurationValues)
-> Parser (Maybe Text)
-> Parser (Runtime -> CodeConfigurationValues)
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
"Port")
Parser (Runtime -> CodeConfigurationValues)
-> Parser Runtime -> Parser CodeConfigurationValues
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Runtime
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Runtime")
)
instance Prelude.Hashable CodeConfigurationValues
instance Prelude.NFData CodeConfigurationValues
instance Core.ToJSON CodeConfigurationValues where
toJSON :: CodeConfigurationValues -> Value
toJSON CodeConfigurationValues' {Maybe Text
Maybe (HashMap Text (Sensitive Text))
Maybe (Sensitive Text)
Runtime
runtime :: Runtime
port :: Maybe Text
buildCommand :: Maybe (Sensitive Text)
runtimeEnvironmentVariables :: Maybe (HashMap Text (Sensitive Text))
startCommand :: Maybe (Sensitive Text)
$sel:runtime:CodeConfigurationValues' :: CodeConfigurationValues -> Runtime
$sel:port:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe Text
$sel:buildCommand:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (Sensitive Text)
$sel:runtimeEnvironmentVariables:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (HashMap Text (Sensitive Text))
$sel:startCommand:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"StartCommand" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
startCommand,
(Text
"RuntimeEnvironmentVariables" Text -> HashMap Text (Sensitive Text) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HashMap Text (Sensitive Text) -> Pair)
-> Maybe (HashMap Text (Sensitive Text)) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentVariables,
(Text
"BuildCommand" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
buildCommand,
(Text
"Port" 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
port,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Runtime" Text -> Runtime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Runtime
runtime)
]
)