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