{-# 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.RobotApplicationConfig
-- 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.RobotApplicationConfig 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

-- | Application configuration information for a robot.
--
-- /See:/ 'newRobotApplicationConfig' smart constructor.
data RobotApplicationConfig = RobotApplicationConfig'
  { -- | 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@.
    RobotApplicationConfig -> Maybe Bool
useDefaultUploadConfigurations :: Prelude.Maybe Prelude.Bool,
    -- | A Boolean indicating whether to use default robot application tools. The
    -- default tools are rviz, rqt, terminal and rosbag record. The default is
    -- @False@.
    RobotApplicationConfig -> Maybe Bool
useDefaultTools :: Prelude.Maybe Prelude.Bool,
    -- | The version of the robot application.
    RobotApplicationConfig -> Maybe Text
applicationVersion :: Prelude.Maybe Prelude.Text,
    -- | The upload configurations for the robot application.
    RobotApplicationConfig -> Maybe [UploadConfiguration]
uploadConfigurations :: Prelude.Maybe [UploadConfiguration],
    -- | Information about tools configured for the robot application.
    RobotApplicationConfig -> Maybe [Tool]
tools :: Prelude.Maybe [Tool],
    -- | The application information for the robot application.
    RobotApplicationConfig -> Text
application :: Prelude.Text,
    -- | The launch configuration for the robot application.
    RobotApplicationConfig -> LaunchConfig
launchConfig :: LaunchConfig
  }
  deriving (RobotApplicationConfig -> RobotApplicationConfig -> Bool
(RobotApplicationConfig -> RobotApplicationConfig -> Bool)
-> (RobotApplicationConfig -> RobotApplicationConfig -> Bool)
-> Eq RobotApplicationConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RobotApplicationConfig -> RobotApplicationConfig -> Bool
$c/= :: RobotApplicationConfig -> RobotApplicationConfig -> Bool
== :: RobotApplicationConfig -> RobotApplicationConfig -> Bool
$c== :: RobotApplicationConfig -> RobotApplicationConfig -> Bool
Prelude.Eq, ReadPrec [RobotApplicationConfig]
ReadPrec RobotApplicationConfig
Int -> ReadS RobotApplicationConfig
ReadS [RobotApplicationConfig]
(Int -> ReadS RobotApplicationConfig)
-> ReadS [RobotApplicationConfig]
-> ReadPrec RobotApplicationConfig
-> ReadPrec [RobotApplicationConfig]
-> Read RobotApplicationConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RobotApplicationConfig]
$creadListPrec :: ReadPrec [RobotApplicationConfig]
readPrec :: ReadPrec RobotApplicationConfig
$creadPrec :: ReadPrec RobotApplicationConfig
readList :: ReadS [RobotApplicationConfig]
$creadList :: ReadS [RobotApplicationConfig]
readsPrec :: Int -> ReadS RobotApplicationConfig
$creadsPrec :: Int -> ReadS RobotApplicationConfig
Prelude.Read, Int -> RobotApplicationConfig -> ShowS
[RobotApplicationConfig] -> ShowS
RobotApplicationConfig -> String
(Int -> RobotApplicationConfig -> ShowS)
-> (RobotApplicationConfig -> String)
-> ([RobotApplicationConfig] -> ShowS)
-> Show RobotApplicationConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RobotApplicationConfig] -> ShowS
$cshowList :: [RobotApplicationConfig] -> ShowS
show :: RobotApplicationConfig -> String
$cshow :: RobotApplicationConfig -> String
showsPrec :: Int -> RobotApplicationConfig -> ShowS
$cshowsPrec :: Int -> RobotApplicationConfig -> ShowS
Prelude.Show, (forall x. RobotApplicationConfig -> Rep RobotApplicationConfig x)
-> (forall x.
    Rep RobotApplicationConfig x -> RobotApplicationConfig)
-> Generic RobotApplicationConfig
forall x. Rep RobotApplicationConfig x -> RobotApplicationConfig
forall x. RobotApplicationConfig -> Rep RobotApplicationConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RobotApplicationConfig x -> RobotApplicationConfig
$cfrom :: forall x. RobotApplicationConfig -> Rep RobotApplicationConfig x
Prelude.Generic)

-- |
-- Create a value of 'RobotApplicationConfig' 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', 'robotApplicationConfig_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', 'robotApplicationConfig_useDefaultTools' - A Boolean indicating whether to use default robot application tools. The
-- default tools are rviz, rqt, terminal and rosbag record. The default is
-- @False@.
--
-- 'applicationVersion', 'robotApplicationConfig_applicationVersion' - The version of the robot application.
--
-- 'uploadConfigurations', 'robotApplicationConfig_uploadConfigurations' - The upload configurations for the robot application.
--
-- 'tools', 'robotApplicationConfig_tools' - Information about tools configured for the robot application.
--
-- 'application', 'robotApplicationConfig_application' - The application information for the robot application.
--
-- 'launchConfig', 'robotApplicationConfig_launchConfig' - The launch configuration for the robot application.
newRobotApplicationConfig ::
  -- | 'application'
  Prelude.Text ->
  -- | 'launchConfig'
  LaunchConfig ->
  RobotApplicationConfig
newRobotApplicationConfig :: Text -> LaunchConfig -> RobotApplicationConfig
newRobotApplicationConfig
  Text
pApplication_
  LaunchConfig
pLaunchConfig_ =
    RobotApplicationConfig' :: Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe [UploadConfiguration]
-> Maybe [Tool]
-> Text
-> LaunchConfig
-> RobotApplicationConfig
RobotApplicationConfig'
      { $sel:useDefaultUploadConfigurations:RobotApplicationConfig' :: Maybe Bool
useDefaultUploadConfigurations =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:useDefaultTools:RobotApplicationConfig' :: Maybe Bool
useDefaultTools = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:applicationVersion:RobotApplicationConfig' :: Maybe Text
applicationVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:uploadConfigurations:RobotApplicationConfig' :: Maybe [UploadConfiguration]
uploadConfigurations = Maybe [UploadConfiguration]
forall a. Maybe a
Prelude.Nothing,
        $sel:tools:RobotApplicationConfig' :: Maybe [Tool]
tools = Maybe [Tool]
forall a. Maybe a
Prelude.Nothing,
        $sel:application:RobotApplicationConfig' :: Text
application = Text
pApplication_,
        $sel:launchConfig:RobotApplicationConfig' :: 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@.
robotApplicationConfig_useDefaultUploadConfigurations :: Lens.Lens' RobotApplicationConfig (Prelude.Maybe Prelude.Bool)
robotApplicationConfig_useDefaultUploadConfigurations :: (Maybe Bool -> f (Maybe Bool))
-> RobotApplicationConfig -> f RobotApplicationConfig
robotApplicationConfig_useDefaultUploadConfigurations = (RobotApplicationConfig -> Maybe Bool)
-> (RobotApplicationConfig -> Maybe Bool -> RobotApplicationConfig)
-> Lens
     RobotApplicationConfig
     RobotApplicationConfig
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RobotApplicationConfig' {Maybe Bool
useDefaultUploadConfigurations :: Maybe Bool
$sel:useDefaultUploadConfigurations:RobotApplicationConfig' :: RobotApplicationConfig -> Maybe Bool
useDefaultUploadConfigurations} -> Maybe Bool
useDefaultUploadConfigurations) (\s :: RobotApplicationConfig
s@RobotApplicationConfig' {} Maybe Bool
a -> RobotApplicationConfig
s {$sel:useDefaultUploadConfigurations:RobotApplicationConfig' :: Maybe Bool
useDefaultUploadConfigurations = Maybe Bool
a} :: RobotApplicationConfig)

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

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

-- | The upload configurations for the robot application.
robotApplicationConfig_uploadConfigurations :: Lens.Lens' RobotApplicationConfig (Prelude.Maybe [UploadConfiguration])
robotApplicationConfig_uploadConfigurations :: (Maybe [UploadConfiguration] -> f (Maybe [UploadConfiguration]))
-> RobotApplicationConfig -> f RobotApplicationConfig
robotApplicationConfig_uploadConfigurations = (RobotApplicationConfig -> Maybe [UploadConfiguration])
-> (RobotApplicationConfig
    -> Maybe [UploadConfiguration] -> RobotApplicationConfig)
-> Lens
     RobotApplicationConfig
     RobotApplicationConfig
     (Maybe [UploadConfiguration])
     (Maybe [UploadConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RobotApplicationConfig' {Maybe [UploadConfiguration]
uploadConfigurations :: Maybe [UploadConfiguration]
$sel:uploadConfigurations:RobotApplicationConfig' :: RobotApplicationConfig -> Maybe [UploadConfiguration]
uploadConfigurations} -> Maybe [UploadConfiguration]
uploadConfigurations) (\s :: RobotApplicationConfig
s@RobotApplicationConfig' {} Maybe [UploadConfiguration]
a -> RobotApplicationConfig
s {$sel:uploadConfigurations:RobotApplicationConfig' :: Maybe [UploadConfiguration]
uploadConfigurations = Maybe [UploadConfiguration]
a} :: RobotApplicationConfig) ((Maybe [UploadConfiguration] -> f (Maybe [UploadConfiguration]))
 -> RobotApplicationConfig -> f RobotApplicationConfig)
-> ((Maybe [UploadConfiguration]
     -> f (Maybe [UploadConfiguration]))
    -> Maybe [UploadConfiguration] -> f (Maybe [UploadConfiguration]))
-> (Maybe [UploadConfiguration] -> f (Maybe [UploadConfiguration]))
-> RobotApplicationConfig
-> f RobotApplicationConfig
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 robot application.
robotApplicationConfig_tools :: Lens.Lens' RobotApplicationConfig (Prelude.Maybe [Tool])
robotApplicationConfig_tools :: (Maybe [Tool] -> f (Maybe [Tool]))
-> RobotApplicationConfig -> f RobotApplicationConfig
robotApplicationConfig_tools = (RobotApplicationConfig -> Maybe [Tool])
-> (RobotApplicationConfig
    -> Maybe [Tool] -> RobotApplicationConfig)
-> Lens
     RobotApplicationConfig
     RobotApplicationConfig
     (Maybe [Tool])
     (Maybe [Tool])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RobotApplicationConfig' {Maybe [Tool]
tools :: Maybe [Tool]
$sel:tools:RobotApplicationConfig' :: RobotApplicationConfig -> Maybe [Tool]
tools} -> Maybe [Tool]
tools) (\s :: RobotApplicationConfig
s@RobotApplicationConfig' {} Maybe [Tool]
a -> RobotApplicationConfig
s {$sel:tools:RobotApplicationConfig' :: Maybe [Tool]
tools = Maybe [Tool]
a} :: RobotApplicationConfig) ((Maybe [Tool] -> f (Maybe [Tool]))
 -> RobotApplicationConfig -> f RobotApplicationConfig)
-> ((Maybe [Tool] -> f (Maybe [Tool]))
    -> Maybe [Tool] -> f (Maybe [Tool]))
-> (Maybe [Tool] -> f (Maybe [Tool]))
-> RobotApplicationConfig
-> f RobotApplicationConfig
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

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

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

instance Core.FromJSON RobotApplicationConfig where
  parseJSON :: Value -> Parser RobotApplicationConfig
parseJSON =
    String
-> (Object -> Parser RobotApplicationConfig)
-> Value
-> Parser RobotApplicationConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RobotApplicationConfig"
      ( \Object
x ->
          Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe [UploadConfiguration]
-> Maybe [Tool]
-> Text
-> LaunchConfig
-> RobotApplicationConfig
RobotApplicationConfig'
            (Maybe Bool
 -> Maybe Bool
 -> Maybe Text
 -> Maybe [UploadConfiguration]
 -> Maybe [Tool]
 -> Text
 -> LaunchConfig
 -> RobotApplicationConfig)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe [UploadConfiguration]
      -> Maybe [Tool]
      -> Text
      -> LaunchConfig
      -> RobotApplicationConfig)
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]
   -> Text
   -> LaunchConfig
   -> RobotApplicationConfig)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe [UploadConfiguration]
      -> Maybe [Tool]
      -> Text
      -> LaunchConfig
      -> RobotApplicationConfig)
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]
   -> Text
   -> LaunchConfig
   -> RobotApplicationConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe [UploadConfiguration]
      -> Maybe [Tool] -> Text -> LaunchConfig -> RobotApplicationConfig)
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] -> Text -> LaunchConfig -> RobotApplicationConfig)
-> Parser (Maybe [UploadConfiguration])
-> Parser
     (Maybe [Tool] -> Text -> LaunchConfig -> RobotApplicationConfig)
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] -> Text -> LaunchConfig -> RobotApplicationConfig)
-> Parser (Maybe [Tool])
-> Parser (Text -> LaunchConfig -> RobotApplicationConfig)
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 (Text -> LaunchConfig -> RobotApplicationConfig)
-> Parser Text -> Parser (LaunchConfig -> RobotApplicationConfig)
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 -> RobotApplicationConfig)
-> Parser LaunchConfig -> Parser RobotApplicationConfig
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 RobotApplicationConfig

instance Prelude.NFData RobotApplicationConfig

instance Core.ToJSON RobotApplicationConfig where
  toJSON :: RobotApplicationConfig -> Value
toJSON RobotApplicationConfig' {Maybe Bool
Maybe [Tool]
Maybe [UploadConfiguration]
Maybe Text
Text
LaunchConfig
launchConfig :: LaunchConfig
application :: Text
tools :: Maybe [Tool]
uploadConfigurations :: Maybe [UploadConfiguration]
applicationVersion :: Maybe Text
useDefaultTools :: Maybe Bool
useDefaultUploadConfigurations :: Maybe Bool
$sel:launchConfig:RobotApplicationConfig' :: RobotApplicationConfig -> LaunchConfig
$sel:application:RobotApplicationConfig' :: RobotApplicationConfig -> Text
$sel:tools:RobotApplicationConfig' :: RobotApplicationConfig -> Maybe [Tool]
$sel:uploadConfigurations:RobotApplicationConfig' :: RobotApplicationConfig -> Maybe [UploadConfiguration]
$sel:applicationVersion:RobotApplicationConfig' :: RobotApplicationConfig -> Maybe Text
$sel:useDefaultTools:RobotApplicationConfig' :: RobotApplicationConfig -> Maybe Bool
$sel:useDefaultUploadConfigurations:RobotApplicationConfig' :: RobotApplicationConfig -> 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,
            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)
          ]
      )