{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data CodeConfigurationValues = CodeConfigurationValues'
{
CodeConfigurationValues -> Maybe (Sensitive Text)
buildCommand :: Prelude.Maybe (Data.Sensitive Prelude.Text),
CodeConfigurationValues -> Maybe Text
port :: Prelude.Maybe Prelude.Text,
CodeConfigurationValues -> Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets :: Prelude.Maybe (Prelude.HashMap Prelude.Text (Data.Sensitive Prelude.Text)),
CodeConfigurationValues -> Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentVariables :: Prelude.Maybe (Prelude.HashMap Prelude.Text (Data.Sensitive Prelude.Text)),
CodeConfigurationValues -> Maybe (Sensitive Text)
startCommand :: Prelude.Maybe (Data.Sensitive Prelude.Text),
CodeConfigurationValues -> Runtime
runtime :: Runtime
}
deriving (CodeConfigurationValues -> CodeConfigurationValues -> Bool
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
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. 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'
{ $sel:buildCommand:CodeConfigurationValues' :: Maybe (Sensitive Text)
buildCommand =
forall a. Maybe a
Prelude.Nothing,
$sel:port:CodeConfigurationValues' :: Maybe Text
port = forall a. Maybe a
Prelude.Nothing,
$sel:runtimeEnvironmentSecrets:CodeConfigurationValues' :: Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets = forall a. Maybe a
Prelude.Nothing,
$sel:runtimeEnvironmentVariables:CodeConfigurationValues' :: Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentVariables = forall a. Maybe a
Prelude.Nothing,
$sel:startCommand:CodeConfigurationValues' :: Maybe (Sensitive Text)
startCommand = forall a. Maybe a
Prelude.Nothing,
$sel:runtime:CodeConfigurationValues' :: Runtime
runtime = Runtime
pRuntime_
}
codeConfigurationValues_buildCommand :: Lens.Lens' CodeConfigurationValues (Prelude.Maybe Prelude.Text)
codeConfigurationValues_buildCommand :: Lens' CodeConfigurationValues (Maybe Text)
codeConfigurationValues_buildCommand = 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) 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
codeConfigurationValues_port :: Lens.Lens' CodeConfigurationValues (Prelude.Maybe Prelude.Text)
codeConfigurationValues_port :: Lens' CodeConfigurationValues (Maybe Text)
codeConfigurationValues_port = 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_runtimeEnvironmentSecrets :: Lens.Lens' CodeConfigurationValues (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
codeConfigurationValues_runtimeEnvironmentSecrets :: Lens' CodeConfigurationValues (Maybe (HashMap Text Text))
codeConfigurationValues_runtimeEnvironmentSecrets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeConfigurationValues' {Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets :: Maybe (HashMap Text (Sensitive Text))
$sel:runtimeEnvironmentSecrets:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets} -> Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets) (\s :: CodeConfigurationValues
s@CodeConfigurationValues' {} Maybe (HashMap Text (Sensitive Text))
a -> CodeConfigurationValues
s {$sel:runtimeEnvironmentSecrets:CodeConfigurationValues' :: Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets = Maybe (HashMap Text (Sensitive Text))
a} :: CodeConfigurationValues) 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
codeConfigurationValues_runtimeEnvironmentVariables :: Lens.Lens' CodeConfigurationValues (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
codeConfigurationValues_runtimeEnvironmentVariables :: Lens' CodeConfigurationValues (Maybe (HashMap Text Text))
codeConfigurationValues_runtimeEnvironmentVariables = 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) 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
codeConfigurationValues_startCommand :: Lens.Lens' CodeConfigurationValues (Prelude.Maybe Prelude.Text)
codeConfigurationValues_startCommand :: Lens' CodeConfigurationValues (Maybe Text)
codeConfigurationValues_startCommand = 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) 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
codeConfigurationValues_runtime :: Lens.Lens' CodeConfigurationValues Runtime
codeConfigurationValues_runtime :: Lens' CodeConfigurationValues Runtime
codeConfigurationValues_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 Data.FromJSON CodeConfigurationValues where
parseJSON :: Value -> Parser CodeConfigurationValues
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CodeConfigurationValues"
( \Object
x ->
Maybe (Sensitive Text)
-> Maybe Text
-> Maybe (HashMap Text (Sensitive Text))
-> Maybe (HashMap Text (Sensitive Text))
-> Maybe (Sensitive Text)
-> Runtime
-> CodeConfigurationValues
CodeConfigurationValues'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"BuildCommand")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Port")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RuntimeEnvironmentSecrets"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RuntimeEnvironmentVariables"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StartCommand")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Runtime")
)
instance Prelude.Hashable CodeConfigurationValues where
hashWithSalt :: Int -> CodeConfigurationValues -> Int
hashWithSalt Int
_salt CodeConfigurationValues' {Maybe Text
Maybe (HashMap Text (Sensitive Text))
Maybe (Sensitive Text)
Runtime
runtime :: Runtime
startCommand :: Maybe (Sensitive Text)
runtimeEnvironmentVariables :: Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets :: Maybe (HashMap Text (Sensitive Text))
port :: Maybe Text
buildCommand :: Maybe (Sensitive Text)
$sel:runtime:CodeConfigurationValues' :: CodeConfigurationValues -> Runtime
$sel:startCommand:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (Sensitive Text)
$sel:runtimeEnvironmentVariables:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (HashMap Text (Sensitive Text))
$sel:runtimeEnvironmentSecrets:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (HashMap Text (Sensitive Text))
$sel:port:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe Text
$sel:buildCommand:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (Sensitive Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
buildCommand
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
port
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentVariables
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
startCommand
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Runtime
runtime
instance Prelude.NFData CodeConfigurationValues where
rnf :: CodeConfigurationValues -> ()
rnf CodeConfigurationValues' {Maybe Text
Maybe (HashMap Text (Sensitive Text))
Maybe (Sensitive Text)
Runtime
runtime :: Runtime
startCommand :: Maybe (Sensitive Text)
runtimeEnvironmentVariables :: Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets :: Maybe (HashMap Text (Sensitive Text))
port :: Maybe Text
buildCommand :: Maybe (Sensitive Text)
$sel:runtime:CodeConfigurationValues' :: CodeConfigurationValues -> Runtime
$sel:startCommand:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (Sensitive Text)
$sel:runtimeEnvironmentVariables:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (HashMap Text (Sensitive Text))
$sel:runtimeEnvironmentSecrets:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (HashMap Text (Sensitive Text))
$sel:port:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe Text
$sel:buildCommand:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (Sensitive Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
buildCommand
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
port
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentVariables
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
startCommand
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Runtime
runtime
instance Data.ToJSON CodeConfigurationValues where
toJSON :: CodeConfigurationValues -> Value
toJSON CodeConfigurationValues' {Maybe Text
Maybe (HashMap Text (Sensitive Text))
Maybe (Sensitive Text)
Runtime
runtime :: Runtime
startCommand :: Maybe (Sensitive Text)
runtimeEnvironmentVariables :: Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets :: Maybe (HashMap Text (Sensitive Text))
port :: Maybe Text
buildCommand :: Maybe (Sensitive Text)
$sel:runtime:CodeConfigurationValues' :: CodeConfigurationValues -> Runtime
$sel:startCommand:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (Sensitive Text)
$sel:runtimeEnvironmentVariables:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (HashMap Text (Sensitive Text))
$sel:runtimeEnvironmentSecrets:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (HashMap Text (Sensitive Text))
$sel:port:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe Text
$sel:buildCommand:CodeConfigurationValues' :: CodeConfigurationValues -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"BuildCommand" 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 (Sensitive Text)
buildCommand,
(Key
"Port" 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
port,
(Key
"RuntimeEnvironmentSecrets" 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 (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets,
(Key
"RuntimeEnvironmentVariables" 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 (HashMap Text (Sensitive Text))
runtimeEnvironmentVariables,
(Key
"StartCommand" 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 (Sensitive Text)
startCommand,
forall a. a -> Maybe a
Prelude.Just (Key
"Runtime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Runtime
runtime)
]
)