{-# 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.SnowDeviceManagement.Types.InstanceBlockDeviceMapping where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SnowDeviceManagement.Types.EbsInstanceBlockDevice
data InstanceBlockDeviceMapping = InstanceBlockDeviceMapping'
{
InstanceBlockDeviceMapping -> Maybe EbsInstanceBlockDevice
ebs :: Prelude.Maybe EbsInstanceBlockDevice,
InstanceBlockDeviceMapping -> Maybe Text
deviceName :: Prelude.Maybe Prelude.Text
}
deriving (InstanceBlockDeviceMapping -> InstanceBlockDeviceMapping -> Bool
(InstanceBlockDeviceMapping -> InstanceBlockDeviceMapping -> Bool)
-> (InstanceBlockDeviceMapping
-> InstanceBlockDeviceMapping -> Bool)
-> Eq InstanceBlockDeviceMapping
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceBlockDeviceMapping -> InstanceBlockDeviceMapping -> Bool
$c/= :: InstanceBlockDeviceMapping -> InstanceBlockDeviceMapping -> Bool
== :: InstanceBlockDeviceMapping -> InstanceBlockDeviceMapping -> Bool
$c== :: InstanceBlockDeviceMapping -> InstanceBlockDeviceMapping -> Bool
Prelude.Eq, ReadPrec [InstanceBlockDeviceMapping]
ReadPrec InstanceBlockDeviceMapping
Int -> ReadS InstanceBlockDeviceMapping
ReadS [InstanceBlockDeviceMapping]
(Int -> ReadS InstanceBlockDeviceMapping)
-> ReadS [InstanceBlockDeviceMapping]
-> ReadPrec InstanceBlockDeviceMapping
-> ReadPrec [InstanceBlockDeviceMapping]
-> Read InstanceBlockDeviceMapping
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceBlockDeviceMapping]
$creadListPrec :: ReadPrec [InstanceBlockDeviceMapping]
readPrec :: ReadPrec InstanceBlockDeviceMapping
$creadPrec :: ReadPrec InstanceBlockDeviceMapping
readList :: ReadS [InstanceBlockDeviceMapping]
$creadList :: ReadS [InstanceBlockDeviceMapping]
readsPrec :: Int -> ReadS InstanceBlockDeviceMapping
$creadsPrec :: Int -> ReadS InstanceBlockDeviceMapping
Prelude.Read, Int -> InstanceBlockDeviceMapping -> ShowS
[InstanceBlockDeviceMapping] -> ShowS
InstanceBlockDeviceMapping -> String
(Int -> InstanceBlockDeviceMapping -> ShowS)
-> (InstanceBlockDeviceMapping -> String)
-> ([InstanceBlockDeviceMapping] -> ShowS)
-> Show InstanceBlockDeviceMapping
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceBlockDeviceMapping] -> ShowS
$cshowList :: [InstanceBlockDeviceMapping] -> ShowS
show :: InstanceBlockDeviceMapping -> String
$cshow :: InstanceBlockDeviceMapping -> String
showsPrec :: Int -> InstanceBlockDeviceMapping -> ShowS
$cshowsPrec :: Int -> InstanceBlockDeviceMapping -> ShowS
Prelude.Show, (forall x.
InstanceBlockDeviceMapping -> Rep InstanceBlockDeviceMapping x)
-> (forall x.
Rep InstanceBlockDeviceMapping x -> InstanceBlockDeviceMapping)
-> Generic InstanceBlockDeviceMapping
forall x.
Rep InstanceBlockDeviceMapping x -> InstanceBlockDeviceMapping
forall x.
InstanceBlockDeviceMapping -> Rep InstanceBlockDeviceMapping x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InstanceBlockDeviceMapping x -> InstanceBlockDeviceMapping
$cfrom :: forall x.
InstanceBlockDeviceMapping -> Rep InstanceBlockDeviceMapping x
Prelude.Generic)
newInstanceBlockDeviceMapping ::
InstanceBlockDeviceMapping
newInstanceBlockDeviceMapping :: InstanceBlockDeviceMapping
newInstanceBlockDeviceMapping =
InstanceBlockDeviceMapping' :: Maybe EbsInstanceBlockDevice
-> Maybe Text -> InstanceBlockDeviceMapping
InstanceBlockDeviceMapping'
{ $sel:ebs:InstanceBlockDeviceMapping' :: Maybe EbsInstanceBlockDevice
ebs = Maybe EbsInstanceBlockDevice
forall a. Maybe a
Prelude.Nothing,
$sel:deviceName:InstanceBlockDeviceMapping' :: Maybe Text
deviceName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
instanceBlockDeviceMapping_ebs :: Lens.Lens' InstanceBlockDeviceMapping (Prelude.Maybe EbsInstanceBlockDevice)
instanceBlockDeviceMapping_ebs :: (Maybe EbsInstanceBlockDevice -> f (Maybe EbsInstanceBlockDevice))
-> InstanceBlockDeviceMapping -> f InstanceBlockDeviceMapping
instanceBlockDeviceMapping_ebs = (InstanceBlockDeviceMapping -> Maybe EbsInstanceBlockDevice)
-> (InstanceBlockDeviceMapping
-> Maybe EbsInstanceBlockDevice -> InstanceBlockDeviceMapping)
-> Lens
InstanceBlockDeviceMapping
InstanceBlockDeviceMapping
(Maybe EbsInstanceBlockDevice)
(Maybe EbsInstanceBlockDevice)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceBlockDeviceMapping' {Maybe EbsInstanceBlockDevice
ebs :: Maybe EbsInstanceBlockDevice
$sel:ebs:InstanceBlockDeviceMapping' :: InstanceBlockDeviceMapping -> Maybe EbsInstanceBlockDevice
ebs} -> Maybe EbsInstanceBlockDevice
ebs) (\s :: InstanceBlockDeviceMapping
s@InstanceBlockDeviceMapping' {} Maybe EbsInstanceBlockDevice
a -> InstanceBlockDeviceMapping
s {$sel:ebs:InstanceBlockDeviceMapping' :: Maybe EbsInstanceBlockDevice
ebs = Maybe EbsInstanceBlockDevice
a} :: InstanceBlockDeviceMapping)
instanceBlockDeviceMapping_deviceName :: Lens.Lens' InstanceBlockDeviceMapping (Prelude.Maybe Prelude.Text)
instanceBlockDeviceMapping_deviceName :: (Maybe Text -> f (Maybe Text))
-> InstanceBlockDeviceMapping -> f InstanceBlockDeviceMapping
instanceBlockDeviceMapping_deviceName = (InstanceBlockDeviceMapping -> Maybe Text)
-> (InstanceBlockDeviceMapping
-> Maybe Text -> InstanceBlockDeviceMapping)
-> Lens
InstanceBlockDeviceMapping
InstanceBlockDeviceMapping
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceBlockDeviceMapping' {Maybe Text
deviceName :: Maybe Text
$sel:deviceName:InstanceBlockDeviceMapping' :: InstanceBlockDeviceMapping -> Maybe Text
deviceName} -> Maybe Text
deviceName) (\s :: InstanceBlockDeviceMapping
s@InstanceBlockDeviceMapping' {} Maybe Text
a -> InstanceBlockDeviceMapping
s {$sel:deviceName:InstanceBlockDeviceMapping' :: Maybe Text
deviceName = Maybe Text
a} :: InstanceBlockDeviceMapping)
instance Core.FromJSON InstanceBlockDeviceMapping where
parseJSON :: Value -> Parser InstanceBlockDeviceMapping
parseJSON =
String
-> (Object -> Parser InstanceBlockDeviceMapping)
-> Value
-> Parser InstanceBlockDeviceMapping
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InstanceBlockDeviceMapping"
( \Object
x ->
Maybe EbsInstanceBlockDevice
-> Maybe Text -> InstanceBlockDeviceMapping
InstanceBlockDeviceMapping'
(Maybe EbsInstanceBlockDevice
-> Maybe Text -> InstanceBlockDeviceMapping)
-> Parser (Maybe EbsInstanceBlockDevice)
-> Parser (Maybe Text -> InstanceBlockDeviceMapping)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe EbsInstanceBlockDevice)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ebs")
Parser (Maybe Text -> InstanceBlockDeviceMapping)
-> Parser (Maybe Text) -> Parser InstanceBlockDeviceMapping
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
"deviceName")
)
instance Prelude.Hashable InstanceBlockDeviceMapping
instance Prelude.NFData InstanceBlockDeviceMapping