{-# 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.ElasticSearch.Types.EBSOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElasticSearch.Types.VolumeType
import qualified Amazonka.Prelude as Prelude
data EBSOptions = EBSOptions'
{
EBSOptions -> Maybe Bool
eBSEnabled :: Prelude.Maybe Prelude.Bool,
EBSOptions -> Maybe Int
iops :: Prelude.Maybe Prelude.Int,
EBSOptions -> Maybe Int
throughput :: Prelude.Maybe Prelude.Int,
EBSOptions -> Maybe Int
volumeSize :: Prelude.Maybe Prelude.Int,
EBSOptions -> Maybe VolumeType
volumeType :: Prelude.Maybe VolumeType
}
deriving (EBSOptions -> EBSOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EBSOptions -> EBSOptions -> Bool
$c/= :: EBSOptions -> EBSOptions -> Bool
== :: EBSOptions -> EBSOptions -> Bool
$c== :: EBSOptions -> EBSOptions -> Bool
Prelude.Eq, ReadPrec [EBSOptions]
ReadPrec EBSOptions
Int -> ReadS EBSOptions
ReadS [EBSOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EBSOptions]
$creadListPrec :: ReadPrec [EBSOptions]
readPrec :: ReadPrec EBSOptions
$creadPrec :: ReadPrec EBSOptions
readList :: ReadS [EBSOptions]
$creadList :: ReadS [EBSOptions]
readsPrec :: Int -> ReadS EBSOptions
$creadsPrec :: Int -> ReadS EBSOptions
Prelude.Read, Int -> EBSOptions -> ShowS
[EBSOptions] -> ShowS
EBSOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EBSOptions] -> ShowS
$cshowList :: [EBSOptions] -> ShowS
show :: EBSOptions -> String
$cshow :: EBSOptions -> String
showsPrec :: Int -> EBSOptions -> ShowS
$cshowsPrec :: Int -> EBSOptions -> ShowS
Prelude.Show, forall x. Rep EBSOptions x -> EBSOptions
forall x. EBSOptions -> Rep EBSOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EBSOptions x -> EBSOptions
$cfrom :: forall x. EBSOptions -> Rep EBSOptions x
Prelude.Generic)
newEBSOptions ::
EBSOptions
newEBSOptions :: EBSOptions
newEBSOptions =
EBSOptions'
{ $sel:eBSEnabled:EBSOptions' :: Maybe Bool
eBSEnabled = forall a. Maybe a
Prelude.Nothing,
$sel:iops:EBSOptions' :: Maybe Int
iops = forall a. Maybe a
Prelude.Nothing,
$sel:throughput:EBSOptions' :: Maybe Int
throughput = forall a. Maybe a
Prelude.Nothing,
$sel:volumeSize:EBSOptions' :: Maybe Int
volumeSize = forall a. Maybe a
Prelude.Nothing,
$sel:volumeType:EBSOptions' :: Maybe VolumeType
volumeType = forall a. Maybe a
Prelude.Nothing
}
eBSOptions_eBSEnabled :: Lens.Lens' EBSOptions (Prelude.Maybe Prelude.Bool)
eBSOptions_eBSEnabled :: Lens' EBSOptions (Maybe Bool)
eBSOptions_eBSEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EBSOptions' {Maybe Bool
eBSEnabled :: Maybe Bool
$sel:eBSEnabled:EBSOptions' :: EBSOptions -> Maybe Bool
eBSEnabled} -> Maybe Bool
eBSEnabled) (\s :: EBSOptions
s@EBSOptions' {} Maybe Bool
a -> EBSOptions
s {$sel:eBSEnabled:EBSOptions' :: Maybe Bool
eBSEnabled = Maybe Bool
a} :: EBSOptions)
eBSOptions_iops :: Lens.Lens' EBSOptions (Prelude.Maybe Prelude.Int)
eBSOptions_iops :: Lens' EBSOptions (Maybe Int)
eBSOptions_iops = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EBSOptions' {Maybe Int
iops :: Maybe Int
$sel:iops:EBSOptions' :: EBSOptions -> Maybe Int
iops} -> Maybe Int
iops) (\s :: EBSOptions
s@EBSOptions' {} Maybe Int
a -> EBSOptions
s {$sel:iops:EBSOptions' :: Maybe Int
iops = Maybe Int
a} :: EBSOptions)
eBSOptions_throughput :: Lens.Lens' EBSOptions (Prelude.Maybe Prelude.Int)
eBSOptions_throughput :: Lens' EBSOptions (Maybe Int)
eBSOptions_throughput = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EBSOptions' {Maybe Int
throughput :: Maybe Int
$sel:throughput:EBSOptions' :: EBSOptions -> Maybe Int
throughput} -> Maybe Int
throughput) (\s :: EBSOptions
s@EBSOptions' {} Maybe Int
a -> EBSOptions
s {$sel:throughput:EBSOptions' :: Maybe Int
throughput = Maybe Int
a} :: EBSOptions)
eBSOptions_volumeSize :: Lens.Lens' EBSOptions (Prelude.Maybe Prelude.Int)
eBSOptions_volumeSize :: Lens' EBSOptions (Maybe Int)
eBSOptions_volumeSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EBSOptions' {Maybe Int
volumeSize :: Maybe Int
$sel:volumeSize:EBSOptions' :: EBSOptions -> Maybe Int
volumeSize} -> Maybe Int
volumeSize) (\s :: EBSOptions
s@EBSOptions' {} Maybe Int
a -> EBSOptions
s {$sel:volumeSize:EBSOptions' :: Maybe Int
volumeSize = Maybe Int
a} :: EBSOptions)
eBSOptions_volumeType :: Lens.Lens' EBSOptions (Prelude.Maybe VolumeType)
eBSOptions_volumeType :: Lens' EBSOptions (Maybe VolumeType)
eBSOptions_volumeType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EBSOptions' {Maybe VolumeType
volumeType :: Maybe VolumeType
$sel:volumeType:EBSOptions' :: EBSOptions -> Maybe VolumeType
volumeType} -> Maybe VolumeType
volumeType) (\s :: EBSOptions
s@EBSOptions' {} Maybe VolumeType
a -> EBSOptions
s {$sel:volumeType:EBSOptions' :: Maybe VolumeType
volumeType = Maybe VolumeType
a} :: EBSOptions)
instance Data.FromJSON EBSOptions where
parseJSON :: Value -> Parser EBSOptions
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EBSOptions"
( \Object
x ->
Maybe Bool
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe VolumeType
-> EBSOptions
EBSOptions'
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
"EBSEnabled")
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
"Throughput")
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
"VolumeSize")
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")
)
instance Prelude.Hashable EBSOptions where
hashWithSalt :: Int -> EBSOptions -> Int
hashWithSalt Int
_salt EBSOptions' {Maybe Bool
Maybe Int
Maybe VolumeType
volumeType :: Maybe VolumeType
volumeSize :: Maybe Int
throughput :: Maybe Int
iops :: Maybe Int
eBSEnabled :: Maybe Bool
$sel:volumeType:EBSOptions' :: EBSOptions -> Maybe VolumeType
$sel:volumeSize:EBSOptions' :: EBSOptions -> Maybe Int
$sel:throughput:EBSOptions' :: EBSOptions -> Maybe Int
$sel:iops:EBSOptions' :: EBSOptions -> Maybe Int
$sel:eBSEnabled:EBSOptions' :: EBSOptions -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
eBSEnabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
iops
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
throughput
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
volumeSize
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VolumeType
volumeType
instance Prelude.NFData EBSOptions where
rnf :: EBSOptions -> ()
rnf EBSOptions' {Maybe Bool
Maybe Int
Maybe VolumeType
volumeType :: Maybe VolumeType
volumeSize :: Maybe Int
throughput :: Maybe Int
iops :: Maybe Int
eBSEnabled :: Maybe Bool
$sel:volumeType:EBSOptions' :: EBSOptions -> Maybe VolumeType
$sel:volumeSize:EBSOptions' :: EBSOptions -> Maybe Int
$sel:throughput:EBSOptions' :: EBSOptions -> Maybe Int
$sel:iops:EBSOptions' :: EBSOptions -> Maybe Int
$sel:eBSEnabled:EBSOptions' :: EBSOptions -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
eBSEnabled
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
throughput
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
volumeSize
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VolumeType
volumeType
instance Data.ToJSON EBSOptions where
toJSON :: EBSOptions -> Value
toJSON EBSOptions' {Maybe Bool
Maybe Int
Maybe VolumeType
volumeType :: Maybe VolumeType
volumeSize :: Maybe Int
throughput :: Maybe Int
iops :: Maybe Int
eBSEnabled :: Maybe Bool
$sel:volumeType:EBSOptions' :: EBSOptions -> Maybe VolumeType
$sel:volumeSize:EBSOptions' :: EBSOptions -> Maybe Int
$sel:throughput:EBSOptions' :: EBSOptions -> Maybe Int
$sel:iops:EBSOptions' :: EBSOptions -> Maybe Int
$sel:eBSEnabled:EBSOptions' :: EBSOptions -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"EBSEnabled" 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
eBSEnabled,
(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 Int
throughput,
(Key
"VolumeSize" 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
volumeSize,
(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 VolumeType
volumeType
]
)