{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.RobOMaker.Types.SimulationApplicationConfig
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.RobOMaker.Types.SimulationApplicationConfig where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RobOMaker.Types.LaunchConfig
import Amazonka.RobOMaker.Types.Tool
import Amazonka.RobOMaker.Types.UploadConfiguration
import Amazonka.RobOMaker.Types.WorldConfig

-- | Information about a simulation application configuration.
--
-- /See:/ 'newSimulationApplicationConfig' smart constructor.
data SimulationApplicationConfig = SimulationApplicationConfig'
  { -- | A Boolean indicating whether to use default upload configurations. By
    -- default, @.ros@ and @.gazebo@ files are uploaded when the application
    -- terminates and all ROS topics will be recorded.
    --
    -- If you set this value, you must specify an @outputLocation@.
    SimulationApplicationConfig -> Maybe Bool
useDefaultUploadConfigurations :: Prelude.Maybe Prelude.Bool,
    -- | A Boolean indicating whether to use default simulation application
    -- tools. The default tools are rviz, rqt, terminal and rosbag record. The
    -- default is @False@.
    SimulationApplicationConfig -> Maybe Bool
useDefaultTools :: Prelude.Maybe Prelude.Bool,
    -- | The version of the simulation application.
    SimulationApplicationConfig -> Maybe Text
applicationVersion :: Prelude.Maybe Prelude.Text,
    -- | Information about upload configurations for the simulation application.
    SimulationApplicationConfig -> Maybe [UploadConfiguration]
uploadConfigurations :: Prelude.Maybe [UploadConfiguration],
    -- | Information about tools configured for the simulation application.
    SimulationApplicationConfig -> Maybe [Tool]
tools :: Prelude.Maybe [Tool],
    -- | A list of world configurations.
    SimulationApplicationConfig -> Maybe [WorldConfig]
worldConfigs :: Prelude.Maybe [WorldConfig],
    -- | The application information for the simulation application.
    SimulationApplicationConfig -> Text
application :: Prelude.Text,
    -- | The launch configuration for the simulation application.
    SimulationApplicationConfig -> LaunchConfig
launchConfig :: LaunchConfig
  }
  deriving (SimulationApplicationConfig -> SimulationApplicationConfig -> Bool
(SimulationApplicationConfig
 -> SimulationApplicationConfig -> Bool)
-> (SimulationApplicationConfig
    -> SimulationApplicationConfig -> Bool)
-> Eq SimulationApplicationConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SimulationApplicationConfig -> SimulationApplicationConfig -> Bool
$c/= :: SimulationApplicationConfig -> SimulationApplicationConfig -> Bool
== :: SimulationApplicationConfig -> SimulationApplicationConfig -> Bool
$c== :: SimulationApplicationConfig -> SimulationApplicationConfig -> Bool
Prelude.Eq, ReadPrec [SimulationApplicationConfig]
ReadPrec SimulationApplicationConfig
Int -> ReadS SimulationApplicationConfig
ReadS [SimulationApplicationConfig]
(Int -> ReadS SimulationApplicationConfig)
-> ReadS [SimulationApplicationConfig]
-> ReadPrec SimulationApplicationConfig
-> ReadPrec [SimulationApplicationConfig]
-> Read SimulationApplicationConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SimulationApplicationConfig]
$creadListPrec :: ReadPrec [SimulationApplicationConfig]
readPrec :: ReadPrec SimulationApplicationConfig
$creadPrec :: ReadPrec SimulationApplicationConfig
readList :: ReadS [SimulationApplicationConfig]
$creadList :: ReadS [SimulationApplicationConfig]
readsPrec :: Int -> ReadS SimulationApplicationConfig
$creadsPrec :: Int -> ReadS SimulationApplicationConfig
Prelude.Read, Int -> SimulationApplicationConfig -> ShowS
[SimulationApplicationConfig] -> ShowS
SimulationApplicationConfig -> String
(Int -> SimulationApplicationConfig -> ShowS)
-> (SimulationApplicationConfig -> String)
-> ([SimulationApplicationConfig] -> ShowS)
-> Show SimulationApplicationConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SimulationApplicationConfig] -> ShowS
$cshowList :: [SimulationApplicationConfig] -> ShowS
show :: SimulationApplicationConfig -> String
$cshow :: SimulationApplicationConfig -> String
showsPrec :: Int -> SimulationApplicationConfig -> ShowS
$cshowsPrec :: Int -> SimulationApplicationConfig -> ShowS
Prelude.Show, (forall x.
 SimulationApplicationConfig -> Rep SimulationApplicationConfig x)
-> (forall x.
    Rep SimulationApplicationConfig x -> SimulationApplicationConfig)
-> Generic SimulationApplicationConfig
forall x.
Rep SimulationApplicationConfig x -> SimulationApplicationConfig
forall x.
SimulationApplicationConfig -> Rep SimulationApplicationConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SimulationApplicationConfig x -> SimulationApplicationConfig
$cfrom :: forall x.
SimulationApplicationConfig -> Rep SimulationApplicationConfig x
Prelude.Generic)

-- |
-- Create a value of 'SimulationApplicationConfig' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'useDefaultUploadConfigurations', 'simulationApplicationConfig_useDefaultUploadConfigurations' - A Boolean indicating whether to use default upload configurations. By
-- default, @.ros@ and @.gazebo@ files are uploaded when the application
-- terminates and all ROS topics will be recorded.
--
-- If you set this value, you must specify an @outputLocation@.
--
-- 'useDefaultTools', 'simulationApplicationConfig_useDefaultTools' - A Boolean indicating whether to use default simulation application
-- tools. The default tools are rviz, rqt, terminal and rosbag record. The
-- default is @False@.
--
-- 'applicationVersion', 'simulationApplicationConfig_applicationVersion' - The version of the simulation application.
--
-- 'uploadConfigurations', 'simulationApplicationConfig_uploadConfigurations' - Information about upload configurations for the simulation application.
--
-- 'tools', 'simulationApplicationConfig_tools' - Information about tools configured for the simulation application.
--
-- 'worldConfigs', 'simulationApplicationConfig_worldConfigs' - A list of world configurations.
--
-- 'application', 'simulationApplicationConfig_application' - The application information for the simulation application.
--
-- 'launchConfig', 'simulationApplicationConfig_launchConfig' - The launch configuration for the simulation application.
newSimulationApplicationConfig ::
  -- | 'application'
  Prelude.Text ->
  -- | 'launchConfig'
  LaunchConfig ->
  SimulationApplicationConfig
newSimulationApplicationConfig :: Text -> LaunchConfig -> SimulationApplicationConfig
newSimulationApplicationConfig
  Text
pApplication_
  LaunchConfig
pLaunchConfig_ =
    SimulationApplicationConfig' :: Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe [UploadConfiguration]
-> Maybe [Tool]
-> Maybe [WorldConfig]
-> Text
-> LaunchConfig
-> SimulationApplicationConfig
SimulationApplicationConfig'
      { $sel:useDefaultUploadConfigurations:SimulationApplicationConfig' :: Maybe Bool
useDefaultUploadConfigurations =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:useDefaultTools:SimulationApplicationConfig' :: Maybe Bool
useDefaultTools = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:applicationVersion:SimulationApplicationConfig' :: Maybe Text
applicationVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:uploadConfigurations:SimulationApplicationConfig' :: Maybe [UploadConfiguration]
uploadConfigurations = Maybe [UploadConfiguration]
forall a. Maybe a
Prelude.Nothing,
        $sel:tools:SimulationApplicationConfig' :: Maybe [Tool]
tools = Maybe [Tool]
forall a. Maybe a
Prelude.Nothing,
        $sel:worldConfigs:SimulationApplicationConfig' :: Maybe [WorldConfig]
worldConfigs = Maybe [WorldConfig]
forall a. Maybe a
Prelude.Nothing,
        $sel:application:SimulationApplicationConfig' :: Text
application = Text
pApplication_,
        $sel:launchConfig:SimulationApplicationConfig' :: LaunchConfig
launchConfig = LaunchConfig
pLaunchConfig_
      }

-- | A Boolean indicating whether to use default upload configurations. By
-- default, @.ros@ and @.gazebo@ files are uploaded when the application
-- terminates and all ROS topics will be recorded.
--
-- If you set this value, you must specify an @outputLocation@.
simulationApplicationConfig_useDefaultUploadConfigurations :: Lens.Lens' SimulationApplicationConfig (Prelude.Maybe Prelude.Bool)
simulationApplicationConfig_useDefaultUploadConfigurations :: (Maybe Bool -> f (Maybe Bool))
-> SimulationApplicationConfig -> f SimulationApplicationConfig
simulationApplicationConfig_useDefaultUploadConfigurations = (SimulationApplicationConfig -> Maybe Bool)
-> (SimulationApplicationConfig
    -> Maybe Bool -> SimulationApplicationConfig)
-> Lens
     SimulationApplicationConfig
     SimulationApplicationConfig
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SimulationApplicationConfig' {Maybe Bool
useDefaultUploadConfigurations :: Maybe Bool
$sel:useDefaultUploadConfigurations:SimulationApplicationConfig' :: SimulationApplicationConfig -> Maybe Bool
useDefaultUploadConfigurations} -> Maybe Bool
useDefaultUploadConfigurations) (\s :: SimulationApplicationConfig
s@SimulationApplicationConfig' {} Maybe Bool
a -> SimulationApplicationConfig
s {$sel:useDefaultUploadConfigurations:SimulationApplicationConfig' :: Maybe Bool
useDefaultUploadConfigurations = Maybe Bool
a} :: SimulationApplicationConfig)

-- | A Boolean indicating whether to use default simulation application
-- tools. The default tools are rviz, rqt, terminal and rosbag record. The
-- default is @False@.
simulationApplicationConfig_useDefaultTools :: Lens.Lens' SimulationApplicationConfig (Prelude.Maybe Prelude.Bool)
simulationApplicationConfig_useDefaultTools :: (Maybe Bool -> f (Maybe Bool))
-> SimulationApplicationConfig -> f SimulationApplicationConfig
simulationApplicationConfig_useDefaultTools = (SimulationApplicationConfig -> Maybe Bool)
-> (SimulationApplicationConfig
    -> Maybe Bool -> SimulationApplicationConfig)
-> Lens
     SimulationApplicationConfig
     SimulationApplicationConfig
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SimulationApplicationConfig' {Maybe Bool
useDefaultTools :: Maybe Bool
$sel:useDefaultTools:SimulationApplicationConfig' :: SimulationApplicationConfig -> Maybe Bool
useDefaultTools} -> Maybe Bool
useDefaultTools) (\s :: SimulationApplicationConfig
s@SimulationApplicationConfig' {} Maybe Bool
a -> SimulationApplicationConfig
s {$sel:useDefaultTools:SimulationApplicationConfig' :: Maybe Bool
useDefaultTools = Maybe Bool
a} :: SimulationApplicationConfig)

-- | The version of the simulation application.
simulationApplicationConfig_applicationVersion :: Lens.Lens' SimulationApplicationConfig (Prelude.Maybe Prelude.Text)
simulationApplicationConfig_applicationVersion :: (Maybe Text -> f (Maybe Text))
-> SimulationApplicationConfig -> f SimulationApplicationConfig
simulationApplicationConfig_applicationVersion = (SimulationApplicationConfig -> Maybe Text)
-> (SimulationApplicationConfig
    -> Maybe Text -> SimulationApplicationConfig)
-> Lens
     SimulationApplicationConfig
     SimulationApplicationConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SimulationApplicationConfig' {Maybe Text
applicationVersion :: Maybe Text
$sel:applicationVersion:SimulationApplicationConfig' :: SimulationApplicationConfig -> Maybe Text
applicationVersion} -> Maybe Text
applicationVersion) (\s :: SimulationApplicationConfig
s@SimulationApplicationConfig' {} Maybe Text
a -> SimulationApplicationConfig
s {$sel:applicationVersion:SimulationApplicationConfig' :: Maybe Text
applicationVersion = Maybe Text
a} :: SimulationApplicationConfig)

-- | Information about upload configurations for the simulation application.
simulationApplicationConfig_uploadConfigurations :: Lens.Lens' SimulationApplicationConfig (Prelude.Maybe [UploadConfiguration])
simulationApplicationConfig_uploadConfigurations :: (Maybe [UploadConfiguration] -> f (Maybe [UploadConfiguration]))
-> SimulationApplicationConfig -> f SimulationApplicationConfig
simulationApplicationConfig_uploadConfigurations = (SimulationApplicationConfig -> Maybe [UploadConfiguration])
-> (SimulationApplicationConfig
    -> Maybe [UploadConfiguration] -> SimulationApplicationConfig)
-> Lens
     SimulationApplicationConfig
     SimulationApplicationConfig
     (Maybe [UploadConfiguration])
     (Maybe [UploadConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SimulationApplicationConfig' {Maybe [UploadConfiguration]
uploadConfigurations :: Maybe [UploadConfiguration]
$sel:uploadConfigurations:SimulationApplicationConfig' :: SimulationApplicationConfig -> Maybe [UploadConfiguration]
uploadConfigurations} -> Maybe [UploadConfiguration]
uploadConfigurations) (\s :: SimulationApplicationConfig
s@SimulationApplicationConfig' {} Maybe [UploadConfiguration]
a -> SimulationApplicationConfig
s {$sel:uploadConfigurations:SimulationApplicationConfig' :: Maybe [UploadConfiguration]
uploadConfigurations = Maybe [UploadConfiguration]
a} :: SimulationApplicationConfig) ((Maybe [UploadConfiguration] -> f (Maybe [UploadConfiguration]))
 -> SimulationApplicationConfig -> f SimulationApplicationConfig)
-> ((Maybe [UploadConfiguration]
     -> f (Maybe [UploadConfiguration]))
    -> Maybe [UploadConfiguration] -> f (Maybe [UploadConfiguration]))
-> (Maybe [UploadConfiguration] -> f (Maybe [UploadConfiguration]))
-> SimulationApplicationConfig
-> f SimulationApplicationConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [UploadConfiguration]
  [UploadConfiguration]
  [UploadConfiguration]
  [UploadConfiguration]
-> Iso
     (Maybe [UploadConfiguration])
     (Maybe [UploadConfiguration])
     (Maybe [UploadConfiguration])
     (Maybe [UploadConfiguration])
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
  [UploadConfiguration]
  [UploadConfiguration]
  [UploadConfiguration]
  [UploadConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Information about tools configured for the simulation application.
simulationApplicationConfig_tools :: Lens.Lens' SimulationApplicationConfig (Prelude.Maybe [Tool])
simulationApplicationConfig_tools :: (Maybe [Tool] -> f (Maybe [Tool]))
-> SimulationApplicationConfig -> f SimulationApplicationConfig
simulationApplicationConfig_tools = (SimulationApplicationConfig -> Maybe [Tool])
-> (SimulationApplicationConfig
    -> Maybe [Tool] -> SimulationApplicationConfig)
-> Lens
     SimulationApplicationConfig
     SimulationApplicationConfig
     (Maybe [Tool])
     (Maybe [Tool])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SimulationApplicationConfig' {Maybe [Tool]
tools :: Maybe [Tool]
$sel:tools:SimulationApplicationConfig' :: SimulationApplicationConfig -> Maybe [Tool]
tools} -> Maybe [Tool]
tools) (\s :: SimulationApplicationConfig
s@SimulationApplicationConfig' {} Maybe [Tool]
a -> SimulationApplicationConfig
s {$sel:tools:SimulationApplicationConfig' :: Maybe [Tool]
tools = Maybe [Tool]
a} :: SimulationApplicationConfig) ((Maybe [Tool] -> f (Maybe [Tool]))
 -> SimulationApplicationConfig -> f SimulationApplicationConfig)
-> ((Maybe [Tool] -> f (Maybe [Tool]))
    -> Maybe [Tool] -> f (Maybe [Tool]))
-> (Maybe [Tool] -> f (Maybe [Tool]))
-> SimulationApplicationConfig
-> f SimulationApplicationConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tool] [Tool] [Tool] [Tool]
-> Iso (Maybe [Tool]) (Maybe [Tool]) (Maybe [Tool]) (Maybe [Tool])
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 [Tool] [Tool] [Tool] [Tool]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of world configurations.
simulationApplicationConfig_worldConfigs :: Lens.Lens' SimulationApplicationConfig (Prelude.Maybe [WorldConfig])
simulationApplicationConfig_worldConfigs :: (Maybe [WorldConfig] -> f (Maybe [WorldConfig]))
-> SimulationApplicationConfig -> f SimulationApplicationConfig
simulationApplicationConfig_worldConfigs = (SimulationApplicationConfig -> Maybe [WorldConfig])
-> (SimulationApplicationConfig
    -> Maybe [WorldConfig] -> SimulationApplicationConfig)
-> Lens
     SimulationApplicationConfig
     SimulationApplicationConfig
     (Maybe [WorldConfig])
     (Maybe [WorldConfig])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SimulationApplicationConfig' {Maybe [WorldConfig]
worldConfigs :: Maybe [WorldConfig]
$sel:worldConfigs:SimulationApplicationConfig' :: SimulationApplicationConfig -> Maybe [WorldConfig]
worldConfigs} -> Maybe [WorldConfig]
worldConfigs) (\s :: SimulationApplicationConfig
s@SimulationApplicationConfig' {} Maybe [WorldConfig]
a -> SimulationApplicationConfig
s {$sel:worldConfigs:SimulationApplicationConfig' :: Maybe [WorldConfig]
worldConfigs = Maybe [WorldConfig]
a} :: SimulationApplicationConfig) ((Maybe [WorldConfig] -> f (Maybe [WorldConfig]))
 -> SimulationApplicationConfig -> f SimulationApplicationConfig)
-> ((Maybe [WorldConfig] -> f (Maybe [WorldConfig]))
    -> Maybe [WorldConfig] -> f (Maybe [WorldConfig]))
-> (Maybe [WorldConfig] -> f (Maybe [WorldConfig]))
-> SimulationApplicationConfig
-> f SimulationApplicationConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [WorldConfig] [WorldConfig] [WorldConfig] [WorldConfig]
-> Iso
     (Maybe [WorldConfig])
     (Maybe [WorldConfig])
     (Maybe [WorldConfig])
     (Maybe [WorldConfig])
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 [WorldConfig] [WorldConfig] [WorldConfig] [WorldConfig]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The application information for the simulation application.
simulationApplicationConfig_application :: Lens.Lens' SimulationApplicationConfig Prelude.Text
simulationApplicationConfig_application :: (Text -> f Text)
-> SimulationApplicationConfig -> f SimulationApplicationConfig
simulationApplicationConfig_application = (SimulationApplicationConfig -> Text)
-> (SimulationApplicationConfig
    -> Text -> SimulationApplicationConfig)
-> Lens
     SimulationApplicationConfig SimulationApplicationConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SimulationApplicationConfig' {Text
application :: Text
$sel:application:SimulationApplicationConfig' :: SimulationApplicationConfig -> Text
application} -> Text
application) (\s :: SimulationApplicationConfig
s@SimulationApplicationConfig' {} Text
a -> SimulationApplicationConfig
s {$sel:application:SimulationApplicationConfig' :: Text
application = Text
a} :: SimulationApplicationConfig)

-- | The launch configuration for the simulation application.
simulationApplicationConfig_launchConfig :: Lens.Lens' SimulationApplicationConfig LaunchConfig
simulationApplicationConfig_launchConfig :: (LaunchConfig -> f LaunchConfig)
-> SimulationApplicationConfig -> f SimulationApplicationConfig
simulationApplicationConfig_launchConfig = (SimulationApplicationConfig -> LaunchConfig)
-> (SimulationApplicationConfig
    -> LaunchConfig -> SimulationApplicationConfig)
-> Lens
     SimulationApplicationConfig
     SimulationApplicationConfig
     LaunchConfig
     LaunchConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SimulationApplicationConfig' {LaunchConfig
launchConfig :: LaunchConfig
$sel:launchConfig:SimulationApplicationConfig' :: SimulationApplicationConfig -> LaunchConfig
launchConfig} -> LaunchConfig
launchConfig) (\s :: SimulationApplicationConfig
s@SimulationApplicationConfig' {} LaunchConfig
a -> SimulationApplicationConfig
s {$sel:launchConfig:SimulationApplicationConfig' :: LaunchConfig
launchConfig = LaunchConfig
a} :: SimulationApplicationConfig)

instance Core.FromJSON SimulationApplicationConfig where
  parseJSON :: Value -> Parser SimulationApplicationConfig
parseJSON =
    String
-> (Object -> Parser SimulationApplicationConfig)
-> Value
-> Parser SimulationApplicationConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SimulationApplicationConfig"
      ( \Object
x ->
          Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe [UploadConfiguration]
-> Maybe [Tool]
-> Maybe [WorldConfig]
-> Text
-> LaunchConfig
-> SimulationApplicationConfig
SimulationApplicationConfig'
            (Maybe Bool
 -> Maybe Bool
 -> Maybe Text
 -> Maybe [UploadConfiguration]
 -> Maybe [Tool]
 -> Maybe [WorldConfig]
 -> Text
 -> LaunchConfig
 -> SimulationApplicationConfig)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe [UploadConfiguration]
      -> Maybe [Tool]
      -> Maybe [WorldConfig]
      -> Text
      -> LaunchConfig
      -> SimulationApplicationConfig)
forall (f :: * -> *) a b. Functor 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
"useDefaultUploadConfigurations")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe [UploadConfiguration]
   -> Maybe [Tool]
   -> Maybe [WorldConfig]
   -> Text
   -> LaunchConfig
   -> SimulationApplicationConfig)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe [UploadConfiguration]
      -> Maybe [Tool]
      -> Maybe [WorldConfig]
      -> Text
      -> LaunchConfig
      -> SimulationApplicationConfig)
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
"useDefaultTools")
            Parser
  (Maybe Text
   -> Maybe [UploadConfiguration]
   -> Maybe [Tool]
   -> Maybe [WorldConfig]
   -> Text
   -> LaunchConfig
   -> SimulationApplicationConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe [UploadConfiguration]
      -> Maybe [Tool]
      -> Maybe [WorldConfig]
      -> Text
      -> LaunchConfig
      -> SimulationApplicationConfig)
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
"applicationVersion")
            Parser
  (Maybe [UploadConfiguration]
   -> Maybe [Tool]
   -> Maybe [WorldConfig]
   -> Text
   -> LaunchConfig
   -> SimulationApplicationConfig)
-> Parser (Maybe [UploadConfiguration])
-> Parser
     (Maybe [Tool]
      -> Maybe [WorldConfig]
      -> Text
      -> LaunchConfig
      -> SimulationApplicationConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [UploadConfiguration]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"uploadConfigurations"
                            Parser (Maybe (Maybe [UploadConfiguration]))
-> Maybe [UploadConfiguration]
-> Parser (Maybe [UploadConfiguration])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [UploadConfiguration]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe [Tool]
   -> Maybe [WorldConfig]
   -> Text
   -> LaunchConfig
   -> SimulationApplicationConfig)
-> Parser (Maybe [Tool])
-> Parser
     (Maybe [WorldConfig]
      -> Text -> LaunchConfig -> SimulationApplicationConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tool]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tools" Parser (Maybe (Maybe [Tool]))
-> Maybe [Tool] -> Parser (Maybe [Tool])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tool]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe [WorldConfig]
   -> Text -> LaunchConfig -> SimulationApplicationConfig)
-> Parser (Maybe [WorldConfig])
-> Parser (Text -> LaunchConfig -> SimulationApplicationConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [WorldConfig]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"worldConfigs" Parser (Maybe (Maybe [WorldConfig]))
-> Maybe [WorldConfig] -> Parser (Maybe [WorldConfig])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [WorldConfig]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Text -> LaunchConfig -> SimulationApplicationConfig)
-> Parser Text
-> Parser (LaunchConfig -> SimulationApplicationConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"application")
            Parser (LaunchConfig -> SimulationApplicationConfig)
-> Parser LaunchConfig -> Parser SimulationApplicationConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser LaunchConfig
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"launchConfig")
      )

instance Prelude.Hashable SimulationApplicationConfig

instance Prelude.NFData SimulationApplicationConfig

instance Core.ToJSON SimulationApplicationConfig where
  toJSON :: SimulationApplicationConfig -> Value
toJSON SimulationApplicationConfig' {Maybe Bool
Maybe [Tool]
Maybe [UploadConfiguration]
Maybe [WorldConfig]
Maybe Text
Text
LaunchConfig
launchConfig :: LaunchConfig
application :: Text
worldConfigs :: Maybe [WorldConfig]
tools :: Maybe [Tool]
uploadConfigurations :: Maybe [UploadConfiguration]
applicationVersion :: Maybe Text
useDefaultTools :: Maybe Bool
useDefaultUploadConfigurations :: Maybe Bool
$sel:launchConfig:SimulationApplicationConfig' :: SimulationApplicationConfig -> LaunchConfig
$sel:application:SimulationApplicationConfig' :: SimulationApplicationConfig -> Text
$sel:worldConfigs:SimulationApplicationConfig' :: SimulationApplicationConfig -> Maybe [WorldConfig]
$sel:tools:SimulationApplicationConfig' :: SimulationApplicationConfig -> Maybe [Tool]
$sel:uploadConfigurations:SimulationApplicationConfig' :: SimulationApplicationConfig -> Maybe [UploadConfiguration]
$sel:applicationVersion:SimulationApplicationConfig' :: SimulationApplicationConfig -> Maybe Text
$sel:useDefaultTools:SimulationApplicationConfig' :: SimulationApplicationConfig -> Maybe Bool
$sel:useDefaultUploadConfigurations:SimulationApplicationConfig' :: SimulationApplicationConfig -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"useDefaultUploadConfigurations" 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
useDefaultUploadConfigurations,
            (Text
"useDefaultTools" 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
useDefaultTools,
            (Text
"applicationVersion" 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
applicationVersion,
            (Text
"uploadConfigurations" Text -> [UploadConfiguration] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([UploadConfiguration] -> Pair)
-> Maybe [UploadConfiguration] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [UploadConfiguration]
uploadConfigurations,
            (Text
"tools" Text -> [Tool] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tool] -> Pair) -> Maybe [Tool] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tool]
tools,
            (Text
"worldConfigs" Text -> [WorldConfig] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([WorldConfig] -> Pair) -> Maybe [WorldConfig] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [WorldConfig]
worldConfigs,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"application" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
application),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"launchConfig" Text -> LaunchConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= LaunchConfig
launchConfig)
          ]
      )