{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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/.
--
-- If your bucket uses the bucket owner enforced setting for S3 Object
-- Ownership, ACLs are disabled and no longer affect permissions. You must
-- use policies to grant access to your bucket and the objects in it.
-- Requests to set ACLs or update ACLs fail and return the
-- @AccessControlListNotSupported@ error code. Requests to read ACLs are
-- still supported. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html Controlling object ownership>
-- 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_acl,
    putObjectAcl_accessControlPolicy,
    putObjectAcl_checksumAlgorithm,
    putObjectAcl_contentMD5,
    putObjectAcl_expectedBucketOwner,
    putObjectAcl_grantFullControl,
    putObjectAcl_grantRead,
    putObjectAcl_grantReadACP,
    putObjectAcl_grantWrite,
    putObjectAcl_grantWriteACP,
    putObjectAcl_requestPayer,
    putObjectAcl_versionId,
    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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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'
  { -- | 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,
    -- | Contains the elements that set the ACL permissions for an object per
    -- grantee.
    PutObjectAcl -> Maybe AccessControlPolicy
accessControlPolicy :: Prelude.Maybe AccessControlPolicy,
    -- | Indicates the algorithm used to create the checksum for the object when
    -- using the SDK. This header will not provide any additional functionality
    -- if not using the SDK. When sending this header, there must be a
    -- corresponding @x-amz-checksum@ or @x-amz-trailer@ header sent.
    -- Otherwise, Amazon S3 fails the request with the HTTP status code
    -- @400 Bad Request@. For more information, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
    -- in the /Amazon S3 User Guide/.
    --
    -- If you provide an individual checksum, Amazon S3 ignores any provided
    -- @ChecksumAlgorithm@ parameter.
    PutObjectAcl -> Maybe ChecksumAlgorithm
checksumAlgorithm :: Prelude.Maybe ChecksumAlgorithm,
    -- | 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,
    -- | The account ID of the expected bucket owner. If the bucket is owned by a
    -- different account, the request fails with the HTTP status code
    -- @403 Forbidden@ (access denied).
    PutObjectAcl -> Maybe Text
expectedBucketOwner :: 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,
    -- | 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 to read the bucket ACL.
    --
    -- This action is not supported by Amazon S3 on Outposts.
    PutObjectAcl -> Maybe Text
grantReadACP :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | 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,
    PutObjectAcl -> Maybe RequestPayer
requestPayer :: Prelude.Maybe RequestPayer,
    -- | VersionId used to reference a specific version of the object.
    PutObjectAcl -> Maybe ObjectVersionId
versionId :: Prelude.Maybe ObjectVersionId,
    -- | 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 with 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 Amazon S3 on Outposts>
    -- in the /Amazon S3 User Guide/.
    PutObjectAcl -> ObjectKey
key :: ObjectKey
  }
  deriving (PutObjectAcl -> PutObjectAcl -> Bool
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]
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
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. 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:
--
-- '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>.
--
-- 'accessControlPolicy', 'putObjectAcl_accessControlPolicy' - Contains the elements that set the ACL permissions for an object per
-- grantee.
--
-- 'checksumAlgorithm', 'putObjectAcl_checksumAlgorithm' - Indicates the algorithm used to create the checksum for the object when
-- using the SDK. This header will not provide any additional functionality
-- if not using the SDK. When sending this header, there must be a
-- corresponding @x-amz-checksum@ or @x-amz-trailer@ header sent.
-- Otherwise, Amazon S3 fails the request with the HTTP status code
-- @400 Bad Request@. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
-- in the /Amazon S3 User Guide/.
--
-- If you provide an individual checksum, Amazon S3 ignores any provided
-- @ChecksumAlgorithm@ parameter.
--
-- '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.
--
-- 'expectedBucketOwner', 'putObjectAcl_expectedBucketOwner' - The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request fails with the HTTP status code
-- @403 Forbidden@ (access denied).
--
-- '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.
--
-- 'grantRead', 'putObjectAcl_grantRead' - Allows grantee to list the objects in the bucket.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- 'grantReadACP', 'putObjectAcl_grantReadACP' - Allows grantee to read the bucket ACL.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- '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.
--
-- 'grantWriteACP', 'putObjectAcl_grantWriteACP' - Allows grantee to write the ACL for the applicable bucket.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- 'requestPayer', 'putObjectAcl_requestPayer' - Undocumented member.
--
-- 'versionId', 'putObjectAcl_versionId' - VersionId used to reference a specific version of the object.
--
-- '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 with 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 Amazon 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'
    { $sel:acl:PutObjectAcl' :: Maybe ObjectCannedACL
acl = forall a. Maybe a
Prelude.Nothing,
      $sel:accessControlPolicy:PutObjectAcl' :: Maybe AccessControlPolicy
accessControlPolicy = forall a. Maybe a
Prelude.Nothing,
      $sel:checksumAlgorithm:PutObjectAcl' :: Maybe ChecksumAlgorithm
checksumAlgorithm = forall a. Maybe a
Prelude.Nothing,
      $sel:contentMD5:PutObjectAcl' :: Maybe Text
contentMD5 = forall a. Maybe a
Prelude.Nothing,
      $sel:expectedBucketOwner:PutObjectAcl' :: Maybe Text
expectedBucketOwner = forall a. Maybe a
Prelude.Nothing,
      $sel:grantFullControl:PutObjectAcl' :: Maybe Text
grantFullControl = forall a. Maybe a
Prelude.Nothing,
      $sel:grantRead:PutObjectAcl' :: Maybe Text
grantRead = forall a. Maybe a
Prelude.Nothing,
      $sel:grantReadACP:PutObjectAcl' :: Maybe Text
grantReadACP = forall a. Maybe a
Prelude.Nothing,
      $sel:grantWrite:PutObjectAcl' :: Maybe Text
grantWrite = forall a. Maybe a
Prelude.Nothing,
      $sel:grantWriteACP:PutObjectAcl' :: Maybe Text
grantWriteACP = forall a. Maybe a
Prelude.Nothing,
      $sel:requestPayer:PutObjectAcl' :: Maybe RequestPayer
requestPayer = forall a. Maybe a
Prelude.Nothing,
      $sel:versionId:PutObjectAcl' :: Maybe ObjectVersionId
versionId = forall a. Maybe a
Prelude.Nothing,
      $sel:bucket:PutObjectAcl' :: BucketName
bucket = BucketName
pBucket_,
      $sel:key:PutObjectAcl' :: ObjectKey
key = ObjectKey
pKey_
    }

-- | 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 :: Lens' PutObjectAcl (Maybe ObjectCannedACL)
putObjectAcl_acl = 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)

-- | Contains the elements that set the ACL permissions for an object per
-- grantee.
putObjectAcl_accessControlPolicy :: Lens.Lens' PutObjectAcl (Prelude.Maybe AccessControlPolicy)
putObjectAcl_accessControlPolicy :: Lens' PutObjectAcl (Maybe AccessControlPolicy)
putObjectAcl_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)

-- | Indicates the algorithm used to create the checksum for the object when
-- using the SDK. This header will not provide any additional functionality
-- if not using the SDK. When sending this header, there must be a
-- corresponding @x-amz-checksum@ or @x-amz-trailer@ header sent.
-- Otherwise, Amazon S3 fails the request with the HTTP status code
-- @400 Bad Request@. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
-- in the /Amazon S3 User Guide/.
--
-- If you provide an individual checksum, Amazon S3 ignores any provided
-- @ChecksumAlgorithm@ parameter.
putObjectAcl_checksumAlgorithm :: Lens.Lens' PutObjectAcl (Prelude.Maybe ChecksumAlgorithm)
putObjectAcl_checksumAlgorithm :: Lens' PutObjectAcl (Maybe ChecksumAlgorithm)
putObjectAcl_checksumAlgorithm = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectAcl' {Maybe ChecksumAlgorithm
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:checksumAlgorithm:PutObjectAcl' :: PutObjectAcl -> Maybe ChecksumAlgorithm
checksumAlgorithm} -> Maybe ChecksumAlgorithm
checksumAlgorithm) (\s :: PutObjectAcl
s@PutObjectAcl' {} Maybe ChecksumAlgorithm
a -> PutObjectAcl
s {$sel:checksumAlgorithm:PutObjectAcl' :: Maybe ChecksumAlgorithm
checksumAlgorithm = Maybe ChecksumAlgorithm
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 :: Lens' PutObjectAcl (Maybe Text)
putObjectAcl_contentMD5 = 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)

-- | The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request fails with the HTTP status code
-- @403 Forbidden@ (access denied).
putObjectAcl_expectedBucketOwner :: Lens.Lens' PutObjectAcl (Prelude.Maybe Prelude.Text)
putObjectAcl_expectedBucketOwner :: Lens' PutObjectAcl (Maybe Text)
putObjectAcl_expectedBucketOwner = 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)

-- | 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 :: Lens' PutObjectAcl (Maybe Text)
putObjectAcl_grantFullControl = 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)

-- | 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 :: Lens' PutObjectAcl (Maybe Text)
putObjectAcl_grantRead = 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 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 :: Lens' PutObjectAcl (Maybe Text)
putObjectAcl_grantReadACP = 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)

-- | 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 :: Lens' PutObjectAcl (Maybe Text)
putObjectAcl_grantWrite = 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)

-- | 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 :: Lens' PutObjectAcl (Maybe Text)
putObjectAcl_grantWriteACP = 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)

-- | Undocumented member.
putObjectAcl_requestPayer :: Lens.Lens' PutObjectAcl (Prelude.Maybe RequestPayer)
putObjectAcl_requestPayer :: Lens' PutObjectAcl (Maybe RequestPayer)
putObjectAcl_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)

-- | VersionId used to reference a specific version of the object.
putObjectAcl_versionId :: Lens.Lens' PutObjectAcl (Prelude.Maybe ObjectVersionId)
putObjectAcl_versionId :: Lens' PutObjectAcl (Maybe ObjectVersionId)
putObjectAcl_versionId = 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)

-- | 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 :: Lens' PutObjectAcl BucketName
putObjectAcl_bucket = 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 with 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 Amazon S3 on Outposts>
-- in the /Amazon S3 User Guide/.
putObjectAcl_key :: Lens.Lens' PutObjectAcl ObjectKey
putObjectAcl_key :: Lens' PutObjectAcl ObjectKey
putObjectAcl_key = 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 :: (Service -> Service) -> PutObjectAcl -> Request PutObjectAcl
request Service -> Service
overrides =
    forall a. Request a -> Request a
Request.s3vhost
      forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutObjectAcl
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutObjectAcl)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Maybe RequestCharged -> Int -> PutObjectAclResponse
PutObjectAclResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Data..#? HeaderName
"x-amz-request-charged")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable PutObjectAcl where
  hashWithSalt :: Int -> PutObjectAcl -> Int
hashWithSalt Int
_salt PutObjectAcl' {Maybe Text
Maybe ObjectVersionId
Maybe ChecksumAlgorithm
Maybe ObjectCannedACL
Maybe RequestPayer
Maybe AccessControlPolicy
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
versionId :: Maybe ObjectVersionId
requestPayer :: Maybe RequestPayer
grantWriteACP :: Maybe Text
grantWrite :: Maybe Text
grantReadACP :: Maybe Text
grantRead :: Maybe Text
grantFullControl :: Maybe Text
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
accessControlPolicy :: Maybe AccessControlPolicy
acl :: Maybe ObjectCannedACL
$sel:key:PutObjectAcl' :: PutObjectAcl -> ObjectKey
$sel:bucket:PutObjectAcl' :: PutObjectAcl -> BucketName
$sel:versionId:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectVersionId
$sel:requestPayer:PutObjectAcl' :: PutObjectAcl -> Maybe RequestPayer
$sel:grantWriteACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantWrite:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantReadACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantRead:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantFullControl:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:expectedBucketOwner:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:contentMD5:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:checksumAlgorithm:PutObjectAcl' :: PutObjectAcl -> Maybe ChecksumAlgorithm
$sel:accessControlPolicy:PutObjectAcl' :: PutObjectAcl -> Maybe AccessControlPolicy
$sel:acl:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectCannedACL
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ObjectCannedACL
acl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AccessControlPolicy
accessControlPolicy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ChecksumAlgorithm
checksumAlgorithm
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
contentMD5
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
expectedBucketOwner
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
grantFullControl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
grantRead
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
grantReadACP
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
grantWrite
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
grantWriteACP
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RequestPayer
requestPayer
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ObjectVersionId
versionId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` BucketName
bucket
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ObjectKey
key

instance Prelude.NFData PutObjectAcl where
  rnf :: PutObjectAcl -> ()
rnf PutObjectAcl' {Maybe Text
Maybe ObjectVersionId
Maybe ChecksumAlgorithm
Maybe ObjectCannedACL
Maybe RequestPayer
Maybe AccessControlPolicy
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
versionId :: Maybe ObjectVersionId
requestPayer :: Maybe RequestPayer
grantWriteACP :: Maybe Text
grantWrite :: Maybe Text
grantReadACP :: Maybe Text
grantRead :: Maybe Text
grantFullControl :: Maybe Text
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
accessControlPolicy :: Maybe AccessControlPolicy
acl :: Maybe ObjectCannedACL
$sel:key:PutObjectAcl' :: PutObjectAcl -> ObjectKey
$sel:bucket:PutObjectAcl' :: PutObjectAcl -> BucketName
$sel:versionId:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectVersionId
$sel:requestPayer:PutObjectAcl' :: PutObjectAcl -> Maybe RequestPayer
$sel:grantWriteACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantWrite:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantReadACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantRead:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantFullControl:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:expectedBucketOwner:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:contentMD5:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:checksumAlgorithm:PutObjectAcl' :: PutObjectAcl -> Maybe ChecksumAlgorithm
$sel:accessControlPolicy:PutObjectAcl' :: PutObjectAcl -> Maybe AccessControlPolicy
$sel:acl:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectCannedACL
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ObjectCannedACL
acl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AccessControlPolicy
accessControlPolicy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ChecksumAlgorithm
checksumAlgorithm
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
contentMD5
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
expectedBucketOwner
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
grantFullControl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
grantRead
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
grantReadACP
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
grantWrite
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
grantWriteACP
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RequestPayer
requestPayer
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ObjectVersionId
versionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf BucketName
bucket
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ObjectKey
key

instance Data.ToElement PutObjectAcl where
  toElement :: PutObjectAcl -> Element
toElement PutObjectAcl' {Maybe Text
Maybe ObjectVersionId
Maybe ChecksumAlgorithm
Maybe ObjectCannedACL
Maybe RequestPayer
Maybe AccessControlPolicy
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
versionId :: Maybe ObjectVersionId
requestPayer :: Maybe RequestPayer
grantWriteACP :: Maybe Text
grantWrite :: Maybe Text
grantReadACP :: Maybe Text
grantRead :: Maybe Text
grantFullControl :: Maybe Text
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
accessControlPolicy :: Maybe AccessControlPolicy
acl :: Maybe ObjectCannedACL
$sel:key:PutObjectAcl' :: PutObjectAcl -> ObjectKey
$sel:bucket:PutObjectAcl' :: PutObjectAcl -> BucketName
$sel:versionId:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectVersionId
$sel:requestPayer:PutObjectAcl' :: PutObjectAcl -> Maybe RequestPayer
$sel:grantWriteACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantWrite:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantReadACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantRead:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantFullControl:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:expectedBucketOwner:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:contentMD5:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:checksumAlgorithm:PutObjectAcl' :: PutObjectAcl -> Maybe ChecksumAlgorithm
$sel:accessControlPolicy:PutObjectAcl' :: PutObjectAcl -> Maybe AccessControlPolicy
$sel:acl:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectCannedACL
..} =
    forall a. ToXML a => Name -> a -> Element
Data.mkElement
      Name
"{http://s3.amazonaws.com/doc/2006-03-01/}AccessControlPolicy"
      Maybe AccessControlPolicy
accessControlPolicy

instance Data.ToHeaders PutObjectAcl where
  toHeaders :: PutObjectAcl -> ResponseHeaders
toHeaders PutObjectAcl' {Maybe Text
Maybe ObjectVersionId
Maybe ChecksumAlgorithm
Maybe ObjectCannedACL
Maybe RequestPayer
Maybe AccessControlPolicy
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
versionId :: Maybe ObjectVersionId
requestPayer :: Maybe RequestPayer
grantWriteACP :: Maybe Text
grantWrite :: Maybe Text
grantReadACP :: Maybe Text
grantRead :: Maybe Text
grantFullControl :: Maybe Text
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
accessControlPolicy :: Maybe AccessControlPolicy
acl :: Maybe ObjectCannedACL
$sel:key:PutObjectAcl' :: PutObjectAcl -> ObjectKey
$sel:bucket:PutObjectAcl' :: PutObjectAcl -> BucketName
$sel:versionId:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectVersionId
$sel:requestPayer:PutObjectAcl' :: PutObjectAcl -> Maybe RequestPayer
$sel:grantWriteACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantWrite:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantReadACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantRead:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantFullControl:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:expectedBucketOwner:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:contentMD5:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:checksumAlgorithm:PutObjectAcl' :: PutObjectAcl -> Maybe ChecksumAlgorithm
$sel:accessControlPolicy:PutObjectAcl' :: PutObjectAcl -> Maybe AccessControlPolicy
$sel:acl:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectCannedACL
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"x-amz-acl" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe ObjectCannedACL
acl,
        HeaderName
"x-amz-sdk-checksum-algorithm"
          forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe ChecksumAlgorithm
checksumAlgorithm,
        HeaderName
"Content-MD5" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
contentMD5,
        HeaderName
"x-amz-expected-bucket-owner"
          forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
expectedBucketOwner,
        HeaderName
"x-amz-grant-full-control" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
grantFullControl,
        HeaderName
"x-amz-grant-read" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
grantRead,
        HeaderName
"x-amz-grant-read-acp" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
grantReadACP,
        HeaderName
"x-amz-grant-write" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
grantWrite,
        HeaderName
"x-amz-grant-write-acp" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
grantWriteACP,
        HeaderName
"x-amz-request-payer" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe RequestPayer
requestPayer
      ]

instance Data.ToPath PutObjectAcl where
  toPath :: PutObjectAcl -> ByteString
toPath PutObjectAcl' {Maybe Text
Maybe ObjectVersionId
Maybe ChecksumAlgorithm
Maybe ObjectCannedACL
Maybe RequestPayer
Maybe AccessControlPolicy
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
versionId :: Maybe ObjectVersionId
requestPayer :: Maybe RequestPayer
grantWriteACP :: Maybe Text
grantWrite :: Maybe Text
grantReadACP :: Maybe Text
grantRead :: Maybe Text
grantFullControl :: Maybe Text
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
accessControlPolicy :: Maybe AccessControlPolicy
acl :: Maybe ObjectCannedACL
$sel:key:PutObjectAcl' :: PutObjectAcl -> ObjectKey
$sel:bucket:PutObjectAcl' :: PutObjectAcl -> BucketName
$sel:versionId:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectVersionId
$sel:requestPayer:PutObjectAcl' :: PutObjectAcl -> Maybe RequestPayer
$sel:grantWriteACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantWrite:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantReadACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantRead:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantFullControl:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:expectedBucketOwner:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:contentMD5:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:checksumAlgorithm:PutObjectAcl' :: PutObjectAcl -> Maybe ChecksumAlgorithm
$sel:accessControlPolicy:PutObjectAcl' :: PutObjectAcl -> Maybe AccessControlPolicy
$sel:acl:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectCannedACL
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/", forall a. ToByteString a => a -> ByteString
Data.toBS BucketName
bucket, ByteString
"/", forall a. ToByteString a => a -> ByteString
Data.toBS ObjectKey
key]

instance Data.ToQuery PutObjectAcl where
  toQuery :: PutObjectAcl -> QueryString
toQuery PutObjectAcl' {Maybe Text
Maybe ObjectVersionId
Maybe ChecksumAlgorithm
Maybe ObjectCannedACL
Maybe RequestPayer
Maybe AccessControlPolicy
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
versionId :: Maybe ObjectVersionId
requestPayer :: Maybe RequestPayer
grantWriteACP :: Maybe Text
grantWrite :: Maybe Text
grantReadACP :: Maybe Text
grantRead :: Maybe Text
grantFullControl :: Maybe Text
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
accessControlPolicy :: Maybe AccessControlPolicy
acl :: Maybe ObjectCannedACL
$sel:key:PutObjectAcl' :: PutObjectAcl -> ObjectKey
$sel:bucket:PutObjectAcl' :: PutObjectAcl -> BucketName
$sel:versionId:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectVersionId
$sel:requestPayer:PutObjectAcl' :: PutObjectAcl -> Maybe RequestPayer
$sel:grantWriteACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantWrite:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantReadACP:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantRead:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:grantFullControl:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:expectedBucketOwner:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:contentMD5:PutObjectAcl' :: PutObjectAcl -> Maybe Text
$sel:checksumAlgorithm:PutObjectAcl' :: PutObjectAcl -> Maybe ChecksumAlgorithm
$sel:accessControlPolicy:PutObjectAcl' :: PutObjectAcl -> Maybe AccessControlPolicy
$sel:acl:PutObjectAcl' :: PutObjectAcl -> Maybe ObjectCannedACL
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"versionId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: 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
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]
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
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. 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'
    { $sel:requestCharged:PutObjectAclResponse' :: Maybe RequestCharged
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 :: Lens' PutObjectAclResponse (Maybe RequestCharged)
putObjectAclResponse_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 :: Lens' PutObjectAclResponse Int
putObjectAclResponse_httpStatus = 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 where
  rnf :: PutObjectAclResponse -> ()
rnf PutObjectAclResponse' {Int
Maybe RequestCharged
httpStatus :: Int
requestCharged :: Maybe RequestCharged
$sel:httpStatus:PutObjectAclResponse' :: PutObjectAclResponse -> Int
$sel:requestCharged:PutObjectAclResponse' :: PutObjectAclResponse -> Maybe RequestCharged
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe RequestCharged
requestCharged
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus