{-# 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.OpsWorks.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 Bool
encrypted :: Prelude.Maybe Prelude.Bool,
VolumeConfiguration -> Maybe Int
iops :: Prelude.Maybe Prelude.Int,
VolumeConfiguration -> Maybe Int
raidLevel :: Prelude.Maybe Prelude.Int,
VolumeConfiguration -> Maybe Text
volumeType :: Prelude.Maybe Prelude.Text,
VolumeConfiguration -> Text
mountPoint :: Prelude.Text,
VolumeConfiguration -> Int
numberOfDisks :: Prelude.Int,
VolumeConfiguration -> Int
size :: Prelude.Int
}
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 ::
Prelude.Text ->
Prelude.Int ->
Prelude.Int ->
VolumeConfiguration
newVolumeConfiguration :: Text -> Int -> Int -> VolumeConfiguration
newVolumeConfiguration
Text
pMountPoint_
Int
pNumberOfDisks_
Int
pSize_ =
VolumeConfiguration'
{ $sel:encrypted:VolumeConfiguration' :: Maybe Bool
encrypted = forall a. Maybe a
Prelude.Nothing,
$sel:iops:VolumeConfiguration' :: Maybe Int
iops = forall a. Maybe a
Prelude.Nothing,
$sel:raidLevel:VolumeConfiguration' :: Maybe Int
raidLevel = forall a. Maybe a
Prelude.Nothing,
$sel:volumeType:VolumeConfiguration' :: Maybe Text
volumeType = forall a. Maybe a
Prelude.Nothing,
$sel:mountPoint:VolumeConfiguration' :: Text
mountPoint = Text
pMountPoint_,
$sel:numberOfDisks:VolumeConfiguration' :: Int
numberOfDisks = Int
pNumberOfDisks_,
$sel:size:VolumeConfiguration' :: Int
size = Int
pSize_
}
volumeConfiguration_encrypted :: Lens.Lens' VolumeConfiguration (Prelude.Maybe Prelude.Bool)
volumeConfiguration_encrypted :: Lens' VolumeConfiguration (Maybe Bool)
volumeConfiguration_encrypted = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeConfiguration' {Maybe Bool
encrypted :: Maybe Bool
$sel:encrypted:VolumeConfiguration' :: VolumeConfiguration -> Maybe Bool
encrypted} -> Maybe Bool
encrypted) (\s :: VolumeConfiguration
s@VolumeConfiguration' {} Maybe Bool
a -> VolumeConfiguration
s {$sel:encrypted:VolumeConfiguration' :: Maybe Bool
encrypted = Maybe Bool
a} :: VolumeConfiguration)
volumeConfiguration_iops :: Lens.Lens' VolumeConfiguration (Prelude.Maybe Prelude.Int)
volumeConfiguration_iops :: Lens' VolumeConfiguration (Maybe Int)
volumeConfiguration_iops = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeConfiguration' {Maybe Int
iops :: Maybe Int
$sel:iops:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
iops} -> Maybe Int
iops) (\s :: VolumeConfiguration
s@VolumeConfiguration' {} Maybe Int
a -> VolumeConfiguration
s {$sel:iops:VolumeConfiguration' :: Maybe Int
iops = Maybe Int
a} :: VolumeConfiguration)
volumeConfiguration_raidLevel :: Lens.Lens' VolumeConfiguration (Prelude.Maybe Prelude.Int)
volumeConfiguration_raidLevel :: Lens' VolumeConfiguration (Maybe Int)
volumeConfiguration_raidLevel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeConfiguration' {Maybe Int
raidLevel :: Maybe Int
$sel:raidLevel:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
raidLevel} -> Maybe Int
raidLevel) (\s :: VolumeConfiguration
s@VolumeConfiguration' {} Maybe Int
a -> VolumeConfiguration
s {$sel:raidLevel:VolumeConfiguration' :: Maybe Int
raidLevel = Maybe Int
a} :: VolumeConfiguration)
volumeConfiguration_volumeType :: Lens.Lens' VolumeConfiguration (Prelude.Maybe Prelude.Text)
volumeConfiguration_volumeType :: Lens' VolumeConfiguration (Maybe Text)
volumeConfiguration_volumeType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeConfiguration' {Maybe Text
volumeType :: Maybe Text
$sel:volumeType:VolumeConfiguration' :: VolumeConfiguration -> Maybe Text
volumeType} -> Maybe Text
volumeType) (\s :: VolumeConfiguration
s@VolumeConfiguration' {} Maybe Text
a -> VolumeConfiguration
s {$sel:volumeType:VolumeConfiguration' :: Maybe Text
volumeType = Maybe Text
a} :: VolumeConfiguration)
volumeConfiguration_mountPoint :: Lens.Lens' VolumeConfiguration Prelude.Text
volumeConfiguration_mountPoint :: Lens' VolumeConfiguration Text
volumeConfiguration_mountPoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeConfiguration' {Text
mountPoint :: Text
$sel:mountPoint:VolumeConfiguration' :: VolumeConfiguration -> Text
mountPoint} -> Text
mountPoint) (\s :: VolumeConfiguration
s@VolumeConfiguration' {} Text
a -> VolumeConfiguration
s {$sel:mountPoint:VolumeConfiguration' :: Text
mountPoint = Text
a} :: VolumeConfiguration)
volumeConfiguration_numberOfDisks :: Lens.Lens' VolumeConfiguration Prelude.Int
volumeConfiguration_numberOfDisks :: Lens' VolumeConfiguration Int
volumeConfiguration_numberOfDisks = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeConfiguration' {Int
numberOfDisks :: Int
$sel:numberOfDisks:VolumeConfiguration' :: VolumeConfiguration -> Int
numberOfDisks} -> Int
numberOfDisks) (\s :: VolumeConfiguration
s@VolumeConfiguration' {} Int
a -> VolumeConfiguration
s {$sel:numberOfDisks:VolumeConfiguration' :: Int
numberOfDisks = Int
a} :: VolumeConfiguration)
volumeConfiguration_size :: Lens.Lens' VolumeConfiguration Prelude.Int
volumeConfiguration_size :: Lens' VolumeConfiguration Int
volumeConfiguration_size = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeConfiguration' {Int
size :: Int
$sel:size:VolumeConfiguration' :: VolumeConfiguration -> Int
size} -> Int
size) (\s :: VolumeConfiguration
s@VolumeConfiguration' {} Int
a -> VolumeConfiguration
s {$sel:size:VolumeConfiguration' :: Int
size = Int
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 Bool
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Text
-> Int
-> Int
-> 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
"Encrypted")
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
"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
"RaidLevel")
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
"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
"MountPoint")
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
"NumberOfDisks")
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
"Size")
)
instance Prelude.Hashable VolumeConfiguration where
hashWithSalt :: Int -> VolumeConfiguration -> Int
hashWithSalt Int
_salt VolumeConfiguration' {Int
Maybe Bool
Maybe Int
Maybe Text
Text
size :: Int
numberOfDisks :: Int
mountPoint :: Text
volumeType :: Maybe Text
raidLevel :: Maybe Int
iops :: Maybe Int
encrypted :: Maybe Bool
$sel:size:VolumeConfiguration' :: VolumeConfiguration -> Int
$sel:numberOfDisks:VolumeConfiguration' :: VolumeConfiguration -> Int
$sel:mountPoint:VolumeConfiguration' :: VolumeConfiguration -> Text
$sel:volumeType:VolumeConfiguration' :: VolumeConfiguration -> Maybe Text
$sel:raidLevel:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:iops:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:encrypted:VolumeConfiguration' :: VolumeConfiguration -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
encrypted
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
iops
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
raidLevel
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
volumeType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
mountPoint
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
numberOfDisks
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
size
instance Prelude.NFData VolumeConfiguration where
rnf :: VolumeConfiguration -> ()
rnf VolumeConfiguration' {Int
Maybe Bool
Maybe Int
Maybe Text
Text
size :: Int
numberOfDisks :: Int
mountPoint :: Text
volumeType :: Maybe Text
raidLevel :: Maybe Int
iops :: Maybe Int
encrypted :: Maybe Bool
$sel:size:VolumeConfiguration' :: VolumeConfiguration -> Int
$sel:numberOfDisks:VolumeConfiguration' :: VolumeConfiguration -> Int
$sel:mountPoint:VolumeConfiguration' :: VolumeConfiguration -> Text
$sel:volumeType:VolumeConfiguration' :: VolumeConfiguration -> Maybe Text
$sel:raidLevel:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:iops:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:encrypted:VolumeConfiguration' :: VolumeConfiguration -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
encrypted
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Int
raidLevel
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
volumeType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
mountPoint
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
numberOfDisks
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
size
instance Data.ToJSON VolumeConfiguration where
toJSON :: VolumeConfiguration -> Value
toJSON VolumeConfiguration' {Int
Maybe Bool
Maybe Int
Maybe Text
Text
size :: Int
numberOfDisks :: Int
mountPoint :: Text
volumeType :: Maybe Text
raidLevel :: Maybe Int
iops :: Maybe Int
encrypted :: Maybe Bool
$sel:size:VolumeConfiguration' :: VolumeConfiguration -> Int
$sel:numberOfDisks:VolumeConfiguration' :: VolumeConfiguration -> Int
$sel:mountPoint:VolumeConfiguration' :: VolumeConfiguration -> Text
$sel:volumeType:VolumeConfiguration' :: VolumeConfiguration -> Maybe Text
$sel:raidLevel:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:iops:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:encrypted:VolumeConfiguration' :: VolumeConfiguration -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Encrypted" 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
encrypted,
(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
"RaidLevel" 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
raidLevel,
(Key
"VolumeType" 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 Text
volumeType,
forall a. a -> Maybe a
Prelude.Just (Key
"MountPoint" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
mountPoint),
forall a. a -> Maybe a
Prelude.Just (Key
"NumberOfDisks" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
numberOfDisks),
forall a. a -> Maybe a
Prelude.Just (Key
"Size" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
size)
]
)