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