{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.S3.PutObjectAcl
(
PutObjectAcl (..),
newPutObjectAcl,
putObjectAcl_versionId,
putObjectAcl_grantReadACP,
putObjectAcl_requestPayer,
putObjectAcl_grantWriteACP,
putObjectAcl_grantRead,
putObjectAcl_grantFullControl,
putObjectAcl_contentMD5,
putObjectAcl_accessControlPolicy,
putObjectAcl_grantWrite,
putObjectAcl_acl,
putObjectAcl_expectedBucketOwner,
putObjectAcl_bucket,
putObjectAcl_key,
PutObjectAclResponse (..),
newPutObjectAclResponse,
putObjectAclResponse_requestCharged,
putObjectAclResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.S3.Types
data PutObjectAcl = PutObjectAcl'
{
PutObjectAcl -> Maybe ObjectVersionId
versionId :: Prelude.Maybe ObjectVersionId,
PutObjectAcl -> Maybe Text
grantReadACP :: Prelude.Maybe Prelude.Text,
PutObjectAcl -> Maybe RequestPayer
requestPayer :: Prelude.Maybe RequestPayer,
PutObjectAcl -> Maybe Text
grantWriteACP :: Prelude.Maybe Prelude.Text,
PutObjectAcl -> Maybe Text
grantRead :: Prelude.Maybe Prelude.Text,
PutObjectAcl -> Maybe Text
grantFullControl :: Prelude.Maybe Prelude.Text,
PutObjectAcl -> Maybe Text
contentMD5 :: Prelude.Maybe Prelude.Text,
PutObjectAcl -> Maybe AccessControlPolicy
accessControlPolicy :: Prelude.Maybe AccessControlPolicy,
PutObjectAcl -> Maybe Text
grantWrite :: Prelude.Maybe Prelude.Text,
PutObjectAcl -> Maybe ObjectCannedACL
acl :: Prelude.Maybe ObjectCannedACL,
PutObjectAcl -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
PutObjectAcl -> BucketName
bucket :: BucketName,
PutObjectAcl -> ObjectKey
key :: ObjectKey
}
deriving (PutObjectAcl -> PutObjectAcl -> Bool
(PutObjectAcl -> PutObjectAcl -> Bool)
-> (PutObjectAcl -> PutObjectAcl -> Bool) -> Eq PutObjectAcl
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutObjectAcl -> PutObjectAcl -> Bool
$c/= :: PutObjectAcl -> PutObjectAcl -> Bool
== :: PutObjectAcl -> PutObjectAcl -> Bool
$c== :: PutObjectAcl -> PutObjectAcl -> Bool
Prelude.Eq, ReadPrec [PutObjectAcl]
ReadPrec PutObjectAcl
Int -> ReadS PutObjectAcl
ReadS [PutObjectAcl]
(Int -> ReadS PutObjectAcl)
-> ReadS [PutObjectAcl]
-> ReadPrec PutObjectAcl
-> ReadPrec [PutObjectAcl]
-> Read PutObjectAcl
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutObjectAcl]
$creadListPrec :: ReadPrec [PutObjectAcl]
readPrec :: ReadPrec PutObjectAcl
$creadPrec :: ReadPrec PutObjectAcl
readList :: ReadS [PutObjectAcl]
$creadList :: ReadS [PutObjectAcl]
readsPrec :: Int -> ReadS PutObjectAcl
$creadsPrec :: Int -> ReadS PutObjectAcl
Prelude.Read, Int -> PutObjectAcl -> ShowS
[PutObjectAcl] -> ShowS
PutObjectAcl -> String
(Int -> PutObjectAcl -> ShowS)
-> (PutObjectAcl -> String)
-> ([PutObjectAcl] -> ShowS)
-> Show PutObjectAcl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutObjectAcl] -> ShowS
$cshowList :: [PutObjectAcl] -> ShowS
show :: PutObjectAcl -> String
$cshow :: PutObjectAcl -> String
showsPrec :: Int -> PutObjectAcl -> ShowS
$cshowsPrec :: Int -> PutObjectAcl -> ShowS
Prelude.Show, (forall x. PutObjectAcl -> Rep PutObjectAcl x)
-> (forall x. Rep PutObjectAcl x -> PutObjectAcl)
-> Generic PutObjectAcl
forall x. Rep PutObjectAcl x -> PutObjectAcl
forall x. PutObjectAcl -> Rep PutObjectAcl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutObjectAcl x -> PutObjectAcl
$cfrom :: forall x. PutObjectAcl -> Rep PutObjectAcl x
Prelude.Generic)
newPutObjectAcl ::
BucketName ->
ObjectKey ->
PutObjectAcl
newPutObjectAcl :: BucketName -> ObjectKey -> PutObjectAcl
newPutObjectAcl BucketName
pBucket_ ObjectKey
pKey_ =
PutObjectAcl' :: Maybe ObjectVersionId
-> Maybe Text
-> Maybe RequestPayer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AccessControlPolicy
-> Maybe Text
-> Maybe ObjectCannedACL
-> Maybe Text
-> BucketName
-> ObjectKey
-> PutObjectAcl
PutObjectAcl'
{ $sel:versionId:PutObjectAcl' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
forall a. Maybe a
Prelude.Nothing,
$sel:grantReadACP:PutObjectAcl' :: Maybe Text
grantReadACP = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:requestPayer:PutObjectAcl' :: Maybe RequestPayer
requestPayer = Maybe RequestPayer
forall a. Maybe a
Prelude.Nothing,
$sel:grantWriteACP:PutObjectAcl' :: Maybe Text
grantWriteACP = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:grantRead:PutObjectAcl' :: Maybe Text
grantRead = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:grantFullControl:PutObjectAcl' :: Maybe Text
grantFullControl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:contentMD5:PutObjectAcl' :: Maybe Text
contentMD5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:accessControlPolicy:PutObjectAcl' :: Maybe AccessControlPolicy
accessControlPolicy = Maybe AccessControlPolicy
forall a. Maybe a
Prelude.Nothing,
$sel:grantWrite:PutObjectAcl' :: Maybe Text
grantWrite = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:acl:PutObjectAcl' :: Maybe ObjectCannedACL
acl = Maybe ObjectCannedACL
forall a. Maybe a
Prelude.Nothing,
$sel:expectedBucketOwner:PutObjectAcl' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:PutObjectAcl' :: BucketName
bucket = BucketName
pBucket_,
$sel:key:PutObjectAcl' :: ObjectKey
key = ObjectKey
pKey_
}
putObjectAcl_versionId :: Lens.Lens' PutObjectAcl (Prelude.Maybe ObjectVersionId)
putObjectAcl_versionId :: (Maybe ObjectVersionId -> f (Maybe ObjectVersionId))
-> PutObjectAcl -> f PutObjectAcl
putObjectAcl_versionId = (PutObjectAcl -> Maybe ObjectVersionId)
-> (PutObjectAcl -> Maybe ObjectVersionId -> PutObjectAcl)
-> Lens
PutObjectAcl
PutObjectAcl
(Maybe ObjectVersionId)
(Maybe ObjectVersionId)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectAcl' {Maybe ObjectVersionId
versionId :: Maybe ObjectVersionId
$sel:versionId:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectVersionId
versionId} -> Maybe ObjectVersionId
versionId) (\s :: PutObjectAcl
s@PutObjectAcl' {} Maybe ObjectVersionId
a -> PutObjectAcl
s {$sel:versionId:PutObjectAcl' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
a} :: PutObjectAcl)
putObjectAcl_grantReadACP :: Lens.Lens' PutObjectAcl (Prelude.Maybe Prelude.Text)
putObjectAcl_grantReadACP :: (Maybe Text -> f (Maybe Text)) -> PutObjectAcl -> f PutObjectAcl
putObjectAcl_grantReadACP = (PutObjectAcl -> Maybe Text)
-> (PutObjectAcl -> Maybe Text -> PutObjectAcl)
-> Lens PutObjectAcl PutObjectAcl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectAcl' {Maybe Text
grantReadACP :: Maybe Text
$sel:grantReadACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
grantReadACP} -> Maybe Text
grantReadACP) (\s :: PutObjectAcl
s@PutObjectAcl' {} Maybe Text
a -> PutObjectAcl
s {$sel:grantReadACP:PutObjectAcl' :: Maybe Text
grantReadACP = Maybe Text
a} :: PutObjectAcl)
putObjectAcl_requestPayer :: Lens.Lens' PutObjectAcl (Prelude.Maybe RequestPayer)
putObjectAcl_requestPayer :: (Maybe RequestPayer -> f (Maybe RequestPayer))
-> PutObjectAcl -> f PutObjectAcl
putObjectAcl_requestPayer = (PutObjectAcl -> Maybe RequestPayer)
-> (PutObjectAcl -> Maybe RequestPayer -> PutObjectAcl)
-> Lens
PutObjectAcl PutObjectAcl (Maybe RequestPayer) (Maybe RequestPayer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectAcl' {Maybe RequestPayer
requestPayer :: Maybe RequestPayer
$sel:requestPayer:PutObjectAcl' :: PutObjectAcl -> Maybe RequestPayer
requestPayer} -> Maybe RequestPayer
requestPayer) (\s :: PutObjectAcl
s@PutObjectAcl' {} Maybe RequestPayer
a -> PutObjectAcl
s {$sel:requestPayer:PutObjectAcl' :: Maybe RequestPayer
requestPayer = Maybe RequestPayer
a} :: PutObjectAcl)
putObjectAcl_grantWriteACP :: Lens.Lens' PutObjectAcl (Prelude.Maybe Prelude.Text)
putObjectAcl_grantWriteACP :: (Maybe Text -> f (Maybe Text)) -> PutObjectAcl -> f PutObjectAcl
putObjectAcl_grantWriteACP = (PutObjectAcl -> Maybe Text)
-> (PutObjectAcl -> Maybe Text -> PutObjectAcl)
-> Lens PutObjectAcl PutObjectAcl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectAcl' {Maybe Text
grantWriteACP :: Maybe Text
$sel:grantWriteACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
grantWriteACP} -> Maybe Text
grantWriteACP) (\s :: PutObjectAcl
s@PutObjectAcl' {} Maybe Text
a -> PutObjectAcl
s {$sel:grantWriteACP:PutObjectAcl' :: Maybe Text
grantWriteACP = Maybe Text
a} :: PutObjectAcl)
putObjectAcl_grantRead :: Lens.Lens' PutObjectAcl (Prelude.Maybe Prelude.Text)
putObjectAcl_grantRead :: (Maybe Text -> f (Maybe Text)) -> PutObjectAcl -> f PutObjectAcl
putObjectAcl_grantRead = (PutObjectAcl -> Maybe Text)
-> (PutObjectAcl -> Maybe Text -> PutObjectAcl)
-> Lens PutObjectAcl PutObjectAcl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectAcl' {Maybe Text
grantRead :: Maybe Text
$sel:grantRead:PutObjectAcl' :: PutObjectAcl -> Maybe Text
grantRead} -> Maybe Text
grantRead) (\s :: PutObjectAcl
s@PutObjectAcl' {} Maybe Text
a -> PutObjectAcl
s {$sel:grantRead:PutObjectAcl' :: Maybe Text
grantRead = Maybe Text
a} :: PutObjectAcl)
putObjectAcl_grantFullControl :: Lens.Lens' PutObjectAcl (Prelude.Maybe Prelude.Text)
putObjectAcl_grantFullControl :: (Maybe Text -> f (Maybe Text)) -> PutObjectAcl -> f PutObjectAcl
putObjectAcl_grantFullControl = (PutObjectAcl -> Maybe Text)
-> (PutObjectAcl -> Maybe Text -> PutObjectAcl)
-> Lens PutObjectAcl PutObjectAcl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectAcl' {Maybe Text
grantFullControl :: Maybe Text
$sel:grantFullControl:PutObjectAcl' :: PutObjectAcl -> Maybe Text
grantFullControl} -> Maybe Text
grantFullControl) (\s :: PutObjectAcl
s@PutObjectAcl' {} Maybe Text
a -> PutObjectAcl
s {$sel:grantFullControl:PutObjectAcl' :: Maybe Text
grantFullControl = Maybe Text
a} :: PutObjectAcl)
putObjectAcl_contentMD5 :: Lens.Lens' PutObjectAcl (Prelude.Maybe Prelude.Text)
putObjectAcl_contentMD5 :: (Maybe Text -> f (Maybe Text)) -> PutObjectAcl -> f PutObjectAcl
putObjectAcl_contentMD5 = (PutObjectAcl -> Maybe Text)
-> (PutObjectAcl -> Maybe Text -> PutObjectAcl)
-> Lens PutObjectAcl PutObjectAcl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectAcl' {Maybe Text
contentMD5 :: Maybe Text
$sel:contentMD5:PutObjectAcl' :: PutObjectAcl -> Maybe Text
contentMD5} -> Maybe Text
contentMD5) (\s :: PutObjectAcl
s@PutObjectAcl' {} Maybe Text
a -> PutObjectAcl
s {$sel:contentMD5:PutObjectAcl' :: Maybe Text
contentMD5 = Maybe Text
a} :: PutObjectAcl)
putObjectAcl_accessControlPolicy :: Lens.Lens' PutObjectAcl (Prelude.Maybe AccessControlPolicy)
putObjectAcl_accessControlPolicy :: (Maybe AccessControlPolicy -> f (Maybe AccessControlPolicy))
-> PutObjectAcl -> f PutObjectAcl
putObjectAcl_accessControlPolicy = (PutObjectAcl -> Maybe AccessControlPolicy)
-> (PutObjectAcl -> Maybe AccessControlPolicy -> PutObjectAcl)
-> Lens
PutObjectAcl
PutObjectAcl
(Maybe AccessControlPolicy)
(Maybe AccessControlPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectAcl' {Maybe AccessControlPolicy
accessControlPolicy :: Maybe AccessControlPolicy
$sel:accessControlPolicy:PutObjectAcl' :: PutObjectAcl -> Maybe AccessControlPolicy
accessControlPolicy} -> Maybe AccessControlPolicy
accessControlPolicy) (\s :: PutObjectAcl
s@PutObjectAcl' {} Maybe AccessControlPolicy
a -> PutObjectAcl
s {$sel:accessControlPolicy:PutObjectAcl' :: Maybe AccessControlPolicy
accessControlPolicy = Maybe AccessControlPolicy
a} :: PutObjectAcl)
putObjectAcl_grantWrite :: Lens.Lens' PutObjectAcl (Prelude.Maybe Prelude.Text)
putObjectAcl_grantWrite :: (Maybe Text -> f (Maybe Text)) -> PutObjectAcl -> f PutObjectAcl
putObjectAcl_grantWrite = (PutObjectAcl -> Maybe Text)
-> (PutObjectAcl -> Maybe Text -> PutObjectAcl)
-> Lens PutObjectAcl PutObjectAcl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectAcl' {Maybe Text
grantWrite :: Maybe Text
$sel:grantWrite:PutObjectAcl' :: PutObjectAcl -> Maybe Text
grantWrite} -> Maybe Text
grantWrite) (\s :: PutObjectAcl
s@PutObjectAcl' {} Maybe Text
a -> PutObjectAcl
s {$sel:grantWrite:PutObjectAcl' :: Maybe Text
grantWrite = Maybe Text
a} :: PutObjectAcl)
putObjectAcl_acl :: Lens.Lens' PutObjectAcl (Prelude.Maybe ObjectCannedACL)
putObjectAcl_acl :: (Maybe ObjectCannedACL -> f (Maybe ObjectCannedACL))
-> PutObjectAcl -> f PutObjectAcl
putObjectAcl_acl = (PutObjectAcl -> Maybe ObjectCannedACL)
-> (PutObjectAcl -> Maybe ObjectCannedACL -> PutObjectAcl)
-> Lens
PutObjectAcl
PutObjectAcl
(Maybe ObjectCannedACL)
(Maybe ObjectCannedACL)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectAcl' {Maybe ObjectCannedACL
acl :: Maybe ObjectCannedACL
$sel:acl:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectCannedACL
acl} -> Maybe ObjectCannedACL
acl) (\s :: PutObjectAcl
s@PutObjectAcl' {} Maybe ObjectCannedACL
a -> PutObjectAcl
s {$sel:acl:PutObjectAcl' :: Maybe ObjectCannedACL
acl = Maybe ObjectCannedACL
a} :: PutObjectAcl)
putObjectAcl_expectedBucketOwner :: Lens.Lens' PutObjectAcl (Prelude.Maybe Prelude.Text)
putObjectAcl_expectedBucketOwner :: (Maybe Text -> f (Maybe Text)) -> PutObjectAcl -> f PutObjectAcl
putObjectAcl_expectedBucketOwner = (PutObjectAcl -> Maybe Text)
-> (PutObjectAcl -> Maybe Text -> PutObjectAcl)
-> Lens PutObjectAcl PutObjectAcl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectAcl' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:PutObjectAcl' :: PutObjectAcl -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: PutObjectAcl
s@PutObjectAcl' {} Maybe Text
a -> PutObjectAcl
s {$sel:expectedBucketOwner:PutObjectAcl' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: PutObjectAcl)
putObjectAcl_bucket :: Lens.Lens' PutObjectAcl BucketName
putObjectAcl_bucket :: (BucketName -> f BucketName) -> PutObjectAcl -> f PutObjectAcl
putObjectAcl_bucket = (PutObjectAcl -> BucketName)
-> (PutObjectAcl -> BucketName -> PutObjectAcl)
-> Lens PutObjectAcl PutObjectAcl BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectAcl' {BucketName
bucket :: BucketName
$sel:bucket:PutObjectAcl' :: PutObjectAcl -> BucketName
bucket} -> BucketName
bucket) (\s :: PutObjectAcl
s@PutObjectAcl' {} BucketName
a -> PutObjectAcl
s {$sel:bucket:PutObjectAcl' :: BucketName
bucket = BucketName
a} :: PutObjectAcl)
putObjectAcl_key :: Lens.Lens' PutObjectAcl ObjectKey
putObjectAcl_key :: (ObjectKey -> f ObjectKey) -> PutObjectAcl -> f PutObjectAcl
putObjectAcl_key = (PutObjectAcl -> ObjectKey)
-> (PutObjectAcl -> ObjectKey -> PutObjectAcl)
-> Lens PutObjectAcl PutObjectAcl ObjectKey ObjectKey
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectAcl' {ObjectKey
key :: ObjectKey
$sel:key:PutObjectAcl' :: PutObjectAcl -> ObjectKey
key} -> ObjectKey
key) (\s :: PutObjectAcl
s@PutObjectAcl' {} ObjectKey
a -> PutObjectAcl
s {$sel:key:PutObjectAcl' :: ObjectKey
key = ObjectKey
a} :: PutObjectAcl)
instance Core.AWSRequest PutObjectAcl where
type AWSResponse PutObjectAcl = PutObjectAclResponse
request :: PutObjectAcl -> Request PutObjectAcl
request =
Request PutObjectAcl -> Request PutObjectAcl
forall a. Request a -> Request a
Request.s3vhost
(Request PutObjectAcl -> Request PutObjectAcl)
-> (PutObjectAcl -> Request PutObjectAcl)
-> PutObjectAcl
-> Request PutObjectAcl
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> PutObjectAcl -> Request PutObjectAcl
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML Service
defaultService
response :: Logger
-> Service
-> Proxy PutObjectAcl
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutObjectAcl)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse PutObjectAcl))
-> Logger
-> Service
-> Proxy PutObjectAcl
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutObjectAcl)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Maybe RequestCharged -> Int -> PutObjectAclResponse
PutObjectAclResponse'
(Maybe RequestCharged -> Int -> PutObjectAclResponse)
-> Either String (Maybe RequestCharged)
-> Either String (Int -> PutObjectAclResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h ResponseHeaders
-> HeaderName -> Either String (Maybe RequestCharged)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-request-charged")
Either String (Int -> PutObjectAclResponse)
-> Either String Int -> Either String PutObjectAclResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable PutObjectAcl
instance Prelude.NFData PutObjectAcl
instance Core.ToElement PutObjectAcl where
toElement :: PutObjectAcl -> Element
toElement PutObjectAcl' {Maybe Text
Maybe ObjectVersionId
Maybe ObjectCannedACL
Maybe RequestPayer
Maybe AccessControlPolicy
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
acl :: Maybe ObjectCannedACL
grantWrite :: Maybe Text
accessControlPolicy :: Maybe AccessControlPolicy
contentMD5 :: Maybe Text
grantFullControl :: Maybe Text
grantRead :: Maybe Text
grantWriteACP :: Maybe Text
requestPayer :: Maybe RequestPayer
grantReadACP :: Maybe Text
versionId :: Maybe ObjectVersionId
$sel:key:PutObjectAcl' :: PutObjectAcl -> ObjectKey
$sel:bucket:PutObjectAcl' :: PutObjectAcl -> BucketName
$sel:expectedBucketOwner:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:acl:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectCannedACL
$sel:grantWrite:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:accessControlPolicy:PutObjectAcl' :: PutObjectAcl -> Maybe AccessControlPolicy
$sel:contentMD5:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantFullControl:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantRead:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantWriteACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:requestPayer:PutObjectAcl' :: PutObjectAcl -> Maybe RequestPayer
$sel:grantReadACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:versionId:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectVersionId
..} =
Name -> Maybe AccessControlPolicy -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
Name
"{http://s3.amazonaws.com/doc/2006-03-01/}AccessControlPolicy"
Maybe AccessControlPolicy
accessControlPolicy
instance Core.ToHeaders PutObjectAcl where
toHeaders :: PutObjectAcl -> ResponseHeaders
toHeaders PutObjectAcl' {Maybe Text
Maybe ObjectVersionId
Maybe ObjectCannedACL
Maybe RequestPayer
Maybe AccessControlPolicy
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
acl :: Maybe ObjectCannedACL
grantWrite :: Maybe Text
accessControlPolicy :: Maybe AccessControlPolicy
contentMD5 :: Maybe Text
grantFullControl :: Maybe Text
grantRead :: Maybe Text
grantWriteACP :: Maybe Text
requestPayer :: Maybe RequestPayer
grantReadACP :: Maybe Text
versionId :: Maybe ObjectVersionId
$sel:key:PutObjectAcl' :: PutObjectAcl -> ObjectKey
$sel:bucket:PutObjectAcl' :: PutObjectAcl -> BucketName
$sel:expectedBucketOwner:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:acl:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectCannedACL
$sel:grantWrite:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:accessControlPolicy:PutObjectAcl' :: PutObjectAcl -> Maybe AccessControlPolicy
$sel:contentMD5:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantFullControl:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantRead:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantWriteACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:requestPayer:PutObjectAcl' :: PutObjectAcl -> Maybe RequestPayer
$sel:grantReadACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:versionId:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectVersionId
..} =
[ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"x-amz-grant-read-acp" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
grantReadACP,
HeaderName
"x-amz-request-payer" HeaderName -> Maybe RequestPayer -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe RequestPayer
requestPayer,
HeaderName
"x-amz-grant-write-acp" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
grantWriteACP,
HeaderName
"x-amz-grant-read" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
grantRead,
HeaderName
"x-amz-grant-full-control" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
grantFullControl,
HeaderName
"Content-MD5" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
contentMD5,
HeaderName
"x-amz-grant-write" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
grantWrite,
HeaderName
"x-amz-acl" HeaderName -> Maybe ObjectCannedACL -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe ObjectCannedACL
acl,
HeaderName
"x-amz-expected-bucket-owner"
HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
expectedBucketOwner
]
instance Core.ToPath PutObjectAcl where
toPath :: PutObjectAcl -> ByteString
toPath PutObjectAcl' {Maybe Text
Maybe ObjectVersionId
Maybe ObjectCannedACL
Maybe RequestPayer
Maybe AccessControlPolicy
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
acl :: Maybe ObjectCannedACL
grantWrite :: Maybe Text
accessControlPolicy :: Maybe AccessControlPolicy
contentMD5 :: Maybe Text
grantFullControl :: Maybe Text
grantRead :: Maybe Text
grantWriteACP :: Maybe Text
requestPayer :: Maybe RequestPayer
grantReadACP :: Maybe Text
versionId :: Maybe ObjectVersionId
$sel:key:PutObjectAcl' :: PutObjectAcl -> ObjectKey
$sel:bucket:PutObjectAcl' :: PutObjectAcl -> BucketName
$sel:expectedBucketOwner:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:acl:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectCannedACL
$sel:grantWrite:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:accessControlPolicy:PutObjectAcl' :: PutObjectAcl -> Maybe AccessControlPolicy
$sel:contentMD5:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantFullControl:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantRead:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantWriteACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:requestPayer:PutObjectAcl' :: PutObjectAcl -> Maybe RequestPayer
$sel:grantReadACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:versionId:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectVersionId
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/", BucketName -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS BucketName
bucket, ByteString
"/", ObjectKey -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS ObjectKey
key]
instance Core.ToQuery PutObjectAcl where
toQuery :: PutObjectAcl -> QueryString
toQuery PutObjectAcl' {Maybe Text
Maybe ObjectVersionId
Maybe ObjectCannedACL
Maybe RequestPayer
Maybe AccessControlPolicy
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
acl :: Maybe ObjectCannedACL
grantWrite :: Maybe Text
accessControlPolicy :: Maybe AccessControlPolicy
contentMD5 :: Maybe Text
grantFullControl :: Maybe Text
grantRead :: Maybe Text
grantWriteACP :: Maybe Text
requestPayer :: Maybe RequestPayer
grantReadACP :: Maybe Text
versionId :: Maybe ObjectVersionId
$sel:key:PutObjectAcl' :: PutObjectAcl -> ObjectKey
$sel:bucket:PutObjectAcl' :: PutObjectAcl -> BucketName
$sel:expectedBucketOwner:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:acl:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectCannedACL
$sel:grantWrite:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:accessControlPolicy:PutObjectAcl' :: PutObjectAcl -> Maybe AccessControlPolicy
$sel:contentMD5:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantFullControl:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantRead:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantWriteACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:requestPayer:PutObjectAcl' :: PutObjectAcl -> Maybe RequestPayer
$sel:grantReadACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:versionId:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectVersionId
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"versionId" ByteString -> Maybe ObjectVersionId -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ObjectVersionId
versionId, QueryString
"acl"]
data PutObjectAclResponse = PutObjectAclResponse'
{ PutObjectAclResponse -> Maybe RequestCharged
requestCharged :: Prelude.Maybe RequestCharged,
PutObjectAclResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutObjectAclResponse -> PutObjectAclResponse -> Bool
(PutObjectAclResponse -> PutObjectAclResponse -> Bool)
-> (PutObjectAclResponse -> PutObjectAclResponse -> Bool)
-> Eq PutObjectAclResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutObjectAclResponse -> PutObjectAclResponse -> Bool
$c/= :: PutObjectAclResponse -> PutObjectAclResponse -> Bool
== :: PutObjectAclResponse -> PutObjectAclResponse -> Bool
$c== :: PutObjectAclResponse -> PutObjectAclResponse -> Bool
Prelude.Eq, ReadPrec [PutObjectAclResponse]
ReadPrec PutObjectAclResponse
Int -> ReadS PutObjectAclResponse
ReadS [PutObjectAclResponse]
(Int -> ReadS PutObjectAclResponse)
-> ReadS [PutObjectAclResponse]
-> ReadPrec PutObjectAclResponse
-> ReadPrec [PutObjectAclResponse]
-> Read PutObjectAclResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutObjectAclResponse]
$creadListPrec :: ReadPrec [PutObjectAclResponse]
readPrec :: ReadPrec PutObjectAclResponse
$creadPrec :: ReadPrec PutObjectAclResponse
readList :: ReadS [PutObjectAclResponse]
$creadList :: ReadS [PutObjectAclResponse]
readsPrec :: Int -> ReadS PutObjectAclResponse
$creadsPrec :: Int -> ReadS PutObjectAclResponse
Prelude.Read, Int -> PutObjectAclResponse -> ShowS
[PutObjectAclResponse] -> ShowS
PutObjectAclResponse -> String
(Int -> PutObjectAclResponse -> ShowS)
-> (PutObjectAclResponse -> String)
-> ([PutObjectAclResponse] -> ShowS)
-> Show PutObjectAclResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutObjectAclResponse] -> ShowS
$cshowList :: [PutObjectAclResponse] -> ShowS
show :: PutObjectAclResponse -> String
$cshow :: PutObjectAclResponse -> String
showsPrec :: Int -> PutObjectAclResponse -> ShowS
$cshowsPrec :: Int -> PutObjectAclResponse -> ShowS
Prelude.Show, (forall x. PutObjectAclResponse -> Rep PutObjectAclResponse x)
-> (forall x. Rep PutObjectAclResponse x -> PutObjectAclResponse)
-> Generic PutObjectAclResponse
forall x. Rep PutObjectAclResponse x -> PutObjectAclResponse
forall x. PutObjectAclResponse -> Rep PutObjectAclResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutObjectAclResponse x -> PutObjectAclResponse
$cfrom :: forall x. PutObjectAclResponse -> Rep PutObjectAclResponse x
Prelude.Generic)
newPutObjectAclResponse ::
Prelude.Int ->
PutObjectAclResponse
newPutObjectAclResponse :: Int -> PutObjectAclResponse
newPutObjectAclResponse Int
pHttpStatus_ =
PutObjectAclResponse' :: Maybe RequestCharged -> Int -> PutObjectAclResponse
PutObjectAclResponse'
{ $sel:requestCharged:PutObjectAclResponse' :: Maybe RequestCharged
requestCharged =
Maybe RequestCharged
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PutObjectAclResponse' :: Int
httpStatus = Int
pHttpStatus_
}
putObjectAclResponse_requestCharged :: Lens.Lens' PutObjectAclResponse (Prelude.Maybe RequestCharged)
putObjectAclResponse_requestCharged :: (Maybe RequestCharged -> f (Maybe RequestCharged))
-> PutObjectAclResponse -> f PutObjectAclResponse
putObjectAclResponse_requestCharged = (PutObjectAclResponse -> Maybe RequestCharged)
-> (PutObjectAclResponse
-> Maybe RequestCharged -> PutObjectAclResponse)
-> Lens
PutObjectAclResponse
PutObjectAclResponse
(Maybe RequestCharged)
(Maybe RequestCharged)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectAclResponse' {Maybe RequestCharged
requestCharged :: Maybe RequestCharged
$sel:requestCharged:PutObjectAclResponse' :: PutObjectAclResponse -> Maybe RequestCharged
requestCharged} -> Maybe RequestCharged
requestCharged) (\s :: PutObjectAclResponse
s@PutObjectAclResponse' {} Maybe RequestCharged
a -> PutObjectAclResponse
s {$sel:requestCharged:PutObjectAclResponse' :: Maybe RequestCharged
requestCharged = Maybe RequestCharged
a} :: PutObjectAclResponse)
putObjectAclResponse_httpStatus :: Lens.Lens' PutObjectAclResponse Prelude.Int
putObjectAclResponse_httpStatus :: (Int -> f Int) -> PutObjectAclResponse -> f PutObjectAclResponse
putObjectAclResponse_httpStatus = (PutObjectAclResponse -> Int)
-> (PutObjectAclResponse -> Int -> PutObjectAclResponse)
-> Lens PutObjectAclResponse PutObjectAclResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectAclResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutObjectAclResponse' :: PutObjectAclResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutObjectAclResponse
s@PutObjectAclResponse' {} Int
a -> PutObjectAclResponse
s {$sel:httpStatus:PutObjectAclResponse' :: Int
httpStatus = Int
a} :: PutObjectAclResponse)
instance Prelude.NFData PutObjectAclResponse