{-# 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.Glacier.InitiateMultipartUpload
-- 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)
--
-- This operation initiates a multipart upload. Amazon S3 Glacier creates a
-- multipart upload resource and returns its ID in the response. The
-- multipart upload ID is used in subsequent requests to upload parts of an
-- archive (see UploadMultipartPart).
--
-- When you initiate a multipart upload, you specify the part size in
-- number of bytes. The part size must be a megabyte (1024 KB) multiplied
-- by a power of 2-for example, 1048576 (1 MB), 2097152 (2 MB), 4194304 (4
-- MB), 8388608 (8 MB), and so on. The minimum allowable part size is 1 MB,
-- and the maximum is 4 GB.
--
-- Every part you upload to this resource (see UploadMultipartPart), except
-- the last one, must have the same size. The last one can be the same size
-- or smaller. For example, suppose you want to upload a 16.2 MB file. If
-- you initiate the multipart upload with a part size of 4 MB, you will
-- upload four parts of 4 MB each and one part of 0.2 MB.
--
-- You don\'t need to know the size of the archive when you start a
-- multipart upload because Amazon S3 Glacier does not require you to
-- specify the overall archive size.
--
-- After you complete the multipart upload, Amazon S3 Glacier (Glacier)
-- removes the multipart upload resource referenced by the ID. Glacier also
-- removes the multipart upload resource if you cancel the multipart upload
-- or it may be removed if there is no activity for a period of 24 hours.
--
-- An AWS account has full permission to perform all operations (actions).
-- However, AWS Identity and Access Management (IAM) users don\'t have any
-- permissions by default. You must grant them explicit permission to
-- perform specific actions. For more information, see
-- <https://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identity and Access Management (IAM)>.
--
-- For conceptual information and underlying REST API, see
-- <https://docs.aws.amazon.com/amazonglacier/latest/dev/uploading-archive-mpu.html Uploading Large Archives in Parts (Multipart Upload)>
-- and
-- <https://docs.aws.amazon.com/amazonglacier/latest/dev/api-multipart-initiate-upload.html Initiate Multipart Upload>
-- in the /Amazon Glacier Developer Guide/.
module Amazonka.Glacier.InitiateMultipartUpload
  ( -- * Creating a Request
    InitiateMultipartUpload (..),
    newInitiateMultipartUpload,

    -- * Request Lenses
    initiateMultipartUpload_archiveDescription,
    initiateMultipartUpload_accountId,
    initiateMultipartUpload_vaultName,
    initiateMultipartUpload_partSize,

    -- * Destructuring the Response
    InitiateMultipartUploadResponse (..),
    newInitiateMultipartUploadResponse,

    -- * Response Lenses
    initiateMultipartUploadResponse_location,
    initiateMultipartUploadResponse_uploadId,
    initiateMultipartUploadResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Glacier.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Provides options for initiating a multipart upload to an Amazon S3
-- Glacier vault.
--
-- /See:/ 'newInitiateMultipartUpload' smart constructor.
data InitiateMultipartUpload = InitiateMultipartUpload'
  { -- | The archive description that you are uploading in parts.
    --
    -- The part size must be a megabyte (1024 KB) multiplied by a power of 2,
    -- for example 1048576 (1 MB), 2097152 (2 MB), 4194304 (4 MB), 8388608 (8
    -- MB), and so on. The minimum allowable part size is 1 MB, and the maximum
    -- is 4 GB (4096 MB).
    InitiateMultipartUpload -> Maybe Text
archiveDescription :: Prelude.Maybe Prelude.Text,
    -- | The @AccountId@ value is the AWS account ID of the account that owns the
    -- vault. You can either specify an AWS account ID or optionally a single
    -- \'@-@\' (hyphen), in which case Amazon S3 Glacier uses the AWS account
    -- ID associated with the credentials used to sign the request. If you use
    -- an account ID, do not include any hyphens (\'-\') in the ID.
    InitiateMultipartUpload -> Text
accountId :: Prelude.Text,
    -- | The name of the vault.
    InitiateMultipartUpload -> Text
vaultName :: Prelude.Text,
    -- | The size of each part except the last, in bytes. The last part can be
    -- smaller than this part size.
    InitiateMultipartUpload -> Text
partSize :: Prelude.Text
  }
  deriving (InitiateMultipartUpload -> InitiateMultipartUpload -> Bool
(InitiateMultipartUpload -> InitiateMultipartUpload -> Bool)
-> (InitiateMultipartUpload -> InitiateMultipartUpload -> Bool)
-> Eq InitiateMultipartUpload
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InitiateMultipartUpload -> InitiateMultipartUpload -> Bool
$c/= :: InitiateMultipartUpload -> InitiateMultipartUpload -> Bool
== :: InitiateMultipartUpload -> InitiateMultipartUpload -> Bool
$c== :: InitiateMultipartUpload -> InitiateMultipartUpload -> Bool
Prelude.Eq, ReadPrec [InitiateMultipartUpload]
ReadPrec InitiateMultipartUpload
Int -> ReadS InitiateMultipartUpload
ReadS [InitiateMultipartUpload]
(Int -> ReadS InitiateMultipartUpload)
-> ReadS [InitiateMultipartUpload]
-> ReadPrec InitiateMultipartUpload
-> ReadPrec [InitiateMultipartUpload]
-> Read InitiateMultipartUpload
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InitiateMultipartUpload]
$creadListPrec :: ReadPrec [InitiateMultipartUpload]
readPrec :: ReadPrec InitiateMultipartUpload
$creadPrec :: ReadPrec InitiateMultipartUpload
readList :: ReadS [InitiateMultipartUpload]
$creadList :: ReadS [InitiateMultipartUpload]
readsPrec :: Int -> ReadS InitiateMultipartUpload
$creadsPrec :: Int -> ReadS InitiateMultipartUpload
Prelude.Read, Int -> InitiateMultipartUpload -> ShowS
[InitiateMultipartUpload] -> ShowS
InitiateMultipartUpload -> String
(Int -> InitiateMultipartUpload -> ShowS)
-> (InitiateMultipartUpload -> String)
-> ([InitiateMultipartUpload] -> ShowS)
-> Show InitiateMultipartUpload
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InitiateMultipartUpload] -> ShowS
$cshowList :: [InitiateMultipartUpload] -> ShowS
show :: InitiateMultipartUpload -> String
$cshow :: InitiateMultipartUpload -> String
showsPrec :: Int -> InitiateMultipartUpload -> ShowS
$cshowsPrec :: Int -> InitiateMultipartUpload -> ShowS
Prelude.Show, (forall x.
 InitiateMultipartUpload -> Rep InitiateMultipartUpload x)
-> (forall x.
    Rep InitiateMultipartUpload x -> InitiateMultipartUpload)
-> Generic InitiateMultipartUpload
forall x. Rep InitiateMultipartUpload x -> InitiateMultipartUpload
forall x. InitiateMultipartUpload -> Rep InitiateMultipartUpload x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InitiateMultipartUpload x -> InitiateMultipartUpload
$cfrom :: forall x. InitiateMultipartUpload -> Rep InitiateMultipartUpload x
Prelude.Generic)

-- |
-- Create a value of 'InitiateMultipartUpload' 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:
--
-- 'archiveDescription', 'initiateMultipartUpload_archiveDescription' - The archive description that you are uploading in parts.
--
-- The part size must be a megabyte (1024 KB) multiplied by a power of 2,
-- for example 1048576 (1 MB), 2097152 (2 MB), 4194304 (4 MB), 8388608 (8
-- MB), and so on. The minimum allowable part size is 1 MB, and the maximum
-- is 4 GB (4096 MB).
--
-- 'accountId', 'initiateMultipartUpload_accountId' - The @AccountId@ value is the AWS account ID of the account that owns the
-- vault. You can either specify an AWS account ID or optionally a single
-- \'@-@\' (hyphen), in which case Amazon S3 Glacier uses the AWS account
-- ID associated with the credentials used to sign the request. If you use
-- an account ID, do not include any hyphens (\'-\') in the ID.
--
-- 'vaultName', 'initiateMultipartUpload_vaultName' - The name of the vault.
--
-- 'partSize', 'initiateMultipartUpload_partSize' - The size of each part except the last, in bytes. The last part can be
-- smaller than this part size.
newInitiateMultipartUpload ::
  -- | 'accountId'
  Prelude.Text ->
  -- | 'vaultName'
  Prelude.Text ->
  -- | 'partSize'
  Prelude.Text ->
  InitiateMultipartUpload
newInitiateMultipartUpload :: Text -> Text -> Text -> InitiateMultipartUpload
newInitiateMultipartUpload
  Text
pAccountId_
  Text
pVaultName_
  Text
pPartSize_ =
    InitiateMultipartUpload' :: Maybe Text -> Text -> Text -> Text -> InitiateMultipartUpload
InitiateMultipartUpload'
      { $sel:archiveDescription:InitiateMultipartUpload' :: Maybe Text
archiveDescription =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:accountId:InitiateMultipartUpload' :: Text
accountId = Text
pAccountId_,
        $sel:vaultName:InitiateMultipartUpload' :: Text
vaultName = Text
pVaultName_,
        $sel:partSize:InitiateMultipartUpload' :: Text
partSize = Text
pPartSize_
      }

-- | The archive description that you are uploading in parts.
--
-- The part size must be a megabyte (1024 KB) multiplied by a power of 2,
-- for example 1048576 (1 MB), 2097152 (2 MB), 4194304 (4 MB), 8388608 (8
-- MB), and so on. The minimum allowable part size is 1 MB, and the maximum
-- is 4 GB (4096 MB).
initiateMultipartUpload_archiveDescription :: Lens.Lens' InitiateMultipartUpload (Prelude.Maybe Prelude.Text)
initiateMultipartUpload_archiveDescription :: (Maybe Text -> f (Maybe Text))
-> InitiateMultipartUpload -> f InitiateMultipartUpload
initiateMultipartUpload_archiveDescription = (InitiateMultipartUpload -> Maybe Text)
-> (InitiateMultipartUpload
    -> Maybe Text -> InitiateMultipartUpload)
-> Lens
     InitiateMultipartUpload
     InitiateMultipartUpload
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InitiateMultipartUpload' {Maybe Text
archiveDescription :: Maybe Text
$sel:archiveDescription:InitiateMultipartUpload' :: InitiateMultipartUpload -> Maybe Text
archiveDescription} -> Maybe Text
archiveDescription) (\s :: InitiateMultipartUpload
s@InitiateMultipartUpload' {} Maybe Text
a -> InitiateMultipartUpload
s {$sel:archiveDescription:InitiateMultipartUpload' :: Maybe Text
archiveDescription = Maybe Text
a} :: InitiateMultipartUpload)

-- | The @AccountId@ value is the AWS account ID of the account that owns the
-- vault. You can either specify an AWS account ID or optionally a single
-- \'@-@\' (hyphen), in which case Amazon S3 Glacier uses the AWS account
-- ID associated with the credentials used to sign the request. If you use
-- an account ID, do not include any hyphens (\'-\') in the ID.
initiateMultipartUpload_accountId :: Lens.Lens' InitiateMultipartUpload Prelude.Text
initiateMultipartUpload_accountId :: (Text -> f Text)
-> InitiateMultipartUpload -> f InitiateMultipartUpload
initiateMultipartUpload_accountId = (InitiateMultipartUpload -> Text)
-> (InitiateMultipartUpload -> Text -> InitiateMultipartUpload)
-> Lens InitiateMultipartUpload InitiateMultipartUpload Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InitiateMultipartUpload' {Text
accountId :: Text
$sel:accountId:InitiateMultipartUpload' :: InitiateMultipartUpload -> Text
accountId} -> Text
accountId) (\s :: InitiateMultipartUpload
s@InitiateMultipartUpload' {} Text
a -> InitiateMultipartUpload
s {$sel:accountId:InitiateMultipartUpload' :: Text
accountId = Text
a} :: InitiateMultipartUpload)

-- | The name of the vault.
initiateMultipartUpload_vaultName :: Lens.Lens' InitiateMultipartUpload Prelude.Text
initiateMultipartUpload_vaultName :: (Text -> f Text)
-> InitiateMultipartUpload -> f InitiateMultipartUpload
initiateMultipartUpload_vaultName = (InitiateMultipartUpload -> Text)
-> (InitiateMultipartUpload -> Text -> InitiateMultipartUpload)
-> Lens InitiateMultipartUpload InitiateMultipartUpload Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InitiateMultipartUpload' {Text
vaultName :: Text
$sel:vaultName:InitiateMultipartUpload' :: InitiateMultipartUpload -> Text
vaultName} -> Text
vaultName) (\s :: InitiateMultipartUpload
s@InitiateMultipartUpload' {} Text
a -> InitiateMultipartUpload
s {$sel:vaultName:InitiateMultipartUpload' :: Text
vaultName = Text
a} :: InitiateMultipartUpload)

-- | The size of each part except the last, in bytes. The last part can be
-- smaller than this part size.
initiateMultipartUpload_partSize :: Lens.Lens' InitiateMultipartUpload Prelude.Text
initiateMultipartUpload_partSize :: (Text -> f Text)
-> InitiateMultipartUpload -> f InitiateMultipartUpload
initiateMultipartUpload_partSize = (InitiateMultipartUpload -> Text)
-> (InitiateMultipartUpload -> Text -> InitiateMultipartUpload)
-> Lens InitiateMultipartUpload InitiateMultipartUpload Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InitiateMultipartUpload' {Text
partSize :: Text
$sel:partSize:InitiateMultipartUpload' :: InitiateMultipartUpload -> Text
partSize} -> Text
partSize) (\s :: InitiateMultipartUpload
s@InitiateMultipartUpload' {} Text
a -> InitiateMultipartUpload
s {$sel:partSize:InitiateMultipartUpload' :: Text
partSize = Text
a} :: InitiateMultipartUpload)

instance Core.AWSRequest InitiateMultipartUpload where
  type
    AWSResponse InitiateMultipartUpload =
      InitiateMultipartUploadResponse
  request :: InitiateMultipartUpload -> Request InitiateMultipartUpload
request =
    ByteString
-> Request InitiateMultipartUpload
-> Request InitiateMultipartUpload
forall a. ByteString -> Request a -> Request a
Request.glacierVersionHeader (Service -> ByteString
Core._serviceVersion Service
defaultService)
      (Request InitiateMultipartUpload
 -> Request InitiateMultipartUpload)
-> (InitiateMultipartUpload -> Request InitiateMultipartUpload)
-> InitiateMultipartUpload
-> Request InitiateMultipartUpload
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service
-> InitiateMultipartUpload -> Request InitiateMultipartUpload
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy InitiateMultipartUpload
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse InitiateMultipartUpload)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse InitiateMultipartUpload))
-> Logger
-> Service
-> Proxy InitiateMultipartUpload
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse InitiateMultipartUpload)))
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 Text -> Maybe Text -> Int -> InitiateMultipartUploadResponse
InitiateMultipartUploadResponse'
            (Maybe Text
 -> Maybe Text -> Int -> InitiateMultipartUploadResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> InitiateMultipartUploadResponse)
forall (f :: * -> *) a b. Functor 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
"Location")
            Either
  String (Maybe Text -> Int -> InitiateMultipartUploadResponse)
-> Either String (Maybe Text)
-> Either String (Int -> InitiateMultipartUploadResponse)
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-multipart-upload-id")
            Either String (Int -> InitiateMultipartUploadResponse)
-> Either String Int
-> Either String InitiateMultipartUploadResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable InitiateMultipartUpload

instance Prelude.NFData InitiateMultipartUpload

instance Core.ToHeaders InitiateMultipartUpload where
  toHeaders :: InitiateMultipartUpload -> ResponseHeaders
toHeaders InitiateMultipartUpload' {Maybe Text
Text
partSize :: Text
vaultName :: Text
accountId :: Text
archiveDescription :: Maybe Text
$sel:partSize:InitiateMultipartUpload' :: InitiateMultipartUpload -> Text
$sel:vaultName:InitiateMultipartUpload' :: InitiateMultipartUpload -> Text
$sel:accountId:InitiateMultipartUpload' :: InitiateMultipartUpload -> Text
$sel:archiveDescription:InitiateMultipartUpload' :: InitiateMultipartUpload -> Maybe Text
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"x-amz-archive-description"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
archiveDescription,
        HeaderName
"x-amz-part-size" HeaderName -> Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Text
partSize
      ]

instance Core.ToJSON InitiateMultipartUpload where
  toJSON :: InitiateMultipartUpload -> Value
toJSON = Value -> InitiateMultipartUpload -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)

instance Core.ToPath InitiateMultipartUpload where
  toPath :: InitiateMultipartUpload -> ByteString
toPath InitiateMultipartUpload' {Maybe Text
Text
partSize :: Text
vaultName :: Text
accountId :: Text
archiveDescription :: Maybe Text
$sel:partSize:InitiateMultipartUpload' :: InitiateMultipartUpload -> Text
$sel:vaultName:InitiateMultipartUpload' :: InitiateMultipartUpload -> Text
$sel:accountId:InitiateMultipartUpload' :: InitiateMultipartUpload -> Text
$sel:archiveDescription:InitiateMultipartUpload' :: InitiateMultipartUpload -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
accountId,
        ByteString
"/vaults/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
vaultName,
        ByteString
"/multipart-uploads"
      ]

instance Core.ToQuery InitiateMultipartUpload where
  toQuery :: InitiateMultipartUpload -> QueryString
toQuery = QueryString -> InitiateMultipartUpload -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | The Amazon S3 Glacier response to your request.
--
-- /See:/ 'newInitiateMultipartUploadResponse' smart constructor.
data InitiateMultipartUploadResponse = InitiateMultipartUploadResponse'
  { -- | The relative URI path of the multipart upload ID Amazon S3 Glacier
    -- created.
    InitiateMultipartUploadResponse -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
    -- | The ID of the multipart upload. This value is also included as part of
    -- the location.
    InitiateMultipartUploadResponse -> Maybe Text
uploadId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    InitiateMultipartUploadResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (InitiateMultipartUploadResponse
-> InitiateMultipartUploadResponse -> Bool
(InitiateMultipartUploadResponse
 -> InitiateMultipartUploadResponse -> Bool)
-> (InitiateMultipartUploadResponse
    -> InitiateMultipartUploadResponse -> Bool)
-> Eq InitiateMultipartUploadResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InitiateMultipartUploadResponse
-> InitiateMultipartUploadResponse -> Bool
$c/= :: InitiateMultipartUploadResponse
-> InitiateMultipartUploadResponse -> Bool
== :: InitiateMultipartUploadResponse
-> InitiateMultipartUploadResponse -> Bool
$c== :: InitiateMultipartUploadResponse
-> InitiateMultipartUploadResponse -> Bool
Prelude.Eq, ReadPrec [InitiateMultipartUploadResponse]
ReadPrec InitiateMultipartUploadResponse
Int -> ReadS InitiateMultipartUploadResponse
ReadS [InitiateMultipartUploadResponse]
(Int -> ReadS InitiateMultipartUploadResponse)
-> ReadS [InitiateMultipartUploadResponse]
-> ReadPrec InitiateMultipartUploadResponse
-> ReadPrec [InitiateMultipartUploadResponse]
-> Read InitiateMultipartUploadResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InitiateMultipartUploadResponse]
$creadListPrec :: ReadPrec [InitiateMultipartUploadResponse]
readPrec :: ReadPrec InitiateMultipartUploadResponse
$creadPrec :: ReadPrec InitiateMultipartUploadResponse
readList :: ReadS [InitiateMultipartUploadResponse]
$creadList :: ReadS [InitiateMultipartUploadResponse]
readsPrec :: Int -> ReadS InitiateMultipartUploadResponse
$creadsPrec :: Int -> ReadS InitiateMultipartUploadResponse
Prelude.Read, Int -> InitiateMultipartUploadResponse -> ShowS
[InitiateMultipartUploadResponse] -> ShowS
InitiateMultipartUploadResponse -> String
(Int -> InitiateMultipartUploadResponse -> ShowS)
-> (InitiateMultipartUploadResponse -> String)
-> ([InitiateMultipartUploadResponse] -> ShowS)
-> Show InitiateMultipartUploadResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InitiateMultipartUploadResponse] -> ShowS
$cshowList :: [InitiateMultipartUploadResponse] -> ShowS
show :: InitiateMultipartUploadResponse -> String
$cshow :: InitiateMultipartUploadResponse -> String
showsPrec :: Int -> InitiateMultipartUploadResponse -> ShowS
$cshowsPrec :: Int -> InitiateMultipartUploadResponse -> ShowS
Prelude.Show, (forall x.
 InitiateMultipartUploadResponse
 -> Rep InitiateMultipartUploadResponse x)
-> (forall x.
    Rep InitiateMultipartUploadResponse x
    -> InitiateMultipartUploadResponse)
-> Generic InitiateMultipartUploadResponse
forall x.
Rep InitiateMultipartUploadResponse x
-> InitiateMultipartUploadResponse
forall x.
InitiateMultipartUploadResponse
-> Rep InitiateMultipartUploadResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InitiateMultipartUploadResponse x
-> InitiateMultipartUploadResponse
$cfrom :: forall x.
InitiateMultipartUploadResponse
-> Rep InitiateMultipartUploadResponse x
Prelude.Generic)

-- |
-- Create a value of 'InitiateMultipartUploadResponse' 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:
--
-- 'location', 'initiateMultipartUploadResponse_location' - The relative URI path of the multipart upload ID Amazon S3 Glacier
-- created.
--
-- 'uploadId', 'initiateMultipartUploadResponse_uploadId' - The ID of the multipart upload. This value is also included as part of
-- the location.
--
-- 'httpStatus', 'initiateMultipartUploadResponse_httpStatus' - The response's http status code.
newInitiateMultipartUploadResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  InitiateMultipartUploadResponse
newInitiateMultipartUploadResponse :: Int -> InitiateMultipartUploadResponse
newInitiateMultipartUploadResponse Int
pHttpStatus_ =
  InitiateMultipartUploadResponse' :: Maybe Text -> Maybe Text -> Int -> InitiateMultipartUploadResponse
InitiateMultipartUploadResponse'
    { $sel:location:InitiateMultipartUploadResponse' :: Maybe Text
location =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:uploadId:InitiateMultipartUploadResponse' :: Maybe Text
uploadId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:InitiateMultipartUploadResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The relative URI path of the multipart upload ID Amazon S3 Glacier
-- created.
initiateMultipartUploadResponse_location :: Lens.Lens' InitiateMultipartUploadResponse (Prelude.Maybe Prelude.Text)
initiateMultipartUploadResponse_location :: (Maybe Text -> f (Maybe Text))
-> InitiateMultipartUploadResponse
-> f InitiateMultipartUploadResponse
initiateMultipartUploadResponse_location = (InitiateMultipartUploadResponse -> Maybe Text)
-> (InitiateMultipartUploadResponse
    -> Maybe Text -> InitiateMultipartUploadResponse)
-> Lens
     InitiateMultipartUploadResponse
     InitiateMultipartUploadResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InitiateMultipartUploadResponse' {Maybe Text
location :: Maybe Text
$sel:location:InitiateMultipartUploadResponse' :: InitiateMultipartUploadResponse -> Maybe Text
location} -> Maybe Text
location) (\s :: InitiateMultipartUploadResponse
s@InitiateMultipartUploadResponse' {} Maybe Text
a -> InitiateMultipartUploadResponse
s {$sel:location:InitiateMultipartUploadResponse' :: Maybe Text
location = Maybe Text
a} :: InitiateMultipartUploadResponse)

-- | The ID of the multipart upload. This value is also included as part of
-- the location.
initiateMultipartUploadResponse_uploadId :: Lens.Lens' InitiateMultipartUploadResponse (Prelude.Maybe Prelude.Text)
initiateMultipartUploadResponse_uploadId :: (Maybe Text -> f (Maybe Text))
-> InitiateMultipartUploadResponse
-> f InitiateMultipartUploadResponse
initiateMultipartUploadResponse_uploadId = (InitiateMultipartUploadResponse -> Maybe Text)
-> (InitiateMultipartUploadResponse
    -> Maybe Text -> InitiateMultipartUploadResponse)
-> Lens
     InitiateMultipartUploadResponse
     InitiateMultipartUploadResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InitiateMultipartUploadResponse' {Maybe Text
uploadId :: Maybe Text
$sel:uploadId:InitiateMultipartUploadResponse' :: InitiateMultipartUploadResponse -> Maybe Text
uploadId} -> Maybe Text
uploadId) (\s :: InitiateMultipartUploadResponse
s@InitiateMultipartUploadResponse' {} Maybe Text
a -> InitiateMultipartUploadResponse
s {$sel:uploadId:InitiateMultipartUploadResponse' :: Maybe Text
uploadId = Maybe Text
a} :: InitiateMultipartUploadResponse)

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

instance
  Prelude.NFData
    InitiateMultipartUploadResponse