{-# 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.RobOMaker.Types.LaunchConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RobOMaker.Types.PortForwardingConfig
data LaunchConfig = LaunchConfig'
{
LaunchConfig -> Maybe [Text]
command :: Prelude.Maybe [Prelude.Text],
LaunchConfig -> Maybe Text
packageName :: Prelude.Maybe Prelude.Text,
LaunchConfig -> Maybe PortForwardingConfig
portForwardingConfig :: Prelude.Maybe PortForwardingConfig,
LaunchConfig -> Maybe Text
launchFile :: Prelude.Maybe Prelude.Text,
LaunchConfig -> Maybe (HashMap Text Text)
environmentVariables :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
LaunchConfig -> Maybe Bool
streamUI :: Prelude.Maybe Prelude.Bool
}
deriving (LaunchConfig -> LaunchConfig -> Bool
(LaunchConfig -> LaunchConfig -> Bool)
-> (LaunchConfig -> LaunchConfig -> Bool) -> Eq LaunchConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LaunchConfig -> LaunchConfig -> Bool
$c/= :: LaunchConfig -> LaunchConfig -> Bool
== :: LaunchConfig -> LaunchConfig -> Bool
$c== :: LaunchConfig -> LaunchConfig -> Bool
Prelude.Eq, ReadPrec [LaunchConfig]
ReadPrec LaunchConfig
Int -> ReadS LaunchConfig
ReadS [LaunchConfig]
(Int -> ReadS LaunchConfig)
-> ReadS [LaunchConfig]
-> ReadPrec LaunchConfig
-> ReadPrec [LaunchConfig]
-> Read LaunchConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LaunchConfig]
$creadListPrec :: ReadPrec [LaunchConfig]
readPrec :: ReadPrec LaunchConfig
$creadPrec :: ReadPrec LaunchConfig
readList :: ReadS [LaunchConfig]
$creadList :: ReadS [LaunchConfig]
readsPrec :: Int -> ReadS LaunchConfig
$creadsPrec :: Int -> ReadS LaunchConfig
Prelude.Read, Int -> LaunchConfig -> ShowS
[LaunchConfig] -> ShowS
LaunchConfig -> String
(Int -> LaunchConfig -> ShowS)
-> (LaunchConfig -> String)
-> ([LaunchConfig] -> ShowS)
-> Show LaunchConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LaunchConfig] -> ShowS
$cshowList :: [LaunchConfig] -> ShowS
show :: LaunchConfig -> String
$cshow :: LaunchConfig -> String
showsPrec :: Int -> LaunchConfig -> ShowS
$cshowsPrec :: Int -> LaunchConfig -> ShowS
Prelude.Show, (forall x. LaunchConfig -> Rep LaunchConfig x)
-> (forall x. Rep LaunchConfig x -> LaunchConfig)
-> Generic LaunchConfig
forall x. Rep LaunchConfig x -> LaunchConfig
forall x. LaunchConfig -> Rep LaunchConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LaunchConfig x -> LaunchConfig
$cfrom :: forall x. LaunchConfig -> Rep LaunchConfig x
Prelude.Generic)
newLaunchConfig ::
LaunchConfig
newLaunchConfig :: LaunchConfig
newLaunchConfig =
LaunchConfig' :: Maybe [Text]
-> Maybe Text
-> Maybe PortForwardingConfig
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> LaunchConfig
LaunchConfig'
{ $sel:command:LaunchConfig' :: Maybe [Text]
command = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:packageName:LaunchConfig' :: Maybe Text
packageName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:portForwardingConfig:LaunchConfig' :: Maybe PortForwardingConfig
portForwardingConfig = Maybe PortForwardingConfig
forall a. Maybe a
Prelude.Nothing,
$sel:launchFile:LaunchConfig' :: Maybe Text
launchFile = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:environmentVariables:LaunchConfig' :: Maybe (HashMap Text Text)
environmentVariables = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:streamUI:LaunchConfig' :: Maybe Bool
streamUI = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
launchConfig_command :: Lens.Lens' LaunchConfig (Prelude.Maybe [Prelude.Text])
launchConfig_command :: (Maybe [Text] -> f (Maybe [Text]))
-> LaunchConfig -> f LaunchConfig
launchConfig_command = (LaunchConfig -> Maybe [Text])
-> (LaunchConfig -> Maybe [Text] -> LaunchConfig)
-> Lens LaunchConfig LaunchConfig (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchConfig' {Maybe [Text]
command :: Maybe [Text]
$sel:command:LaunchConfig' :: LaunchConfig -> Maybe [Text]
command} -> Maybe [Text]
command) (\s :: LaunchConfig
s@LaunchConfig' {} Maybe [Text]
a -> LaunchConfig
s {$sel:command:LaunchConfig' :: Maybe [Text]
command = Maybe [Text]
a} :: LaunchConfig) ((Maybe [Text] -> f (Maybe [Text]))
-> LaunchConfig -> f LaunchConfig)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> LaunchConfig
-> f LaunchConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
launchConfig_packageName :: Lens.Lens' LaunchConfig (Prelude.Maybe Prelude.Text)
launchConfig_packageName :: (Maybe Text -> f (Maybe Text)) -> LaunchConfig -> f LaunchConfig
launchConfig_packageName = (LaunchConfig -> Maybe Text)
-> (LaunchConfig -> Maybe Text -> LaunchConfig)
-> Lens LaunchConfig LaunchConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchConfig' {Maybe Text
packageName :: Maybe Text
$sel:packageName:LaunchConfig' :: LaunchConfig -> Maybe Text
packageName} -> Maybe Text
packageName) (\s :: LaunchConfig
s@LaunchConfig' {} Maybe Text
a -> LaunchConfig
s {$sel:packageName:LaunchConfig' :: Maybe Text
packageName = Maybe Text
a} :: LaunchConfig)
launchConfig_portForwardingConfig :: Lens.Lens' LaunchConfig (Prelude.Maybe PortForwardingConfig)
launchConfig_portForwardingConfig :: (Maybe PortForwardingConfig -> f (Maybe PortForwardingConfig))
-> LaunchConfig -> f LaunchConfig
launchConfig_portForwardingConfig = (LaunchConfig -> Maybe PortForwardingConfig)
-> (LaunchConfig -> Maybe PortForwardingConfig -> LaunchConfig)
-> Lens
LaunchConfig
LaunchConfig
(Maybe PortForwardingConfig)
(Maybe PortForwardingConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchConfig' {Maybe PortForwardingConfig
portForwardingConfig :: Maybe PortForwardingConfig
$sel:portForwardingConfig:LaunchConfig' :: LaunchConfig -> Maybe PortForwardingConfig
portForwardingConfig} -> Maybe PortForwardingConfig
portForwardingConfig) (\s :: LaunchConfig
s@LaunchConfig' {} Maybe PortForwardingConfig
a -> LaunchConfig
s {$sel:portForwardingConfig:LaunchConfig' :: Maybe PortForwardingConfig
portForwardingConfig = Maybe PortForwardingConfig
a} :: LaunchConfig)
launchConfig_launchFile :: Lens.Lens' LaunchConfig (Prelude.Maybe Prelude.Text)
launchConfig_launchFile :: (Maybe Text -> f (Maybe Text)) -> LaunchConfig -> f LaunchConfig
launchConfig_launchFile = (LaunchConfig -> Maybe Text)
-> (LaunchConfig -> Maybe Text -> LaunchConfig)
-> Lens LaunchConfig LaunchConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchConfig' {Maybe Text
launchFile :: Maybe Text
$sel:launchFile:LaunchConfig' :: LaunchConfig -> Maybe Text
launchFile} -> Maybe Text
launchFile) (\s :: LaunchConfig
s@LaunchConfig' {} Maybe Text
a -> LaunchConfig
s {$sel:launchFile:LaunchConfig' :: Maybe Text
launchFile = Maybe Text
a} :: LaunchConfig)
launchConfig_environmentVariables :: Lens.Lens' LaunchConfig (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
launchConfig_environmentVariables :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> LaunchConfig -> f LaunchConfig
launchConfig_environmentVariables = (LaunchConfig -> Maybe (HashMap Text Text))
-> (LaunchConfig -> Maybe (HashMap Text Text) -> LaunchConfig)
-> Lens
LaunchConfig
LaunchConfig
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchConfig' {Maybe (HashMap Text Text)
environmentVariables :: Maybe (HashMap Text Text)
$sel:environmentVariables:LaunchConfig' :: LaunchConfig -> Maybe (HashMap Text Text)
environmentVariables} -> Maybe (HashMap Text Text)
environmentVariables) (\s :: LaunchConfig
s@LaunchConfig' {} Maybe (HashMap Text Text)
a -> LaunchConfig
s {$sel:environmentVariables:LaunchConfig' :: Maybe (HashMap Text Text)
environmentVariables = Maybe (HashMap Text Text)
a} :: LaunchConfig) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> LaunchConfig -> f LaunchConfig)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> LaunchConfig
-> f LaunchConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text 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 Text)
(HashMap Text 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
launchConfig_streamUI :: Lens.Lens' LaunchConfig (Prelude.Maybe Prelude.Bool)
launchConfig_streamUI :: (Maybe Bool -> f (Maybe Bool)) -> LaunchConfig -> f LaunchConfig
launchConfig_streamUI = (LaunchConfig -> Maybe Bool)
-> (LaunchConfig -> Maybe Bool -> LaunchConfig)
-> Lens LaunchConfig LaunchConfig (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchConfig' {Maybe Bool
streamUI :: Maybe Bool
$sel:streamUI:LaunchConfig' :: LaunchConfig -> Maybe Bool
streamUI} -> Maybe Bool
streamUI) (\s :: LaunchConfig
s@LaunchConfig' {} Maybe Bool
a -> LaunchConfig
s {$sel:streamUI:LaunchConfig' :: Maybe Bool
streamUI = Maybe Bool
a} :: LaunchConfig)
instance Core.FromJSON LaunchConfig where
parseJSON :: Value -> Parser LaunchConfig
parseJSON =
String
-> (Object -> Parser LaunchConfig) -> Value -> Parser LaunchConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LaunchConfig"
( \Object
x ->
Maybe [Text]
-> Maybe Text
-> Maybe PortForwardingConfig
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> LaunchConfig
LaunchConfig'
(Maybe [Text]
-> Maybe Text
-> Maybe PortForwardingConfig
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> LaunchConfig)
-> Parser (Maybe [Text])
-> Parser
(Maybe Text
-> Maybe PortForwardingConfig
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> LaunchConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"command" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text
-> Maybe PortForwardingConfig
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> LaunchConfig)
-> Parser (Maybe Text)
-> Parser
(Maybe PortForwardingConfig
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> LaunchConfig)
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
"packageName")
Parser
(Maybe PortForwardingConfig
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> LaunchConfig)
-> Parser (Maybe PortForwardingConfig)
-> Parser
(Maybe Text
-> Maybe (HashMap Text Text) -> Maybe Bool -> LaunchConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PortForwardingConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"portForwardingConfig")
Parser
(Maybe Text
-> Maybe (HashMap Text Text) -> Maybe Bool -> LaunchConfig)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> Maybe Bool -> LaunchConfig)
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
"launchFile")
Parser (Maybe (HashMap Text Text) -> Maybe Bool -> LaunchConfig)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Maybe Bool -> LaunchConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"environmentVariables"
Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe Bool -> LaunchConfig)
-> Parser (Maybe Bool) -> Parser LaunchConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"streamUI")
)
instance Prelude.Hashable LaunchConfig
instance Prelude.NFData LaunchConfig
instance Core.ToJSON LaunchConfig where
toJSON :: LaunchConfig -> Value
toJSON LaunchConfig' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe PortForwardingConfig
streamUI :: Maybe Bool
environmentVariables :: Maybe (HashMap Text Text)
launchFile :: Maybe Text
portForwardingConfig :: Maybe PortForwardingConfig
packageName :: Maybe Text
command :: Maybe [Text]
$sel:streamUI:LaunchConfig' :: LaunchConfig -> Maybe Bool
$sel:environmentVariables:LaunchConfig' :: LaunchConfig -> Maybe (HashMap Text Text)
$sel:launchFile:LaunchConfig' :: LaunchConfig -> Maybe Text
$sel:portForwardingConfig:LaunchConfig' :: LaunchConfig -> Maybe PortForwardingConfig
$sel:packageName:LaunchConfig' :: LaunchConfig -> Maybe Text
$sel:command:LaunchConfig' :: LaunchConfig -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"command" 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]
command,
(Text
"packageName" 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
packageName,
(Text
"portForwardingConfig" Text -> PortForwardingConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(PortForwardingConfig -> Pair)
-> Maybe PortForwardingConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PortForwardingConfig
portForwardingConfig,
(Text
"launchFile" 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
launchFile,
(Text
"environmentVariables" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
environmentVariables,
(Text
"streamUI" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
streamUI
]
)