{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.S3.PutObjectAcl
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Uses the @acl@ subresource to set the access control list (ACL)
-- permissions for a new or existing object in an S3 bucket. You must have
-- @WRITE_ACP@ permission to set the ACL of an object. For more
-- information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#permissions What permissions can I grant?>
-- in the /Amazon S3 User Guide/.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- Depending on your application needs, you can choose to set the ACL on an
-- object using either the request body or the headers. For example, if you
-- have an existing application that updates a bucket ACL using the request
-- body, you can continue to use that approach. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html Access Control List (ACL) Overview>
-- in the /Amazon S3 User Guide/.
--
-- __Access Permissions__
--
-- You can set access permissions using one of the following methods:
--
-- -   Specify a canned ACL with the @x-amz-acl@ request header. Amazon S3
--     supports a set of predefined ACLs, known as canned ACLs. Each canned
--     ACL has a predefined set of grantees and permissions. Specify the
--     canned ACL name as the value of @x-amz-ac@l. If you use this header,
--     you cannot use other access control-specific headers in your
--     request. For more information, see
--     <https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL Canned ACL>.
--
-- -   Specify access permissions explicitly with the @x-amz-grant-read@,
--     @x-amz-grant-read-acp@, @x-amz-grant-write-acp@, and
--     @x-amz-grant-full-control@ headers. When using these headers, you
--     specify explicit access permissions and grantees (Amazon Web
--     Services accounts or Amazon S3 groups) who will receive the
--     permission. If you use these ACL-specific headers, you cannot use
--     @x-amz-acl@ header to set a canned ACL. These parameters map to the
--     set of permissions that Amazon S3 supports in an ACL. For more
--     information, see
--     <https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html Access Control List (ACL) Overview>.
--
--     You specify each grantee as a type=value pair, where the type is one
--     of the following:
--
--     -   @id@ – if the value specified is the canonical user ID of an
--         Amazon Web Services account
--
--     -   @uri@ – if you are granting permissions to a predefined group
--
--     -   @emailAddress@ – if the value specified is the email address of
--         an Amazon Web Services account
--
--         Using email addresses to specify a grantee is only supported in
--         the following Amazon Web Services Regions:
--
--         -   US East (N. Virginia)
--
--         -   US West (N. California)
--
--         -   US West (Oregon)
--
--         -   Asia Pacific (Singapore)
--
--         -   Asia Pacific (Sydney)
--
--         -   Asia Pacific (Tokyo)
--
--         -   Europe (Ireland)
--
--         -   South America (São Paulo)
--
--         For a list of all the Amazon S3 supported Regions and endpoints,
--         see
--         <https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region Regions and Endpoints>
--         in the Amazon Web Services General Reference.
--
--     For example, the following @x-amz-grant-read@ header grants list
--     objects permission to the two Amazon Web Services accounts
--     identified by their email addresses.
--
--     @x-amz-grant-read: emailAddress=\"xyz\@amazon.com\", emailAddress=\"abc\@amazon.com\" @
--
-- You can use either a canned ACL or specify access permissions
-- explicitly. You cannot do both.
--
-- __Grantee Values__
--
-- You can specify the person (grantee) to whom you\'re assigning access
-- rights (using request elements) in the following ways:
--
-- -   By the person\'s ID:
--
--     @\<Grantee xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:type=\"CanonicalUser\">\<ID>\<>ID\<>\<\/ID>\<DisplayName>\<>GranteesEmail\<>\<\/DisplayName> \<\/Grantee>@
--
--     DisplayName is optional and ignored in the request.
--
-- -   By URI:
--
--     @\<Grantee xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:type=\"Group\">\<URI>\<>http:\/\/acs.amazonaws.com\/groups\/global\/AuthenticatedUsers\<>\<\/URI>\<\/Grantee>@
--
-- -   By Email address:
--
--     @\<Grantee xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:type=\"AmazonCustomerByEmail\">\<EmailAddress>\<>Grantees\@email.com\<>\<\/EmailAddress>lt;\/Grantee>@
--
--     The grantee is resolved to the CanonicalUser and, in a response to a
--     GET Object acl request, appears as the CanonicalUser.
--
--     Using email addresses to specify a grantee is only supported in the
--     following Amazon Web Services Regions:
--
--     -   US East (N. Virginia)
--
--     -   US West (N. California)
--
--     -   US West (Oregon)
--
--     -   Asia Pacific (Singapore)
--
--     -   Asia Pacific (Sydney)
--
--     -   Asia Pacific (Tokyo)
--
--     -   Europe (Ireland)
--
--     -   South America (São Paulo)
--
--     For a list of all the Amazon S3 supported Regions and endpoints, see
--     <https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region Regions and Endpoints>
--     in the Amazon Web Services General Reference.
--
-- __Versioning__
--
-- The ACL of an object is set at the object version level. By default, PUT
-- sets the ACL of the current version of an object. To set the ACL of a
-- different version, use the @versionId@ subresource.
--
-- __Related Resources__
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html CopyObject>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html GetObject>
module Amazonka.S3.PutObjectAcl
  ( -- * Creating a Request
    PutObjectAcl (..),
    newPutObjectAcl,

    -- * Request Lenses
    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,

    -- * Destructuring the Response
    PutObjectAclResponse (..),
    newPutObjectAclResponse,

    -- * Response Lenses
    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

-- | /See:/ 'newPutObjectAcl' smart constructor.
data PutObjectAcl = PutObjectAcl'
  { -- | VersionId used to reference a specific version of the object.
    PutObjectAcl -> Maybe ObjectVersionId
versionId :: Prelude.Maybe ObjectVersionId,
    -- | Allows grantee to read the bucket ACL.
    --
    -- This action is not supported by Amazon S3 on Outposts.
    PutObjectAcl -> Maybe Text
grantReadACP :: Prelude.Maybe Prelude.Text,
    PutObjectAcl -> Maybe RequestPayer
requestPayer :: Prelude.Maybe RequestPayer,
    -- | Allows grantee to write the ACL for the applicable bucket.
    --
    -- This action is not supported by Amazon S3 on Outposts.
    PutObjectAcl -> Maybe Text
grantWriteACP :: Prelude.Maybe Prelude.Text,
    -- | Allows grantee to list the objects in the bucket.
    --
    -- This action is not supported by Amazon S3 on Outposts.
    PutObjectAcl -> Maybe Text
grantRead :: Prelude.Maybe Prelude.Text,
    -- | Allows grantee the read, write, read ACP, and write ACP permissions on
    -- the bucket.
    --
    -- This action is not supported by Amazon S3 on Outposts.
    PutObjectAcl -> Maybe Text
grantFullControl :: Prelude.Maybe Prelude.Text,
    -- | The base64-encoded 128-bit MD5 digest of the data. This header must be
    -- used as a message integrity check to verify that the request body was
    -- not corrupted in transit. For more information, go to
    -- <http://www.ietf.org/rfc/rfc1864.txt RFC 1864.>>
    --
    -- For requests made using the Amazon Web Services Command Line Interface
    -- (CLI) or Amazon Web Services SDKs, this field is calculated
    -- automatically.
    PutObjectAcl -> Maybe Text
contentMD5 :: Prelude.Maybe Prelude.Text,
    -- | Contains the elements that set the ACL permissions for an object per
    -- grantee.
    PutObjectAcl -> Maybe AccessControlPolicy
accessControlPolicy :: Prelude.Maybe AccessControlPolicy,
    -- | Allows grantee to create new objects in the bucket.
    --
    -- For the bucket and object owners of existing objects, also allows
    -- deletions and overwrites of those objects.
    PutObjectAcl -> Maybe Text
grantWrite :: Prelude.Maybe Prelude.Text,
    -- | The canned ACL to apply to the object. For more information, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL Canned ACL>.
    PutObjectAcl -> Maybe ObjectCannedACL
acl :: Prelude.Maybe ObjectCannedACL,
    -- | The account ID of the expected bucket owner. If the bucket is owned by a
    -- different account, the request will fail with an HTTP
    -- @403 (Access Denied)@ error.
    PutObjectAcl -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | The bucket name that contains the object to which you want to attach the
    -- ACL.
    --
    -- When using this action with an access point, you must direct requests to
    -- the access point hostname. The access point hostname takes the form
    -- /AccessPointName/-/AccountId/.s3-accesspoint./Region/.amazonaws.com.
    -- When using this action with an access point through the Amazon Web
    -- Services SDKs, you provide the access point ARN in place of the bucket
    -- name. For more information about access point ARNs, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html Using access points>
    -- in the /Amazon S3 User Guide/.
    PutObjectAcl -> BucketName
bucket :: BucketName,
    -- | Key for which the PUT action was initiated.
    --
    -- When using this action with an access point, you must direct requests to
    -- the access point hostname. The access point hostname takes the form
    -- /AccessPointName/-/AccountId/.s3-accesspoint./Region/.amazonaws.com.
    -- When using this action with an access point through the Amazon Web
    -- Services SDKs, you provide the access point ARN in place of the bucket
    -- name. For more information about access point ARNs, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html Using access points>
    -- in the /Amazon S3 User Guide/.
    --
    -- When using this action with Amazon S3 on Outposts, you must direct
    -- requests to the S3 on Outposts hostname. The S3 on Outposts hostname
    -- takes the form
    -- /AccessPointName/-/AccountId/./outpostID/.s3-outposts./Region/.amazonaws.com.
    -- When using this action using S3 on Outposts through the Amazon Web
    -- Services SDKs, you provide the Outposts bucket ARN in place of the
    -- bucket name. For more information about S3 on Outposts ARNs, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html Using S3 on Outposts>
    -- in the /Amazon S3 User Guide/.
    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)

-- |
-- Create a value of 'PutObjectAcl' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'versionId', 'putObjectAcl_versionId' - VersionId used to reference a specific version of the object.
--
-- 'grantReadACP', 'putObjectAcl_grantReadACP' - Allows grantee to read the bucket ACL.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- 'requestPayer', 'putObjectAcl_requestPayer' - Undocumented member.
--
-- 'grantWriteACP', 'putObjectAcl_grantWriteACP' - Allows grantee to write the ACL for the applicable bucket.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- 'grantRead', 'putObjectAcl_grantRead' - Allows grantee to list the objects in the bucket.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- 'grantFullControl', 'putObjectAcl_grantFullControl' - Allows grantee the read, write, read ACP, and write ACP permissions on
-- the bucket.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- 'contentMD5', 'putObjectAcl_contentMD5' - The base64-encoded 128-bit MD5 digest of the data. This header must be
-- used as a message integrity check to verify that the request body was
-- not corrupted in transit. For more information, go to
-- <http://www.ietf.org/rfc/rfc1864.txt RFC 1864.>>
--
-- For requests made using the Amazon Web Services Command Line Interface
-- (CLI) or Amazon Web Services SDKs, this field is calculated
-- automatically.
--
-- 'accessControlPolicy', 'putObjectAcl_accessControlPolicy' - Contains the elements that set the ACL permissions for an object per
-- grantee.
--
-- 'grantWrite', 'putObjectAcl_grantWrite' - Allows grantee to create new objects in the bucket.
--
-- For the bucket and object owners of existing objects, also allows
-- deletions and overwrites of those objects.
--
-- 'acl', 'putObjectAcl_acl' - The canned ACL to apply to the object. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL Canned ACL>.
--
-- 'expectedBucketOwner', 'putObjectAcl_expectedBucketOwner' - The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request will fail with an HTTP
-- @403 (Access Denied)@ error.
--
-- 'bucket', 'putObjectAcl_bucket' - The bucket name that contains the object to which you want to attach the
-- ACL.
--
-- When using this action with an access point, you must direct requests to
-- the access point hostname. The access point hostname takes the form
-- /AccessPointName/-/AccountId/.s3-accesspoint./Region/.amazonaws.com.
-- When using this action with an access point through the Amazon Web
-- Services SDKs, you provide the access point ARN in place of the bucket
-- name. For more information about access point ARNs, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html Using access points>
-- in the /Amazon S3 User Guide/.
--
-- 'key', 'putObjectAcl_key' - Key for which the PUT action was initiated.
--
-- When using this action with an access point, you must direct requests to
-- the access point hostname. The access point hostname takes the form
-- /AccessPointName/-/AccountId/.s3-accesspoint./Region/.amazonaws.com.
-- When using this action with an access point through the Amazon Web
-- Services SDKs, you provide the access point ARN in place of the bucket
-- name. For more information about access point ARNs, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html Using access points>
-- in the /Amazon S3 User Guide/.
--
-- When using this action with Amazon S3 on Outposts, you must direct
-- requests to the S3 on Outposts hostname. The S3 on Outposts hostname
-- takes the form
-- /AccessPointName/-/AccountId/./outpostID/.s3-outposts./Region/.amazonaws.com.
-- When using this action using S3 on Outposts through the Amazon Web
-- Services SDKs, you provide the Outposts bucket ARN in place of the
-- bucket name. For more information about S3 on Outposts ARNs, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html Using S3 on Outposts>
-- in the /Amazon S3 User Guide/.
newPutObjectAcl ::
  -- | 'bucket'
  BucketName ->
  -- | 'key'
  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_
    }

-- | VersionId used to reference a specific version of the object.
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)

-- | Allows grantee to read the bucket ACL.
--
-- This action is not supported by Amazon S3 on Outposts.
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)

-- | Undocumented member.
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)

-- | Allows grantee to write the ACL for the applicable bucket.
--
-- This action is not supported by Amazon S3 on Outposts.
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)

-- | Allows grantee to list the objects in the bucket.
--
-- This action is not supported by Amazon S3 on Outposts.
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)

-- | Allows grantee the read, write, read ACP, and write ACP permissions on
-- the bucket.
--
-- This action is not supported by Amazon S3 on Outposts.
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)

-- | The base64-encoded 128-bit MD5 digest of the data. This header must be
-- used as a message integrity check to verify that the request body was
-- not corrupted in transit. For more information, go to
-- <http://www.ietf.org/rfc/rfc1864.txt RFC 1864.>>
--
-- For requests made using the Amazon Web Services Command Line Interface
-- (CLI) or Amazon Web Services SDKs, this field is calculated
-- automatically.
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)

-- | Contains the elements that set the ACL permissions for an object per
-- grantee.
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)

-- | Allows grantee to create new objects in the bucket.
--
-- For the bucket and object owners of existing objects, also allows
-- deletions and overwrites of those objects.
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)

-- | The canned ACL to apply to the object. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL Canned ACL>.
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)

-- | The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request will fail with an HTTP
-- @403 (Access Denied)@ error.
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)

-- | The bucket name that contains the object to which you want to attach the
-- ACL.
--
-- When using this action with an access point, you must direct requests to
-- the access point hostname. The access point hostname takes the form
-- /AccessPointName/-/AccountId/.s3-accesspoint./Region/.amazonaws.com.
-- When using this action with an access point through the Amazon Web
-- Services SDKs, you provide the access point ARN in place of the bucket
-- name. For more information about access point ARNs, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html Using access points>
-- in the /Amazon S3 User Guide/.
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)

-- | Key for which the PUT action was initiated.
--
-- When using this action with an access point, you must direct requests to
-- the access point hostname. The access point hostname takes the form
-- /AccessPointName/-/AccountId/.s3-accesspoint./Region/.amazonaws.com.
-- When using this action with an access point through the Amazon Web
-- Services SDKs, you provide the access point ARN in place of the bucket
-- name. For more information about access point ARNs, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html Using access points>
-- in the /Amazon S3 User Guide/.
--
-- When using this action with Amazon S3 on Outposts, you must direct
-- requests to the S3 on Outposts hostname. The S3 on Outposts hostname
-- takes the form
-- /AccessPointName/-/AccountId/./outpostID/.s3-outposts./Region/.amazonaws.com.
-- When using this action using S3 on Outposts through the Amazon Web
-- Services SDKs, you provide the Outposts bucket ARN in place of the
-- bucket name. For more information about S3 on Outposts ARNs, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html Using S3 on Outposts>
-- in the /Amazon S3 User Guide/.
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"]

-- | /See:/ 'newPutObjectAclResponse' smart constructor.
data PutObjectAclResponse = PutObjectAclResponse'
  { PutObjectAclResponse -> Maybe RequestCharged
requestCharged :: Prelude.Maybe RequestCharged,
    -- | The response's http status code.
    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)

-- |
-- Create a value of 'PutObjectAclResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'requestCharged', 'putObjectAclResponse_requestCharged' - Undocumented member.
--
-- 'httpStatus', 'putObjectAclResponse_httpStatus' - The response's http status code.
newPutObjectAclResponse ::
  -- | 'httpStatus'
  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_
    }

-- | Undocumented member.
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)

-- | The response's http status code.
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