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