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