{-# 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.ObjectIdentifier where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
data ObjectIdentifier = ObjectIdentifier'
{
ObjectIdentifier -> Maybe ObjectVersionId
versionId :: Prelude.Maybe ObjectVersionId,
ObjectIdentifier -> ObjectKey
key :: ObjectKey
}
deriving (ObjectIdentifier -> ObjectIdentifier -> Bool
(ObjectIdentifier -> ObjectIdentifier -> Bool)
-> (ObjectIdentifier -> ObjectIdentifier -> Bool)
-> Eq ObjectIdentifier
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ObjectIdentifier -> ObjectIdentifier -> Bool
$c/= :: ObjectIdentifier -> ObjectIdentifier -> Bool
== :: ObjectIdentifier -> ObjectIdentifier -> Bool
$c== :: ObjectIdentifier -> ObjectIdentifier -> Bool
Prelude.Eq, ReadPrec [ObjectIdentifier]
ReadPrec ObjectIdentifier
Int -> ReadS ObjectIdentifier
ReadS [ObjectIdentifier]
(Int -> ReadS ObjectIdentifier)
-> ReadS [ObjectIdentifier]
-> ReadPrec ObjectIdentifier
-> ReadPrec [ObjectIdentifier]
-> Read ObjectIdentifier
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ObjectIdentifier]
$creadListPrec :: ReadPrec [ObjectIdentifier]
readPrec :: ReadPrec ObjectIdentifier
$creadPrec :: ReadPrec ObjectIdentifier
readList :: ReadS [ObjectIdentifier]
$creadList :: ReadS [ObjectIdentifier]
readsPrec :: Int -> ReadS ObjectIdentifier
$creadsPrec :: Int -> ReadS ObjectIdentifier
Prelude.Read, Int -> ObjectIdentifier -> ShowS
[ObjectIdentifier] -> ShowS
ObjectIdentifier -> String
(Int -> ObjectIdentifier -> ShowS)
-> (ObjectIdentifier -> String)
-> ([ObjectIdentifier] -> ShowS)
-> Show ObjectIdentifier
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ObjectIdentifier] -> ShowS
$cshowList :: [ObjectIdentifier] -> ShowS
show :: ObjectIdentifier -> String
$cshow :: ObjectIdentifier -> String
showsPrec :: Int -> ObjectIdentifier -> ShowS
$cshowsPrec :: Int -> ObjectIdentifier -> ShowS
Prelude.Show, (forall x. ObjectIdentifier -> Rep ObjectIdentifier x)
-> (forall x. Rep ObjectIdentifier x -> ObjectIdentifier)
-> Generic ObjectIdentifier
forall x. Rep ObjectIdentifier x -> ObjectIdentifier
forall x. ObjectIdentifier -> Rep ObjectIdentifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ObjectIdentifier x -> ObjectIdentifier
$cfrom :: forall x. ObjectIdentifier -> Rep ObjectIdentifier x
Prelude.Generic)
newObjectIdentifier ::
ObjectKey ->
ObjectIdentifier
newObjectIdentifier :: ObjectKey -> ObjectIdentifier
newObjectIdentifier ObjectKey
pKey_ =
ObjectIdentifier' :: Maybe ObjectVersionId -> ObjectKey -> ObjectIdentifier
ObjectIdentifier'
{ $sel:versionId:ObjectIdentifier' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
forall a. Maybe a
Prelude.Nothing,
$sel:key:ObjectIdentifier' :: ObjectKey
key = ObjectKey
pKey_
}
objectIdentifier_versionId :: Lens.Lens' ObjectIdentifier (Prelude.Maybe ObjectVersionId)
objectIdentifier_versionId :: (Maybe ObjectVersionId -> f (Maybe ObjectVersionId))
-> ObjectIdentifier -> f ObjectIdentifier
objectIdentifier_versionId = (ObjectIdentifier -> Maybe ObjectVersionId)
-> (ObjectIdentifier -> Maybe ObjectVersionId -> ObjectIdentifier)
-> Lens
ObjectIdentifier
ObjectIdentifier
(Maybe ObjectVersionId)
(Maybe ObjectVersionId)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ObjectIdentifier' {Maybe ObjectVersionId
versionId :: Maybe ObjectVersionId
$sel:versionId:ObjectIdentifier' :: ObjectIdentifier -> Maybe ObjectVersionId
versionId} -> Maybe ObjectVersionId
versionId) (\s :: ObjectIdentifier
s@ObjectIdentifier' {} Maybe ObjectVersionId
a -> ObjectIdentifier
s {$sel:versionId:ObjectIdentifier' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
a} :: ObjectIdentifier)
objectIdentifier_key :: Lens.Lens' ObjectIdentifier ObjectKey
objectIdentifier_key :: (ObjectKey -> f ObjectKey)
-> ObjectIdentifier -> f ObjectIdentifier
objectIdentifier_key = (ObjectIdentifier -> ObjectKey)
-> (ObjectIdentifier -> ObjectKey -> ObjectIdentifier)
-> Lens ObjectIdentifier ObjectIdentifier ObjectKey ObjectKey
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ObjectIdentifier' {ObjectKey
key :: ObjectKey
$sel:key:ObjectIdentifier' :: ObjectIdentifier -> ObjectKey
key} -> ObjectKey
key) (\s :: ObjectIdentifier
s@ObjectIdentifier' {} ObjectKey
a -> ObjectIdentifier
s {$sel:key:ObjectIdentifier' :: ObjectKey
key = ObjectKey
a} :: ObjectIdentifier)
instance Prelude.Hashable ObjectIdentifier
instance Prelude.NFData ObjectIdentifier
instance Core.ToXML ObjectIdentifier where
toXML :: ObjectIdentifier -> XML
toXML ObjectIdentifier' {Maybe ObjectVersionId
ObjectKey
key :: ObjectKey
versionId :: Maybe ObjectVersionId
$sel:key:ObjectIdentifier' :: ObjectIdentifier -> ObjectKey
$sel:versionId:ObjectIdentifier' :: ObjectIdentifier -> Maybe ObjectVersionId
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[Name
"VersionId" Name -> Maybe ObjectVersionId -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe ObjectVersionId
versionId, Name
"Key" Name -> ObjectKey -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= ObjectKey
key]