{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data VolumeConfiguration = VolumeConfiguration'
{
VolumeConfiguration -> Maybe Int
iops :: Prelude.Maybe Prelude.Int,
VolumeConfiguration -> Maybe Int
raidLevel :: Prelude.Maybe Prelude.Int,
VolumeConfiguration -> Maybe Bool
encrypted :: Prelude.Maybe Prelude.Bool,
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
(VolumeConfiguration -> VolumeConfiguration -> Bool)
-> (VolumeConfiguration -> VolumeConfiguration -> Bool)
-> Eq VolumeConfiguration
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]
(Int -> ReadS VolumeConfiguration)
-> ReadS [VolumeConfiguration]
-> ReadPrec VolumeConfiguration
-> ReadPrec [VolumeConfiguration]
-> Read 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
(Int -> VolumeConfiguration -> ShowS)
-> (VolumeConfiguration -> String)
-> ([VolumeConfiguration] -> ShowS)
-> Show VolumeConfiguration
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. VolumeConfiguration -> Rep VolumeConfiguration x)
-> (forall x. Rep VolumeConfiguration x -> VolumeConfiguration)
-> Generic VolumeConfiguration
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' :: Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Text
-> Text
-> Int
-> Int
-> VolumeConfiguration
VolumeConfiguration'
{ $sel:iops:VolumeConfiguration' :: Maybe Int
iops = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:raidLevel:VolumeConfiguration' :: Maybe Int
raidLevel = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:encrypted:VolumeConfiguration' :: Maybe Bool
encrypted = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:volumeType:VolumeConfiguration' :: Maybe Text
volumeType = Maybe Text
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_iops :: Lens.Lens' VolumeConfiguration (Prelude.Maybe Prelude.Int)
volumeConfiguration_iops :: (Maybe Int -> f (Maybe Int))
-> VolumeConfiguration -> f VolumeConfiguration
volumeConfiguration_iops = (VolumeConfiguration -> Maybe Int)
-> (VolumeConfiguration -> Maybe Int -> VolumeConfiguration)
-> Lens
VolumeConfiguration VolumeConfiguration (Maybe Int) (Maybe Int)
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 :: (Maybe Int -> f (Maybe Int))
-> VolumeConfiguration -> f VolumeConfiguration
volumeConfiguration_raidLevel = (VolumeConfiguration -> Maybe Int)
-> (VolumeConfiguration -> Maybe Int -> VolumeConfiguration)
-> Lens
VolumeConfiguration VolumeConfiguration (Maybe Int) (Maybe Int)
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_encrypted :: Lens.Lens' VolumeConfiguration (Prelude.Maybe Prelude.Bool)
volumeConfiguration_encrypted :: (Maybe Bool -> f (Maybe Bool))
-> VolumeConfiguration -> f VolumeConfiguration
volumeConfiguration_encrypted = (VolumeConfiguration -> Maybe Bool)
-> (VolumeConfiguration -> Maybe Bool -> VolumeConfiguration)
-> Lens
VolumeConfiguration VolumeConfiguration (Maybe Bool) (Maybe Bool)
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_volumeType :: Lens.Lens' VolumeConfiguration (Prelude.Maybe Prelude.Text)
volumeConfiguration_volumeType :: (Maybe Text -> f (Maybe Text))
-> VolumeConfiguration -> f VolumeConfiguration
volumeConfiguration_volumeType = (VolumeConfiguration -> Maybe Text)
-> (VolumeConfiguration -> Maybe Text -> VolumeConfiguration)
-> Lens
VolumeConfiguration VolumeConfiguration (Maybe Text) (Maybe Text)
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 :: (Text -> f Text) -> VolumeConfiguration -> f VolumeConfiguration
volumeConfiguration_mountPoint = (VolumeConfiguration -> Text)
-> (VolumeConfiguration -> Text -> VolumeConfiguration)
-> Lens VolumeConfiguration VolumeConfiguration Text Text
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 :: (Int -> f Int) -> VolumeConfiguration -> f VolumeConfiguration
volumeConfiguration_numberOfDisks = (VolumeConfiguration -> Int)
-> (VolumeConfiguration -> Int -> VolumeConfiguration)
-> Lens VolumeConfiguration VolumeConfiguration Int Int
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 :: (Int -> f Int) -> VolumeConfiguration -> f VolumeConfiguration
volumeConfiguration_size = (VolumeConfiguration -> Int)
-> (VolumeConfiguration -> Int -> VolumeConfiguration)
-> Lens VolumeConfiguration VolumeConfiguration Int Int
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 Core.FromJSON VolumeConfiguration where
parseJSON :: Value -> Parser VolumeConfiguration
parseJSON =
String
-> (Object -> Parser VolumeConfiguration)
-> Value
-> Parser VolumeConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"VolumeConfiguration"
( \Object
x ->
Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Text
-> Text
-> Int
-> Int
-> VolumeConfiguration
VolumeConfiguration'
(Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Text
-> Text
-> Int
-> Int
-> VolumeConfiguration)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe Bool
-> Maybe Text
-> Text
-> Int
-> Int
-> VolumeConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Iops")
Parser
(Maybe Int
-> Maybe Bool
-> Maybe Text
-> Text
-> Int
-> Int
-> VolumeConfiguration)
-> Parser (Maybe Int)
-> Parser
(Maybe Bool
-> Maybe Text -> Text -> Int -> Int -> VolumeConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RaidLevel")
Parser
(Maybe Bool
-> Maybe Text -> Text -> Int -> Int -> VolumeConfiguration)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> Text -> Int -> Int -> VolumeConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Encrypted")
Parser (Maybe Text -> Text -> Int -> Int -> VolumeConfiguration)
-> Parser (Maybe Text)
-> Parser (Text -> Int -> Int -> VolumeConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VolumeType")
Parser (Text -> Int -> Int -> VolumeConfiguration)
-> Parser Text -> Parser (Int -> Int -> VolumeConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"MountPoint")
Parser (Int -> Int -> VolumeConfiguration)
-> Parser Int -> Parser (Int -> VolumeConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"NumberOfDisks")
Parser (Int -> VolumeConfiguration)
-> Parser Int -> Parser VolumeConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Size")
)
instance Prelude.Hashable VolumeConfiguration
instance Prelude.NFData VolumeConfiguration
instance Core.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
encrypted :: Maybe Bool
raidLevel :: Maybe Int
iops :: Maybe Int
$sel:size:VolumeConfiguration' :: VolumeConfiguration -> Int
$sel:numberOfDisks:VolumeConfiguration' :: VolumeConfiguration -> Int
$sel:mountPoint:VolumeConfiguration' :: VolumeConfiguration -> Text
$sel:volumeType:VolumeConfiguration' :: VolumeConfiguration -> Maybe Text
$sel:encrypted:VolumeConfiguration' :: VolumeConfiguration -> Maybe Bool
$sel:raidLevel:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:iops:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Iops" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
iops,
(Text
"RaidLevel" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
raidLevel,
(Text
"Encrypted" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
encrypted,
(Text
"VolumeType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
volumeType,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"MountPoint" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
mountPoint),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"NumberOfDisks" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
numberOfDisks),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Size" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
size)
]
)