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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RobOMaker.Types.RobotSoftwareSuiteType
import Amazonka.RobOMaker.Types.RobotSoftwareSuiteVersionType

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

-- |
-- Create a value of 'RobotSoftwareSuite' 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', 'robotSoftwareSuite_name' - The name of the robot software suite (ROS distribution).
--
-- 'version', 'robotSoftwareSuite_version' - The version of the robot software suite (ROS distribution).
newRobotSoftwareSuite ::
  RobotSoftwareSuite
newRobotSoftwareSuite :: RobotSoftwareSuite
newRobotSoftwareSuite =
  RobotSoftwareSuite' :: Maybe RobotSoftwareSuiteType
-> Maybe RobotSoftwareSuiteVersionType -> RobotSoftwareSuite
RobotSoftwareSuite'
    { $sel:name:RobotSoftwareSuite' :: Maybe RobotSoftwareSuiteType
name = Maybe RobotSoftwareSuiteType
forall a. Maybe a
Prelude.Nothing,
      $sel:version:RobotSoftwareSuite' :: Maybe RobotSoftwareSuiteVersionType
version = Maybe RobotSoftwareSuiteVersionType
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the robot software suite (ROS distribution).
robotSoftwareSuite_name :: Lens.Lens' RobotSoftwareSuite (Prelude.Maybe RobotSoftwareSuiteType)
robotSoftwareSuite_name :: (Maybe RobotSoftwareSuiteType -> f (Maybe RobotSoftwareSuiteType))
-> RobotSoftwareSuite -> f RobotSoftwareSuite
robotSoftwareSuite_name = (RobotSoftwareSuite -> Maybe RobotSoftwareSuiteType)
-> (RobotSoftwareSuite
    -> Maybe RobotSoftwareSuiteType -> RobotSoftwareSuite)
-> Lens
     RobotSoftwareSuite
     RobotSoftwareSuite
     (Maybe RobotSoftwareSuiteType)
     (Maybe RobotSoftwareSuiteType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RobotSoftwareSuite' {Maybe RobotSoftwareSuiteType
name :: Maybe RobotSoftwareSuiteType
$sel:name:RobotSoftwareSuite' :: RobotSoftwareSuite -> Maybe RobotSoftwareSuiteType
name} -> Maybe RobotSoftwareSuiteType
name) (\s :: RobotSoftwareSuite
s@RobotSoftwareSuite' {} Maybe RobotSoftwareSuiteType
a -> RobotSoftwareSuite
s {$sel:name:RobotSoftwareSuite' :: Maybe RobotSoftwareSuiteType
name = Maybe RobotSoftwareSuiteType
a} :: RobotSoftwareSuite)

-- | The version of the robot software suite (ROS distribution).
robotSoftwareSuite_version :: Lens.Lens' RobotSoftwareSuite (Prelude.Maybe RobotSoftwareSuiteVersionType)
robotSoftwareSuite_version :: (Maybe RobotSoftwareSuiteVersionType
 -> f (Maybe RobotSoftwareSuiteVersionType))
-> RobotSoftwareSuite -> f RobotSoftwareSuite
robotSoftwareSuite_version = (RobotSoftwareSuite -> Maybe RobotSoftwareSuiteVersionType)
-> (RobotSoftwareSuite
    -> Maybe RobotSoftwareSuiteVersionType -> RobotSoftwareSuite)
-> Lens
     RobotSoftwareSuite
     RobotSoftwareSuite
     (Maybe RobotSoftwareSuiteVersionType)
     (Maybe RobotSoftwareSuiteVersionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RobotSoftwareSuite' {Maybe RobotSoftwareSuiteVersionType
version :: Maybe RobotSoftwareSuiteVersionType
$sel:version:RobotSoftwareSuite' :: RobotSoftwareSuite -> Maybe RobotSoftwareSuiteVersionType
version} -> Maybe RobotSoftwareSuiteVersionType
version) (\s :: RobotSoftwareSuite
s@RobotSoftwareSuite' {} Maybe RobotSoftwareSuiteVersionType
a -> RobotSoftwareSuite
s {$sel:version:RobotSoftwareSuite' :: Maybe RobotSoftwareSuiteVersionType
version = Maybe RobotSoftwareSuiteVersionType
a} :: RobotSoftwareSuite)

instance Core.FromJSON RobotSoftwareSuite where
  parseJSON :: Value -> Parser RobotSoftwareSuite
parseJSON =
    String
-> (Object -> Parser RobotSoftwareSuite)
-> Value
-> Parser RobotSoftwareSuite
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RobotSoftwareSuite"
      ( \Object
x ->
          Maybe RobotSoftwareSuiteType
-> Maybe RobotSoftwareSuiteVersionType -> RobotSoftwareSuite
RobotSoftwareSuite'
            (Maybe RobotSoftwareSuiteType
 -> Maybe RobotSoftwareSuiteVersionType -> RobotSoftwareSuite)
-> Parser (Maybe RobotSoftwareSuiteType)
-> Parser
     (Maybe RobotSoftwareSuiteVersionType -> RobotSoftwareSuite)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe RobotSoftwareSuiteType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
            Parser (Maybe RobotSoftwareSuiteVersionType -> RobotSoftwareSuite)
-> Parser (Maybe RobotSoftwareSuiteVersionType)
-> Parser RobotSoftwareSuite
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RobotSoftwareSuiteVersionType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"version")
      )

instance Prelude.Hashable RobotSoftwareSuite

instance Prelude.NFData RobotSoftwareSuite

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