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