{-# 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.DeploymentApplicationConfig
-- 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.DeploymentApplicationConfig where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RobOMaker.Types.DeploymentLaunchConfig

-- | Information about a deployment application configuration.
--
-- /See:/ 'newDeploymentApplicationConfig' smart constructor.
data DeploymentApplicationConfig = DeploymentApplicationConfig'
  { -- | The Amazon Resource Name (ARN) of the robot application.
    DeploymentApplicationConfig -> Text
application :: Prelude.Text,
    -- | The version of the application.
    DeploymentApplicationConfig -> Text
applicationVersion :: Prelude.Text,
    -- | The launch configuration.
    DeploymentApplicationConfig -> DeploymentLaunchConfig
launchConfig :: DeploymentLaunchConfig
  }
  deriving (DeploymentApplicationConfig -> DeploymentApplicationConfig -> Bool
(DeploymentApplicationConfig
 -> DeploymentApplicationConfig -> Bool)
-> (DeploymentApplicationConfig
    -> DeploymentApplicationConfig -> Bool)
-> Eq DeploymentApplicationConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeploymentApplicationConfig -> DeploymentApplicationConfig -> Bool
$c/= :: DeploymentApplicationConfig -> DeploymentApplicationConfig -> Bool
== :: DeploymentApplicationConfig -> DeploymentApplicationConfig -> Bool
$c== :: DeploymentApplicationConfig -> DeploymentApplicationConfig -> Bool
Prelude.Eq, ReadPrec [DeploymentApplicationConfig]
ReadPrec DeploymentApplicationConfig
Int -> ReadS DeploymentApplicationConfig
ReadS [DeploymentApplicationConfig]
(Int -> ReadS DeploymentApplicationConfig)
-> ReadS [DeploymentApplicationConfig]
-> ReadPrec DeploymentApplicationConfig
-> ReadPrec [DeploymentApplicationConfig]
-> Read DeploymentApplicationConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeploymentApplicationConfig]
$creadListPrec :: ReadPrec [DeploymentApplicationConfig]
readPrec :: ReadPrec DeploymentApplicationConfig
$creadPrec :: ReadPrec DeploymentApplicationConfig
readList :: ReadS [DeploymentApplicationConfig]
$creadList :: ReadS [DeploymentApplicationConfig]
readsPrec :: Int -> ReadS DeploymentApplicationConfig
$creadsPrec :: Int -> ReadS DeploymentApplicationConfig
Prelude.Read, Int -> DeploymentApplicationConfig -> ShowS
[DeploymentApplicationConfig] -> ShowS
DeploymentApplicationConfig -> String
(Int -> DeploymentApplicationConfig -> ShowS)
-> (DeploymentApplicationConfig -> String)
-> ([DeploymentApplicationConfig] -> ShowS)
-> Show DeploymentApplicationConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeploymentApplicationConfig] -> ShowS
$cshowList :: [DeploymentApplicationConfig] -> ShowS
show :: DeploymentApplicationConfig -> String
$cshow :: DeploymentApplicationConfig -> String
showsPrec :: Int -> DeploymentApplicationConfig -> ShowS
$cshowsPrec :: Int -> DeploymentApplicationConfig -> ShowS
Prelude.Show, (forall x.
 DeploymentApplicationConfig -> Rep DeploymentApplicationConfig x)
-> (forall x.
    Rep DeploymentApplicationConfig x -> DeploymentApplicationConfig)
-> Generic DeploymentApplicationConfig
forall x.
Rep DeploymentApplicationConfig x -> DeploymentApplicationConfig
forall x.
DeploymentApplicationConfig -> Rep DeploymentApplicationConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeploymentApplicationConfig x -> DeploymentApplicationConfig
$cfrom :: forall x.
DeploymentApplicationConfig -> Rep DeploymentApplicationConfig x
Prelude.Generic)

-- |
-- Create a value of 'DeploymentApplicationConfig' 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:
--
-- 'application', 'deploymentApplicationConfig_application' - The Amazon Resource Name (ARN) of the robot application.
--
-- 'applicationVersion', 'deploymentApplicationConfig_applicationVersion' - The version of the application.
--
-- 'launchConfig', 'deploymentApplicationConfig_launchConfig' - The launch configuration.
newDeploymentApplicationConfig ::
  -- | 'application'
  Prelude.Text ->
  -- | 'applicationVersion'
  Prelude.Text ->
  -- | 'launchConfig'
  DeploymentLaunchConfig ->
  DeploymentApplicationConfig
newDeploymentApplicationConfig :: Text
-> Text -> DeploymentLaunchConfig -> DeploymentApplicationConfig
newDeploymentApplicationConfig
  Text
pApplication_
  Text
pApplicationVersion_
  DeploymentLaunchConfig
pLaunchConfig_ =
    DeploymentApplicationConfig' :: Text
-> Text -> DeploymentLaunchConfig -> DeploymentApplicationConfig
DeploymentApplicationConfig'
      { $sel:application:DeploymentApplicationConfig' :: Text
application =
          Text
pApplication_,
        $sel:applicationVersion:DeploymentApplicationConfig' :: Text
applicationVersion = Text
pApplicationVersion_,
        $sel:launchConfig:DeploymentApplicationConfig' :: DeploymentLaunchConfig
launchConfig = DeploymentLaunchConfig
pLaunchConfig_
      }

-- | The Amazon Resource Name (ARN) of the robot application.
deploymentApplicationConfig_application :: Lens.Lens' DeploymentApplicationConfig Prelude.Text
deploymentApplicationConfig_application :: (Text -> f Text)
-> DeploymentApplicationConfig -> f DeploymentApplicationConfig
deploymentApplicationConfig_application = (DeploymentApplicationConfig -> Text)
-> (DeploymentApplicationConfig
    -> Text -> DeploymentApplicationConfig)
-> Lens
     DeploymentApplicationConfig DeploymentApplicationConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentApplicationConfig' {Text
application :: Text
$sel:application:DeploymentApplicationConfig' :: DeploymentApplicationConfig -> Text
application} -> Text
application) (\s :: DeploymentApplicationConfig
s@DeploymentApplicationConfig' {} Text
a -> DeploymentApplicationConfig
s {$sel:application:DeploymentApplicationConfig' :: Text
application = Text
a} :: DeploymentApplicationConfig)

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

-- | The launch configuration.
deploymentApplicationConfig_launchConfig :: Lens.Lens' DeploymentApplicationConfig DeploymentLaunchConfig
deploymentApplicationConfig_launchConfig :: (DeploymentLaunchConfig -> f DeploymentLaunchConfig)
-> DeploymentApplicationConfig -> f DeploymentApplicationConfig
deploymentApplicationConfig_launchConfig = (DeploymentApplicationConfig -> DeploymentLaunchConfig)
-> (DeploymentApplicationConfig
    -> DeploymentLaunchConfig -> DeploymentApplicationConfig)
-> Lens
     DeploymentApplicationConfig
     DeploymentApplicationConfig
     DeploymentLaunchConfig
     DeploymentLaunchConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentApplicationConfig' {DeploymentLaunchConfig
launchConfig :: DeploymentLaunchConfig
$sel:launchConfig:DeploymentApplicationConfig' :: DeploymentApplicationConfig -> DeploymentLaunchConfig
launchConfig} -> DeploymentLaunchConfig
launchConfig) (\s :: DeploymentApplicationConfig
s@DeploymentApplicationConfig' {} DeploymentLaunchConfig
a -> DeploymentApplicationConfig
s {$sel:launchConfig:DeploymentApplicationConfig' :: DeploymentLaunchConfig
launchConfig = DeploymentLaunchConfig
a} :: DeploymentApplicationConfig)

instance Core.FromJSON DeploymentApplicationConfig where
  parseJSON :: Value -> Parser DeploymentApplicationConfig
parseJSON =
    String
-> (Object -> Parser DeploymentApplicationConfig)
-> Value
-> Parser DeploymentApplicationConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DeploymentApplicationConfig"
      ( \Object
x ->
          Text
-> Text -> DeploymentLaunchConfig -> DeploymentApplicationConfig
DeploymentApplicationConfig'
            (Text
 -> Text -> DeploymentLaunchConfig -> DeploymentApplicationConfig)
-> Parser Text
-> Parser
     (Text -> DeploymentLaunchConfig -> DeploymentApplicationConfig)
forall (f :: * -> *) a b. Functor 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
  (Text -> DeploymentLaunchConfig -> DeploymentApplicationConfig)
-> Parser Text
-> Parser (DeploymentLaunchConfig -> DeploymentApplicationConfig)
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
"applicationVersion")
            Parser (DeploymentLaunchConfig -> DeploymentApplicationConfig)
-> Parser DeploymentLaunchConfig
-> Parser DeploymentApplicationConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DeploymentLaunchConfig
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"launchConfig")
      )

instance Prelude.Hashable DeploymentApplicationConfig

instance Prelude.NFData DeploymentApplicationConfig

instance Core.ToJSON DeploymentApplicationConfig where
  toJSON :: DeploymentApplicationConfig -> Value
toJSON DeploymentApplicationConfig' {Text
DeploymentLaunchConfig
launchConfig :: DeploymentLaunchConfig
applicationVersion :: Text
application :: Text
$sel:launchConfig:DeploymentApplicationConfig' :: DeploymentApplicationConfig -> DeploymentLaunchConfig
$sel:applicationVersion:DeploymentApplicationConfig' :: DeploymentApplicationConfig -> Text
$sel:application:DeploymentApplicationConfig' :: DeploymentApplicationConfig -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ 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
"applicationVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
applicationVersion),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"launchConfig" Text -> DeploymentLaunchConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DeploymentLaunchConfig
launchConfig)
          ]
      )