{-# 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.EMR.Types.VolumeSpecification 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 VolumeSpecification = VolumeSpecification'
{
VolumeSpecification -> Maybe Int
iops :: Prelude.Maybe Prelude.Int,
VolumeSpecification -> Maybe Natural
throughput :: Prelude.Maybe Prelude.Natural,
VolumeSpecification -> Text
volumeType :: Prelude.Text,
VolumeSpecification -> Int
sizeInGB :: Prelude.Int
}
deriving (VolumeSpecification -> VolumeSpecification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VolumeSpecification -> VolumeSpecification -> Bool
$c/= :: VolumeSpecification -> VolumeSpecification -> Bool
== :: VolumeSpecification -> VolumeSpecification -> Bool
$c== :: VolumeSpecification -> VolumeSpecification -> Bool
Prelude.Eq, ReadPrec [VolumeSpecification]
ReadPrec VolumeSpecification
Int -> ReadS VolumeSpecification
ReadS [VolumeSpecification]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VolumeSpecification]
$creadListPrec :: ReadPrec [VolumeSpecification]
readPrec :: ReadPrec VolumeSpecification
$creadPrec :: ReadPrec VolumeSpecification
readList :: ReadS [VolumeSpecification]
$creadList :: ReadS [VolumeSpecification]
readsPrec :: Int -> ReadS VolumeSpecification
$creadsPrec :: Int -> ReadS VolumeSpecification
Prelude.Read, Int -> VolumeSpecification -> ShowS
[VolumeSpecification] -> ShowS
VolumeSpecification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VolumeSpecification] -> ShowS
$cshowList :: [VolumeSpecification] -> ShowS
show :: VolumeSpecification -> String
$cshow :: VolumeSpecification -> String
showsPrec :: Int -> VolumeSpecification -> ShowS
$cshowsPrec :: Int -> VolumeSpecification -> ShowS
Prelude.Show, forall x. Rep VolumeSpecification x -> VolumeSpecification
forall x. VolumeSpecification -> Rep VolumeSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VolumeSpecification x -> VolumeSpecification
$cfrom :: forall x. VolumeSpecification -> Rep VolumeSpecification x
Prelude.Generic)
newVolumeSpecification ::
Prelude.Text ->
Prelude.Int ->
VolumeSpecification
newVolumeSpecification :: Text -> Int -> VolumeSpecification
newVolumeSpecification Text
pVolumeType_ Int
pSizeInGB_ =
VolumeSpecification'
{ $sel:iops:VolumeSpecification' :: Maybe Int
iops = forall a. Maybe a
Prelude.Nothing,
$sel:throughput:VolumeSpecification' :: Maybe Natural
throughput = forall a. Maybe a
Prelude.Nothing,
$sel:volumeType:VolumeSpecification' :: Text
volumeType = Text
pVolumeType_,
$sel:sizeInGB:VolumeSpecification' :: Int
sizeInGB = Int
pSizeInGB_
}
volumeSpecification_iops :: Lens.Lens' VolumeSpecification (Prelude.Maybe Prelude.Int)
volumeSpecification_iops :: Lens' VolumeSpecification (Maybe Int)
volumeSpecification_iops = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeSpecification' {Maybe Int
iops :: Maybe Int
$sel:iops:VolumeSpecification' :: VolumeSpecification -> Maybe Int
iops} -> Maybe Int
iops) (\s :: VolumeSpecification
s@VolumeSpecification' {} Maybe Int
a -> VolumeSpecification
s {$sel:iops:VolumeSpecification' :: Maybe Int
iops = Maybe Int
a} :: VolumeSpecification)
volumeSpecification_throughput :: Lens.Lens' VolumeSpecification (Prelude.Maybe Prelude.Natural)
volumeSpecification_throughput :: Lens' VolumeSpecification (Maybe Natural)
volumeSpecification_throughput = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeSpecification' {Maybe Natural
throughput :: Maybe Natural
$sel:throughput:VolumeSpecification' :: VolumeSpecification -> Maybe Natural
throughput} -> Maybe Natural
throughput) (\s :: VolumeSpecification
s@VolumeSpecification' {} Maybe Natural
a -> VolumeSpecification
s {$sel:throughput:VolumeSpecification' :: Maybe Natural
throughput = Maybe Natural
a} :: VolumeSpecification)
volumeSpecification_volumeType :: Lens.Lens' VolumeSpecification Prelude.Text
volumeSpecification_volumeType :: Lens' VolumeSpecification Text
volumeSpecification_volumeType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeSpecification' {Text
volumeType :: Text
$sel:volumeType:VolumeSpecification' :: VolumeSpecification -> Text
volumeType} -> Text
volumeType) (\s :: VolumeSpecification
s@VolumeSpecification' {} Text
a -> VolumeSpecification
s {$sel:volumeType:VolumeSpecification' :: Text
volumeType = Text
a} :: VolumeSpecification)
volumeSpecification_sizeInGB :: Lens.Lens' VolumeSpecification Prelude.Int
volumeSpecification_sizeInGB :: Lens' VolumeSpecification Int
volumeSpecification_sizeInGB = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeSpecification' {Int
sizeInGB :: Int
$sel:sizeInGB:VolumeSpecification' :: VolumeSpecification -> Int
sizeInGB} -> Int
sizeInGB) (\s :: VolumeSpecification
s@VolumeSpecification' {} Int
a -> VolumeSpecification
s {$sel:sizeInGB:VolumeSpecification' :: Int
sizeInGB = Int
a} :: VolumeSpecification)
instance Data.FromJSON VolumeSpecification where
parseJSON :: Value -> Parser VolumeSpecification
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"VolumeSpecification"
( \Object
x ->
Maybe Int -> Maybe Natural -> Text -> Int -> VolumeSpecification
VolumeSpecification'
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
"Throughput")
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
"VolumeType")
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
"SizeInGB")
)
instance Prelude.Hashable VolumeSpecification where
hashWithSalt :: Int -> VolumeSpecification -> Int
hashWithSalt Int
_salt VolumeSpecification' {Int
Maybe Int
Maybe Natural
Text
sizeInGB :: Int
volumeType :: Text
throughput :: Maybe Natural
iops :: Maybe Int
$sel:sizeInGB:VolumeSpecification' :: VolumeSpecification -> Int
$sel:volumeType:VolumeSpecification' :: VolumeSpecification -> Text
$sel:throughput:VolumeSpecification' :: VolumeSpecification -> Maybe Natural
$sel:iops:VolumeSpecification' :: VolumeSpecification -> Maybe Int
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
iops
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
throughput
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
volumeType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
sizeInGB
instance Prelude.NFData VolumeSpecification where
rnf :: VolumeSpecification -> ()
rnf VolumeSpecification' {Int
Maybe Int
Maybe Natural
Text
sizeInGB :: Int
volumeType :: Text
throughput :: Maybe Natural
iops :: Maybe Int
$sel:sizeInGB:VolumeSpecification' :: VolumeSpecification -> Int
$sel:volumeType:VolumeSpecification' :: VolumeSpecification -> Text
$sel:throughput:VolumeSpecification' :: VolumeSpecification -> Maybe Natural
$sel:iops:VolumeSpecification' :: VolumeSpecification -> Maybe Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
iops
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
throughput
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
volumeType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
sizeInGB
instance Data.ToJSON VolumeSpecification where
toJSON :: VolumeSpecification -> Value
toJSON VolumeSpecification' {Int
Maybe Int
Maybe Natural
Text
sizeInGB :: Int
volumeType :: Text
throughput :: Maybe Natural
iops :: Maybe Int
$sel:sizeInGB:VolumeSpecification' :: VolumeSpecification -> Int
$sel:volumeType:VolumeSpecification' :: VolumeSpecification -> Text
$sel:throughput:VolumeSpecification' :: VolumeSpecification -> Maybe Natural
$sel:iops:VolumeSpecification' :: VolumeSpecification -> Maybe Int
..} =
[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 Int
iops,
(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,
forall a. a -> Maybe a
Prelude.Just (Key
"VolumeType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
volumeType),
forall a. a -> Maybe a
Prelude.Just (Key
"SizeInGB" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
sizeInGB)
]
)