{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.RobOMaker.Types.SimulationSoftwareSuite where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
    { $sel:name:SimulationSoftwareSuite' :: Maybe SimulationSoftwareSuiteType
name = forall a. Maybe a
Prelude.Nothing,
      $sel:version:SimulationSoftwareSuite' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the simulation software suite.
simulationSoftwareSuite_name :: Lens.Lens' SimulationSoftwareSuite (Prelude.Maybe SimulationSoftwareSuiteType)
simulationSoftwareSuite_name :: Lens' SimulationSoftwareSuite (Maybe SimulationSoftwareSuiteType)
simulationSoftwareSuite_name = 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 :: Lens' SimulationSoftwareSuite (Maybe Text)
simulationSoftwareSuite_version = 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 Data.FromJSON SimulationSoftwareSuite where
  parseJSON :: Value -> Parser SimulationSoftwareSuite
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SimulationSoftwareSuite"
      ( \Object
x ->
          Maybe SimulationSoftwareSuiteType
-> Maybe Text -> SimulationSoftwareSuite
SimulationSoftwareSuite'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"version")
      )

instance Prelude.Hashable SimulationSoftwareSuite where
  hashWithSalt :: Int -> SimulationSoftwareSuite -> Int
hashWithSalt Int
_salt SimulationSoftwareSuite' {Maybe Text
Maybe SimulationSoftwareSuiteType
version :: Maybe Text
name :: Maybe SimulationSoftwareSuiteType
$sel:version:SimulationSoftwareSuite' :: SimulationSoftwareSuite -> Maybe Text
$sel:name:SimulationSoftwareSuite' :: SimulationSoftwareSuite -> Maybe SimulationSoftwareSuiteType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SimulationSoftwareSuiteType
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
version

instance Prelude.NFData SimulationSoftwareSuite where
  rnf :: SimulationSoftwareSuite -> ()
rnf SimulationSoftwareSuite' {Maybe Text
Maybe SimulationSoftwareSuiteType
version :: Maybe Text
name :: Maybe SimulationSoftwareSuiteType
$sel:version:SimulationSoftwareSuite' :: SimulationSoftwareSuite -> Maybe Text
$sel:name:SimulationSoftwareSuite' :: SimulationSoftwareSuite -> Maybe SimulationSoftwareSuiteType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe SimulationSoftwareSuiteType
name seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
version

instance Data.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
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SimulationSoftwareSuiteType
name,
            (Key
"version" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
version
          ]
      )