{-# 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.OperatingSystem where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WorkSpaces.Types.OperatingSystemType
data OperatingSystem = OperatingSystem'
{
OperatingSystem -> Maybe OperatingSystemType
type' :: Prelude.Maybe OperatingSystemType
}
deriving (OperatingSystem -> OperatingSystem -> Bool
(OperatingSystem -> OperatingSystem -> Bool)
-> (OperatingSystem -> OperatingSystem -> Bool)
-> Eq OperatingSystem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OperatingSystem -> OperatingSystem -> Bool
$c/= :: OperatingSystem -> OperatingSystem -> Bool
== :: OperatingSystem -> OperatingSystem -> Bool
$c== :: OperatingSystem -> OperatingSystem -> Bool
Prelude.Eq, ReadPrec [OperatingSystem]
ReadPrec OperatingSystem
Int -> ReadS OperatingSystem
ReadS [OperatingSystem]
(Int -> ReadS OperatingSystem)
-> ReadS [OperatingSystem]
-> ReadPrec OperatingSystem
-> ReadPrec [OperatingSystem]
-> Read OperatingSystem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OperatingSystem]
$creadListPrec :: ReadPrec [OperatingSystem]
readPrec :: ReadPrec OperatingSystem
$creadPrec :: ReadPrec OperatingSystem
readList :: ReadS [OperatingSystem]
$creadList :: ReadS [OperatingSystem]
readsPrec :: Int -> ReadS OperatingSystem
$creadsPrec :: Int -> ReadS OperatingSystem
Prelude.Read, Int -> OperatingSystem -> ShowS
[OperatingSystem] -> ShowS
OperatingSystem -> String
(Int -> OperatingSystem -> ShowS)
-> (OperatingSystem -> String)
-> ([OperatingSystem] -> ShowS)
-> Show OperatingSystem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OperatingSystem] -> ShowS
$cshowList :: [OperatingSystem] -> ShowS
show :: OperatingSystem -> String
$cshow :: OperatingSystem -> String
showsPrec :: Int -> OperatingSystem -> ShowS
$cshowsPrec :: Int -> OperatingSystem -> ShowS
Prelude.Show, (forall x. OperatingSystem -> Rep OperatingSystem x)
-> (forall x. Rep OperatingSystem x -> OperatingSystem)
-> Generic OperatingSystem
forall x. Rep OperatingSystem x -> OperatingSystem
forall x. OperatingSystem -> Rep OperatingSystem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OperatingSystem x -> OperatingSystem
$cfrom :: forall x. OperatingSystem -> Rep OperatingSystem x
Prelude.Generic)
newOperatingSystem ::
OperatingSystem
newOperatingSystem :: OperatingSystem
newOperatingSystem =
OperatingSystem' :: Maybe OperatingSystemType -> OperatingSystem
OperatingSystem' {$sel:type':OperatingSystem' :: Maybe OperatingSystemType
type' = Maybe OperatingSystemType
forall a. Maybe a
Prelude.Nothing}
operatingSystem_type :: Lens.Lens' OperatingSystem (Prelude.Maybe OperatingSystemType)
operatingSystem_type :: (Maybe OperatingSystemType -> f (Maybe OperatingSystemType))
-> OperatingSystem -> f OperatingSystem
operatingSystem_type = (OperatingSystem -> Maybe OperatingSystemType)
-> (OperatingSystem
-> Maybe OperatingSystemType -> OperatingSystem)
-> Lens
OperatingSystem
OperatingSystem
(Maybe OperatingSystemType)
(Maybe OperatingSystemType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OperatingSystem' {Maybe OperatingSystemType
type' :: Maybe OperatingSystemType
$sel:type':OperatingSystem' :: OperatingSystem -> Maybe OperatingSystemType
type'} -> Maybe OperatingSystemType
type') (\s :: OperatingSystem
s@OperatingSystem' {} Maybe OperatingSystemType
a -> OperatingSystem
s {$sel:type':OperatingSystem' :: Maybe OperatingSystemType
type' = Maybe OperatingSystemType
a} :: OperatingSystem)
instance Core.FromJSON OperatingSystem where
parseJSON :: Value -> Parser OperatingSystem
parseJSON =
String
-> (Object -> Parser OperatingSystem)
-> Value
-> Parser OperatingSystem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"OperatingSystem"
( \Object
x ->
Maybe OperatingSystemType -> OperatingSystem
OperatingSystem' (Maybe OperatingSystemType -> OperatingSystem)
-> Parser (Maybe OperatingSystemType) -> Parser OperatingSystem
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe OperatingSystemType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
)
instance Prelude.Hashable OperatingSystem
instance Prelude.NFData OperatingSystem