{-# 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.EbsBlockDevice 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 EbsBlockDevice = EbsBlockDevice'
{
EbsBlockDevice -> Maybe Text
device :: Prelude.Maybe Prelude.Text,
EbsBlockDevice -> Maybe VolumeSpecification
volumeSpecification :: Prelude.Maybe VolumeSpecification
}
deriving (EbsBlockDevice -> EbsBlockDevice -> Bool
(EbsBlockDevice -> EbsBlockDevice -> Bool)
-> (EbsBlockDevice -> EbsBlockDevice -> Bool) -> Eq EbsBlockDevice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EbsBlockDevice -> EbsBlockDevice -> Bool
$c/= :: EbsBlockDevice -> EbsBlockDevice -> Bool
== :: EbsBlockDevice -> EbsBlockDevice -> Bool
$c== :: EbsBlockDevice -> EbsBlockDevice -> Bool
Prelude.Eq, ReadPrec [EbsBlockDevice]
ReadPrec EbsBlockDevice
Int -> ReadS EbsBlockDevice
ReadS [EbsBlockDevice]
(Int -> ReadS EbsBlockDevice)
-> ReadS [EbsBlockDevice]
-> ReadPrec EbsBlockDevice
-> ReadPrec [EbsBlockDevice]
-> Read EbsBlockDevice
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EbsBlockDevice]
$creadListPrec :: ReadPrec [EbsBlockDevice]
readPrec :: ReadPrec EbsBlockDevice
$creadPrec :: ReadPrec EbsBlockDevice
readList :: ReadS [EbsBlockDevice]
$creadList :: ReadS [EbsBlockDevice]
readsPrec :: Int -> ReadS EbsBlockDevice
$creadsPrec :: Int -> ReadS EbsBlockDevice
Prelude.Read, Int -> EbsBlockDevice -> ShowS
[EbsBlockDevice] -> ShowS
EbsBlockDevice -> String
(Int -> EbsBlockDevice -> ShowS)
-> (EbsBlockDevice -> String)
-> ([EbsBlockDevice] -> ShowS)
-> Show EbsBlockDevice
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EbsBlockDevice] -> ShowS
$cshowList :: [EbsBlockDevice] -> ShowS
show :: EbsBlockDevice -> String
$cshow :: EbsBlockDevice -> String
showsPrec :: Int -> EbsBlockDevice -> ShowS
$cshowsPrec :: Int -> EbsBlockDevice -> ShowS
Prelude.Show, (forall x. EbsBlockDevice -> Rep EbsBlockDevice x)
-> (forall x. Rep EbsBlockDevice x -> EbsBlockDevice)
-> Generic EbsBlockDevice
forall x. Rep EbsBlockDevice x -> EbsBlockDevice
forall x. EbsBlockDevice -> Rep EbsBlockDevice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EbsBlockDevice x -> EbsBlockDevice
$cfrom :: forall x. EbsBlockDevice -> Rep EbsBlockDevice x
Prelude.Generic)
newEbsBlockDevice ::
EbsBlockDevice
newEbsBlockDevice :: EbsBlockDevice
newEbsBlockDevice =
EbsBlockDevice' :: Maybe Text -> Maybe VolumeSpecification -> EbsBlockDevice
EbsBlockDevice'
{ $sel:device:EbsBlockDevice' :: Maybe Text
device = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:volumeSpecification:EbsBlockDevice' :: Maybe VolumeSpecification
volumeSpecification = Maybe VolumeSpecification
forall a. Maybe a
Prelude.Nothing
}
ebsBlockDevice_device :: Lens.Lens' EbsBlockDevice (Prelude.Maybe Prelude.Text)
ebsBlockDevice_device :: (Maybe Text -> f (Maybe Text))
-> EbsBlockDevice -> f EbsBlockDevice
ebsBlockDevice_device = (EbsBlockDevice -> Maybe Text)
-> (EbsBlockDevice -> Maybe Text -> EbsBlockDevice)
-> Lens EbsBlockDevice EbsBlockDevice (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsBlockDevice' {Maybe Text
device :: Maybe Text
$sel:device:EbsBlockDevice' :: EbsBlockDevice -> Maybe Text
device} -> Maybe Text
device) (\s :: EbsBlockDevice
s@EbsBlockDevice' {} Maybe Text
a -> EbsBlockDevice
s {$sel:device:EbsBlockDevice' :: Maybe Text
device = Maybe Text
a} :: EbsBlockDevice)
ebsBlockDevice_volumeSpecification :: Lens.Lens' EbsBlockDevice (Prelude.Maybe VolumeSpecification)
ebsBlockDevice_volumeSpecification :: (Maybe VolumeSpecification -> f (Maybe VolumeSpecification))
-> EbsBlockDevice -> f EbsBlockDevice
ebsBlockDevice_volumeSpecification = (EbsBlockDevice -> Maybe VolumeSpecification)
-> (EbsBlockDevice -> Maybe VolumeSpecification -> EbsBlockDevice)
-> Lens
EbsBlockDevice
EbsBlockDevice
(Maybe VolumeSpecification)
(Maybe VolumeSpecification)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsBlockDevice' {Maybe VolumeSpecification
volumeSpecification :: Maybe VolumeSpecification
$sel:volumeSpecification:EbsBlockDevice' :: EbsBlockDevice -> Maybe VolumeSpecification
volumeSpecification} -> Maybe VolumeSpecification
volumeSpecification) (\s :: EbsBlockDevice
s@EbsBlockDevice' {} Maybe VolumeSpecification
a -> EbsBlockDevice
s {$sel:volumeSpecification:EbsBlockDevice' :: Maybe VolumeSpecification
volumeSpecification = Maybe VolumeSpecification
a} :: EbsBlockDevice)
instance Core.FromJSON EbsBlockDevice where
parseJSON :: Value -> Parser EbsBlockDevice
parseJSON =
String
-> (Object -> Parser EbsBlockDevice)
-> Value
-> Parser EbsBlockDevice
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EbsBlockDevice"
( \Object
x ->
Maybe Text -> Maybe VolumeSpecification -> EbsBlockDevice
EbsBlockDevice'
(Maybe Text -> Maybe VolumeSpecification -> EbsBlockDevice)
-> Parser (Maybe Text)
-> Parser (Maybe VolumeSpecification -> EbsBlockDevice)
forall (f :: * -> *) a b. Functor 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
"Device")
Parser (Maybe VolumeSpecification -> EbsBlockDevice)
-> Parser (Maybe VolumeSpecification) -> Parser EbsBlockDevice
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VolumeSpecification)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VolumeSpecification")
)
instance Prelude.Hashable EbsBlockDevice
instance Prelude.NFData EbsBlockDevice