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

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

-- | Information about a simulation software suite.
--
-- /See:/ 'newSimulationSoftwareSuite' smart constructor.
data SimulationSoftwareSuite = SimulationSoftwareSuite'
  { -- | The name of the simulation software suite.
    SimulationSoftwareSuite -> Maybe SimulationSoftwareSuiteType
name :: Prelude.Maybe SimulationSoftwareSuiteType,
    -- | The version of the simulation software suite.
    SimulationSoftwareSuite -> Maybe Text
version :: Prelude.Maybe Prelude.Text
  }
  deriving (SimulationSoftwareSuite -> SimulationSoftwareSuite -> Bool
(SimulationSoftwareSuite -> SimulationSoftwareSuite -> Bool)
-> (SimulationSoftwareSuite -> SimulationSoftwareSuite -> Bool)
-> Eq SimulationSoftwareSuite
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SimulationSoftwareSuite -> SimulationSoftwareSuite -> Bool
$c/= :: SimulationSoftwareSuite -> SimulationSoftwareSuite -> Bool
== :: SimulationSoftwareSuite -> SimulationSoftwareSuite -> Bool
$c== :: SimulationSoftwareSuite -> SimulationSoftwareSuite -> Bool
Prelude.Eq, ReadPrec [SimulationSoftwareSuite]
ReadPrec SimulationSoftwareSuite
Int -> ReadS SimulationSoftwareSuite
ReadS [SimulationSoftwareSuite]
(Int -> ReadS SimulationSoftwareSuite)
-> ReadS [SimulationSoftwareSuite]
-> ReadPrec SimulationSoftwareSuite
-> ReadPrec [SimulationSoftwareSuite]
-> Read SimulationSoftwareSuite
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SimulationSoftwareSuite]
$creadListPrec :: ReadPrec [SimulationSoftwareSuite]
readPrec :: ReadPrec SimulationSoftwareSuite
$creadPrec :: ReadPrec SimulationSoftwareSuite
readList :: ReadS [SimulationSoftwareSuite]
$creadList :: ReadS [SimulationSoftwareSuite]
readsPrec :: Int -> ReadS SimulationSoftwareSuite
$creadsPrec :: Int -> ReadS SimulationSoftwareSuite
Prelude.Read, Int -> SimulationSoftwareSuite -> ShowS
[SimulationSoftwareSuite] -> ShowS
SimulationSoftwareSuite -> String
(Int -> SimulationSoftwareSuite -> ShowS)
-> (SimulationSoftwareSuite -> String)
-> ([SimulationSoftwareSuite] -> ShowS)
-> Show SimulationSoftwareSuite
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SimulationSoftwareSuite] -> ShowS
$cshowList :: [SimulationSoftwareSuite] -> ShowS
show :: SimulationSoftwareSuite -> String
$cshow :: SimulationSoftwareSuite -> String
showsPrec :: Int -> SimulationSoftwareSuite -> ShowS
$cshowsPrec :: Int -> SimulationSoftwareSuite -> ShowS
Prelude.Show, (forall x.
 SimulationSoftwareSuite -> Rep SimulationSoftwareSuite x)
-> (forall x.
    Rep SimulationSoftwareSuite x -> SimulationSoftwareSuite)
-> Generic SimulationSoftwareSuite
forall x. Rep SimulationSoftwareSuite x -> SimulationSoftwareSuite
forall x. SimulationSoftwareSuite -> Rep SimulationSoftwareSuite x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SimulationSoftwareSuite x -> SimulationSoftwareSuite
$cfrom :: forall x. SimulationSoftwareSuite -> Rep SimulationSoftwareSuite x
Prelude.Generic)

-- |
-- Create a value of 'SimulationSoftwareSuite' 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:
--
-- 'name', 'simulationSoftwareSuite_name' - The name of the simulation software suite.
--
-- 'version', 'simulationSoftwareSuite_version' - The version of the simulation software suite.
newSimulationSoftwareSuite ::
  SimulationSoftwareSuite
newSimulationSoftwareSuite :: SimulationSoftwareSuite
newSimulationSoftwareSuite =
  SimulationSoftwareSuite' :: Maybe SimulationSoftwareSuiteType
-> Maybe Text -> SimulationSoftwareSuite
SimulationSoftwareSuite'
    { $sel:name:SimulationSoftwareSuite' :: Maybe SimulationSoftwareSuiteType
name = Maybe SimulationSoftwareSuiteType
forall a. Maybe a
Prelude.Nothing,
      $sel:version:SimulationSoftwareSuite' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the simulation software suite.
simulationSoftwareSuite_name :: Lens.Lens' SimulationSoftwareSuite (Prelude.Maybe SimulationSoftwareSuiteType)
simulationSoftwareSuite_name :: (Maybe SimulationSoftwareSuiteType
 -> f (Maybe SimulationSoftwareSuiteType))
-> SimulationSoftwareSuite -> f SimulationSoftwareSuite
simulationSoftwareSuite_name = (SimulationSoftwareSuite -> Maybe SimulationSoftwareSuiteType)
-> (SimulationSoftwareSuite
    -> Maybe SimulationSoftwareSuiteType -> SimulationSoftwareSuite)
-> Lens
     SimulationSoftwareSuite
     SimulationSoftwareSuite
     (Maybe SimulationSoftwareSuiteType)
     (Maybe SimulationSoftwareSuiteType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SimulationSoftwareSuite' {Maybe SimulationSoftwareSuiteType
name :: Maybe SimulationSoftwareSuiteType
$sel:name:SimulationSoftwareSuite' :: SimulationSoftwareSuite -> Maybe SimulationSoftwareSuiteType
name} -> Maybe SimulationSoftwareSuiteType
name) (\s :: SimulationSoftwareSuite
s@SimulationSoftwareSuite' {} Maybe SimulationSoftwareSuiteType
a -> SimulationSoftwareSuite
s {$sel:name:SimulationSoftwareSuite' :: Maybe SimulationSoftwareSuiteType
name = Maybe SimulationSoftwareSuiteType
a} :: SimulationSoftwareSuite)

-- | The version of the simulation software suite.
simulationSoftwareSuite_version :: Lens.Lens' SimulationSoftwareSuite (Prelude.Maybe Prelude.Text)
simulationSoftwareSuite_version :: (Maybe Text -> f (Maybe Text))
-> SimulationSoftwareSuite -> f SimulationSoftwareSuite
simulationSoftwareSuite_version = (SimulationSoftwareSuite -> Maybe Text)
-> (SimulationSoftwareSuite
    -> Maybe Text -> SimulationSoftwareSuite)
-> Lens
     SimulationSoftwareSuite
     SimulationSoftwareSuite
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SimulationSoftwareSuite' {Maybe Text
version :: Maybe Text
$sel:version:SimulationSoftwareSuite' :: SimulationSoftwareSuite -> Maybe Text
version} -> Maybe Text
version) (\s :: SimulationSoftwareSuite
s@SimulationSoftwareSuite' {} Maybe Text
a -> SimulationSoftwareSuite
s {$sel:version:SimulationSoftwareSuite' :: Maybe Text
version = Maybe Text
a} :: SimulationSoftwareSuite)

instance Core.FromJSON SimulationSoftwareSuite where
  parseJSON :: Value -> Parser SimulationSoftwareSuite
parseJSON =
    String
-> (Object -> Parser SimulationSoftwareSuite)
-> Value
-> Parser SimulationSoftwareSuite
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SimulationSoftwareSuite"
      ( \Object
x ->
          Maybe SimulationSoftwareSuiteType
-> Maybe Text -> SimulationSoftwareSuite
SimulationSoftwareSuite'
            (Maybe SimulationSoftwareSuiteType
 -> Maybe Text -> SimulationSoftwareSuite)
-> Parser (Maybe SimulationSoftwareSuiteType)
-> Parser (Maybe Text -> SimulationSoftwareSuite)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe SimulationSoftwareSuiteType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
            Parser (Maybe Text -> SimulationSoftwareSuite)
-> Parser (Maybe Text) -> Parser SimulationSoftwareSuite
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
"version")
      )

instance Prelude.Hashable SimulationSoftwareSuite

instance Prelude.NFData SimulationSoftwareSuite

instance Core.ToJSON SimulationSoftwareSuite where
  toJSON :: SimulationSoftwareSuite -> Value
toJSON SimulationSoftwareSuite' {Maybe Text
Maybe SimulationSoftwareSuiteType
version :: Maybe Text
name :: Maybe SimulationSoftwareSuiteType
$sel:version:SimulationSoftwareSuite' :: SimulationSoftwareSuite -> Maybe Text
$sel:name:SimulationSoftwareSuite' :: SimulationSoftwareSuite -> Maybe SimulationSoftwareSuiteType
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"name" Text -> SimulationSoftwareSuiteType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SimulationSoftwareSuiteType -> Pair)
-> Maybe SimulationSoftwareSuiteType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SimulationSoftwareSuiteType
name,
            (Text
"version" 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
version
          ]
      )