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