{-# 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.SecurityHub.Types.AwsEc2VolumeAttachment where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AwsEc2VolumeAttachment = AwsEc2VolumeAttachment'
{
AwsEc2VolumeAttachment -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
AwsEc2VolumeAttachment -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
AwsEc2VolumeAttachment -> Maybe Bool
deleteOnTermination :: Prelude.Maybe Prelude.Bool,
AwsEc2VolumeAttachment -> Maybe Text
attachTime :: Prelude.Maybe Prelude.Text
}
deriving (AwsEc2VolumeAttachment -> AwsEc2VolumeAttachment -> Bool
(AwsEc2VolumeAttachment -> AwsEc2VolumeAttachment -> Bool)
-> (AwsEc2VolumeAttachment -> AwsEc2VolumeAttachment -> Bool)
-> Eq AwsEc2VolumeAttachment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEc2VolumeAttachment -> AwsEc2VolumeAttachment -> Bool
$c/= :: AwsEc2VolumeAttachment -> AwsEc2VolumeAttachment -> Bool
== :: AwsEc2VolumeAttachment -> AwsEc2VolumeAttachment -> Bool
$c== :: AwsEc2VolumeAttachment -> AwsEc2VolumeAttachment -> Bool
Prelude.Eq, ReadPrec [AwsEc2VolumeAttachment]
ReadPrec AwsEc2VolumeAttachment
Int -> ReadS AwsEc2VolumeAttachment
ReadS [AwsEc2VolumeAttachment]
(Int -> ReadS AwsEc2VolumeAttachment)
-> ReadS [AwsEc2VolumeAttachment]
-> ReadPrec AwsEc2VolumeAttachment
-> ReadPrec [AwsEc2VolumeAttachment]
-> Read AwsEc2VolumeAttachment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsEc2VolumeAttachment]
$creadListPrec :: ReadPrec [AwsEc2VolumeAttachment]
readPrec :: ReadPrec AwsEc2VolumeAttachment
$creadPrec :: ReadPrec AwsEc2VolumeAttachment
readList :: ReadS [AwsEc2VolumeAttachment]
$creadList :: ReadS [AwsEc2VolumeAttachment]
readsPrec :: Int -> ReadS AwsEc2VolumeAttachment
$creadsPrec :: Int -> ReadS AwsEc2VolumeAttachment
Prelude.Read, Int -> AwsEc2VolumeAttachment -> ShowS
[AwsEc2VolumeAttachment] -> ShowS
AwsEc2VolumeAttachment -> String
(Int -> AwsEc2VolumeAttachment -> ShowS)
-> (AwsEc2VolumeAttachment -> String)
-> ([AwsEc2VolumeAttachment] -> ShowS)
-> Show AwsEc2VolumeAttachment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEc2VolumeAttachment] -> ShowS
$cshowList :: [AwsEc2VolumeAttachment] -> ShowS
show :: AwsEc2VolumeAttachment -> String
$cshow :: AwsEc2VolumeAttachment -> String
showsPrec :: Int -> AwsEc2VolumeAttachment -> ShowS
$cshowsPrec :: Int -> AwsEc2VolumeAttachment -> ShowS
Prelude.Show, (forall x. AwsEc2VolumeAttachment -> Rep AwsEc2VolumeAttachment x)
-> (forall x.
Rep AwsEc2VolumeAttachment x -> AwsEc2VolumeAttachment)
-> Generic AwsEc2VolumeAttachment
forall x. Rep AwsEc2VolumeAttachment x -> AwsEc2VolumeAttachment
forall x. AwsEc2VolumeAttachment -> Rep AwsEc2VolumeAttachment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AwsEc2VolumeAttachment x -> AwsEc2VolumeAttachment
$cfrom :: forall x. AwsEc2VolumeAttachment -> Rep AwsEc2VolumeAttachment x
Prelude.Generic)
newAwsEc2VolumeAttachment ::
AwsEc2VolumeAttachment
newAwsEc2VolumeAttachment :: AwsEc2VolumeAttachment
newAwsEc2VolumeAttachment =
AwsEc2VolumeAttachment' :: Maybe Text
-> Maybe Text -> Maybe Bool -> Maybe Text -> AwsEc2VolumeAttachment
AwsEc2VolumeAttachment'
{ $sel:instanceId:AwsEc2VolumeAttachment' :: Maybe Text
instanceId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:AwsEc2VolumeAttachment' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deleteOnTermination:AwsEc2VolumeAttachment' :: Maybe Bool
deleteOnTermination = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:attachTime:AwsEc2VolumeAttachment' :: Maybe Text
attachTime = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
awsEc2VolumeAttachment_instanceId :: Lens.Lens' AwsEc2VolumeAttachment (Prelude.Maybe Prelude.Text)
awsEc2VolumeAttachment_instanceId :: (Maybe Text -> f (Maybe Text))
-> AwsEc2VolumeAttachment -> f AwsEc2VolumeAttachment
awsEc2VolumeAttachment_instanceId = (AwsEc2VolumeAttachment -> Maybe Text)
-> (AwsEc2VolumeAttachment -> Maybe Text -> AwsEc2VolumeAttachment)
-> Lens
AwsEc2VolumeAttachment
AwsEc2VolumeAttachment
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2VolumeAttachment' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:AwsEc2VolumeAttachment' :: AwsEc2VolumeAttachment -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: AwsEc2VolumeAttachment
s@AwsEc2VolumeAttachment' {} Maybe Text
a -> AwsEc2VolumeAttachment
s {$sel:instanceId:AwsEc2VolumeAttachment' :: Maybe Text
instanceId = Maybe Text
a} :: AwsEc2VolumeAttachment)
awsEc2VolumeAttachment_status :: Lens.Lens' AwsEc2VolumeAttachment (Prelude.Maybe Prelude.Text)
awsEc2VolumeAttachment_status :: (Maybe Text -> f (Maybe Text))
-> AwsEc2VolumeAttachment -> f AwsEc2VolumeAttachment
awsEc2VolumeAttachment_status = (AwsEc2VolumeAttachment -> Maybe Text)
-> (AwsEc2VolumeAttachment -> Maybe Text -> AwsEc2VolumeAttachment)
-> Lens
AwsEc2VolumeAttachment
AwsEc2VolumeAttachment
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2VolumeAttachment' {Maybe Text
status :: Maybe Text
$sel:status:AwsEc2VolumeAttachment' :: AwsEc2VolumeAttachment -> Maybe Text
status} -> Maybe Text
status) (\s :: AwsEc2VolumeAttachment
s@AwsEc2VolumeAttachment' {} Maybe Text
a -> AwsEc2VolumeAttachment
s {$sel:status:AwsEc2VolumeAttachment' :: Maybe Text
status = Maybe Text
a} :: AwsEc2VolumeAttachment)
awsEc2VolumeAttachment_deleteOnTermination :: Lens.Lens' AwsEc2VolumeAttachment (Prelude.Maybe Prelude.Bool)
awsEc2VolumeAttachment_deleteOnTermination :: (Maybe Bool -> f (Maybe Bool))
-> AwsEc2VolumeAttachment -> f AwsEc2VolumeAttachment
awsEc2VolumeAttachment_deleteOnTermination = (AwsEc2VolumeAttachment -> Maybe Bool)
-> (AwsEc2VolumeAttachment -> Maybe Bool -> AwsEc2VolumeAttachment)
-> Lens
AwsEc2VolumeAttachment
AwsEc2VolumeAttachment
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2VolumeAttachment' {Maybe Bool
deleteOnTermination :: Maybe Bool
$sel:deleteOnTermination:AwsEc2VolumeAttachment' :: AwsEc2VolumeAttachment -> Maybe Bool
deleteOnTermination} -> Maybe Bool
deleteOnTermination) (\s :: AwsEc2VolumeAttachment
s@AwsEc2VolumeAttachment' {} Maybe Bool
a -> AwsEc2VolumeAttachment
s {$sel:deleteOnTermination:AwsEc2VolumeAttachment' :: Maybe Bool
deleteOnTermination = Maybe Bool
a} :: AwsEc2VolumeAttachment)
awsEc2VolumeAttachment_attachTime :: Lens.Lens' AwsEc2VolumeAttachment (Prelude.Maybe Prelude.Text)
awsEc2VolumeAttachment_attachTime :: (Maybe Text -> f (Maybe Text))
-> AwsEc2VolumeAttachment -> f AwsEc2VolumeAttachment
awsEc2VolumeAttachment_attachTime = (AwsEc2VolumeAttachment -> Maybe Text)
-> (AwsEc2VolumeAttachment -> Maybe Text -> AwsEc2VolumeAttachment)
-> Lens
AwsEc2VolumeAttachment
AwsEc2VolumeAttachment
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2VolumeAttachment' {Maybe Text
attachTime :: Maybe Text
$sel:attachTime:AwsEc2VolumeAttachment' :: AwsEc2VolumeAttachment -> Maybe Text
attachTime} -> Maybe Text
attachTime) (\s :: AwsEc2VolumeAttachment
s@AwsEc2VolumeAttachment' {} Maybe Text
a -> AwsEc2VolumeAttachment
s {$sel:attachTime:AwsEc2VolumeAttachment' :: Maybe Text
attachTime = Maybe Text
a} :: AwsEc2VolumeAttachment)
instance Core.FromJSON AwsEc2VolumeAttachment where
parseJSON :: Value -> Parser AwsEc2VolumeAttachment
parseJSON =
String
-> (Object -> Parser AwsEc2VolumeAttachment)
-> Value
-> Parser AwsEc2VolumeAttachment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AwsEc2VolumeAttachment"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe Bool -> Maybe Text -> AwsEc2VolumeAttachment
AwsEc2VolumeAttachment'
(Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> AwsEc2VolumeAttachment)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Bool -> Maybe Text -> AwsEc2VolumeAttachment)
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
"InstanceId")
Parser
(Maybe Text -> Maybe Bool -> Maybe Text -> AwsEc2VolumeAttachment)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> Maybe Text -> AwsEc2VolumeAttachment)
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
"Status")
Parser (Maybe Bool -> Maybe Text -> AwsEc2VolumeAttachment)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> AwsEc2VolumeAttachment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DeleteOnTermination")
Parser (Maybe Text -> AwsEc2VolumeAttachment)
-> Parser (Maybe Text) -> Parser AwsEc2VolumeAttachment
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
"AttachTime")
)
instance Prelude.Hashable AwsEc2VolumeAttachment
instance Prelude.NFData AwsEc2VolumeAttachment
instance Core.ToJSON AwsEc2VolumeAttachment where
toJSON :: AwsEc2VolumeAttachment -> Value
toJSON AwsEc2VolumeAttachment' {Maybe Bool
Maybe Text
attachTime :: Maybe Text
deleteOnTermination :: Maybe Bool
status :: Maybe Text
instanceId :: Maybe Text
$sel:attachTime:AwsEc2VolumeAttachment' :: AwsEc2VolumeAttachment -> Maybe Text
$sel:deleteOnTermination:AwsEc2VolumeAttachment' :: AwsEc2VolumeAttachment -> Maybe Bool
$sel:status:AwsEc2VolumeAttachment' :: AwsEc2VolumeAttachment -> Maybe Text
$sel:instanceId:AwsEc2VolumeAttachment' :: AwsEc2VolumeAttachment -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"InstanceId" 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
instanceId,
(Text
"Status" 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
status,
(Text
"DeleteOnTermination" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
deleteOnTermination,
(Text
"AttachTime" 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
attachTime
]
)