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