{-# 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 #-}
module Amazonka.RobOMaker.Types.RenderingEngine where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RobOMaker.Types.RenderingEngineType
data RenderingEngine = RenderingEngine'
{
RenderingEngine -> Maybe RenderingEngineType
name :: Prelude.Maybe RenderingEngineType,
RenderingEngine -> Maybe Text
version :: Prelude.Maybe Prelude.Text
}
deriving (RenderingEngine -> RenderingEngine -> Bool
(RenderingEngine -> RenderingEngine -> Bool)
-> (RenderingEngine -> RenderingEngine -> Bool)
-> Eq RenderingEngine
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RenderingEngine -> RenderingEngine -> Bool
$c/= :: RenderingEngine -> RenderingEngine -> Bool
== :: RenderingEngine -> RenderingEngine -> Bool
$c== :: RenderingEngine -> RenderingEngine -> Bool
Prelude.Eq, ReadPrec [RenderingEngine]
ReadPrec RenderingEngine
Int -> ReadS RenderingEngine
ReadS [RenderingEngine]
(Int -> ReadS RenderingEngine)
-> ReadS [RenderingEngine]
-> ReadPrec RenderingEngine
-> ReadPrec [RenderingEngine]
-> Read RenderingEngine
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RenderingEngine]
$creadListPrec :: ReadPrec [RenderingEngine]
readPrec :: ReadPrec RenderingEngine
$creadPrec :: ReadPrec RenderingEngine
readList :: ReadS [RenderingEngine]
$creadList :: ReadS [RenderingEngine]
readsPrec :: Int -> ReadS RenderingEngine
$creadsPrec :: Int -> ReadS RenderingEngine
Prelude.Read, Int -> RenderingEngine -> ShowS
[RenderingEngine] -> ShowS
RenderingEngine -> String
(Int -> RenderingEngine -> ShowS)
-> (RenderingEngine -> String)
-> ([RenderingEngine] -> ShowS)
-> Show RenderingEngine
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RenderingEngine] -> ShowS
$cshowList :: [RenderingEngine] -> ShowS
show :: RenderingEngine -> String
$cshow :: RenderingEngine -> String
showsPrec :: Int -> RenderingEngine -> ShowS
$cshowsPrec :: Int -> RenderingEngine -> ShowS
Prelude.Show, (forall x. RenderingEngine -> Rep RenderingEngine x)
-> (forall x. Rep RenderingEngine x -> RenderingEngine)
-> Generic RenderingEngine
forall x. Rep RenderingEngine x -> RenderingEngine
forall x. RenderingEngine -> Rep RenderingEngine x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RenderingEngine x -> RenderingEngine
$cfrom :: forall x. RenderingEngine -> Rep RenderingEngine x
Prelude.Generic)
newRenderingEngine ::
RenderingEngine
newRenderingEngine :: RenderingEngine
newRenderingEngine =
RenderingEngine' :: Maybe RenderingEngineType -> Maybe Text -> RenderingEngine
RenderingEngine'
{ $sel:name:RenderingEngine' :: Maybe RenderingEngineType
name = Maybe RenderingEngineType
forall a. Maybe a
Prelude.Nothing,
$sel:version:RenderingEngine' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
renderingEngine_name :: Lens.Lens' RenderingEngine (Prelude.Maybe RenderingEngineType)
renderingEngine_name :: (Maybe RenderingEngineType -> f (Maybe RenderingEngineType))
-> RenderingEngine -> f RenderingEngine
renderingEngine_name = (RenderingEngine -> Maybe RenderingEngineType)
-> (RenderingEngine
-> Maybe RenderingEngineType -> RenderingEngine)
-> Lens
RenderingEngine
RenderingEngine
(Maybe RenderingEngineType)
(Maybe RenderingEngineType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RenderingEngine' {Maybe RenderingEngineType
name :: Maybe RenderingEngineType
$sel:name:RenderingEngine' :: RenderingEngine -> Maybe RenderingEngineType
name} -> Maybe RenderingEngineType
name) (\s :: RenderingEngine
s@RenderingEngine' {} Maybe RenderingEngineType
a -> RenderingEngine
s {$sel:name:RenderingEngine' :: Maybe RenderingEngineType
name = Maybe RenderingEngineType
a} :: RenderingEngine)
renderingEngine_version :: Lens.Lens' RenderingEngine (Prelude.Maybe Prelude.Text)
renderingEngine_version :: (Maybe Text -> f (Maybe Text))
-> RenderingEngine -> f RenderingEngine
renderingEngine_version = (RenderingEngine -> Maybe Text)
-> (RenderingEngine -> Maybe Text -> RenderingEngine)
-> Lens RenderingEngine RenderingEngine (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RenderingEngine' {Maybe Text
version :: Maybe Text
$sel:version:RenderingEngine' :: RenderingEngine -> Maybe Text
version} -> Maybe Text
version) (\s :: RenderingEngine
s@RenderingEngine' {} Maybe Text
a -> RenderingEngine
s {$sel:version:RenderingEngine' :: Maybe Text
version = Maybe Text
a} :: RenderingEngine)
instance Core.FromJSON RenderingEngine where
parseJSON :: Value -> Parser RenderingEngine
parseJSON =
String
-> (Object -> Parser RenderingEngine)
-> Value
-> Parser RenderingEngine
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RenderingEngine"
( \Object
x ->
Maybe RenderingEngineType -> Maybe Text -> RenderingEngine
RenderingEngine'
(Maybe RenderingEngineType -> Maybe Text -> RenderingEngine)
-> Parser (Maybe RenderingEngineType)
-> Parser (Maybe Text -> RenderingEngine)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe RenderingEngineType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
Parser (Maybe Text -> RenderingEngine)
-> Parser (Maybe Text) -> Parser RenderingEngine
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 RenderingEngine
instance Prelude.NFData RenderingEngine
instance Core.ToJSON RenderingEngine where
toJSON :: RenderingEngine -> Value
toJSON RenderingEngine' {Maybe Text
Maybe RenderingEngineType
version :: Maybe Text
name :: Maybe RenderingEngineType
$sel:version:RenderingEngine' :: RenderingEngine -> Maybe Text
$sel:name:RenderingEngine' :: RenderingEngine -> Maybe RenderingEngineType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"name" Text -> RenderingEngineType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RenderingEngineType -> Pair)
-> Maybe RenderingEngineType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RenderingEngineType
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
]
)