{-# 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.EC2.Types.VolumeAttachment where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.VolumeAttachmentState
import qualified Amazonka.Prelude as Prelude
data VolumeAttachment = VolumeAttachment'
{
VolumeAttachment -> Maybe ISO8601
attachTime :: Prelude.Maybe Data.ISO8601,
VolumeAttachment -> Maybe Bool
deleteOnTermination :: Prelude.Maybe Prelude.Bool,
VolumeAttachment -> Maybe Text
device :: Prelude.Maybe Prelude.Text,
VolumeAttachment -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
VolumeAttachment -> Maybe VolumeAttachmentState
state :: Prelude.Maybe VolumeAttachmentState,
VolumeAttachment -> Maybe Text
volumeId :: Prelude.Maybe Prelude.Text
}
deriving (VolumeAttachment -> VolumeAttachment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VolumeAttachment -> VolumeAttachment -> Bool
$c/= :: VolumeAttachment -> VolumeAttachment -> Bool
== :: VolumeAttachment -> VolumeAttachment -> Bool
$c== :: VolumeAttachment -> VolumeAttachment -> Bool
Prelude.Eq, ReadPrec [VolumeAttachment]
ReadPrec VolumeAttachment
Int -> ReadS VolumeAttachment
ReadS [VolumeAttachment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VolumeAttachment]
$creadListPrec :: ReadPrec [VolumeAttachment]
readPrec :: ReadPrec VolumeAttachment
$creadPrec :: ReadPrec VolumeAttachment
readList :: ReadS [VolumeAttachment]
$creadList :: ReadS [VolumeAttachment]
readsPrec :: Int -> ReadS VolumeAttachment
$creadsPrec :: Int -> ReadS VolumeAttachment
Prelude.Read, Int -> VolumeAttachment -> ShowS
[VolumeAttachment] -> ShowS
VolumeAttachment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VolumeAttachment] -> ShowS
$cshowList :: [VolumeAttachment] -> ShowS
show :: VolumeAttachment -> String
$cshow :: VolumeAttachment -> String
showsPrec :: Int -> VolumeAttachment -> ShowS
$cshowsPrec :: Int -> VolumeAttachment -> ShowS
Prelude.Show, forall x. Rep VolumeAttachment x -> VolumeAttachment
forall x. VolumeAttachment -> Rep VolumeAttachment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VolumeAttachment x -> VolumeAttachment
$cfrom :: forall x. VolumeAttachment -> Rep VolumeAttachment x
Prelude.Generic)
newVolumeAttachment ::
VolumeAttachment
newVolumeAttachment :: VolumeAttachment
newVolumeAttachment =
VolumeAttachment'
{ $sel:attachTime:VolumeAttachment' :: Maybe ISO8601
attachTime = forall a. Maybe a
Prelude.Nothing,
$sel:deleteOnTermination:VolumeAttachment' :: Maybe Bool
deleteOnTermination = forall a. Maybe a
Prelude.Nothing,
$sel:device:VolumeAttachment' :: Maybe Text
device = forall a. Maybe a
Prelude.Nothing,
$sel:instanceId:VolumeAttachment' :: Maybe Text
instanceId = forall a. Maybe a
Prelude.Nothing,
$sel:state:VolumeAttachment' :: Maybe VolumeAttachmentState
state = forall a. Maybe a
Prelude.Nothing,
$sel:volumeId:VolumeAttachment' :: Maybe Text
volumeId = forall a. Maybe a
Prelude.Nothing
}
volumeAttachment_attachTime :: Lens.Lens' VolumeAttachment (Prelude.Maybe Prelude.UTCTime)
volumeAttachment_attachTime :: Lens' VolumeAttachment (Maybe UTCTime)
volumeAttachment_attachTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeAttachment' {Maybe ISO8601
attachTime :: Maybe ISO8601
$sel:attachTime:VolumeAttachment' :: VolumeAttachment -> Maybe ISO8601
attachTime} -> Maybe ISO8601
attachTime) (\s :: VolumeAttachment
s@VolumeAttachment' {} Maybe ISO8601
a -> VolumeAttachment
s {$sel:attachTime:VolumeAttachment' :: Maybe ISO8601
attachTime = Maybe ISO8601
a} :: VolumeAttachment) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
volumeAttachment_deleteOnTermination :: Lens.Lens' VolumeAttachment (Prelude.Maybe Prelude.Bool)
volumeAttachment_deleteOnTermination :: Lens' VolumeAttachment (Maybe Bool)
volumeAttachment_deleteOnTermination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeAttachment' {Maybe Bool
deleteOnTermination :: Maybe Bool
$sel:deleteOnTermination:VolumeAttachment' :: VolumeAttachment -> Maybe Bool
deleteOnTermination} -> Maybe Bool
deleteOnTermination) (\s :: VolumeAttachment
s@VolumeAttachment' {} Maybe Bool
a -> VolumeAttachment
s {$sel:deleteOnTermination:VolumeAttachment' :: Maybe Bool
deleteOnTermination = Maybe Bool
a} :: VolumeAttachment)
volumeAttachment_device :: Lens.Lens' VolumeAttachment (Prelude.Maybe Prelude.Text)
volumeAttachment_device :: Lens' VolumeAttachment (Maybe Text)
volumeAttachment_device = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeAttachment' {Maybe Text
device :: Maybe Text
$sel:device:VolumeAttachment' :: VolumeAttachment -> Maybe Text
device} -> Maybe Text
device) (\s :: VolumeAttachment
s@VolumeAttachment' {} Maybe Text
a -> VolumeAttachment
s {$sel:device:VolumeAttachment' :: Maybe Text
device = Maybe Text
a} :: VolumeAttachment)
volumeAttachment_instanceId :: Lens.Lens' VolumeAttachment (Prelude.Maybe Prelude.Text)
volumeAttachment_instanceId :: Lens' VolumeAttachment (Maybe Text)
volumeAttachment_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeAttachment' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:VolumeAttachment' :: VolumeAttachment -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: VolumeAttachment
s@VolumeAttachment' {} Maybe Text
a -> VolumeAttachment
s {$sel:instanceId:VolumeAttachment' :: Maybe Text
instanceId = Maybe Text
a} :: VolumeAttachment)
volumeAttachment_state :: Lens.Lens' VolumeAttachment (Prelude.Maybe VolumeAttachmentState)
volumeAttachment_state :: Lens' VolumeAttachment (Maybe VolumeAttachmentState)
volumeAttachment_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeAttachment' {Maybe VolumeAttachmentState
state :: Maybe VolumeAttachmentState
$sel:state:VolumeAttachment' :: VolumeAttachment -> Maybe VolumeAttachmentState
state} -> Maybe VolumeAttachmentState
state) (\s :: VolumeAttachment
s@VolumeAttachment' {} Maybe VolumeAttachmentState
a -> VolumeAttachment
s {$sel:state:VolumeAttachment' :: Maybe VolumeAttachmentState
state = Maybe VolumeAttachmentState
a} :: VolumeAttachment)
volumeAttachment_volumeId :: Lens.Lens' VolumeAttachment (Prelude.Maybe Prelude.Text)
volumeAttachment_volumeId :: Lens' VolumeAttachment (Maybe Text)
volumeAttachment_volumeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeAttachment' {Maybe Text
volumeId :: Maybe Text
$sel:volumeId:VolumeAttachment' :: VolumeAttachment -> Maybe Text
volumeId} -> Maybe Text
volumeId) (\s :: VolumeAttachment
s@VolumeAttachment' {} Maybe Text
a -> VolumeAttachment
s {$sel:volumeId:VolumeAttachment' :: Maybe Text
volumeId = Maybe Text
a} :: VolumeAttachment)
instance Data.FromXML VolumeAttachment where
parseXML :: [Node] -> Either String VolumeAttachment
parseXML [Node]
x =
Maybe ISO8601
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe VolumeAttachmentState
-> Maybe Text
-> VolumeAttachment
VolumeAttachment'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"attachTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"deleteOnTermination")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"device")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"instanceId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"status")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"volumeId")
instance Prelude.Hashable VolumeAttachment where
hashWithSalt :: Int -> VolumeAttachment -> Int
hashWithSalt Int
_salt VolumeAttachment' {Maybe Bool
Maybe Text
Maybe ISO8601
Maybe VolumeAttachmentState
volumeId :: Maybe Text
state :: Maybe VolumeAttachmentState
instanceId :: Maybe Text
device :: Maybe Text
deleteOnTermination :: Maybe Bool
attachTime :: Maybe ISO8601
$sel:volumeId:VolumeAttachment' :: VolumeAttachment -> Maybe Text
$sel:state:VolumeAttachment' :: VolumeAttachment -> Maybe VolumeAttachmentState
$sel:instanceId:VolumeAttachment' :: VolumeAttachment -> Maybe Text
$sel:device:VolumeAttachment' :: VolumeAttachment -> Maybe Text
$sel:deleteOnTermination:VolumeAttachment' :: VolumeAttachment -> Maybe Bool
$sel:attachTime:VolumeAttachment' :: VolumeAttachment -> Maybe ISO8601
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
attachTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
deleteOnTermination
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
device
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VolumeAttachmentState
state
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
volumeId
instance Prelude.NFData VolumeAttachment where
rnf :: VolumeAttachment -> ()
rnf VolumeAttachment' {Maybe Bool
Maybe Text
Maybe ISO8601
Maybe VolumeAttachmentState
volumeId :: Maybe Text
state :: Maybe VolumeAttachmentState
instanceId :: Maybe Text
device :: Maybe Text
deleteOnTermination :: Maybe Bool
attachTime :: Maybe ISO8601
$sel:volumeId:VolumeAttachment' :: VolumeAttachment -> Maybe Text
$sel:state:VolumeAttachment' :: VolumeAttachment -> Maybe VolumeAttachmentState
$sel:instanceId:VolumeAttachment' :: VolumeAttachment -> Maybe Text
$sel:device:VolumeAttachment' :: VolumeAttachment -> Maybe Text
$sel:deleteOnTermination:VolumeAttachment' :: VolumeAttachment -> Maybe Bool
$sel:attachTime:VolumeAttachment' :: VolumeAttachment -> Maybe ISO8601
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
attachTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
deleteOnTermination
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
device
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VolumeAttachmentState
state
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
volumeId