{-# 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.ImageConfiguration 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 ImageConfiguration = ImageConfiguration'
{
ImageConfiguration -> Maybe Text
port :: Prelude.Maybe Prelude.Text,
ImageConfiguration -> Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets :: Prelude.Maybe (Prelude.HashMap Prelude.Text (Data.Sensitive Prelude.Text)),
ImageConfiguration -> Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentVariables :: Prelude.Maybe (Prelude.HashMap Prelude.Text (Data.Sensitive Prelude.Text)),
ImageConfiguration -> Maybe (Sensitive Text)
startCommand :: Prelude.Maybe (Data.Sensitive Prelude.Text)
}
deriving (ImageConfiguration -> ImageConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageConfiguration -> ImageConfiguration -> Bool
$c/= :: ImageConfiguration -> ImageConfiguration -> Bool
== :: ImageConfiguration -> ImageConfiguration -> Bool
$c== :: ImageConfiguration -> ImageConfiguration -> Bool
Prelude.Eq, Int -> ImageConfiguration -> ShowS
[ImageConfiguration] -> ShowS
ImageConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImageConfiguration] -> ShowS
$cshowList :: [ImageConfiguration] -> ShowS
show :: ImageConfiguration -> String
$cshow :: ImageConfiguration -> String
showsPrec :: Int -> ImageConfiguration -> ShowS
$cshowsPrec :: Int -> ImageConfiguration -> ShowS
Prelude.Show, forall x. Rep ImageConfiguration x -> ImageConfiguration
forall x. ImageConfiguration -> Rep ImageConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImageConfiguration x -> ImageConfiguration
$cfrom :: forall x. ImageConfiguration -> Rep ImageConfiguration x
Prelude.Generic)
newImageConfiguration ::
ImageConfiguration
newImageConfiguration :: ImageConfiguration
newImageConfiguration =
ImageConfiguration'
{ $sel:port:ImageConfiguration' :: Maybe Text
port = forall a. Maybe a
Prelude.Nothing,
$sel:runtimeEnvironmentSecrets:ImageConfiguration' :: Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets = forall a. Maybe a
Prelude.Nothing,
$sel:runtimeEnvironmentVariables:ImageConfiguration' :: Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentVariables = forall a. Maybe a
Prelude.Nothing,
$sel:startCommand:ImageConfiguration' :: Maybe (Sensitive Text)
startCommand = forall a. Maybe a
Prelude.Nothing
}
imageConfiguration_port :: Lens.Lens' ImageConfiguration (Prelude.Maybe Prelude.Text)
imageConfiguration_port :: Lens' ImageConfiguration (Maybe Text)
imageConfiguration_port = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageConfiguration' {Maybe Text
port :: Maybe Text
$sel:port:ImageConfiguration' :: ImageConfiguration -> Maybe Text
port} -> Maybe Text
port) (\s :: ImageConfiguration
s@ImageConfiguration' {} Maybe Text
a -> ImageConfiguration
s {$sel:port:ImageConfiguration' :: Maybe Text
port = Maybe Text
a} :: ImageConfiguration)
imageConfiguration_runtimeEnvironmentSecrets :: Lens.Lens' ImageConfiguration (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
imageConfiguration_runtimeEnvironmentSecrets :: Lens' ImageConfiguration (Maybe (HashMap Text Text))
imageConfiguration_runtimeEnvironmentSecrets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageConfiguration' {Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets :: Maybe (HashMap Text (Sensitive Text))
$sel:runtimeEnvironmentSecrets:ImageConfiguration' :: ImageConfiguration -> Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets} -> Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets) (\s :: ImageConfiguration
s@ImageConfiguration' {} Maybe (HashMap Text (Sensitive Text))
a -> ImageConfiguration
s {$sel:runtimeEnvironmentSecrets:ImageConfiguration' :: Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets = Maybe (HashMap Text (Sensitive Text))
a} :: ImageConfiguration) 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
imageConfiguration_runtimeEnvironmentVariables :: Lens.Lens' ImageConfiguration (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
imageConfiguration_runtimeEnvironmentVariables :: Lens' ImageConfiguration (Maybe (HashMap Text Text))
imageConfiguration_runtimeEnvironmentVariables = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageConfiguration' {Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentVariables :: Maybe (HashMap Text (Sensitive Text))
$sel:runtimeEnvironmentVariables:ImageConfiguration' :: ImageConfiguration -> Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentVariables} -> Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentVariables) (\s :: ImageConfiguration
s@ImageConfiguration' {} Maybe (HashMap Text (Sensitive Text))
a -> ImageConfiguration
s {$sel:runtimeEnvironmentVariables:ImageConfiguration' :: Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentVariables = Maybe (HashMap Text (Sensitive Text))
a} :: ImageConfiguration) 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
imageConfiguration_startCommand :: Lens.Lens' ImageConfiguration (Prelude.Maybe Prelude.Text)
imageConfiguration_startCommand :: Lens' ImageConfiguration (Maybe Text)
imageConfiguration_startCommand = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageConfiguration' {Maybe (Sensitive Text)
startCommand :: Maybe (Sensitive Text)
$sel:startCommand:ImageConfiguration' :: ImageConfiguration -> Maybe (Sensitive Text)
startCommand} -> Maybe (Sensitive Text)
startCommand) (\s :: ImageConfiguration
s@ImageConfiguration' {} Maybe (Sensitive Text)
a -> ImageConfiguration
s {$sel:startCommand:ImageConfiguration' :: Maybe (Sensitive Text)
startCommand = Maybe (Sensitive Text)
a} :: ImageConfiguration) 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
instance Data.FromJSON ImageConfiguration where
parseJSON :: Value -> Parser ImageConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ImageConfiguration"
( \Object
x ->
Maybe Text
-> Maybe (HashMap Text (Sensitive Text))
-> Maybe (HashMap Text (Sensitive Text))
-> Maybe (Sensitive Text)
-> ImageConfiguration
ImageConfiguration'
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
"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")
)
instance Prelude.Hashable ImageConfiguration where
hashWithSalt :: Int -> ImageConfiguration -> Int
hashWithSalt Int
_salt ImageConfiguration' {Maybe Text
Maybe (HashMap Text (Sensitive Text))
Maybe (Sensitive Text)
startCommand :: Maybe (Sensitive Text)
runtimeEnvironmentVariables :: Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets :: Maybe (HashMap Text (Sensitive Text))
port :: Maybe Text
$sel:startCommand:ImageConfiguration' :: ImageConfiguration -> Maybe (Sensitive Text)
$sel:runtimeEnvironmentVariables:ImageConfiguration' :: ImageConfiguration -> Maybe (HashMap Text (Sensitive Text))
$sel:runtimeEnvironmentSecrets:ImageConfiguration' :: ImageConfiguration -> Maybe (HashMap Text (Sensitive Text))
$sel:port:ImageConfiguration' :: ImageConfiguration -> Maybe Text
..} =
Int
_salt
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
instance Prelude.NFData ImageConfiguration where
rnf :: ImageConfiguration -> ()
rnf ImageConfiguration' {Maybe Text
Maybe (HashMap Text (Sensitive Text))
Maybe (Sensitive Text)
startCommand :: Maybe (Sensitive Text)
runtimeEnvironmentVariables :: Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets :: Maybe (HashMap Text (Sensitive Text))
port :: Maybe Text
$sel:startCommand:ImageConfiguration' :: ImageConfiguration -> Maybe (Sensitive Text)
$sel:runtimeEnvironmentVariables:ImageConfiguration' :: ImageConfiguration -> Maybe (HashMap Text (Sensitive Text))
$sel:runtimeEnvironmentSecrets:ImageConfiguration' :: ImageConfiguration -> Maybe (HashMap Text (Sensitive Text))
$sel:port:ImageConfiguration' :: ImageConfiguration -> Maybe Text
..} =
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
instance Data.ToJSON ImageConfiguration where
toJSON :: ImageConfiguration -> Value
toJSON ImageConfiguration' {Maybe Text
Maybe (HashMap Text (Sensitive Text))
Maybe (Sensitive Text)
startCommand :: Maybe (Sensitive Text)
runtimeEnvironmentVariables :: Maybe (HashMap Text (Sensitive Text))
runtimeEnvironmentSecrets :: Maybe (HashMap Text (Sensitive Text))
port :: Maybe Text
$sel:startCommand:ImageConfiguration' :: ImageConfiguration -> Maybe (Sensitive Text)
$sel:runtimeEnvironmentVariables:ImageConfiguration' :: ImageConfiguration -> Maybe (HashMap Text (Sensitive Text))
$sel:runtimeEnvironmentSecrets:ImageConfiguration' :: ImageConfiguration -> Maybe (HashMap Text (Sensitive Text))
$sel:port:ImageConfiguration' :: ImageConfiguration -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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
]
)