{-# 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.EbsBlockDeviceConfig where
import qualified Amazonka.Core as Core
import Amazonka.EMR.Types.VolumeSpecification
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EbsBlockDeviceConfig = EbsBlockDeviceConfig'
{
EbsBlockDeviceConfig -> Maybe Int
volumesPerInstance :: Prelude.Maybe Prelude.Int,
EbsBlockDeviceConfig -> VolumeSpecification
volumeSpecification :: VolumeSpecification
}
deriving (EbsBlockDeviceConfig -> EbsBlockDeviceConfig -> Bool
(EbsBlockDeviceConfig -> EbsBlockDeviceConfig -> Bool)
-> (EbsBlockDeviceConfig -> EbsBlockDeviceConfig -> Bool)
-> Eq EbsBlockDeviceConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EbsBlockDeviceConfig -> EbsBlockDeviceConfig -> Bool
$c/= :: EbsBlockDeviceConfig -> EbsBlockDeviceConfig -> Bool
== :: EbsBlockDeviceConfig -> EbsBlockDeviceConfig -> Bool
$c== :: EbsBlockDeviceConfig -> EbsBlockDeviceConfig -> Bool
Prelude.Eq, ReadPrec [EbsBlockDeviceConfig]
ReadPrec EbsBlockDeviceConfig
Int -> ReadS EbsBlockDeviceConfig
ReadS [EbsBlockDeviceConfig]
(Int -> ReadS EbsBlockDeviceConfig)
-> ReadS [EbsBlockDeviceConfig]
-> ReadPrec EbsBlockDeviceConfig
-> ReadPrec [EbsBlockDeviceConfig]
-> Read EbsBlockDeviceConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EbsBlockDeviceConfig]
$creadListPrec :: ReadPrec [EbsBlockDeviceConfig]
readPrec :: ReadPrec EbsBlockDeviceConfig
$creadPrec :: ReadPrec EbsBlockDeviceConfig
readList :: ReadS [EbsBlockDeviceConfig]
$creadList :: ReadS [EbsBlockDeviceConfig]
readsPrec :: Int -> ReadS EbsBlockDeviceConfig
$creadsPrec :: Int -> ReadS EbsBlockDeviceConfig
Prelude.Read, Int -> EbsBlockDeviceConfig -> ShowS
[EbsBlockDeviceConfig] -> ShowS
EbsBlockDeviceConfig -> String
(Int -> EbsBlockDeviceConfig -> ShowS)
-> (EbsBlockDeviceConfig -> String)
-> ([EbsBlockDeviceConfig] -> ShowS)
-> Show EbsBlockDeviceConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EbsBlockDeviceConfig] -> ShowS
$cshowList :: [EbsBlockDeviceConfig] -> ShowS
show :: EbsBlockDeviceConfig -> String
$cshow :: EbsBlockDeviceConfig -> String
showsPrec :: Int -> EbsBlockDeviceConfig -> ShowS
$cshowsPrec :: Int -> EbsBlockDeviceConfig -> ShowS
Prelude.Show, (forall x. EbsBlockDeviceConfig -> Rep EbsBlockDeviceConfig x)
-> (forall x. Rep EbsBlockDeviceConfig x -> EbsBlockDeviceConfig)
-> Generic EbsBlockDeviceConfig
forall x. Rep EbsBlockDeviceConfig x -> EbsBlockDeviceConfig
forall x. EbsBlockDeviceConfig -> Rep EbsBlockDeviceConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EbsBlockDeviceConfig x -> EbsBlockDeviceConfig
$cfrom :: forall x. EbsBlockDeviceConfig -> Rep EbsBlockDeviceConfig x
Prelude.Generic)
newEbsBlockDeviceConfig ::
VolumeSpecification ->
EbsBlockDeviceConfig
newEbsBlockDeviceConfig :: VolumeSpecification -> EbsBlockDeviceConfig
newEbsBlockDeviceConfig VolumeSpecification
pVolumeSpecification_ =
EbsBlockDeviceConfig' :: Maybe Int -> VolumeSpecification -> EbsBlockDeviceConfig
EbsBlockDeviceConfig'
{ $sel:volumesPerInstance:EbsBlockDeviceConfig' :: Maybe Int
volumesPerInstance =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:volumeSpecification:EbsBlockDeviceConfig' :: VolumeSpecification
volumeSpecification = VolumeSpecification
pVolumeSpecification_
}
ebsBlockDeviceConfig_volumesPerInstance :: Lens.Lens' EbsBlockDeviceConfig (Prelude.Maybe Prelude.Int)
ebsBlockDeviceConfig_volumesPerInstance :: (Maybe Int -> f (Maybe Int))
-> EbsBlockDeviceConfig -> f EbsBlockDeviceConfig
ebsBlockDeviceConfig_volumesPerInstance = (EbsBlockDeviceConfig -> Maybe Int)
-> (EbsBlockDeviceConfig -> Maybe Int -> EbsBlockDeviceConfig)
-> Lens
EbsBlockDeviceConfig EbsBlockDeviceConfig (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsBlockDeviceConfig' {Maybe Int
volumesPerInstance :: Maybe Int
$sel:volumesPerInstance:EbsBlockDeviceConfig' :: EbsBlockDeviceConfig -> Maybe Int
volumesPerInstance} -> Maybe Int
volumesPerInstance) (\s :: EbsBlockDeviceConfig
s@EbsBlockDeviceConfig' {} Maybe Int
a -> EbsBlockDeviceConfig
s {$sel:volumesPerInstance:EbsBlockDeviceConfig' :: Maybe Int
volumesPerInstance = Maybe Int
a} :: EbsBlockDeviceConfig)
ebsBlockDeviceConfig_volumeSpecification :: Lens.Lens' EbsBlockDeviceConfig VolumeSpecification
ebsBlockDeviceConfig_volumeSpecification :: (VolumeSpecification -> f VolumeSpecification)
-> EbsBlockDeviceConfig -> f EbsBlockDeviceConfig
ebsBlockDeviceConfig_volumeSpecification = (EbsBlockDeviceConfig -> VolumeSpecification)
-> (EbsBlockDeviceConfig
-> VolumeSpecification -> EbsBlockDeviceConfig)
-> Lens
EbsBlockDeviceConfig
EbsBlockDeviceConfig
VolumeSpecification
VolumeSpecification
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsBlockDeviceConfig' {VolumeSpecification
volumeSpecification :: VolumeSpecification
$sel:volumeSpecification:EbsBlockDeviceConfig' :: EbsBlockDeviceConfig -> VolumeSpecification
volumeSpecification} -> VolumeSpecification
volumeSpecification) (\s :: EbsBlockDeviceConfig
s@EbsBlockDeviceConfig' {} VolumeSpecification
a -> EbsBlockDeviceConfig
s {$sel:volumeSpecification:EbsBlockDeviceConfig' :: VolumeSpecification
volumeSpecification = VolumeSpecification
a} :: EbsBlockDeviceConfig)
instance Prelude.Hashable EbsBlockDeviceConfig
instance Prelude.NFData EbsBlockDeviceConfig
instance Core.ToJSON EbsBlockDeviceConfig where
toJSON :: EbsBlockDeviceConfig -> Value
toJSON EbsBlockDeviceConfig' {Maybe Int
VolumeSpecification
volumeSpecification :: VolumeSpecification
volumesPerInstance :: Maybe Int
$sel:volumeSpecification:EbsBlockDeviceConfig' :: EbsBlockDeviceConfig -> VolumeSpecification
$sel:volumesPerInstance:EbsBlockDeviceConfig' :: EbsBlockDeviceConfig -> Maybe Int
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"VolumesPerInstance" 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
volumesPerInstance,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"VolumeSpecification" Text -> VolumeSpecification -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= VolumeSpecification
volumeSpecification)
]
)