{-# 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.ObjectLockLegalHold where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
import Amazonka.S3.Types.ObjectLockLegalHoldStatus
data ObjectLockLegalHold = ObjectLockLegalHold'
{
ObjectLockLegalHold -> Maybe ObjectLockLegalHoldStatus
status :: Prelude.Maybe ObjectLockLegalHoldStatus
}
deriving (ObjectLockLegalHold -> ObjectLockLegalHold -> Bool
(ObjectLockLegalHold -> ObjectLockLegalHold -> Bool)
-> (ObjectLockLegalHold -> ObjectLockLegalHold -> Bool)
-> Eq ObjectLockLegalHold
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ObjectLockLegalHold -> ObjectLockLegalHold -> Bool
$c/= :: ObjectLockLegalHold -> ObjectLockLegalHold -> Bool
== :: ObjectLockLegalHold -> ObjectLockLegalHold -> Bool
$c== :: ObjectLockLegalHold -> ObjectLockLegalHold -> Bool
Prelude.Eq, ReadPrec [ObjectLockLegalHold]
ReadPrec ObjectLockLegalHold
Int -> ReadS ObjectLockLegalHold
ReadS [ObjectLockLegalHold]
(Int -> ReadS ObjectLockLegalHold)
-> ReadS [ObjectLockLegalHold]
-> ReadPrec ObjectLockLegalHold
-> ReadPrec [ObjectLockLegalHold]
-> Read ObjectLockLegalHold
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ObjectLockLegalHold]
$creadListPrec :: ReadPrec [ObjectLockLegalHold]
readPrec :: ReadPrec ObjectLockLegalHold
$creadPrec :: ReadPrec ObjectLockLegalHold
readList :: ReadS [ObjectLockLegalHold]
$creadList :: ReadS [ObjectLockLegalHold]
readsPrec :: Int -> ReadS ObjectLockLegalHold
$creadsPrec :: Int -> ReadS ObjectLockLegalHold
Prelude.Read, Int -> ObjectLockLegalHold -> ShowS
[ObjectLockLegalHold] -> ShowS
ObjectLockLegalHold -> String
(Int -> ObjectLockLegalHold -> ShowS)
-> (ObjectLockLegalHold -> String)
-> ([ObjectLockLegalHold] -> ShowS)
-> Show ObjectLockLegalHold
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ObjectLockLegalHold] -> ShowS
$cshowList :: [ObjectLockLegalHold] -> ShowS
show :: ObjectLockLegalHold -> String
$cshow :: ObjectLockLegalHold -> String
showsPrec :: Int -> ObjectLockLegalHold -> ShowS
$cshowsPrec :: Int -> ObjectLockLegalHold -> ShowS
Prelude.Show, (forall x. ObjectLockLegalHold -> Rep ObjectLockLegalHold x)
-> (forall x. Rep ObjectLockLegalHold x -> ObjectLockLegalHold)
-> Generic ObjectLockLegalHold
forall x. Rep ObjectLockLegalHold x -> ObjectLockLegalHold
forall x. ObjectLockLegalHold -> Rep ObjectLockLegalHold x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ObjectLockLegalHold x -> ObjectLockLegalHold
$cfrom :: forall x. ObjectLockLegalHold -> Rep ObjectLockLegalHold x
Prelude.Generic)
newObjectLockLegalHold ::
ObjectLockLegalHold
newObjectLockLegalHold :: ObjectLockLegalHold
newObjectLockLegalHold =
ObjectLockLegalHold' :: Maybe ObjectLockLegalHoldStatus -> ObjectLockLegalHold
ObjectLockLegalHold' {$sel:status:ObjectLockLegalHold' :: Maybe ObjectLockLegalHoldStatus
status = Maybe ObjectLockLegalHoldStatus
forall a. Maybe a
Prelude.Nothing}
objectLockLegalHold_status :: Lens.Lens' ObjectLockLegalHold (Prelude.Maybe ObjectLockLegalHoldStatus)
objectLockLegalHold_status :: (Maybe ObjectLockLegalHoldStatus
-> f (Maybe ObjectLockLegalHoldStatus))
-> ObjectLockLegalHold -> f ObjectLockLegalHold
objectLockLegalHold_status = (ObjectLockLegalHold -> Maybe ObjectLockLegalHoldStatus)
-> (ObjectLockLegalHold
-> Maybe ObjectLockLegalHoldStatus -> ObjectLockLegalHold)
-> Lens
ObjectLockLegalHold
ObjectLockLegalHold
(Maybe ObjectLockLegalHoldStatus)
(Maybe ObjectLockLegalHoldStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ObjectLockLegalHold' {Maybe ObjectLockLegalHoldStatus
status :: Maybe ObjectLockLegalHoldStatus
$sel:status:ObjectLockLegalHold' :: ObjectLockLegalHold -> Maybe ObjectLockLegalHoldStatus
status} -> Maybe ObjectLockLegalHoldStatus
status) (\s :: ObjectLockLegalHold
s@ObjectLockLegalHold' {} Maybe ObjectLockLegalHoldStatus
a -> ObjectLockLegalHold
s {$sel:status:ObjectLockLegalHold' :: Maybe ObjectLockLegalHoldStatus
status = Maybe ObjectLockLegalHoldStatus
a} :: ObjectLockLegalHold)
instance Core.FromXML ObjectLockLegalHold where
parseXML :: [Node] -> Either String ObjectLockLegalHold
parseXML [Node]
x =
Maybe ObjectLockLegalHoldStatus -> ObjectLockLegalHold
ObjectLockLegalHold'
(Maybe ObjectLockLegalHoldStatus -> ObjectLockLegalHold)
-> Either String (Maybe ObjectLockLegalHoldStatus)
-> Either String ObjectLockLegalHold
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe ObjectLockLegalHoldStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Status")
instance Prelude.Hashable ObjectLockLegalHold
instance Prelude.NFData ObjectLockLegalHold
instance Core.ToXML ObjectLockLegalHold where
toXML :: ObjectLockLegalHold -> XML
toXML ObjectLockLegalHold' {Maybe ObjectLockLegalHoldStatus
status :: Maybe ObjectLockLegalHoldStatus
$sel:status:ObjectLockLegalHold' :: ObjectLockLegalHold -> Maybe ObjectLockLegalHoldStatus
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat [Name
"Status" Name -> Maybe ObjectLockLegalHoldStatus -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe ObjectLockLegalHoldStatus
status]