{-# 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.PutObject
-- 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)
--
-- Adds an object to a bucket. You must have WRITE permissions on a bucket
-- to add an object to it.
--
-- Amazon S3 never adds partial objects; if you receive a success response,
-- Amazon S3 added the entire object to the bucket.
--
-- Amazon S3 is a distributed system. If it receives multiple write
-- requests for the same object simultaneously, it overwrites all but the
-- last object written. Amazon S3 does not provide object locking; if you
-- need this, make sure to build it into your application layer or use
-- versioning instead.
--
-- To ensure that data is not corrupted traversing the network, use the
-- @Content-MD5@ header. When you use this header, Amazon S3 checks the
-- object against the provided MD5 value and, if they do not match, returns
-- an error. Additionally, you can calculate the MD5 while putting an
-- object to Amazon S3 and compare the returned ETag to the calculated MD5
-- value.
--
-- -   To successfully complete the @PutObject@ request, you must have the
--     @s3:PutObject@ in your IAM permissions.
--
-- -   To successfully change the objects acl of your @PutObject@ request,
--     you must have the @s3:PutObjectAcl@ in your IAM permissions.
--
-- -   The @Content-MD5@ header is required for any request to upload an
--     object with a retention period configured using Amazon S3 Object
--     Lock. For more information about Amazon S3 Object Lock, see
--     <https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html Amazon S3 Object Lock Overview>
--     in the /Amazon S3 User Guide/.
--
-- __Server-side Encryption__
--
-- You can optionally request server-side encryption. With server-side
-- encryption, Amazon S3 encrypts your data as it writes it to disks in its
-- data centers and decrypts the data when you access it. You have the
-- option to provide your own encryption key or use Amazon Web Services
-- managed encryption keys (SSE-S3 or SSE-KMS). For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html Using Server-Side Encryption>.
--
-- If you request server-side encryption using Amazon Web Services Key
-- Management Service (SSE-KMS), you can enable an S3 Bucket Key at the
-- object-level. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html Amazon S3 Bucket Keys>
-- in the /Amazon S3 User Guide/.
--
-- __Access Control List (ACL)-Specific Request Headers__
--
-- You can use headers to grant ACL- based permissions. By default, all
-- objects are private. Only the owner has full access control. When adding
-- a new object, you can grant permissions to individual Amazon Web
-- Services accounts or to predefined groups defined by Amazon S3. These
-- permissions are then added to the ACL on the object. For more
-- information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html Access Control List (ACL) Overview>
-- and
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html Managing ACLs Using the REST API>.
--
-- __Storage Class Options__
--
-- By default, Amazon S3 uses the STANDARD Storage Class to store newly
-- created objects. The STANDARD storage class provides high durability and
-- high availability. Depending on performance needs, you can specify a
-- different Storage Class. Amazon S3 on Outposts only uses the OUTPOSTS
-- Storage Class. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html Storage Classes>
-- in the /Amazon S3 User Guide/.
--
-- __Versioning__
--
-- If you enable versioning for a bucket, Amazon S3 automatically generates
-- a unique version ID for the object being stored. Amazon S3 returns this
-- ID in the response. When you enable versioning for a bucket, if Amazon
-- S3 receives multiple write requests for the same object simultaneously,
-- it stores all of the objects.
--
-- For more information about versioning, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/AddingObjectstoVersioningEnabledBuckets.html Adding Objects to Versioning Enabled Buckets>.
-- For information about returning the versioning state of a bucket, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html GetBucketVersioning>.
--
-- __Related Resources__
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html CopyObject>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html DeleteObject>
module Amazonka.S3.PutObject
  ( -- * Creating a Request
    PutObject (..),
    newPutObject,

    -- * Request Lenses
    putObject_contentLength,
    putObject_objectLockMode,
    putObject_expires,
    putObject_grantReadACP,
    putObject_sSECustomerAlgorithm,
    putObject_sSECustomerKey,
    putObject_requestPayer,
    putObject_grantWriteACP,
    putObject_bucketKeyEnabled,
    putObject_websiteRedirectLocation,
    putObject_grantRead,
    putObject_storageClass,
    putObject_sSECustomerKeyMD5,
    putObject_sSEKMSKeyId,
    putObject_grantFullControl,
    putObject_contentEncoding,
    putObject_tagging,
    putObject_contentMD5,
    putObject_objectLockRetainUntilDate,
    putObject_metadata,
    putObject_sSEKMSEncryptionContext,
    putObject_cacheControl,
    putObject_contentLanguage,
    putObject_objectLockLegalHoldStatus,
    putObject_acl,
    putObject_contentDisposition,
    putObject_expectedBucketOwner,
    putObject_serverSideEncryption,
    putObject_contentType,
    putObject_bucket,
    putObject_key,
    putObject_body,

    -- * Destructuring the Response
    PutObjectResponse (..),
    newPutObjectResponse,

    -- * Response Lenses
    putObjectResponse_requestCharged,
    putObjectResponse_eTag,
    putObjectResponse_versionId,
    putObjectResponse_expiration,
    putObjectResponse_sSECustomerAlgorithm,
    putObjectResponse_bucketKeyEnabled,
    putObjectResponse_sSECustomerKeyMD5,
    putObjectResponse_sSEKMSKeyId,
    putObjectResponse_sSEKMSEncryptionContext,
    putObjectResponse_serverSideEncryption,
    putObjectResponse_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:/ 'newPutObject' smart constructor.
data PutObject = PutObject'
  { -- | Size of the body in bytes. This parameter is useful when the size of the
    -- body cannot be determined automatically. For more information, see
    -- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13>.
    PutObject -> Maybe Integer
contentLength :: Prelude.Maybe Prelude.Integer,
    -- | The Object Lock mode that you want to apply to this object.
    PutObject -> Maybe ObjectLockMode
objectLockMode :: Prelude.Maybe ObjectLockMode,
    -- | The date and time at which the object is no longer cacheable. For more
    -- information, see
    -- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21>.
    PutObject -> Maybe ISO8601
expires :: Prelude.Maybe Core.ISO8601,
    -- | Allows grantee to read the object ACL.
    --
    -- This action is not supported by Amazon S3 on Outposts.
    PutObject -> Maybe Text
grantReadACP :: Prelude.Maybe Prelude.Text,
    -- | Specifies the algorithm to use to when encrypting the object (for
    -- example, AES256).
    PutObject -> Maybe Text
sSECustomerAlgorithm :: Prelude.Maybe Prelude.Text,
    -- | Specifies the customer-provided encryption key for Amazon S3 to use in
    -- encrypting data. This value is used to store the object and then it is
    -- discarded; Amazon S3 does not store the encryption key. The key must be
    -- appropriate for use with the algorithm specified in the
    -- @x-amz-server-side-encryption-customer-algorithm@ header.
    PutObject -> Maybe (Sensitive Text)
sSECustomerKey :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    PutObject -> Maybe RequestPayer
requestPayer :: Prelude.Maybe RequestPayer,
    -- | Allows grantee to write the ACL for the applicable object.
    --
    -- This action is not supported by Amazon S3 on Outposts.
    PutObject -> Maybe Text
grantWriteACP :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether Amazon S3 should use an S3 Bucket Key for object
    -- encryption with server-side encryption using AWS KMS (SSE-KMS). Setting
    -- this header to @true@ causes Amazon S3 to use an S3 Bucket Key for
    -- object encryption with SSE-KMS.
    --
    -- Specifying this header with a PUT action doesn’t affect bucket-level
    -- settings for S3 Bucket Key.
    PutObject -> Maybe Bool
bucketKeyEnabled :: Prelude.Maybe Prelude.Bool,
    -- | If the bucket is configured as a website, redirects requests for this
    -- object to another object in the same bucket or to an external URL.
    -- Amazon S3 stores the value of this header in the object metadata. For
    -- information about object metadata, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html Object Key and Metadata>.
    --
    -- In the following example, the request header sets the redirect to an
    -- object (anotherPage.html) in the same bucket:
    --
    -- @x-amz-website-redirect-location: \/anotherPage.html@
    --
    -- In the following example, the request header sets the object redirect to
    -- another website:
    --
    -- @x-amz-website-redirect-location: http:\/\/www.example.com\/@
    --
    -- For more information about website hosting in Amazon S3, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html Hosting Websites on Amazon S3>
    -- and
    -- <https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html How to Configure Website Page Redirects>.
    PutObject -> Maybe Text
websiteRedirectLocation :: Prelude.Maybe Prelude.Text,
    -- | Allows grantee to read the object data and its metadata.
    --
    -- This action is not supported by Amazon S3 on Outposts.
    PutObject -> Maybe Text
grantRead :: Prelude.Maybe Prelude.Text,
    -- | By default, Amazon S3 uses the STANDARD Storage Class to store newly
    -- created objects. The STANDARD storage class provides high durability and
    -- high availability. Depending on performance needs, you can specify a
    -- different Storage Class. Amazon S3 on Outposts only uses the OUTPOSTS
    -- Storage Class. For more information, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html Storage Classes>
    -- in the /Amazon S3 User Guide/.
    PutObject -> Maybe StorageClass
storageClass :: Prelude.Maybe StorageClass,
    -- | Specifies the 128-bit MD5 digest of the encryption key according to RFC
    -- 1321. Amazon S3 uses this header for a message integrity check to ensure
    -- that the encryption key was transmitted without error.
    PutObject -> Maybe Text
sSECustomerKeyMD5 :: Prelude.Maybe Prelude.Text,
    -- | If @x-amz-server-side-encryption@ is present and has the value of
    -- @aws:kms@, this header specifies the ID of the Amazon Web Services Key
    -- Management Service (Amazon Web Services KMS) symmetrical customer
    -- managed key that was used for the object. If you specify
    -- @x-amz-server-side-encryption:aws:kms@, but do not
    -- provide@ x-amz-server-side-encryption-aws-kms-key-id@, Amazon S3 uses
    -- the Amazon Web Services managed key to protect the data. If the KMS key
    -- does not exist in the same account issuing the command, you must use the
    -- full ARN and not just the ID.
    PutObject -> Maybe (Sensitive Text)
sSEKMSKeyId :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the
    -- object.
    --
    -- This action is not supported by Amazon S3 on Outposts.
    PutObject -> Maybe Text
grantFullControl :: Prelude.Maybe Prelude.Text,
    -- | Specifies what content encodings have been applied to the object and
    -- thus what decoding mechanisms must be applied to obtain the media-type
    -- referenced by the Content-Type header field. For more information, see
    -- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11>.
    PutObject -> Maybe Text
contentEncoding :: Prelude.Maybe Prelude.Text,
    -- | The tag-set for the object. The tag-set must be encoded as URL Query
    -- parameters. (For example, \"Key1=Value1\")
    PutObject -> Maybe Text
tagging :: Prelude.Maybe Prelude.Text,
    -- | The base64-encoded 128-bit MD5 digest of the message (without the
    -- headers) according to RFC 1864. This header can be used as a message
    -- integrity check to verify that the data is the same data that was
    -- originally sent. Although it is optional, we recommend using the
    -- Content-MD5 mechanism as an end-to-end integrity check. For more
    -- information about REST request authentication, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html REST Authentication>.
    PutObject -> Maybe Text
contentMD5 :: Prelude.Maybe Prelude.Text,
    -- | The date and time when you want this object\'s Object Lock to expire.
    -- Must be formatted as a timestamp parameter.
    PutObject -> Maybe ISO8601
objectLockRetainUntilDate :: Prelude.Maybe Core.ISO8601,
    -- | A map of metadata to store with the object in S3.
    PutObject -> HashMap Text Text
metadata :: Prelude.HashMap Prelude.Text Prelude.Text,
    -- | Specifies the Amazon Web Services KMS Encryption Context to use for
    -- object encryption. The value of this header is a base64-encoded UTF-8
    -- string holding JSON with the encryption context key-value pairs.
    PutObject -> Maybe (Sensitive Text)
sSEKMSEncryptionContext :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Can be used to specify caching behavior along the request\/reply chain.
    -- For more information, see
    -- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9>.
    PutObject -> Maybe Text
cacheControl :: Prelude.Maybe Prelude.Text,
    -- | The language the content is in.
    PutObject -> Maybe Text
contentLanguage :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether a legal hold will be applied to this object. For more
    -- information about S3 Object Lock, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html Object Lock>.
    PutObject -> Maybe ObjectLockLegalHoldStatus
objectLockLegalHoldStatus :: Prelude.Maybe ObjectLockLegalHoldStatus,
    -- | 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>.
    --
    -- This action is not supported by Amazon S3 on Outposts.
    PutObject -> Maybe ObjectCannedACL
acl :: Prelude.Maybe ObjectCannedACL,
    -- | Specifies presentational information for the object. For more
    -- information, see
    -- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1>.
    PutObject -> Maybe Text
contentDisposition :: Prelude.Maybe Prelude.Text,
    -- | 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.
    PutObject -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | The server-side encryption algorithm used when storing this object in
    -- Amazon S3 (for example, AES256, aws:kms).
    PutObject -> Maybe ServerSideEncryption
serverSideEncryption :: Prelude.Maybe ServerSideEncryption,
    -- | A standard MIME type describing the format of the contents. For more
    -- information, see
    -- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17>.
    PutObject -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
    -- | The bucket name to 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/.
    PutObject -> BucketName
bucket :: BucketName,
    -- | Object key for which the PUT action was initiated.
    PutObject -> ObjectKey
key :: ObjectKey,
    -- | Object data.
    PutObject -> RequestBody
body :: Core.RequestBody
  }
  deriving (Int -> PutObject -> ShowS
[PutObject] -> ShowS
PutObject -> String
(Int -> PutObject -> ShowS)
-> (PutObject -> String)
-> ([PutObject] -> ShowS)
-> Show PutObject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutObject] -> ShowS
$cshowList :: [PutObject] -> ShowS
show :: PutObject -> String
$cshow :: PutObject -> String
showsPrec :: Int -> PutObject -> ShowS
$cshowsPrec :: Int -> PutObject -> ShowS
Prelude.Show, (forall x. PutObject -> Rep PutObject x)
-> (forall x. Rep PutObject x -> PutObject) -> Generic PutObject
forall x. Rep PutObject x -> PutObject
forall x. PutObject -> Rep PutObject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutObject x -> PutObject
$cfrom :: forall x. PutObject -> Rep PutObject x
Prelude.Generic)

-- |
-- Create a value of 'PutObject' 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:
--
-- 'contentLength', 'putObject_contentLength' - Size of the body in bytes. This parameter is useful when the size of the
-- body cannot be determined automatically. For more information, see
-- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13>.
--
-- 'objectLockMode', 'putObject_objectLockMode' - The Object Lock mode that you want to apply to this object.
--
-- 'expires', 'putObject_expires' - The date and time at which the object is no longer cacheable. For more
-- information, see
-- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21>.
--
-- 'grantReadACP', 'putObject_grantReadACP' - Allows grantee to read the object ACL.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- 'sSECustomerAlgorithm', 'putObject_sSECustomerAlgorithm' - Specifies the algorithm to use to when encrypting the object (for
-- example, AES256).
--
-- 'sSECustomerKey', 'putObject_sSECustomerKey' - Specifies the customer-provided encryption key for Amazon S3 to use in
-- encrypting data. This value is used to store the object and then it is
-- discarded; Amazon S3 does not store the encryption key. The key must be
-- appropriate for use with the algorithm specified in the
-- @x-amz-server-side-encryption-customer-algorithm@ header.
--
-- 'requestPayer', 'putObject_requestPayer' - Undocumented member.
--
-- 'grantWriteACP', 'putObject_grantWriteACP' - Allows grantee to write the ACL for the applicable object.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- 'bucketKeyEnabled', 'putObject_bucketKeyEnabled' - Specifies whether Amazon S3 should use an S3 Bucket Key for object
-- encryption with server-side encryption using AWS KMS (SSE-KMS). Setting
-- this header to @true@ causes Amazon S3 to use an S3 Bucket Key for
-- object encryption with SSE-KMS.
--
-- Specifying this header with a PUT action doesn’t affect bucket-level
-- settings for S3 Bucket Key.
--
-- 'websiteRedirectLocation', 'putObject_websiteRedirectLocation' - If the bucket is configured as a website, redirects requests for this
-- object to another object in the same bucket or to an external URL.
-- Amazon S3 stores the value of this header in the object metadata. For
-- information about object metadata, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html Object Key and Metadata>.
--
-- In the following example, the request header sets the redirect to an
-- object (anotherPage.html) in the same bucket:
--
-- @x-amz-website-redirect-location: \/anotherPage.html@
--
-- In the following example, the request header sets the object redirect to
-- another website:
--
-- @x-amz-website-redirect-location: http:\/\/www.example.com\/@
--
-- For more information about website hosting in Amazon S3, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html Hosting Websites on Amazon S3>
-- and
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html How to Configure Website Page Redirects>.
--
-- 'grantRead', 'putObject_grantRead' - Allows grantee to read the object data and its metadata.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- 'storageClass', 'putObject_storageClass' - By default, Amazon S3 uses the STANDARD Storage Class to store newly
-- created objects. The STANDARD storage class provides high durability and
-- high availability. Depending on performance needs, you can specify a
-- different Storage Class. Amazon S3 on Outposts only uses the OUTPOSTS
-- Storage Class. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html Storage Classes>
-- in the /Amazon S3 User Guide/.
--
-- 'sSECustomerKeyMD5', 'putObject_sSECustomerKeyMD5' - Specifies the 128-bit MD5 digest of the encryption key according to RFC
-- 1321. Amazon S3 uses this header for a message integrity check to ensure
-- that the encryption key was transmitted without error.
--
-- 'sSEKMSKeyId', 'putObject_sSEKMSKeyId' - If @x-amz-server-side-encryption@ is present and has the value of
-- @aws:kms@, this header specifies the ID of the Amazon Web Services Key
-- Management Service (Amazon Web Services KMS) symmetrical customer
-- managed key that was used for the object. If you specify
-- @x-amz-server-side-encryption:aws:kms@, but do not
-- provide@ x-amz-server-side-encryption-aws-kms-key-id@, Amazon S3 uses
-- the Amazon Web Services managed key to protect the data. If the KMS key
-- does not exist in the same account issuing the command, you must use the
-- full ARN and not just the ID.
--
-- 'grantFullControl', 'putObject_grantFullControl' - Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the
-- object.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- 'contentEncoding', 'putObject_contentEncoding' - Specifies what content encodings have been applied to the object and
-- thus what decoding mechanisms must be applied to obtain the media-type
-- referenced by the Content-Type header field. For more information, see
-- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11>.
--
-- 'tagging', 'putObject_tagging' - The tag-set for the object. The tag-set must be encoded as URL Query
-- parameters. (For example, \"Key1=Value1\")
--
-- 'contentMD5', 'putObject_contentMD5' - The base64-encoded 128-bit MD5 digest of the message (without the
-- headers) according to RFC 1864. This header can be used as a message
-- integrity check to verify that the data is the same data that was
-- originally sent. Although it is optional, we recommend using the
-- Content-MD5 mechanism as an end-to-end integrity check. For more
-- information about REST request authentication, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html REST Authentication>.
--
-- 'objectLockRetainUntilDate', 'putObject_objectLockRetainUntilDate' - The date and time when you want this object\'s Object Lock to expire.
-- Must be formatted as a timestamp parameter.
--
-- 'metadata', 'putObject_metadata' - A map of metadata to store with the object in S3.
--
-- 'sSEKMSEncryptionContext', 'putObject_sSEKMSEncryptionContext' - Specifies the Amazon Web Services KMS Encryption Context to use for
-- object encryption. The value of this header is a base64-encoded UTF-8
-- string holding JSON with the encryption context key-value pairs.
--
-- 'cacheControl', 'putObject_cacheControl' - Can be used to specify caching behavior along the request\/reply chain.
-- For more information, see
-- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9>.
--
-- 'contentLanguage', 'putObject_contentLanguage' - The language the content is in.
--
-- 'objectLockLegalHoldStatus', 'putObject_objectLockLegalHoldStatus' - Specifies whether a legal hold will be applied to this object. For more
-- information about S3 Object Lock, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html Object Lock>.
--
-- 'acl', 'putObject_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>.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- 'contentDisposition', 'putObject_contentDisposition' - Specifies presentational information for the object. For more
-- information, see
-- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1>.
--
-- 'expectedBucketOwner', 'putObject_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.
--
-- 'serverSideEncryption', 'putObject_serverSideEncryption' - The server-side encryption algorithm used when storing this object in
-- Amazon S3 (for example, AES256, aws:kms).
--
-- 'contentType', 'putObject_contentType' - A standard MIME type describing the format of the contents. For more
-- information, see
-- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17>.
--
-- 'bucket', 'putObject_bucket' - The bucket name to 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/.
--
-- 'key', 'putObject_key' - Object key for which the PUT action was initiated.
--
-- 'body', 'putObject_body' - Object data.
newPutObject ::
  -- | 'bucket'
  BucketName ->
  -- | 'key'
  ObjectKey ->
  -- | 'body'
  Core.RequestBody ->
  PutObject
newPutObject :: BucketName -> ObjectKey -> RequestBody -> PutObject
newPutObject BucketName
pBucket_ ObjectKey
pKey_ RequestBody
pBody_ =
  PutObject' :: Maybe Integer
-> Maybe ObjectLockMode
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe RequestPayer
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe StorageClass
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> HashMap Text Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe ObjectLockLegalHoldStatus
-> Maybe ObjectCannedACL
-> Maybe Text
-> Maybe Text
-> Maybe ServerSideEncryption
-> Maybe Text
-> BucketName
-> ObjectKey
-> RequestBody
-> PutObject
PutObject'
    { $sel:contentLength:PutObject' :: Maybe Integer
contentLength = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:objectLockMode:PutObject' :: Maybe ObjectLockMode
objectLockMode = Maybe ObjectLockMode
forall a. Maybe a
Prelude.Nothing,
      $sel:expires:PutObject' :: Maybe ISO8601
expires = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:grantReadACP:PutObject' :: Maybe Text
grantReadACP = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sSECustomerAlgorithm:PutObject' :: Maybe Text
sSECustomerAlgorithm = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sSECustomerKey:PutObject' :: Maybe (Sensitive Text)
sSECustomerKey = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:requestPayer:PutObject' :: Maybe RequestPayer
requestPayer = Maybe RequestPayer
forall a. Maybe a
Prelude.Nothing,
      $sel:grantWriteACP:PutObject' :: Maybe Text
grantWriteACP = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketKeyEnabled:PutObject' :: Maybe Bool
bucketKeyEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:websiteRedirectLocation:PutObject' :: Maybe Text
websiteRedirectLocation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:grantRead:PutObject' :: Maybe Text
grantRead = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:storageClass:PutObject' :: Maybe StorageClass
storageClass = Maybe StorageClass
forall a. Maybe a
Prelude.Nothing,
      $sel:sSECustomerKeyMD5:PutObject' :: Maybe Text
sSECustomerKeyMD5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sSEKMSKeyId:PutObject' :: Maybe (Sensitive Text)
sSEKMSKeyId = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:grantFullControl:PutObject' :: Maybe Text
grantFullControl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentEncoding:PutObject' :: Maybe Text
contentEncoding = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tagging:PutObject' :: Maybe Text
tagging = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentMD5:PutObject' :: Maybe Text
contentMD5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:objectLockRetainUntilDate:PutObject' :: Maybe ISO8601
objectLockRetainUntilDate = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:metadata:PutObject' :: HashMap Text Text
metadata = HashMap Text Text
forall a. Monoid a => a
Prelude.mempty,
      $sel:sSEKMSEncryptionContext:PutObject' :: Maybe (Sensitive Text)
sSEKMSEncryptionContext = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheControl:PutObject' :: Maybe Text
cacheControl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentLanguage:PutObject' :: Maybe Text
contentLanguage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:objectLockLegalHoldStatus:PutObject' :: Maybe ObjectLockLegalHoldStatus
objectLockLegalHoldStatus = Maybe ObjectLockLegalHoldStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:acl:PutObject' :: Maybe ObjectCannedACL
acl = Maybe ObjectCannedACL
forall a. Maybe a
Prelude.Nothing,
      $sel:contentDisposition:PutObject' :: Maybe Text
contentDisposition = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:expectedBucketOwner:PutObject' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serverSideEncryption:PutObject' :: Maybe ServerSideEncryption
serverSideEncryption = Maybe ServerSideEncryption
forall a. Maybe a
Prelude.Nothing,
      $sel:contentType:PutObject' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucket:PutObject' :: BucketName
bucket = BucketName
pBucket_,
      $sel:key:PutObject' :: ObjectKey
key = ObjectKey
pKey_,
      $sel:body:PutObject' :: RequestBody
body = RequestBody
pBody_
    }

-- | Size of the body in bytes. This parameter is useful when the size of the
-- body cannot be determined automatically. For more information, see
-- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13>.
putObject_contentLength :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Integer)
putObject_contentLength :: (Maybe Integer -> f (Maybe Integer)) -> PutObject -> f PutObject
putObject_contentLength = (PutObject -> Maybe Integer)
-> (PutObject -> Maybe Integer -> PutObject)
-> Lens PutObject PutObject (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Integer
contentLength :: Maybe Integer
$sel:contentLength:PutObject' :: PutObject -> Maybe Integer
contentLength} -> Maybe Integer
contentLength) (\s :: PutObject
s@PutObject' {} Maybe Integer
a -> PutObject
s {$sel:contentLength:PutObject' :: Maybe Integer
contentLength = Maybe Integer
a} :: PutObject)

-- | The Object Lock mode that you want to apply to this object.
putObject_objectLockMode :: Lens.Lens' PutObject (Prelude.Maybe ObjectLockMode)
putObject_objectLockMode :: (Maybe ObjectLockMode -> f (Maybe ObjectLockMode))
-> PutObject -> f PutObject
putObject_objectLockMode = (PutObject -> Maybe ObjectLockMode)
-> (PutObject -> Maybe ObjectLockMode -> PutObject)
-> Lens
     PutObject PutObject (Maybe ObjectLockMode) (Maybe ObjectLockMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe ObjectLockMode
objectLockMode :: Maybe ObjectLockMode
$sel:objectLockMode:PutObject' :: PutObject -> Maybe ObjectLockMode
objectLockMode} -> Maybe ObjectLockMode
objectLockMode) (\s :: PutObject
s@PutObject' {} Maybe ObjectLockMode
a -> PutObject
s {$sel:objectLockMode:PutObject' :: Maybe ObjectLockMode
objectLockMode = Maybe ObjectLockMode
a} :: PutObject)

-- | The date and time at which the object is no longer cacheable. For more
-- information, see
-- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21>.
putObject_expires :: Lens.Lens' PutObject (Prelude.Maybe Prelude.UTCTime)
putObject_expires :: (Maybe UTCTime -> f (Maybe UTCTime)) -> PutObject -> f PutObject
putObject_expires = (PutObject -> Maybe ISO8601)
-> (PutObject -> Maybe ISO8601 -> PutObject)
-> Lens PutObject PutObject (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe ISO8601
expires :: Maybe ISO8601
$sel:expires:PutObject' :: PutObject -> Maybe ISO8601
expires} -> Maybe ISO8601
expires) (\s :: PutObject
s@PutObject' {} Maybe ISO8601
a -> PutObject
s {$sel:expires:PutObject' :: Maybe ISO8601
expires = Maybe ISO8601
a} :: PutObject) ((Maybe ISO8601 -> f (Maybe ISO8601)) -> PutObject -> f PutObject)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PutObject
-> f PutObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Allows grantee to read the object ACL.
--
-- This action is not supported by Amazon S3 on Outposts.
putObject_grantReadACP :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_grantReadACP :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_grantReadACP = (PutObject -> Maybe Text)
-> (PutObject -> Maybe Text -> PutObject)
-> Lens PutObject PutObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Text
grantReadACP :: Maybe Text
$sel:grantReadACP:PutObject' :: PutObject -> Maybe Text
grantReadACP} -> Maybe Text
grantReadACP) (\s :: PutObject
s@PutObject' {} Maybe Text
a -> PutObject
s {$sel:grantReadACP:PutObject' :: Maybe Text
grantReadACP = Maybe Text
a} :: PutObject)

-- | Specifies the algorithm to use to when encrypting the object (for
-- example, AES256).
putObject_sSECustomerAlgorithm :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_sSECustomerAlgorithm :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_sSECustomerAlgorithm = (PutObject -> Maybe Text)
-> (PutObject -> Maybe Text -> PutObject)
-> Lens PutObject PutObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Text
sSECustomerAlgorithm :: Maybe Text
$sel:sSECustomerAlgorithm:PutObject' :: PutObject -> Maybe Text
sSECustomerAlgorithm} -> Maybe Text
sSECustomerAlgorithm) (\s :: PutObject
s@PutObject' {} Maybe Text
a -> PutObject
s {$sel:sSECustomerAlgorithm:PutObject' :: Maybe Text
sSECustomerAlgorithm = Maybe Text
a} :: PutObject)

-- | Specifies the customer-provided encryption key for Amazon S3 to use in
-- encrypting data. This value is used to store the object and then it is
-- discarded; Amazon S3 does not store the encryption key. The key must be
-- appropriate for use with the algorithm specified in the
-- @x-amz-server-side-encryption-customer-algorithm@ header.
putObject_sSECustomerKey :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_sSECustomerKey :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_sSECustomerKey = (PutObject -> Maybe (Sensitive Text))
-> (PutObject -> Maybe (Sensitive Text) -> PutObject)
-> Lens
     PutObject
     PutObject
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe (Sensitive Text)
sSECustomerKey :: Maybe (Sensitive Text)
$sel:sSECustomerKey:PutObject' :: PutObject -> Maybe (Sensitive Text)
sSECustomerKey} -> Maybe (Sensitive Text)
sSECustomerKey) (\s :: PutObject
s@PutObject' {} Maybe (Sensitive Text)
a -> PutObject
s {$sel:sSECustomerKey:PutObject' :: Maybe (Sensitive Text)
sSECustomerKey = Maybe (Sensitive Text)
a} :: PutObject) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> PutObject -> f PutObject)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> PutObject
-> f PutObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | Undocumented member.
putObject_requestPayer :: Lens.Lens' PutObject (Prelude.Maybe RequestPayer)
putObject_requestPayer :: (Maybe RequestPayer -> f (Maybe RequestPayer))
-> PutObject -> f PutObject
putObject_requestPayer = (PutObject -> Maybe RequestPayer)
-> (PutObject -> Maybe RequestPayer -> PutObject)
-> Lens
     PutObject PutObject (Maybe RequestPayer) (Maybe RequestPayer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe RequestPayer
requestPayer :: Maybe RequestPayer
$sel:requestPayer:PutObject' :: PutObject -> Maybe RequestPayer
requestPayer} -> Maybe RequestPayer
requestPayer) (\s :: PutObject
s@PutObject' {} Maybe RequestPayer
a -> PutObject
s {$sel:requestPayer:PutObject' :: Maybe RequestPayer
requestPayer = Maybe RequestPayer
a} :: PutObject)

-- | Allows grantee to write the ACL for the applicable object.
--
-- This action is not supported by Amazon S3 on Outposts.
putObject_grantWriteACP :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_grantWriteACP :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_grantWriteACP = (PutObject -> Maybe Text)
-> (PutObject -> Maybe Text -> PutObject)
-> Lens PutObject PutObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Text
grantWriteACP :: Maybe Text
$sel:grantWriteACP:PutObject' :: PutObject -> Maybe Text
grantWriteACP} -> Maybe Text
grantWriteACP) (\s :: PutObject
s@PutObject' {} Maybe Text
a -> PutObject
s {$sel:grantWriteACP:PutObject' :: Maybe Text
grantWriteACP = Maybe Text
a} :: PutObject)

-- | Specifies whether Amazon S3 should use an S3 Bucket Key for object
-- encryption with server-side encryption using AWS KMS (SSE-KMS). Setting
-- this header to @true@ causes Amazon S3 to use an S3 Bucket Key for
-- object encryption with SSE-KMS.
--
-- Specifying this header with a PUT action doesn’t affect bucket-level
-- settings for S3 Bucket Key.
putObject_bucketKeyEnabled :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Bool)
putObject_bucketKeyEnabled :: (Maybe Bool -> f (Maybe Bool)) -> PutObject -> f PutObject
putObject_bucketKeyEnabled = (PutObject -> Maybe Bool)
-> (PutObject -> Maybe Bool -> PutObject)
-> Lens PutObject PutObject (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Bool
bucketKeyEnabled :: Maybe Bool
$sel:bucketKeyEnabled:PutObject' :: PutObject -> Maybe Bool
bucketKeyEnabled} -> Maybe Bool
bucketKeyEnabled) (\s :: PutObject
s@PutObject' {} Maybe Bool
a -> PutObject
s {$sel:bucketKeyEnabled:PutObject' :: Maybe Bool
bucketKeyEnabled = Maybe Bool
a} :: PutObject)

-- | If the bucket is configured as a website, redirects requests for this
-- object to another object in the same bucket or to an external URL.
-- Amazon S3 stores the value of this header in the object metadata. For
-- information about object metadata, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html Object Key and Metadata>.
--
-- In the following example, the request header sets the redirect to an
-- object (anotherPage.html) in the same bucket:
--
-- @x-amz-website-redirect-location: \/anotherPage.html@
--
-- In the following example, the request header sets the object redirect to
-- another website:
--
-- @x-amz-website-redirect-location: http:\/\/www.example.com\/@
--
-- For more information about website hosting in Amazon S3, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html Hosting Websites on Amazon S3>
-- and
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html How to Configure Website Page Redirects>.
putObject_websiteRedirectLocation :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_websiteRedirectLocation :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_websiteRedirectLocation = (PutObject -> Maybe Text)
-> (PutObject -> Maybe Text -> PutObject)
-> Lens PutObject PutObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Text
websiteRedirectLocation :: Maybe Text
$sel:websiteRedirectLocation:PutObject' :: PutObject -> Maybe Text
websiteRedirectLocation} -> Maybe Text
websiteRedirectLocation) (\s :: PutObject
s@PutObject' {} Maybe Text
a -> PutObject
s {$sel:websiteRedirectLocation:PutObject' :: Maybe Text
websiteRedirectLocation = Maybe Text
a} :: PutObject)

-- | Allows grantee to read the object data and its metadata.
--
-- This action is not supported by Amazon S3 on Outposts.
putObject_grantRead :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_grantRead :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_grantRead = (PutObject -> Maybe Text)
-> (PutObject -> Maybe Text -> PutObject)
-> Lens PutObject PutObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Text
grantRead :: Maybe Text
$sel:grantRead:PutObject' :: PutObject -> Maybe Text
grantRead} -> Maybe Text
grantRead) (\s :: PutObject
s@PutObject' {} Maybe Text
a -> PutObject
s {$sel:grantRead:PutObject' :: Maybe Text
grantRead = Maybe Text
a} :: PutObject)

-- | By default, Amazon S3 uses the STANDARD Storage Class to store newly
-- created objects. The STANDARD storage class provides high durability and
-- high availability. Depending on performance needs, you can specify a
-- different Storage Class. Amazon S3 on Outposts only uses the OUTPOSTS
-- Storage Class. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html Storage Classes>
-- in the /Amazon S3 User Guide/.
putObject_storageClass :: Lens.Lens' PutObject (Prelude.Maybe StorageClass)
putObject_storageClass :: (Maybe StorageClass -> f (Maybe StorageClass))
-> PutObject -> f PutObject
putObject_storageClass = (PutObject -> Maybe StorageClass)
-> (PutObject -> Maybe StorageClass -> PutObject)
-> Lens
     PutObject PutObject (Maybe StorageClass) (Maybe StorageClass)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe StorageClass
storageClass :: Maybe StorageClass
$sel:storageClass:PutObject' :: PutObject -> Maybe StorageClass
storageClass} -> Maybe StorageClass
storageClass) (\s :: PutObject
s@PutObject' {} Maybe StorageClass
a -> PutObject
s {$sel:storageClass:PutObject' :: Maybe StorageClass
storageClass = Maybe StorageClass
a} :: PutObject)

-- | Specifies the 128-bit MD5 digest of the encryption key according to RFC
-- 1321. Amazon S3 uses this header for a message integrity check to ensure
-- that the encryption key was transmitted without error.
putObject_sSECustomerKeyMD5 :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_sSECustomerKeyMD5 :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_sSECustomerKeyMD5 = (PutObject -> Maybe Text)
-> (PutObject -> Maybe Text -> PutObject)
-> Lens PutObject PutObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Text
sSECustomerKeyMD5 :: Maybe Text
$sel:sSECustomerKeyMD5:PutObject' :: PutObject -> Maybe Text
sSECustomerKeyMD5} -> Maybe Text
sSECustomerKeyMD5) (\s :: PutObject
s@PutObject' {} Maybe Text
a -> PutObject
s {$sel:sSECustomerKeyMD5:PutObject' :: Maybe Text
sSECustomerKeyMD5 = Maybe Text
a} :: PutObject)

-- | If @x-amz-server-side-encryption@ is present and has the value of
-- @aws:kms@, this header specifies the ID of the Amazon Web Services Key
-- Management Service (Amazon Web Services KMS) symmetrical customer
-- managed key that was used for the object. If you specify
-- @x-amz-server-side-encryption:aws:kms@, but do not
-- provide@ x-amz-server-side-encryption-aws-kms-key-id@, Amazon S3 uses
-- the Amazon Web Services managed key to protect the data. If the KMS key
-- does not exist in the same account issuing the command, you must use the
-- full ARN and not just the ID.
putObject_sSEKMSKeyId :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_sSEKMSKeyId :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_sSEKMSKeyId = (PutObject -> Maybe (Sensitive Text))
-> (PutObject -> Maybe (Sensitive Text) -> PutObject)
-> Lens
     PutObject
     PutObject
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe (Sensitive Text)
sSEKMSKeyId :: Maybe (Sensitive Text)
$sel:sSEKMSKeyId:PutObject' :: PutObject -> Maybe (Sensitive Text)
sSEKMSKeyId} -> Maybe (Sensitive Text)
sSEKMSKeyId) (\s :: PutObject
s@PutObject' {} Maybe (Sensitive Text)
a -> PutObject
s {$sel:sSEKMSKeyId:PutObject' :: Maybe (Sensitive Text)
sSEKMSKeyId = Maybe (Sensitive Text)
a} :: PutObject) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> PutObject -> f PutObject)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> PutObject
-> f PutObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the
-- object.
--
-- This action is not supported by Amazon S3 on Outposts.
putObject_grantFullControl :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_grantFullControl :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_grantFullControl = (PutObject -> Maybe Text)
-> (PutObject -> Maybe Text -> PutObject)
-> Lens PutObject PutObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Text
grantFullControl :: Maybe Text
$sel:grantFullControl:PutObject' :: PutObject -> Maybe Text
grantFullControl} -> Maybe Text
grantFullControl) (\s :: PutObject
s@PutObject' {} Maybe Text
a -> PutObject
s {$sel:grantFullControl:PutObject' :: Maybe Text
grantFullControl = Maybe Text
a} :: PutObject)

-- | Specifies what content encodings have been applied to the object and
-- thus what decoding mechanisms must be applied to obtain the media-type
-- referenced by the Content-Type header field. For more information, see
-- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11>.
putObject_contentEncoding :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_contentEncoding :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_contentEncoding = (PutObject -> Maybe Text)
-> (PutObject -> Maybe Text -> PutObject)
-> Lens PutObject PutObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Text
contentEncoding :: Maybe Text
$sel:contentEncoding:PutObject' :: PutObject -> Maybe Text
contentEncoding} -> Maybe Text
contentEncoding) (\s :: PutObject
s@PutObject' {} Maybe Text
a -> PutObject
s {$sel:contentEncoding:PutObject' :: Maybe Text
contentEncoding = Maybe Text
a} :: PutObject)

-- | The tag-set for the object. The tag-set must be encoded as URL Query
-- parameters. (For example, \"Key1=Value1\")
putObject_tagging :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_tagging :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_tagging = (PutObject -> Maybe Text)
-> (PutObject -> Maybe Text -> PutObject)
-> Lens PutObject PutObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Text
tagging :: Maybe Text
$sel:tagging:PutObject' :: PutObject -> Maybe Text
tagging} -> Maybe Text
tagging) (\s :: PutObject
s@PutObject' {} Maybe Text
a -> PutObject
s {$sel:tagging:PutObject' :: Maybe Text
tagging = Maybe Text
a} :: PutObject)

-- | The base64-encoded 128-bit MD5 digest of the message (without the
-- headers) according to RFC 1864. This header can be used as a message
-- integrity check to verify that the data is the same data that was
-- originally sent. Although it is optional, we recommend using the
-- Content-MD5 mechanism as an end-to-end integrity check. For more
-- information about REST request authentication, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html REST Authentication>.
putObject_contentMD5 :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_contentMD5 :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_contentMD5 = (PutObject -> Maybe Text)
-> (PutObject -> Maybe Text -> PutObject)
-> Lens PutObject PutObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Text
contentMD5 :: Maybe Text
$sel:contentMD5:PutObject' :: PutObject -> Maybe Text
contentMD5} -> Maybe Text
contentMD5) (\s :: PutObject
s@PutObject' {} Maybe Text
a -> PutObject
s {$sel:contentMD5:PutObject' :: Maybe Text
contentMD5 = Maybe Text
a} :: PutObject)

-- | The date and time when you want this object\'s Object Lock to expire.
-- Must be formatted as a timestamp parameter.
putObject_objectLockRetainUntilDate :: Lens.Lens' PutObject (Prelude.Maybe Prelude.UTCTime)
putObject_objectLockRetainUntilDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> PutObject -> f PutObject
putObject_objectLockRetainUntilDate = (PutObject -> Maybe ISO8601)
-> (PutObject -> Maybe ISO8601 -> PutObject)
-> Lens PutObject PutObject (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe ISO8601
objectLockRetainUntilDate :: Maybe ISO8601
$sel:objectLockRetainUntilDate:PutObject' :: PutObject -> Maybe ISO8601
objectLockRetainUntilDate} -> Maybe ISO8601
objectLockRetainUntilDate) (\s :: PutObject
s@PutObject' {} Maybe ISO8601
a -> PutObject
s {$sel:objectLockRetainUntilDate:PutObject' :: Maybe ISO8601
objectLockRetainUntilDate = Maybe ISO8601
a} :: PutObject) ((Maybe ISO8601 -> f (Maybe ISO8601)) -> PutObject -> f PutObject)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PutObject
-> f PutObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A map of metadata to store with the object in S3.
putObject_metadata :: Lens.Lens' PutObject (Prelude.HashMap Prelude.Text Prelude.Text)
putObject_metadata :: (HashMap Text Text -> f (HashMap Text Text))
-> PutObject -> f PutObject
putObject_metadata = (PutObject -> HashMap Text Text)
-> (PutObject -> HashMap Text Text -> PutObject)
-> Lens PutObject PutObject (HashMap Text Text) (HashMap Text Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {HashMap Text Text
metadata :: HashMap Text Text
$sel:metadata:PutObject' :: PutObject -> HashMap Text Text
metadata} -> HashMap Text Text
metadata) (\s :: PutObject
s@PutObject' {} HashMap Text Text
a -> PutObject
s {$sel:metadata:PutObject' :: HashMap Text Text
metadata = HashMap Text Text
a} :: PutObject) ((HashMap Text Text -> f (HashMap Text Text))
 -> PutObject -> f PutObject)
-> ((HashMap Text Text -> f (HashMap Text Text))
    -> HashMap Text Text -> f (HashMap Text Text))
-> (HashMap Text Text -> f (HashMap Text Text))
-> PutObject
-> f PutObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text Text -> f (HashMap Text Text))
-> HashMap Text Text -> f (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies the Amazon Web Services KMS Encryption Context to use for
-- object encryption. The value of this header is a base64-encoded UTF-8
-- string holding JSON with the encryption context key-value pairs.
putObject_sSEKMSEncryptionContext :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_sSEKMSEncryptionContext :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_sSEKMSEncryptionContext = (PutObject -> Maybe (Sensitive Text))
-> (PutObject -> Maybe (Sensitive Text) -> PutObject)
-> Lens
     PutObject
     PutObject
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe (Sensitive Text)
sSEKMSEncryptionContext :: Maybe (Sensitive Text)
$sel:sSEKMSEncryptionContext:PutObject' :: PutObject -> Maybe (Sensitive Text)
sSEKMSEncryptionContext} -> Maybe (Sensitive Text)
sSEKMSEncryptionContext) (\s :: PutObject
s@PutObject' {} Maybe (Sensitive Text)
a -> PutObject
s {$sel:sSEKMSEncryptionContext:PutObject' :: Maybe (Sensitive Text)
sSEKMSEncryptionContext = Maybe (Sensitive Text)
a} :: PutObject) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> PutObject -> f PutObject)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> PutObject
-> f PutObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | Can be used to specify caching behavior along the request\/reply chain.
-- For more information, see
-- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9>.
putObject_cacheControl :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_cacheControl :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_cacheControl = (PutObject -> Maybe Text)
-> (PutObject -> Maybe Text -> PutObject)
-> Lens PutObject PutObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Text
cacheControl :: Maybe Text
$sel:cacheControl:PutObject' :: PutObject -> Maybe Text
cacheControl} -> Maybe Text
cacheControl) (\s :: PutObject
s@PutObject' {} Maybe Text
a -> PutObject
s {$sel:cacheControl:PutObject' :: Maybe Text
cacheControl = Maybe Text
a} :: PutObject)

-- | The language the content is in.
putObject_contentLanguage :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_contentLanguage :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_contentLanguage = (PutObject -> Maybe Text)
-> (PutObject -> Maybe Text -> PutObject)
-> Lens PutObject PutObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Text
contentLanguage :: Maybe Text
$sel:contentLanguage:PutObject' :: PutObject -> Maybe Text
contentLanguage} -> Maybe Text
contentLanguage) (\s :: PutObject
s@PutObject' {} Maybe Text
a -> PutObject
s {$sel:contentLanguage:PutObject' :: Maybe Text
contentLanguage = Maybe Text
a} :: PutObject)

-- | Specifies whether a legal hold will be applied to this object. For more
-- information about S3 Object Lock, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html Object Lock>.
putObject_objectLockLegalHoldStatus :: Lens.Lens' PutObject (Prelude.Maybe ObjectLockLegalHoldStatus)
putObject_objectLockLegalHoldStatus :: (Maybe ObjectLockLegalHoldStatus
 -> f (Maybe ObjectLockLegalHoldStatus))
-> PutObject -> f PutObject
putObject_objectLockLegalHoldStatus = (PutObject -> Maybe ObjectLockLegalHoldStatus)
-> (PutObject -> Maybe ObjectLockLegalHoldStatus -> PutObject)
-> Lens
     PutObject
     PutObject
     (Maybe ObjectLockLegalHoldStatus)
     (Maybe ObjectLockLegalHoldStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe ObjectLockLegalHoldStatus
objectLockLegalHoldStatus :: Maybe ObjectLockLegalHoldStatus
$sel:objectLockLegalHoldStatus:PutObject' :: PutObject -> Maybe ObjectLockLegalHoldStatus
objectLockLegalHoldStatus} -> Maybe ObjectLockLegalHoldStatus
objectLockLegalHoldStatus) (\s :: PutObject
s@PutObject' {} Maybe ObjectLockLegalHoldStatus
a -> PutObject
s {$sel:objectLockLegalHoldStatus:PutObject' :: Maybe ObjectLockLegalHoldStatus
objectLockLegalHoldStatus = Maybe ObjectLockLegalHoldStatus
a} :: PutObject)

-- | 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>.
--
-- This action is not supported by Amazon S3 on Outposts.
putObject_acl :: Lens.Lens' PutObject (Prelude.Maybe ObjectCannedACL)
putObject_acl :: (Maybe ObjectCannedACL -> f (Maybe ObjectCannedACL))
-> PutObject -> f PutObject
putObject_acl = (PutObject -> Maybe ObjectCannedACL)
-> (PutObject -> Maybe ObjectCannedACL -> PutObject)
-> Lens
     PutObject PutObject (Maybe ObjectCannedACL) (Maybe ObjectCannedACL)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe ObjectCannedACL
acl :: Maybe ObjectCannedACL
$sel:acl:PutObject' :: PutObject -> Maybe ObjectCannedACL
acl} -> Maybe ObjectCannedACL
acl) (\s :: PutObject
s@PutObject' {} Maybe ObjectCannedACL
a -> PutObject
s {$sel:acl:PutObject' :: Maybe ObjectCannedACL
acl = Maybe ObjectCannedACL
a} :: PutObject)

-- | Specifies presentational information for the object. For more
-- information, see
-- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1>.
putObject_contentDisposition :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_contentDisposition :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_contentDisposition = (PutObject -> Maybe Text)
-> (PutObject -> Maybe Text -> PutObject)
-> Lens PutObject PutObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Text
contentDisposition :: Maybe Text
$sel:contentDisposition:PutObject' :: PutObject -> Maybe Text
contentDisposition} -> Maybe Text
contentDisposition) (\s :: PutObject
s@PutObject' {} Maybe Text
a -> PutObject
s {$sel:contentDisposition:PutObject' :: Maybe Text
contentDisposition = Maybe Text
a} :: PutObject)

-- | 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.
putObject_expectedBucketOwner :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_expectedBucketOwner :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_expectedBucketOwner = (PutObject -> Maybe Text)
-> (PutObject -> Maybe Text -> PutObject)
-> Lens PutObject PutObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:PutObject' :: PutObject -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: PutObject
s@PutObject' {} Maybe Text
a -> PutObject
s {$sel:expectedBucketOwner:PutObject' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: PutObject)

-- | The server-side encryption algorithm used when storing this object in
-- Amazon S3 (for example, AES256, aws:kms).
putObject_serverSideEncryption :: Lens.Lens' PutObject (Prelude.Maybe ServerSideEncryption)
putObject_serverSideEncryption :: (Maybe ServerSideEncryption -> f (Maybe ServerSideEncryption))
-> PutObject -> f PutObject
putObject_serverSideEncryption = (PutObject -> Maybe ServerSideEncryption)
-> (PutObject -> Maybe ServerSideEncryption -> PutObject)
-> Lens
     PutObject
     PutObject
     (Maybe ServerSideEncryption)
     (Maybe ServerSideEncryption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe ServerSideEncryption
serverSideEncryption :: Maybe ServerSideEncryption
$sel:serverSideEncryption:PutObject' :: PutObject -> Maybe ServerSideEncryption
serverSideEncryption} -> Maybe ServerSideEncryption
serverSideEncryption) (\s :: PutObject
s@PutObject' {} Maybe ServerSideEncryption
a -> PutObject
s {$sel:serverSideEncryption:PutObject' :: Maybe ServerSideEncryption
serverSideEncryption = Maybe ServerSideEncryption
a} :: PutObject)

-- | A standard MIME type describing the format of the contents. For more
-- information, see
-- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17>.
putObject_contentType :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_contentType :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_contentType = (PutObject -> Maybe Text)
-> (PutObject -> Maybe Text -> PutObject)
-> Lens PutObject PutObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Text
contentType :: Maybe Text
$sel:contentType:PutObject' :: PutObject -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: PutObject
s@PutObject' {} Maybe Text
a -> PutObject
s {$sel:contentType:PutObject' :: Maybe Text
contentType = Maybe Text
a} :: PutObject)

-- | The bucket name to 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/.
putObject_bucket :: Lens.Lens' PutObject BucketName
putObject_bucket :: (BucketName -> f BucketName) -> PutObject -> f PutObject
putObject_bucket = (PutObject -> BucketName)
-> (PutObject -> BucketName -> PutObject)
-> Lens PutObject PutObject BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {BucketName
bucket :: BucketName
$sel:bucket:PutObject' :: PutObject -> BucketName
bucket} -> BucketName
bucket) (\s :: PutObject
s@PutObject' {} BucketName
a -> PutObject
s {$sel:bucket:PutObject' :: BucketName
bucket = BucketName
a} :: PutObject)

-- | Object key for which the PUT action was initiated.
putObject_key :: Lens.Lens' PutObject ObjectKey
putObject_key :: (ObjectKey -> f ObjectKey) -> PutObject -> f PutObject
putObject_key = (PutObject -> ObjectKey)
-> (PutObject -> ObjectKey -> PutObject)
-> Lens PutObject PutObject ObjectKey ObjectKey
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {ObjectKey
key :: ObjectKey
$sel:key:PutObject' :: PutObject -> ObjectKey
key} -> ObjectKey
key) (\s :: PutObject
s@PutObject' {} ObjectKey
a -> PutObject
s {$sel:key:PutObject' :: ObjectKey
key = ObjectKey
a} :: PutObject)

-- | Object data.
putObject_body :: Lens.Lens' PutObject Core.RequestBody
putObject_body :: (RequestBody -> f RequestBody) -> PutObject -> f PutObject
putObject_body = (PutObject -> RequestBody)
-> (PutObject -> RequestBody -> PutObject)
-> Lens PutObject PutObject RequestBody RequestBody
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {RequestBody
body :: RequestBody
$sel:body:PutObject' :: PutObject -> RequestBody
body} -> RequestBody
body) (\s :: PutObject
s@PutObject' {} RequestBody
a -> PutObject
s {$sel:body:PutObject' :: RequestBody
body = RequestBody
a} :: PutObject)

instance Core.AWSRequest PutObject where
  type AWSResponse PutObject = PutObjectResponse
  request :: PutObject -> Request PutObject
request =
    Request PutObject -> Request PutObject
forall a. Request a -> Request a
Request.expectHeader
      (Request PutObject -> Request PutObject)
-> (PutObject -> Request PutObject)
-> PutObject
-> Request PutObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Request PutObject -> Request PutObject
forall a. Request a -> Request a
Request.s3vhost
      (Request PutObject -> Request PutObject)
-> (PutObject -> Request PutObject)
-> PutObject
-> Request PutObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> PutObject -> Request PutObject
forall a. (ToRequest a, ToBody a) => Service -> a -> Request a
Request.putBody Service
defaultService
  response :: Logger
-> Service
-> Proxy PutObject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutObject)))
response =
    (Int
 -> ResponseHeaders -> () -> Either String (AWSResponse PutObject))
-> Logger
-> Service
-> Proxy PutObject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutObject)))
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
-> Maybe ETag
-> Maybe ObjectVersionId
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe ServerSideEncryption
-> Int
-> PutObjectResponse
PutObjectResponse'
            (Maybe RequestCharged
 -> Maybe ETag
 -> Maybe ObjectVersionId
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe (Sensitive Text)
 -> Maybe (Sensitive Text)
 -> Maybe ServerSideEncryption
 -> Int
 -> PutObjectResponse)
-> Either String (Maybe RequestCharged)
-> Either
     String
     (Maybe ETag
      -> Maybe ObjectVersionId
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> PutObjectResponse)
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
  (Maybe ETag
   -> Maybe ObjectVersionId
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Int
   -> PutObjectResponse)
-> Either String (Maybe ETag)
-> Either
     String
     (Maybe ObjectVersionId
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> PutObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe ETag)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"ETag")
            Either
  String
  (Maybe ObjectVersionId
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Int
   -> PutObjectResponse)
-> Either String (Maybe ObjectVersionId)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> PutObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders
-> HeaderName -> Either String (Maybe ObjectVersionId)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-version-id")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Int
   -> PutObjectResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> PutObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-expiration")
            Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Int
   -> PutObjectResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> PutObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( ResponseHeaders
h
                            ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-server-side-encryption-customer-algorithm"
                        )
            Either
  String
  (Maybe Bool
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Int
   -> PutObjectResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> PutObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( ResponseHeaders
h
                            ResponseHeaders -> HeaderName -> Either String (Maybe Bool)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-server-side-encryption-bucket-key-enabled"
                        )
            Either
  String
  (Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Int
   -> PutObjectResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> PutObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( ResponseHeaders
h
                            ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-server-side-encryption-customer-key-MD5"
                        )
            Either
  String
  (Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Int
   -> PutObjectResponse)
-> Either String (Maybe (Sensitive Text))
-> Either
     String
     (Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption -> Int -> PutObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( ResponseHeaders
h
                            ResponseHeaders
-> HeaderName -> Either String (Maybe (Sensitive Text))
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-server-side-encryption-aws-kms-key-id"
                        )
            Either
  String
  (Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption -> Int -> PutObjectResponse)
-> Either String (Maybe (Sensitive Text))
-> Either
     String (Maybe ServerSideEncryption -> Int -> PutObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders
-> HeaderName -> Either String (Maybe (Sensitive Text))
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-server-side-encryption-context")
            Either
  String (Maybe ServerSideEncryption -> Int -> PutObjectResponse)
-> Either String (Maybe ServerSideEncryption)
-> Either String (Int -> PutObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders
-> HeaderName -> Either String (Maybe ServerSideEncryption)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-server-side-encryption")
            Either String (Int -> PutObjectResponse)
-> Either String Int -> Either String PutObjectResponse
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 Core.ToBody PutObject where
  toBody :: PutObject -> RequestBody
toBody PutObject' {Maybe Bool
Maybe Integer
Maybe Text
Maybe (Sensitive Text)
Maybe ISO8601
Maybe ObjectCannedACL
Maybe ObjectLockLegalHoldStatus
Maybe ObjectLockMode
Maybe RequestPayer
Maybe ServerSideEncryption
Maybe StorageClass
HashMap Text Text
RequestBody
ObjectKey
BucketName
body :: RequestBody
key :: ObjectKey
bucket :: BucketName
contentType :: Maybe Text
serverSideEncryption :: Maybe ServerSideEncryption
expectedBucketOwner :: Maybe Text
contentDisposition :: Maybe Text
acl :: Maybe ObjectCannedACL
objectLockLegalHoldStatus :: Maybe ObjectLockLegalHoldStatus
contentLanguage :: Maybe Text
cacheControl :: Maybe Text
sSEKMSEncryptionContext :: Maybe (Sensitive Text)
metadata :: HashMap Text Text
objectLockRetainUntilDate :: Maybe ISO8601
contentMD5 :: Maybe Text
tagging :: Maybe Text
contentEncoding :: Maybe Text
grantFullControl :: Maybe Text
sSEKMSKeyId :: Maybe (Sensitive Text)
sSECustomerKeyMD5 :: Maybe Text
storageClass :: Maybe StorageClass
grantRead :: Maybe Text
websiteRedirectLocation :: Maybe Text
bucketKeyEnabled :: Maybe Bool
grantWriteACP :: Maybe Text
requestPayer :: Maybe RequestPayer
sSECustomerKey :: Maybe (Sensitive Text)
sSECustomerAlgorithm :: Maybe Text
grantReadACP :: Maybe Text
expires :: Maybe ISO8601
objectLockMode :: Maybe ObjectLockMode
contentLength :: Maybe Integer
$sel:body:PutObject' :: PutObject -> RequestBody
$sel:key:PutObject' :: PutObject -> ObjectKey
$sel:bucket:PutObject' :: PutObject -> BucketName
$sel:contentType:PutObject' :: PutObject -> Maybe Text
$sel:serverSideEncryption:PutObject' :: PutObject -> Maybe ServerSideEncryption
$sel:expectedBucketOwner:PutObject' :: PutObject -> Maybe Text
$sel:contentDisposition:PutObject' :: PutObject -> Maybe Text
$sel:acl:PutObject' :: PutObject -> Maybe ObjectCannedACL
$sel:objectLockLegalHoldStatus:PutObject' :: PutObject -> Maybe ObjectLockLegalHoldStatus
$sel:contentLanguage:PutObject' :: PutObject -> Maybe Text
$sel:cacheControl:PutObject' :: PutObject -> Maybe Text
$sel:sSEKMSEncryptionContext:PutObject' :: PutObject -> Maybe (Sensitive Text)
$sel:metadata:PutObject' :: PutObject -> HashMap Text Text
$sel:objectLockRetainUntilDate:PutObject' :: PutObject -> Maybe ISO8601
$sel:contentMD5:PutObject' :: PutObject -> Maybe Text
$sel:tagging:PutObject' :: PutObject -> Maybe Text
$sel:contentEncoding:PutObject' :: PutObject -> Maybe Text
$sel:grantFullControl:PutObject' :: PutObject -> Maybe Text
$sel:sSEKMSKeyId:PutObject' :: PutObject -> Maybe (Sensitive Text)
$sel:sSECustomerKeyMD5:PutObject' :: PutObject -> Maybe Text
$sel:storageClass:PutObject' :: PutObject -> Maybe StorageClass
$sel:grantRead:PutObject' :: PutObject -> Maybe Text
$sel:websiteRedirectLocation:PutObject' :: PutObject -> Maybe Text
$sel:bucketKeyEnabled:PutObject' :: PutObject -> Maybe Bool
$sel:grantWriteACP:PutObject' :: PutObject -> Maybe Text
$sel:requestPayer:PutObject' :: PutObject -> Maybe RequestPayer
$sel:sSECustomerKey:PutObject' :: PutObject -> Maybe (Sensitive Text)
$sel:sSECustomerAlgorithm:PutObject' :: PutObject -> Maybe Text
$sel:grantReadACP:PutObject' :: PutObject -> Maybe Text
$sel:expires:PutObject' :: PutObject -> Maybe ISO8601
$sel:objectLockMode:PutObject' :: PutObject -> Maybe ObjectLockMode
$sel:contentLength:PutObject' :: PutObject -> Maybe Integer
..} = RequestBody -> RequestBody
forall a. ToBody a => a -> RequestBody
Core.toBody RequestBody
body

instance Core.ToHeaders PutObject where
  toHeaders :: PutObject -> ResponseHeaders
toHeaders PutObject' {Maybe Bool
Maybe Integer
Maybe Text
Maybe (Sensitive Text)
Maybe ISO8601
Maybe ObjectCannedACL
Maybe ObjectLockLegalHoldStatus
Maybe ObjectLockMode
Maybe RequestPayer
Maybe ServerSideEncryption
Maybe StorageClass
HashMap Text Text
RequestBody
ObjectKey
BucketName
body :: RequestBody
key :: ObjectKey
bucket :: BucketName
contentType :: Maybe Text
serverSideEncryption :: Maybe ServerSideEncryption
expectedBucketOwner :: Maybe Text
contentDisposition :: Maybe Text
acl :: Maybe ObjectCannedACL
objectLockLegalHoldStatus :: Maybe ObjectLockLegalHoldStatus
contentLanguage :: Maybe Text
cacheControl :: Maybe Text
sSEKMSEncryptionContext :: Maybe (Sensitive Text)
metadata :: HashMap Text Text
objectLockRetainUntilDate :: Maybe ISO8601
contentMD5 :: Maybe Text
tagging :: Maybe Text
contentEncoding :: Maybe Text
grantFullControl :: Maybe Text
sSEKMSKeyId :: Maybe (Sensitive Text)
sSECustomerKeyMD5 :: Maybe Text
storageClass :: Maybe StorageClass
grantRead :: Maybe Text
websiteRedirectLocation :: Maybe Text
bucketKeyEnabled :: Maybe Bool
grantWriteACP :: Maybe Text
requestPayer :: Maybe RequestPayer
sSECustomerKey :: Maybe (Sensitive Text)
sSECustomerAlgorithm :: Maybe Text
grantReadACP :: Maybe Text
expires :: Maybe ISO8601
objectLockMode :: Maybe ObjectLockMode
contentLength :: Maybe Integer
$sel:body:PutObject' :: PutObject -> RequestBody
$sel:key:PutObject' :: PutObject -> ObjectKey
$sel:bucket:PutObject' :: PutObject -> BucketName
$sel:contentType:PutObject' :: PutObject -> Maybe Text
$sel:serverSideEncryption:PutObject' :: PutObject -> Maybe ServerSideEncryption
$sel:expectedBucketOwner:PutObject' :: PutObject -> Maybe Text
$sel:contentDisposition:PutObject' :: PutObject -> Maybe Text
$sel:acl:PutObject' :: PutObject -> Maybe ObjectCannedACL
$sel:objectLockLegalHoldStatus:PutObject' :: PutObject -> Maybe ObjectLockLegalHoldStatus
$sel:contentLanguage:PutObject' :: PutObject -> Maybe Text
$sel:cacheControl:PutObject' :: PutObject -> Maybe Text
$sel:sSEKMSEncryptionContext:PutObject' :: PutObject -> Maybe (Sensitive Text)
$sel:metadata:PutObject' :: PutObject -> HashMap Text Text
$sel:objectLockRetainUntilDate:PutObject' :: PutObject -> Maybe ISO8601
$sel:contentMD5:PutObject' :: PutObject -> Maybe Text
$sel:tagging:PutObject' :: PutObject -> Maybe Text
$sel:contentEncoding:PutObject' :: PutObject -> Maybe Text
$sel:grantFullControl:PutObject' :: PutObject -> Maybe Text
$sel:sSEKMSKeyId:PutObject' :: PutObject -> Maybe (Sensitive Text)
$sel:sSECustomerKeyMD5:PutObject' :: PutObject -> Maybe Text
$sel:storageClass:PutObject' :: PutObject -> Maybe StorageClass
$sel:grantRead:PutObject' :: PutObject -> Maybe Text
$sel:websiteRedirectLocation:PutObject' :: PutObject -> Maybe Text
$sel:bucketKeyEnabled:PutObject' :: PutObject -> Maybe Bool
$sel:grantWriteACP:PutObject' :: PutObject -> Maybe Text
$sel:requestPayer:PutObject' :: PutObject -> Maybe RequestPayer
$sel:sSECustomerKey:PutObject' :: PutObject -> Maybe (Sensitive Text)
$sel:sSECustomerAlgorithm:PutObject' :: PutObject -> Maybe Text
$sel:grantReadACP:PutObject' :: PutObject -> Maybe Text
$sel:expires:PutObject' :: PutObject -> Maybe ISO8601
$sel:objectLockMode:PutObject' :: PutObject -> Maybe ObjectLockMode
$sel:contentLength:PutObject' :: PutObject -> Maybe Integer
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"Content-Length" HeaderName -> Maybe Integer -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Integer
contentLength,
        HeaderName
"x-amz-object-lock-mode" HeaderName -> Maybe ObjectLockMode -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe ObjectLockMode
objectLockMode,
        HeaderName
"Expires" HeaderName -> Maybe ISO8601 -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe ISO8601
expires,
        HeaderName
"x-amz-grant-read-acp" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
grantReadACP,
        HeaderName
"x-amz-server-side-encryption-customer-algorithm"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
sSECustomerAlgorithm,
        HeaderName
"x-amz-server-side-encryption-customer-key"
          HeaderName -> Maybe (Sensitive Text) -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe (Sensitive Text)
sSECustomerKey,
        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-server-side-encryption-bucket-key-enabled"
          HeaderName -> Maybe Bool -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Bool
bucketKeyEnabled,
        HeaderName
"x-amz-website-redirect-location"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
websiteRedirectLocation,
        HeaderName
"x-amz-grant-read" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
grantRead,
        HeaderName
"x-amz-storage-class" HeaderName -> Maybe StorageClass -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe StorageClass
storageClass,
        HeaderName
"x-amz-server-side-encryption-customer-key-MD5"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
sSECustomerKeyMD5,
        HeaderName
"x-amz-server-side-encryption-aws-kms-key-id"
          HeaderName -> Maybe (Sensitive Text) -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe (Sensitive Text)
sSEKMSKeyId,
        HeaderName
"x-amz-grant-full-control" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
grantFullControl,
        HeaderName
"Content-Encoding" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
contentEncoding,
        HeaderName
"x-amz-tagging" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
tagging,
        HeaderName
"Content-MD5" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
contentMD5,
        HeaderName
"x-amz-object-lock-retain-until-date"
          HeaderName -> Maybe ISO8601 -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe ISO8601
objectLockRetainUntilDate,
        HeaderName
"x-amz-meta-" HeaderName -> HashMap Text Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# HashMap Text Text
metadata,
        HeaderName
"x-amz-server-side-encryption-context"
          HeaderName -> Maybe (Sensitive Text) -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe (Sensitive Text)
sSEKMSEncryptionContext,
        HeaderName
"Cache-Control" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
cacheControl,
        HeaderName
"Content-Language" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
contentLanguage,
        HeaderName
"x-amz-object-lock-legal-hold"
          HeaderName -> Maybe ObjectLockLegalHoldStatus -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe ObjectLockLegalHoldStatus
objectLockLegalHoldStatus,
        HeaderName
"x-amz-acl" HeaderName -> Maybe ObjectCannedACL -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe ObjectCannedACL
acl,
        HeaderName
"Content-Disposition" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
contentDisposition,
        HeaderName
"x-amz-expected-bucket-owner"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
expectedBucketOwner,
        HeaderName
"x-amz-server-side-encryption"
          HeaderName -> Maybe ServerSideEncryption -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe ServerSideEncryption
serverSideEncryption,
        HeaderName
"Content-Type" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
contentType
      ]

instance Core.ToPath PutObject where
  toPath :: PutObject -> ByteString
toPath PutObject' {Maybe Bool
Maybe Integer
Maybe Text
Maybe (Sensitive Text)
Maybe ISO8601
Maybe ObjectCannedACL
Maybe ObjectLockLegalHoldStatus
Maybe ObjectLockMode
Maybe RequestPayer
Maybe ServerSideEncryption
Maybe StorageClass
HashMap Text Text
RequestBody
ObjectKey
BucketName
body :: RequestBody
key :: ObjectKey
bucket :: BucketName
contentType :: Maybe Text
serverSideEncryption :: Maybe ServerSideEncryption
expectedBucketOwner :: Maybe Text
contentDisposition :: Maybe Text
acl :: Maybe ObjectCannedACL
objectLockLegalHoldStatus :: Maybe ObjectLockLegalHoldStatus
contentLanguage :: Maybe Text
cacheControl :: Maybe Text
sSEKMSEncryptionContext :: Maybe (Sensitive Text)
metadata :: HashMap Text Text
objectLockRetainUntilDate :: Maybe ISO8601
contentMD5 :: Maybe Text
tagging :: Maybe Text
contentEncoding :: Maybe Text
grantFullControl :: Maybe Text
sSEKMSKeyId :: Maybe (Sensitive Text)
sSECustomerKeyMD5 :: Maybe Text
storageClass :: Maybe StorageClass
grantRead :: Maybe Text
websiteRedirectLocation :: Maybe Text
bucketKeyEnabled :: Maybe Bool
grantWriteACP :: Maybe Text
requestPayer :: Maybe RequestPayer
sSECustomerKey :: Maybe (Sensitive Text)
sSECustomerAlgorithm :: Maybe Text
grantReadACP :: Maybe Text
expires :: Maybe ISO8601
objectLockMode :: Maybe ObjectLockMode
contentLength :: Maybe Integer
$sel:body:PutObject' :: PutObject -> RequestBody
$sel:key:PutObject' :: PutObject -> ObjectKey
$sel:bucket:PutObject' :: PutObject -> BucketName
$sel:contentType:PutObject' :: PutObject -> Maybe Text
$sel:serverSideEncryption:PutObject' :: PutObject -> Maybe ServerSideEncryption
$sel:expectedBucketOwner:PutObject' :: PutObject -> Maybe Text
$sel:contentDisposition:PutObject' :: PutObject -> Maybe Text
$sel:acl:PutObject' :: PutObject -> Maybe ObjectCannedACL
$sel:objectLockLegalHoldStatus:PutObject' :: PutObject -> Maybe ObjectLockLegalHoldStatus
$sel:contentLanguage:PutObject' :: PutObject -> Maybe Text
$sel:cacheControl:PutObject' :: PutObject -> Maybe Text
$sel:sSEKMSEncryptionContext:PutObject' :: PutObject -> Maybe (Sensitive Text)
$sel:metadata:PutObject' :: PutObject -> HashMap Text Text
$sel:objectLockRetainUntilDate:PutObject' :: PutObject -> Maybe ISO8601
$sel:contentMD5:PutObject' :: PutObject -> Maybe Text
$sel:tagging:PutObject' :: PutObject -> Maybe Text
$sel:contentEncoding:PutObject' :: PutObject -> Maybe Text
$sel:grantFullControl:PutObject' :: PutObject -> Maybe Text
$sel:sSEKMSKeyId:PutObject' :: PutObject -> Maybe (Sensitive Text)
$sel:sSECustomerKeyMD5:PutObject' :: PutObject -> Maybe Text
$sel:storageClass:PutObject' :: PutObject -> Maybe StorageClass
$sel:grantRead:PutObject' :: PutObject -> Maybe Text
$sel:websiteRedirectLocation:PutObject' :: PutObject -> Maybe Text
$sel:bucketKeyEnabled:PutObject' :: PutObject -> Maybe Bool
$sel:grantWriteACP:PutObject' :: PutObject -> Maybe Text
$sel:requestPayer:PutObject' :: PutObject -> Maybe RequestPayer
$sel:sSECustomerKey:PutObject' :: PutObject -> Maybe (Sensitive Text)
$sel:sSECustomerAlgorithm:PutObject' :: PutObject -> Maybe Text
$sel:grantReadACP:PutObject' :: PutObject -> Maybe Text
$sel:expires:PutObject' :: PutObject -> Maybe ISO8601
$sel:objectLockMode:PutObject' :: PutObject -> Maybe ObjectLockMode
$sel:contentLength:PutObject' :: PutObject -> Maybe Integer
..} =
    [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 PutObject where
  toQuery :: PutObject -> QueryString
toQuery = QueryString -> PutObject -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newPutObjectResponse' smart constructor.
data PutObjectResponse = PutObjectResponse'
  { PutObjectResponse -> Maybe RequestCharged
requestCharged :: Prelude.Maybe RequestCharged,
    -- | Entity tag for the uploaded object.
    PutObjectResponse -> Maybe ETag
eTag :: Prelude.Maybe ETag,
    -- | Version of the object.
    PutObjectResponse -> Maybe ObjectVersionId
versionId :: Prelude.Maybe ObjectVersionId,
    -- | If the expiration is configured for the object (see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html PutBucketLifecycleConfiguration>),
    -- the response includes this header. It includes the expiry-date and
    -- rule-id key-value pairs that provide information about object
    -- expiration. The value of the rule-id is URL encoded.
    PutObjectResponse -> Maybe Text
expiration :: Prelude.Maybe Prelude.Text,
    -- | If server-side encryption with a customer-provided encryption key was
    -- requested, the response will include this header confirming the
    -- encryption algorithm used.
    PutObjectResponse -> Maybe Text
sSECustomerAlgorithm :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the uploaded object uses an S3 Bucket Key for
    -- server-side encryption with Amazon Web Services KMS (SSE-KMS).
    PutObjectResponse -> Maybe Bool
bucketKeyEnabled :: Prelude.Maybe Prelude.Bool,
    -- | If server-side encryption with a customer-provided encryption key was
    -- requested, the response will include this header to provide round-trip
    -- message integrity verification of the customer-provided encryption key.
    PutObjectResponse -> Maybe Text
sSECustomerKeyMD5 :: Prelude.Maybe Prelude.Text,
    -- | If @x-amz-server-side-encryption@ is present and has the value of
    -- @aws:kms@, this header specifies the ID of the Amazon Web Services Key
    -- Management Service (Amazon Web Services KMS) symmetric customer managed
    -- key that was used for the object.
    PutObjectResponse -> Maybe (Sensitive Text)
sSEKMSKeyId :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | If present, specifies the Amazon Web Services KMS Encryption Context to
    -- use for object encryption. The value of this header is a base64-encoded
    -- UTF-8 string holding JSON with the encryption context key-value pairs.
    PutObjectResponse -> Maybe (Sensitive Text)
sSEKMSEncryptionContext :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | If you specified server-side encryption either with an Amazon Web
    -- Services KMS key or Amazon S3-managed encryption key in your PUT
    -- request, the response includes this header. It confirms the encryption
    -- algorithm that Amazon S3 used to encrypt the object.
    PutObjectResponse -> Maybe ServerSideEncryption
serverSideEncryption :: Prelude.Maybe ServerSideEncryption,
    -- | The response's http status code.
    PutObjectResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (PutObjectResponse -> PutObjectResponse -> Bool
(PutObjectResponse -> PutObjectResponse -> Bool)
-> (PutObjectResponse -> PutObjectResponse -> Bool)
-> Eq PutObjectResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutObjectResponse -> PutObjectResponse -> Bool
$c/= :: PutObjectResponse -> PutObjectResponse -> Bool
== :: PutObjectResponse -> PutObjectResponse -> Bool
$c== :: PutObjectResponse -> PutObjectResponse -> Bool
Prelude.Eq, Int -> PutObjectResponse -> ShowS
[PutObjectResponse] -> ShowS
PutObjectResponse -> String
(Int -> PutObjectResponse -> ShowS)
-> (PutObjectResponse -> String)
-> ([PutObjectResponse] -> ShowS)
-> Show PutObjectResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutObjectResponse] -> ShowS
$cshowList :: [PutObjectResponse] -> ShowS
show :: PutObjectResponse -> String
$cshow :: PutObjectResponse -> String
showsPrec :: Int -> PutObjectResponse -> ShowS
$cshowsPrec :: Int -> PutObjectResponse -> ShowS
Prelude.Show, (forall x. PutObjectResponse -> Rep PutObjectResponse x)
-> (forall x. Rep PutObjectResponse x -> PutObjectResponse)
-> Generic PutObjectResponse
forall x. Rep PutObjectResponse x -> PutObjectResponse
forall x. PutObjectResponse -> Rep PutObjectResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutObjectResponse x -> PutObjectResponse
$cfrom :: forall x. PutObjectResponse -> Rep PutObjectResponse x
Prelude.Generic)

-- |
-- Create a value of 'PutObjectResponse' 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', 'putObjectResponse_requestCharged' - Undocumented member.
--
-- 'eTag', 'putObjectResponse_eTag' - Entity tag for the uploaded object.
--
-- 'versionId', 'putObjectResponse_versionId' - Version of the object.
--
-- 'expiration', 'putObjectResponse_expiration' - If the expiration is configured for the object (see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html PutBucketLifecycleConfiguration>),
-- the response includes this header. It includes the expiry-date and
-- rule-id key-value pairs that provide information about object
-- expiration. The value of the rule-id is URL encoded.
--
-- 'sSECustomerAlgorithm', 'putObjectResponse_sSECustomerAlgorithm' - If server-side encryption with a customer-provided encryption key was
-- requested, the response will include this header confirming the
-- encryption algorithm used.
--
-- 'bucketKeyEnabled', 'putObjectResponse_bucketKeyEnabled' - Indicates whether the uploaded object uses an S3 Bucket Key for
-- server-side encryption with Amazon Web Services KMS (SSE-KMS).
--
-- 'sSECustomerKeyMD5', 'putObjectResponse_sSECustomerKeyMD5' - If server-side encryption with a customer-provided encryption key was
-- requested, the response will include this header to provide round-trip
-- message integrity verification of the customer-provided encryption key.
--
-- 'sSEKMSKeyId', 'putObjectResponse_sSEKMSKeyId' - If @x-amz-server-side-encryption@ is present and has the value of
-- @aws:kms@, this header specifies the ID of the Amazon Web Services Key
-- Management Service (Amazon Web Services KMS) symmetric customer managed
-- key that was used for the object.
--
-- 'sSEKMSEncryptionContext', 'putObjectResponse_sSEKMSEncryptionContext' - If present, specifies the Amazon Web Services KMS Encryption Context to
-- use for object encryption. The value of this header is a base64-encoded
-- UTF-8 string holding JSON with the encryption context key-value pairs.
--
-- 'serverSideEncryption', 'putObjectResponse_serverSideEncryption' - If you specified server-side encryption either with an Amazon Web
-- Services KMS key or Amazon S3-managed encryption key in your PUT
-- request, the response includes this header. It confirms the encryption
-- algorithm that Amazon S3 used to encrypt the object.
--
-- 'httpStatus', 'putObjectResponse_httpStatus' - The response's http status code.
newPutObjectResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  PutObjectResponse
newPutObjectResponse :: Int -> PutObjectResponse
newPutObjectResponse Int
pHttpStatus_ =
  PutObjectResponse' :: Maybe RequestCharged
-> Maybe ETag
-> Maybe ObjectVersionId
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe ServerSideEncryption
-> Int
-> PutObjectResponse
PutObjectResponse'
    { $sel:requestCharged:PutObjectResponse' :: Maybe RequestCharged
requestCharged =
        Maybe RequestCharged
forall a. Maybe a
Prelude.Nothing,
      $sel:eTag:PutObjectResponse' :: Maybe ETag
eTag = Maybe ETag
forall a. Maybe a
Prelude.Nothing,
      $sel:versionId:PutObjectResponse' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
forall a. Maybe a
Prelude.Nothing,
      $sel:expiration:PutObjectResponse' :: Maybe Text
expiration = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sSECustomerAlgorithm:PutObjectResponse' :: Maybe Text
sSECustomerAlgorithm = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketKeyEnabled:PutObjectResponse' :: Maybe Bool
bucketKeyEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:sSECustomerKeyMD5:PutObjectResponse' :: Maybe Text
sSECustomerKeyMD5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sSEKMSKeyId:PutObjectResponse' :: Maybe (Sensitive Text)
sSEKMSKeyId = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:sSEKMSEncryptionContext:PutObjectResponse' :: Maybe (Sensitive Text)
sSEKMSEncryptionContext = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:serverSideEncryption:PutObjectResponse' :: Maybe ServerSideEncryption
serverSideEncryption = Maybe ServerSideEncryption
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:PutObjectResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
putObjectResponse_requestCharged :: Lens.Lens' PutObjectResponse (Prelude.Maybe RequestCharged)
putObjectResponse_requestCharged :: (Maybe RequestCharged -> f (Maybe RequestCharged))
-> PutObjectResponse -> f PutObjectResponse
putObjectResponse_requestCharged = (PutObjectResponse -> Maybe RequestCharged)
-> (PutObjectResponse -> Maybe RequestCharged -> PutObjectResponse)
-> Lens
     PutObjectResponse
     PutObjectResponse
     (Maybe RequestCharged)
     (Maybe RequestCharged)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectResponse' {Maybe RequestCharged
requestCharged :: Maybe RequestCharged
$sel:requestCharged:PutObjectResponse' :: PutObjectResponse -> Maybe RequestCharged
requestCharged} -> Maybe RequestCharged
requestCharged) (\s :: PutObjectResponse
s@PutObjectResponse' {} Maybe RequestCharged
a -> PutObjectResponse
s {$sel:requestCharged:PutObjectResponse' :: Maybe RequestCharged
requestCharged = Maybe RequestCharged
a} :: PutObjectResponse)

-- | Entity tag for the uploaded object.
putObjectResponse_eTag :: Lens.Lens' PutObjectResponse (Prelude.Maybe ETag)
putObjectResponse_eTag :: (Maybe ETag -> f (Maybe ETag))
-> PutObjectResponse -> f PutObjectResponse
putObjectResponse_eTag = (PutObjectResponse -> Maybe ETag)
-> (PutObjectResponse -> Maybe ETag -> PutObjectResponse)
-> Lens
     PutObjectResponse PutObjectResponse (Maybe ETag) (Maybe ETag)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectResponse' {Maybe ETag
eTag :: Maybe ETag
$sel:eTag:PutObjectResponse' :: PutObjectResponse -> Maybe ETag
eTag} -> Maybe ETag
eTag) (\s :: PutObjectResponse
s@PutObjectResponse' {} Maybe ETag
a -> PutObjectResponse
s {$sel:eTag:PutObjectResponse' :: Maybe ETag
eTag = Maybe ETag
a} :: PutObjectResponse)

-- | Version of the object.
putObjectResponse_versionId :: Lens.Lens' PutObjectResponse (Prelude.Maybe ObjectVersionId)
putObjectResponse_versionId :: (Maybe ObjectVersionId -> f (Maybe ObjectVersionId))
-> PutObjectResponse -> f PutObjectResponse
putObjectResponse_versionId = (PutObjectResponse -> Maybe ObjectVersionId)
-> (PutObjectResponse
    -> Maybe ObjectVersionId -> PutObjectResponse)
-> Lens
     PutObjectResponse
     PutObjectResponse
     (Maybe ObjectVersionId)
     (Maybe ObjectVersionId)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectResponse' {Maybe ObjectVersionId
versionId :: Maybe ObjectVersionId
$sel:versionId:PutObjectResponse' :: PutObjectResponse -> Maybe ObjectVersionId
versionId} -> Maybe ObjectVersionId
versionId) (\s :: PutObjectResponse
s@PutObjectResponse' {} Maybe ObjectVersionId
a -> PutObjectResponse
s {$sel:versionId:PutObjectResponse' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
a} :: PutObjectResponse)

-- | If the expiration is configured for the object (see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html PutBucketLifecycleConfiguration>),
-- the response includes this header. It includes the expiry-date and
-- rule-id key-value pairs that provide information about object
-- expiration. The value of the rule-id is URL encoded.
putObjectResponse_expiration :: Lens.Lens' PutObjectResponse (Prelude.Maybe Prelude.Text)
putObjectResponse_expiration :: (Maybe Text -> f (Maybe Text))
-> PutObjectResponse -> f PutObjectResponse
putObjectResponse_expiration = (PutObjectResponse -> Maybe Text)
-> (PutObjectResponse -> Maybe Text -> PutObjectResponse)
-> Lens
     PutObjectResponse PutObjectResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectResponse' {Maybe Text
expiration :: Maybe Text
$sel:expiration:PutObjectResponse' :: PutObjectResponse -> Maybe Text
expiration} -> Maybe Text
expiration) (\s :: PutObjectResponse
s@PutObjectResponse' {} Maybe Text
a -> PutObjectResponse
s {$sel:expiration:PutObjectResponse' :: Maybe Text
expiration = Maybe Text
a} :: PutObjectResponse)

-- | If server-side encryption with a customer-provided encryption key was
-- requested, the response will include this header confirming the
-- encryption algorithm used.
putObjectResponse_sSECustomerAlgorithm :: Lens.Lens' PutObjectResponse (Prelude.Maybe Prelude.Text)
putObjectResponse_sSECustomerAlgorithm :: (Maybe Text -> f (Maybe Text))
-> PutObjectResponse -> f PutObjectResponse
putObjectResponse_sSECustomerAlgorithm = (PutObjectResponse -> Maybe Text)
-> (PutObjectResponse -> Maybe Text -> PutObjectResponse)
-> Lens
     PutObjectResponse PutObjectResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectResponse' {Maybe Text
sSECustomerAlgorithm :: Maybe Text
$sel:sSECustomerAlgorithm:PutObjectResponse' :: PutObjectResponse -> Maybe Text
sSECustomerAlgorithm} -> Maybe Text
sSECustomerAlgorithm) (\s :: PutObjectResponse
s@PutObjectResponse' {} Maybe Text
a -> PutObjectResponse
s {$sel:sSECustomerAlgorithm:PutObjectResponse' :: Maybe Text
sSECustomerAlgorithm = Maybe Text
a} :: PutObjectResponse)

-- | Indicates whether the uploaded object uses an S3 Bucket Key for
-- server-side encryption with Amazon Web Services KMS (SSE-KMS).
putObjectResponse_bucketKeyEnabled :: Lens.Lens' PutObjectResponse (Prelude.Maybe Prelude.Bool)
putObjectResponse_bucketKeyEnabled :: (Maybe Bool -> f (Maybe Bool))
-> PutObjectResponse -> f PutObjectResponse
putObjectResponse_bucketKeyEnabled = (PutObjectResponse -> Maybe Bool)
-> (PutObjectResponse -> Maybe Bool -> PutObjectResponse)
-> Lens
     PutObjectResponse PutObjectResponse (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectResponse' {Maybe Bool
bucketKeyEnabled :: Maybe Bool
$sel:bucketKeyEnabled:PutObjectResponse' :: PutObjectResponse -> Maybe Bool
bucketKeyEnabled} -> Maybe Bool
bucketKeyEnabled) (\s :: PutObjectResponse
s@PutObjectResponse' {} Maybe Bool
a -> PutObjectResponse
s {$sel:bucketKeyEnabled:PutObjectResponse' :: Maybe Bool
bucketKeyEnabled = Maybe Bool
a} :: PutObjectResponse)

-- | If server-side encryption with a customer-provided encryption key was
-- requested, the response will include this header to provide round-trip
-- message integrity verification of the customer-provided encryption key.
putObjectResponse_sSECustomerKeyMD5 :: Lens.Lens' PutObjectResponse (Prelude.Maybe Prelude.Text)
putObjectResponse_sSECustomerKeyMD5 :: (Maybe Text -> f (Maybe Text))
-> PutObjectResponse -> f PutObjectResponse
putObjectResponse_sSECustomerKeyMD5 = (PutObjectResponse -> Maybe Text)
-> (PutObjectResponse -> Maybe Text -> PutObjectResponse)
-> Lens
     PutObjectResponse PutObjectResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectResponse' {Maybe Text
sSECustomerKeyMD5 :: Maybe Text
$sel:sSECustomerKeyMD5:PutObjectResponse' :: PutObjectResponse -> Maybe Text
sSECustomerKeyMD5} -> Maybe Text
sSECustomerKeyMD5) (\s :: PutObjectResponse
s@PutObjectResponse' {} Maybe Text
a -> PutObjectResponse
s {$sel:sSECustomerKeyMD5:PutObjectResponse' :: Maybe Text
sSECustomerKeyMD5 = Maybe Text
a} :: PutObjectResponse)

-- | If @x-amz-server-side-encryption@ is present and has the value of
-- @aws:kms@, this header specifies the ID of the Amazon Web Services Key
-- Management Service (Amazon Web Services KMS) symmetric customer managed
-- key that was used for the object.
putObjectResponse_sSEKMSKeyId :: Lens.Lens' PutObjectResponse (Prelude.Maybe Prelude.Text)
putObjectResponse_sSEKMSKeyId :: (Maybe Text -> f (Maybe Text))
-> PutObjectResponse -> f PutObjectResponse
putObjectResponse_sSEKMSKeyId = (PutObjectResponse -> Maybe (Sensitive Text))
-> (PutObjectResponse
    -> Maybe (Sensitive Text) -> PutObjectResponse)
-> Lens
     PutObjectResponse
     PutObjectResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectResponse' {Maybe (Sensitive Text)
sSEKMSKeyId :: Maybe (Sensitive Text)
$sel:sSEKMSKeyId:PutObjectResponse' :: PutObjectResponse -> Maybe (Sensitive Text)
sSEKMSKeyId} -> Maybe (Sensitive Text)
sSEKMSKeyId) (\s :: PutObjectResponse
s@PutObjectResponse' {} Maybe (Sensitive Text)
a -> PutObjectResponse
s {$sel:sSEKMSKeyId:PutObjectResponse' :: Maybe (Sensitive Text)
sSEKMSKeyId = Maybe (Sensitive Text)
a} :: PutObjectResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> PutObjectResponse -> f PutObjectResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> PutObjectResponse
-> f PutObjectResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | If present, specifies the Amazon Web Services KMS Encryption Context to
-- use for object encryption. The value of this header is a base64-encoded
-- UTF-8 string holding JSON with the encryption context key-value pairs.
putObjectResponse_sSEKMSEncryptionContext :: Lens.Lens' PutObjectResponse (Prelude.Maybe Prelude.Text)
putObjectResponse_sSEKMSEncryptionContext :: (Maybe Text -> f (Maybe Text))
-> PutObjectResponse -> f PutObjectResponse
putObjectResponse_sSEKMSEncryptionContext = (PutObjectResponse -> Maybe (Sensitive Text))
-> (PutObjectResponse
    -> Maybe (Sensitive Text) -> PutObjectResponse)
-> Lens
     PutObjectResponse
     PutObjectResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectResponse' {Maybe (Sensitive Text)
sSEKMSEncryptionContext :: Maybe (Sensitive Text)
$sel:sSEKMSEncryptionContext:PutObjectResponse' :: PutObjectResponse -> Maybe (Sensitive Text)
sSEKMSEncryptionContext} -> Maybe (Sensitive Text)
sSEKMSEncryptionContext) (\s :: PutObjectResponse
s@PutObjectResponse' {} Maybe (Sensitive Text)
a -> PutObjectResponse
s {$sel:sSEKMSEncryptionContext:PutObjectResponse' :: Maybe (Sensitive Text)
sSEKMSEncryptionContext = Maybe (Sensitive Text)
a} :: PutObjectResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> PutObjectResponse -> f PutObjectResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> PutObjectResponse
-> f PutObjectResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | If you specified server-side encryption either with an Amazon Web
-- Services KMS key or Amazon S3-managed encryption key in your PUT
-- request, the response includes this header. It confirms the encryption
-- algorithm that Amazon S3 used to encrypt the object.
putObjectResponse_serverSideEncryption :: Lens.Lens' PutObjectResponse (Prelude.Maybe ServerSideEncryption)
putObjectResponse_serverSideEncryption :: (Maybe ServerSideEncryption -> f (Maybe ServerSideEncryption))
-> PutObjectResponse -> f PutObjectResponse
putObjectResponse_serverSideEncryption = (PutObjectResponse -> Maybe ServerSideEncryption)
-> (PutObjectResponse
    -> Maybe ServerSideEncryption -> PutObjectResponse)
-> Lens
     PutObjectResponse
     PutObjectResponse
     (Maybe ServerSideEncryption)
     (Maybe ServerSideEncryption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectResponse' {Maybe ServerSideEncryption
serverSideEncryption :: Maybe ServerSideEncryption
$sel:serverSideEncryption:PutObjectResponse' :: PutObjectResponse -> Maybe ServerSideEncryption
serverSideEncryption} -> Maybe ServerSideEncryption
serverSideEncryption) (\s :: PutObjectResponse
s@PutObjectResponse' {} Maybe ServerSideEncryption
a -> PutObjectResponse
s {$sel:serverSideEncryption:PutObjectResponse' :: Maybe ServerSideEncryption
serverSideEncryption = Maybe ServerSideEncryption
a} :: PutObjectResponse)

-- | The response's http status code.
putObjectResponse_httpStatus :: Lens.Lens' PutObjectResponse Prelude.Int
putObjectResponse_httpStatus :: (Int -> f Int) -> PutObjectResponse -> f PutObjectResponse
putObjectResponse_httpStatus = (PutObjectResponse -> Int)
-> (PutObjectResponse -> Int -> PutObjectResponse)
-> Lens PutObjectResponse PutObjectResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutObjectResponse' :: PutObjectResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutObjectResponse
s@PutObjectResponse' {} Int
a -> PutObjectResponse
s {$sel:httpStatus:PutObjectResponse' :: Int
httpStatus = Int
a} :: PutObjectResponse)

instance Prelude.NFData PutObjectResponse