{-# 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.WorkSpaces.Types.ComputeType 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.WorkSpaces.Types.Compute
data ComputeType = ComputeType'
{
ComputeType -> Maybe Compute
name :: Prelude.Maybe Compute
}
deriving (ComputeType -> ComputeType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComputeType -> ComputeType -> Bool
$c/= :: ComputeType -> ComputeType -> Bool
== :: ComputeType -> ComputeType -> Bool
$c== :: ComputeType -> ComputeType -> Bool
Prelude.Eq, ReadPrec [ComputeType]
ReadPrec ComputeType
Int -> ReadS ComputeType
ReadS [ComputeType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComputeType]
$creadListPrec :: ReadPrec [ComputeType]
readPrec :: ReadPrec ComputeType
$creadPrec :: ReadPrec ComputeType
readList :: ReadS [ComputeType]
$creadList :: ReadS [ComputeType]
readsPrec :: Int -> ReadS ComputeType
$creadsPrec :: Int -> ReadS ComputeType
Prelude.Read, Int -> ComputeType -> ShowS
[ComputeType] -> ShowS
ComputeType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComputeType] -> ShowS
$cshowList :: [ComputeType] -> ShowS
show :: ComputeType -> String
$cshow :: ComputeType -> String
showsPrec :: Int -> ComputeType -> ShowS
$cshowsPrec :: Int -> ComputeType -> ShowS
Prelude.Show, forall x. Rep ComputeType x -> ComputeType
forall x. ComputeType -> Rep ComputeType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComputeType x -> ComputeType
$cfrom :: forall x. ComputeType -> Rep ComputeType x
Prelude.Generic)
newComputeType ::
ComputeType
newComputeType :: ComputeType
newComputeType = ComputeType' {$sel:name:ComputeType' :: Maybe Compute
name = forall a. Maybe a
Prelude.Nothing}
computeType_name :: Lens.Lens' ComputeType (Prelude.Maybe Compute)
computeType_name :: Lens' ComputeType (Maybe Compute)
computeType_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeType' {Maybe Compute
name :: Maybe Compute
$sel:name:ComputeType' :: ComputeType -> Maybe Compute
name} -> Maybe Compute
name) (\s :: ComputeType
s@ComputeType' {} Maybe Compute
a -> ComputeType
s {$sel:name:ComputeType' :: Maybe Compute
name = Maybe Compute
a} :: ComputeType)
instance Data.FromJSON ComputeType where
parseJSON :: Value -> Parser ComputeType
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ComputeType"
(\Object
x -> Maybe Compute -> ComputeType
ComputeType' 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"))
instance Prelude.Hashable ComputeType where
hashWithSalt :: Int -> ComputeType -> Int
hashWithSalt Int
_salt ComputeType' {Maybe Compute
name :: Maybe Compute
$sel:name:ComputeType' :: ComputeType -> Maybe Compute
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Compute
name
instance Prelude.NFData ComputeType where
rnf :: ComputeType -> ()
rnf ComputeType' {Maybe Compute
name :: Maybe Compute
$sel:name:ComputeType' :: ComputeType -> Maybe Compute
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Compute
name
instance Data.ToJSON ComputeType where
toJSON :: ComputeType -> Value
toJSON ComputeType' {Maybe Compute
name :: Maybe Compute
$sel:name:ComputeType' :: ComputeType -> Maybe Compute
..} =
[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 Compute
name]
)