{-# 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.StorageGateway.Types.AutomaticTapeCreationRule 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 AutomaticTapeCreationRule = AutomaticTapeCreationRule'
{
AutomaticTapeCreationRule -> Maybe Bool
worm :: Prelude.Maybe Prelude.Bool,
AutomaticTapeCreationRule -> Text
tapeBarcodePrefix :: Prelude.Text,
AutomaticTapeCreationRule -> Text
poolId :: Prelude.Text,
AutomaticTapeCreationRule -> Integer
tapeSizeInBytes :: Prelude.Integer,
AutomaticTapeCreationRule -> Natural
minimumNumTapes :: Prelude.Natural
}
deriving (AutomaticTapeCreationRule -> AutomaticTapeCreationRule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutomaticTapeCreationRule -> AutomaticTapeCreationRule -> Bool
$c/= :: AutomaticTapeCreationRule -> AutomaticTapeCreationRule -> Bool
== :: AutomaticTapeCreationRule -> AutomaticTapeCreationRule -> Bool
$c== :: AutomaticTapeCreationRule -> AutomaticTapeCreationRule -> Bool
Prelude.Eq, ReadPrec [AutomaticTapeCreationRule]
ReadPrec AutomaticTapeCreationRule
Int -> ReadS AutomaticTapeCreationRule
ReadS [AutomaticTapeCreationRule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutomaticTapeCreationRule]
$creadListPrec :: ReadPrec [AutomaticTapeCreationRule]
readPrec :: ReadPrec AutomaticTapeCreationRule
$creadPrec :: ReadPrec AutomaticTapeCreationRule
readList :: ReadS [AutomaticTapeCreationRule]
$creadList :: ReadS [AutomaticTapeCreationRule]
readsPrec :: Int -> ReadS AutomaticTapeCreationRule
$creadsPrec :: Int -> ReadS AutomaticTapeCreationRule
Prelude.Read, Int -> AutomaticTapeCreationRule -> ShowS
[AutomaticTapeCreationRule] -> ShowS
AutomaticTapeCreationRule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutomaticTapeCreationRule] -> ShowS
$cshowList :: [AutomaticTapeCreationRule] -> ShowS
show :: AutomaticTapeCreationRule -> String
$cshow :: AutomaticTapeCreationRule -> String
showsPrec :: Int -> AutomaticTapeCreationRule -> ShowS
$cshowsPrec :: Int -> AutomaticTapeCreationRule -> ShowS
Prelude.Show, forall x.
Rep AutomaticTapeCreationRule x -> AutomaticTapeCreationRule
forall x.
AutomaticTapeCreationRule -> Rep AutomaticTapeCreationRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AutomaticTapeCreationRule x -> AutomaticTapeCreationRule
$cfrom :: forall x.
AutomaticTapeCreationRule -> Rep AutomaticTapeCreationRule x
Prelude.Generic)
newAutomaticTapeCreationRule ::
Prelude.Text ->
Prelude.Text ->
Prelude.Integer ->
Prelude.Natural ->
AutomaticTapeCreationRule
newAutomaticTapeCreationRule :: Text -> Text -> Integer -> Natural -> AutomaticTapeCreationRule
newAutomaticTapeCreationRule
Text
pTapeBarcodePrefix_
Text
pPoolId_
Integer
pTapeSizeInBytes_
Natural
pMinimumNumTapes_ =
AutomaticTapeCreationRule'
{ $sel:worm:AutomaticTapeCreationRule' :: Maybe Bool
worm = forall a. Maybe a
Prelude.Nothing,
$sel:tapeBarcodePrefix:AutomaticTapeCreationRule' :: Text
tapeBarcodePrefix = Text
pTapeBarcodePrefix_,
$sel:poolId:AutomaticTapeCreationRule' :: Text
poolId = Text
pPoolId_,
$sel:tapeSizeInBytes:AutomaticTapeCreationRule' :: Integer
tapeSizeInBytes = Integer
pTapeSizeInBytes_,
$sel:minimumNumTapes:AutomaticTapeCreationRule' :: Natural
minimumNumTapes = Natural
pMinimumNumTapes_
}
automaticTapeCreationRule_worm :: Lens.Lens' AutomaticTapeCreationRule (Prelude.Maybe Prelude.Bool)
automaticTapeCreationRule_worm :: Lens' AutomaticTapeCreationRule (Maybe Bool)
automaticTapeCreationRule_worm = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutomaticTapeCreationRule' {Maybe Bool
worm :: Maybe Bool
$sel:worm:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Maybe Bool
worm} -> Maybe Bool
worm) (\s :: AutomaticTapeCreationRule
s@AutomaticTapeCreationRule' {} Maybe Bool
a -> AutomaticTapeCreationRule
s {$sel:worm:AutomaticTapeCreationRule' :: Maybe Bool
worm = Maybe Bool
a} :: AutomaticTapeCreationRule)
automaticTapeCreationRule_tapeBarcodePrefix :: Lens.Lens' AutomaticTapeCreationRule Prelude.Text
automaticTapeCreationRule_tapeBarcodePrefix :: Lens' AutomaticTapeCreationRule Text
automaticTapeCreationRule_tapeBarcodePrefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutomaticTapeCreationRule' {Text
tapeBarcodePrefix :: Text
$sel:tapeBarcodePrefix:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Text
tapeBarcodePrefix} -> Text
tapeBarcodePrefix) (\s :: AutomaticTapeCreationRule
s@AutomaticTapeCreationRule' {} Text
a -> AutomaticTapeCreationRule
s {$sel:tapeBarcodePrefix:AutomaticTapeCreationRule' :: Text
tapeBarcodePrefix = Text
a} :: AutomaticTapeCreationRule)
automaticTapeCreationRule_poolId :: Lens.Lens' AutomaticTapeCreationRule Prelude.Text
automaticTapeCreationRule_poolId :: Lens' AutomaticTapeCreationRule Text
automaticTapeCreationRule_poolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutomaticTapeCreationRule' {Text
poolId :: Text
$sel:poolId:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Text
poolId} -> Text
poolId) (\s :: AutomaticTapeCreationRule
s@AutomaticTapeCreationRule' {} Text
a -> AutomaticTapeCreationRule
s {$sel:poolId:AutomaticTapeCreationRule' :: Text
poolId = Text
a} :: AutomaticTapeCreationRule)
automaticTapeCreationRule_tapeSizeInBytes :: Lens.Lens' AutomaticTapeCreationRule Prelude.Integer
automaticTapeCreationRule_tapeSizeInBytes :: Lens' AutomaticTapeCreationRule Integer
automaticTapeCreationRule_tapeSizeInBytes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutomaticTapeCreationRule' {Integer
tapeSizeInBytes :: Integer
$sel:tapeSizeInBytes:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Integer
tapeSizeInBytes} -> Integer
tapeSizeInBytes) (\s :: AutomaticTapeCreationRule
s@AutomaticTapeCreationRule' {} Integer
a -> AutomaticTapeCreationRule
s {$sel:tapeSizeInBytes:AutomaticTapeCreationRule' :: Integer
tapeSizeInBytes = Integer
a} :: AutomaticTapeCreationRule)
automaticTapeCreationRule_minimumNumTapes :: Lens.Lens' AutomaticTapeCreationRule Prelude.Natural
automaticTapeCreationRule_minimumNumTapes :: Lens' AutomaticTapeCreationRule Natural
automaticTapeCreationRule_minimumNumTapes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutomaticTapeCreationRule' {Natural
minimumNumTapes :: Natural
$sel:minimumNumTapes:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Natural
minimumNumTapes} -> Natural
minimumNumTapes) (\s :: AutomaticTapeCreationRule
s@AutomaticTapeCreationRule' {} Natural
a -> AutomaticTapeCreationRule
s {$sel:minimumNumTapes:AutomaticTapeCreationRule' :: Natural
minimumNumTapes = Natural
a} :: AutomaticTapeCreationRule)
instance Data.FromJSON AutomaticTapeCreationRule where
parseJSON :: Value -> Parser AutomaticTapeCreationRule
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AutomaticTapeCreationRule"
( \Object
x ->
Maybe Bool
-> Text -> Text -> Integer -> Natural -> AutomaticTapeCreationRule
AutomaticTapeCreationRule'
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
"Worm")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"TapeBarcodePrefix")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"PoolId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"TapeSizeInBytes")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"MinimumNumTapes")
)
instance Prelude.Hashable AutomaticTapeCreationRule where
hashWithSalt :: Int -> AutomaticTapeCreationRule -> Int
hashWithSalt Int
_salt AutomaticTapeCreationRule' {Integer
Natural
Maybe Bool
Text
minimumNumTapes :: Natural
tapeSizeInBytes :: Integer
poolId :: Text
tapeBarcodePrefix :: Text
worm :: Maybe Bool
$sel:minimumNumTapes:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Natural
$sel:tapeSizeInBytes:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Integer
$sel:poolId:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Text
$sel:tapeBarcodePrefix:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Text
$sel:worm:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
worm
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
tapeBarcodePrefix
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
poolId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
tapeSizeInBytes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
minimumNumTapes
instance Prelude.NFData AutomaticTapeCreationRule where
rnf :: AutomaticTapeCreationRule -> ()
rnf AutomaticTapeCreationRule' {Integer
Natural
Maybe Bool
Text
minimumNumTapes :: Natural
tapeSizeInBytes :: Integer
poolId :: Text
tapeBarcodePrefix :: Text
worm :: Maybe Bool
$sel:minimumNumTapes:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Natural
$sel:tapeSizeInBytes:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Integer
$sel:poolId:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Text
$sel:tapeBarcodePrefix:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Text
$sel:worm:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
worm
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
tapeBarcodePrefix
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
poolId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
tapeSizeInBytes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
minimumNumTapes
instance Data.ToJSON AutomaticTapeCreationRule where
toJSON :: AutomaticTapeCreationRule -> Value
toJSON AutomaticTapeCreationRule' {Integer
Natural
Maybe Bool
Text
minimumNumTapes :: Natural
tapeSizeInBytes :: Integer
poolId :: Text
tapeBarcodePrefix :: Text
worm :: Maybe Bool
$sel:minimumNumTapes:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Natural
$sel:tapeSizeInBytes:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Integer
$sel:poolId:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Text
$sel:tapeBarcodePrefix:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Text
$sel:worm:AutomaticTapeCreationRule' :: AutomaticTapeCreationRule -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Worm" 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 Bool
worm,
forall a. a -> Maybe a
Prelude.Just
(Key
"TapeBarcodePrefix" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
tapeBarcodePrefix),
forall a. a -> Maybe a
Prelude.Just (Key
"PoolId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
poolId),
forall a. a -> Maybe a
Prelude.Just
(Key
"TapeSizeInBytes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Integer
tapeSizeInBytes),
forall a. a -> Maybe a
Prelude.Just
(Key
"MinimumNumTapes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
minimumNumTapes)
]
)