{-# 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.WorkspaceProperties where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WorkSpaces.Types.Compute
import Amazonka.WorkSpaces.Types.RunningMode
data WorkspaceProperties = WorkspaceProperties'
{
WorkspaceProperties -> Maybe Compute
computeTypeName :: Prelude.Maybe Compute,
WorkspaceProperties -> Maybe RunningMode
runningMode :: Prelude.Maybe RunningMode,
WorkspaceProperties -> Maybe Int
rootVolumeSizeGib :: Prelude.Maybe Prelude.Int,
WorkspaceProperties -> Maybe Int
runningModeAutoStopTimeoutInMinutes :: Prelude.Maybe Prelude.Int,
WorkspaceProperties -> Maybe Int
userVolumeSizeGib :: Prelude.Maybe Prelude.Int
}
deriving (WorkspaceProperties -> WorkspaceProperties -> Bool
(WorkspaceProperties -> WorkspaceProperties -> Bool)
-> (WorkspaceProperties -> WorkspaceProperties -> Bool)
-> Eq WorkspaceProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkspaceProperties -> WorkspaceProperties -> Bool
$c/= :: WorkspaceProperties -> WorkspaceProperties -> Bool
== :: WorkspaceProperties -> WorkspaceProperties -> Bool
$c== :: WorkspaceProperties -> WorkspaceProperties -> Bool
Prelude.Eq, ReadPrec [WorkspaceProperties]
ReadPrec WorkspaceProperties
Int -> ReadS WorkspaceProperties
ReadS [WorkspaceProperties]
(Int -> ReadS WorkspaceProperties)
-> ReadS [WorkspaceProperties]
-> ReadPrec WorkspaceProperties
-> ReadPrec [WorkspaceProperties]
-> Read WorkspaceProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkspaceProperties]
$creadListPrec :: ReadPrec [WorkspaceProperties]
readPrec :: ReadPrec WorkspaceProperties
$creadPrec :: ReadPrec WorkspaceProperties
readList :: ReadS [WorkspaceProperties]
$creadList :: ReadS [WorkspaceProperties]
readsPrec :: Int -> ReadS WorkspaceProperties
$creadsPrec :: Int -> ReadS WorkspaceProperties
Prelude.Read, Int -> WorkspaceProperties -> ShowS
[WorkspaceProperties] -> ShowS
WorkspaceProperties -> String
(Int -> WorkspaceProperties -> ShowS)
-> (WorkspaceProperties -> String)
-> ([WorkspaceProperties] -> ShowS)
-> Show WorkspaceProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkspaceProperties] -> ShowS
$cshowList :: [WorkspaceProperties] -> ShowS
show :: WorkspaceProperties -> String
$cshow :: WorkspaceProperties -> String
showsPrec :: Int -> WorkspaceProperties -> ShowS
$cshowsPrec :: Int -> WorkspaceProperties -> ShowS
Prelude.Show, (forall x. WorkspaceProperties -> Rep WorkspaceProperties x)
-> (forall x. Rep WorkspaceProperties x -> WorkspaceProperties)
-> Generic WorkspaceProperties
forall x. Rep WorkspaceProperties x -> WorkspaceProperties
forall x. WorkspaceProperties -> Rep WorkspaceProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkspaceProperties x -> WorkspaceProperties
$cfrom :: forall x. WorkspaceProperties -> Rep WorkspaceProperties x
Prelude.Generic)
newWorkspaceProperties ::
WorkspaceProperties
newWorkspaceProperties :: WorkspaceProperties
newWorkspaceProperties =
WorkspaceProperties' :: Maybe Compute
-> Maybe RunningMode
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> WorkspaceProperties
WorkspaceProperties'
{ $sel:computeTypeName:WorkspaceProperties' :: Maybe Compute
computeTypeName =
Maybe Compute
forall a. Maybe a
Prelude.Nothing,
$sel:runningMode:WorkspaceProperties' :: Maybe RunningMode
runningMode = Maybe RunningMode
forall a. Maybe a
Prelude.Nothing,
$sel:rootVolumeSizeGib:WorkspaceProperties' :: Maybe Int
rootVolumeSizeGib = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:runningModeAutoStopTimeoutInMinutes:WorkspaceProperties' :: Maybe Int
runningModeAutoStopTimeoutInMinutes =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:userVolumeSizeGib:WorkspaceProperties' :: Maybe Int
userVolumeSizeGib = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
workspaceProperties_computeTypeName :: Lens.Lens' WorkspaceProperties (Prelude.Maybe Compute)
workspaceProperties_computeTypeName :: (Maybe Compute -> f (Maybe Compute))
-> WorkspaceProperties -> f WorkspaceProperties
workspaceProperties_computeTypeName = (WorkspaceProperties -> Maybe Compute)
-> (WorkspaceProperties -> Maybe Compute -> WorkspaceProperties)
-> Lens
WorkspaceProperties
WorkspaceProperties
(Maybe Compute)
(Maybe Compute)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkspaceProperties' {Maybe Compute
computeTypeName :: Maybe Compute
$sel:computeTypeName:WorkspaceProperties' :: WorkspaceProperties -> Maybe Compute
computeTypeName} -> Maybe Compute
computeTypeName) (\s :: WorkspaceProperties
s@WorkspaceProperties' {} Maybe Compute
a -> WorkspaceProperties
s {$sel:computeTypeName:WorkspaceProperties' :: Maybe Compute
computeTypeName = Maybe Compute
a} :: WorkspaceProperties)
workspaceProperties_runningMode :: Lens.Lens' WorkspaceProperties (Prelude.Maybe RunningMode)
workspaceProperties_runningMode :: (Maybe RunningMode -> f (Maybe RunningMode))
-> WorkspaceProperties -> f WorkspaceProperties
workspaceProperties_runningMode = (WorkspaceProperties -> Maybe RunningMode)
-> (WorkspaceProperties
-> Maybe RunningMode -> WorkspaceProperties)
-> Lens
WorkspaceProperties
WorkspaceProperties
(Maybe RunningMode)
(Maybe RunningMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkspaceProperties' {Maybe RunningMode
runningMode :: Maybe RunningMode
$sel:runningMode:WorkspaceProperties' :: WorkspaceProperties -> Maybe RunningMode
runningMode} -> Maybe RunningMode
runningMode) (\s :: WorkspaceProperties
s@WorkspaceProperties' {} Maybe RunningMode
a -> WorkspaceProperties
s {$sel:runningMode:WorkspaceProperties' :: Maybe RunningMode
runningMode = Maybe RunningMode
a} :: WorkspaceProperties)
workspaceProperties_rootVolumeSizeGib :: Lens.Lens' WorkspaceProperties (Prelude.Maybe Prelude.Int)
workspaceProperties_rootVolumeSizeGib :: (Maybe Int -> f (Maybe Int))
-> WorkspaceProperties -> f WorkspaceProperties
workspaceProperties_rootVolumeSizeGib = (WorkspaceProperties -> Maybe Int)
-> (WorkspaceProperties -> Maybe Int -> WorkspaceProperties)
-> Lens
WorkspaceProperties WorkspaceProperties (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkspaceProperties' {Maybe Int
rootVolumeSizeGib :: Maybe Int
$sel:rootVolumeSizeGib:WorkspaceProperties' :: WorkspaceProperties -> Maybe Int
rootVolumeSizeGib} -> Maybe Int
rootVolumeSizeGib) (\s :: WorkspaceProperties
s@WorkspaceProperties' {} Maybe Int
a -> WorkspaceProperties
s {$sel:rootVolumeSizeGib:WorkspaceProperties' :: Maybe Int
rootVolumeSizeGib = Maybe Int
a} :: WorkspaceProperties)
workspaceProperties_runningModeAutoStopTimeoutInMinutes :: Lens.Lens' WorkspaceProperties (Prelude.Maybe Prelude.Int)
workspaceProperties_runningModeAutoStopTimeoutInMinutes :: (Maybe Int -> f (Maybe Int))
-> WorkspaceProperties -> f WorkspaceProperties
workspaceProperties_runningModeAutoStopTimeoutInMinutes = (WorkspaceProperties -> Maybe Int)
-> (WorkspaceProperties -> Maybe Int -> WorkspaceProperties)
-> Lens
WorkspaceProperties WorkspaceProperties (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkspaceProperties' {Maybe Int
runningModeAutoStopTimeoutInMinutes :: Maybe Int
$sel:runningModeAutoStopTimeoutInMinutes:WorkspaceProperties' :: WorkspaceProperties -> Maybe Int
runningModeAutoStopTimeoutInMinutes} -> Maybe Int
runningModeAutoStopTimeoutInMinutes) (\s :: WorkspaceProperties
s@WorkspaceProperties' {} Maybe Int
a -> WorkspaceProperties
s {$sel:runningModeAutoStopTimeoutInMinutes:WorkspaceProperties' :: Maybe Int
runningModeAutoStopTimeoutInMinutes = Maybe Int
a} :: WorkspaceProperties)
workspaceProperties_userVolumeSizeGib :: Lens.Lens' WorkspaceProperties (Prelude.Maybe Prelude.Int)
workspaceProperties_userVolumeSizeGib :: (Maybe Int -> f (Maybe Int))
-> WorkspaceProperties -> f WorkspaceProperties
workspaceProperties_userVolumeSizeGib = (WorkspaceProperties -> Maybe Int)
-> (WorkspaceProperties -> Maybe Int -> WorkspaceProperties)
-> Lens
WorkspaceProperties WorkspaceProperties (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkspaceProperties' {Maybe Int
userVolumeSizeGib :: Maybe Int
$sel:userVolumeSizeGib:WorkspaceProperties' :: WorkspaceProperties -> Maybe Int
userVolumeSizeGib} -> Maybe Int
userVolumeSizeGib) (\s :: WorkspaceProperties
s@WorkspaceProperties' {} Maybe Int
a -> WorkspaceProperties
s {$sel:userVolumeSizeGib:WorkspaceProperties' :: Maybe Int
userVolumeSizeGib = Maybe Int
a} :: WorkspaceProperties)
instance Core.FromJSON WorkspaceProperties where
parseJSON :: Value -> Parser WorkspaceProperties
parseJSON =
String
-> (Object -> Parser WorkspaceProperties)
-> Value
-> Parser WorkspaceProperties
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"WorkspaceProperties"
( \Object
x ->
Maybe Compute
-> Maybe RunningMode
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> WorkspaceProperties
WorkspaceProperties'
(Maybe Compute
-> Maybe RunningMode
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> WorkspaceProperties)
-> Parser (Maybe Compute)
-> Parser
(Maybe RunningMode
-> Maybe Int -> Maybe Int -> Maybe Int -> WorkspaceProperties)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Compute)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ComputeTypeName")
Parser
(Maybe RunningMode
-> Maybe Int -> Maybe Int -> Maybe Int -> WorkspaceProperties)
-> Parser (Maybe RunningMode)
-> Parser
(Maybe Int -> Maybe Int -> Maybe Int -> WorkspaceProperties)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RunningMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RunningMode")
Parser (Maybe Int -> Maybe Int -> Maybe Int -> WorkspaceProperties)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Maybe Int -> WorkspaceProperties)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RootVolumeSizeGib")
Parser (Maybe Int -> Maybe Int -> WorkspaceProperties)
-> Parser (Maybe Int) -> Parser (Maybe Int -> WorkspaceProperties)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RunningModeAutoStopTimeoutInMinutes")
Parser (Maybe Int -> WorkspaceProperties)
-> Parser (Maybe Int) -> Parser WorkspaceProperties
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UserVolumeSizeGib")
)
instance Prelude.Hashable WorkspaceProperties
instance Prelude.NFData WorkspaceProperties
instance Core.ToJSON WorkspaceProperties where
toJSON :: WorkspaceProperties -> Value
toJSON WorkspaceProperties' {Maybe Int
Maybe Compute
Maybe RunningMode
userVolumeSizeGib :: Maybe Int
runningModeAutoStopTimeoutInMinutes :: Maybe Int
rootVolumeSizeGib :: Maybe Int
runningMode :: Maybe RunningMode
computeTypeName :: Maybe Compute
$sel:userVolumeSizeGib:WorkspaceProperties' :: WorkspaceProperties -> Maybe Int
$sel:runningModeAutoStopTimeoutInMinutes:WorkspaceProperties' :: WorkspaceProperties -> Maybe Int
$sel:rootVolumeSizeGib:WorkspaceProperties' :: WorkspaceProperties -> Maybe Int
$sel:runningMode:WorkspaceProperties' :: WorkspaceProperties -> Maybe RunningMode
$sel:computeTypeName:WorkspaceProperties' :: WorkspaceProperties -> Maybe Compute
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ComputeTypeName" Text -> Compute -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Compute -> Pair) -> Maybe Compute -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Compute
computeTypeName,
(Text
"RunningMode" Text -> RunningMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RunningMode -> Pair) -> Maybe RunningMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RunningMode
runningMode,
(Text
"RootVolumeSizeGib" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
rootVolumeSizeGib,
(Text
"RunningModeAutoStopTimeoutInMinutes" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
runningModeAutoStopTimeoutInMinutes,
(Text
"UserVolumeSizeGib" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
userVolumeSizeGib
]
)