{-# 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.S3.Types.DeletedObject where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
data DeletedObject = DeletedObject'
{
DeletedObject -> Maybe ObjectVersionId
versionId :: Prelude.Maybe ObjectVersionId,
DeletedObject -> Maybe Bool
deleteMarker :: Prelude.Maybe Prelude.Bool,
DeletedObject -> Maybe Text
deleteMarkerVersionId :: Prelude.Maybe Prelude.Text,
DeletedObject -> Maybe ObjectKey
key :: Prelude.Maybe ObjectKey
}
deriving (DeletedObject -> DeletedObject -> Bool
(DeletedObject -> DeletedObject -> Bool)
-> (DeletedObject -> DeletedObject -> Bool) -> Eq DeletedObject
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletedObject -> DeletedObject -> Bool
$c/= :: DeletedObject -> DeletedObject -> Bool
== :: DeletedObject -> DeletedObject -> Bool
$c== :: DeletedObject -> DeletedObject -> Bool
Prelude.Eq, ReadPrec [DeletedObject]
ReadPrec DeletedObject
Int -> ReadS DeletedObject
ReadS [DeletedObject]
(Int -> ReadS DeletedObject)
-> ReadS [DeletedObject]
-> ReadPrec DeletedObject
-> ReadPrec [DeletedObject]
-> Read DeletedObject
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletedObject]
$creadListPrec :: ReadPrec [DeletedObject]
readPrec :: ReadPrec DeletedObject
$creadPrec :: ReadPrec DeletedObject
readList :: ReadS [DeletedObject]
$creadList :: ReadS [DeletedObject]
readsPrec :: Int -> ReadS DeletedObject
$creadsPrec :: Int -> ReadS DeletedObject
Prelude.Read, Int -> DeletedObject -> ShowS
[DeletedObject] -> ShowS
DeletedObject -> String
(Int -> DeletedObject -> ShowS)
-> (DeletedObject -> String)
-> ([DeletedObject] -> ShowS)
-> Show DeletedObject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletedObject] -> ShowS
$cshowList :: [DeletedObject] -> ShowS
show :: DeletedObject -> String
$cshow :: DeletedObject -> String
showsPrec :: Int -> DeletedObject -> ShowS
$cshowsPrec :: Int -> DeletedObject -> ShowS
Prelude.Show, (forall x. DeletedObject -> Rep DeletedObject x)
-> (forall x. Rep DeletedObject x -> DeletedObject)
-> Generic DeletedObject
forall x. Rep DeletedObject x -> DeletedObject
forall x. DeletedObject -> Rep DeletedObject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeletedObject x -> DeletedObject
$cfrom :: forall x. DeletedObject -> Rep DeletedObject x
Prelude.Generic)
newDeletedObject ::
DeletedObject
newDeletedObject :: DeletedObject
newDeletedObject =
DeletedObject' :: Maybe ObjectVersionId
-> Maybe Bool -> Maybe Text -> Maybe ObjectKey -> DeletedObject
DeletedObject'
{ $sel:versionId:DeletedObject' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
forall a. Maybe a
Prelude.Nothing,
$sel:deleteMarker:DeletedObject' :: Maybe Bool
deleteMarker = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:deleteMarkerVersionId:DeletedObject' :: Maybe Text
deleteMarkerVersionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:key:DeletedObject' :: Maybe ObjectKey
key = Maybe ObjectKey
forall a. Maybe a
Prelude.Nothing
}
deletedObject_versionId :: Lens.Lens' DeletedObject (Prelude.Maybe ObjectVersionId)
deletedObject_versionId :: (Maybe ObjectVersionId -> f (Maybe ObjectVersionId))
-> DeletedObject -> f DeletedObject
deletedObject_versionId = (DeletedObject -> Maybe ObjectVersionId)
-> (DeletedObject -> Maybe ObjectVersionId -> DeletedObject)
-> Lens
DeletedObject
DeletedObject
(Maybe ObjectVersionId)
(Maybe ObjectVersionId)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletedObject' {Maybe ObjectVersionId
versionId :: Maybe ObjectVersionId
$sel:versionId:DeletedObject' :: DeletedObject -> Maybe ObjectVersionId
versionId} -> Maybe ObjectVersionId
versionId) (\s :: DeletedObject
s@DeletedObject' {} Maybe ObjectVersionId
a -> DeletedObject
s {$sel:versionId:DeletedObject' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
a} :: DeletedObject)
deletedObject_deleteMarker :: Lens.Lens' DeletedObject (Prelude.Maybe Prelude.Bool)
deletedObject_deleteMarker :: (Maybe Bool -> f (Maybe Bool)) -> DeletedObject -> f DeletedObject
deletedObject_deleteMarker = (DeletedObject -> Maybe Bool)
-> (DeletedObject -> Maybe Bool -> DeletedObject)
-> Lens DeletedObject DeletedObject (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletedObject' {Maybe Bool
deleteMarker :: Maybe Bool
$sel:deleteMarker:DeletedObject' :: DeletedObject -> Maybe Bool
deleteMarker} -> Maybe Bool
deleteMarker) (\s :: DeletedObject
s@DeletedObject' {} Maybe Bool
a -> DeletedObject
s {$sel:deleteMarker:DeletedObject' :: Maybe Bool
deleteMarker = Maybe Bool
a} :: DeletedObject)
deletedObject_deleteMarkerVersionId :: Lens.Lens' DeletedObject (Prelude.Maybe Prelude.Text)
deletedObject_deleteMarkerVersionId :: (Maybe Text -> f (Maybe Text)) -> DeletedObject -> f DeletedObject
deletedObject_deleteMarkerVersionId = (DeletedObject -> Maybe Text)
-> (DeletedObject -> Maybe Text -> DeletedObject)
-> Lens DeletedObject DeletedObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletedObject' {Maybe Text
deleteMarkerVersionId :: Maybe Text
$sel:deleteMarkerVersionId:DeletedObject' :: DeletedObject -> Maybe Text
deleteMarkerVersionId} -> Maybe Text
deleteMarkerVersionId) (\s :: DeletedObject
s@DeletedObject' {} Maybe Text
a -> DeletedObject
s {$sel:deleteMarkerVersionId:DeletedObject' :: Maybe Text
deleteMarkerVersionId = Maybe Text
a} :: DeletedObject)
deletedObject_key :: Lens.Lens' DeletedObject (Prelude.Maybe ObjectKey)
deletedObject_key :: (Maybe ObjectKey -> f (Maybe ObjectKey))
-> DeletedObject -> f DeletedObject
deletedObject_key = (DeletedObject -> Maybe ObjectKey)
-> (DeletedObject -> Maybe ObjectKey -> DeletedObject)
-> Lens
DeletedObject DeletedObject (Maybe ObjectKey) (Maybe ObjectKey)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletedObject' {Maybe ObjectKey
key :: Maybe ObjectKey
$sel:key:DeletedObject' :: DeletedObject -> Maybe ObjectKey
key} -> Maybe ObjectKey
key) (\s :: DeletedObject
s@DeletedObject' {} Maybe ObjectKey
a -> DeletedObject
s {$sel:key:DeletedObject' :: Maybe ObjectKey
key = Maybe ObjectKey
a} :: DeletedObject)
instance Core.FromXML DeletedObject where
parseXML :: [Node] -> Either String DeletedObject
parseXML [Node]
x =
Maybe ObjectVersionId
-> Maybe Bool -> Maybe Text -> Maybe ObjectKey -> DeletedObject
DeletedObject'
(Maybe ObjectVersionId
-> Maybe Bool -> Maybe Text -> Maybe ObjectKey -> DeletedObject)
-> Either String (Maybe ObjectVersionId)
-> Either
String
(Maybe Bool -> Maybe Text -> Maybe ObjectKey -> DeletedObject)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe ObjectVersionId)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"VersionId")
Either
String
(Maybe Bool -> Maybe Text -> Maybe ObjectKey -> DeletedObject)
-> Either String (Maybe Bool)
-> Either String (Maybe Text -> Maybe ObjectKey -> DeletedObject)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DeleteMarker")
Either String (Maybe Text -> Maybe ObjectKey -> DeletedObject)
-> Either String (Maybe Text)
-> Either String (Maybe ObjectKey -> DeletedObject)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DeleteMarkerVersionId")
Either String (Maybe ObjectKey -> DeletedObject)
-> Either String (Maybe ObjectKey) -> Either String DeletedObject
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ObjectKey)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Key")
instance Prelude.Hashable DeletedObject
instance Prelude.NFData DeletedObject