{-# 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.ListParts
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- This operation lists the parts of an archive that have been uploaded in
-- a specific multipart upload. You can make this request at any time
-- during an in-progress multipart upload before you complete the upload
-- (see CompleteMultipartUpload. List Parts returns an error for completed
-- uploads. The list returned in the List Parts response is sorted by part
-- range.
--
-- The List Parts operation supports pagination. By default, this operation
-- returns up to 50 uploaded parts in the response. You should always check
-- the response for a @marker@ at which to continue the list; if there are
-- no more items the @marker@ is @null@. To return a list of parts that
-- begins at a specific part, set the @marker@ request parameter to the
-- value you obtained from a previous List Parts request. You can also
-- limit the number of parts returned in the response by specifying the
-- @limit@ parameter in the request.
--
-- 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 the underlying REST API, see
-- <https://docs.aws.amazon.com/amazonglacier/latest/dev/working-with-archives.html Working with Archives in Amazon S3 Glacier>
-- and
-- <https://docs.aws.amazon.com/amazonglacier/latest/dev/api-multipart-list-parts.html List Parts>
-- in the /Amazon Glacier Developer Guide/.
--
-- This operation returns paginated results.
module Amazonka.Glacier.ListParts
  ( -- * Creating a Request
    ListParts (..),
    newListParts,

    -- * Request Lenses
    listParts_limit,
    listParts_marker,
    listParts_accountId,
    listParts_vaultName,
    listParts_uploadId,

    -- * Destructuring the Response
    ListPartsResponse (..),
    newListPartsResponse,

    -- * Response Lenses
    listPartsResponse_archiveDescription,
    listPartsResponse_creationDate,
    listPartsResponse_marker,
    listPartsResponse_multipartUploadId,
    listPartsResponse_partSizeInBytes,
    listPartsResponse_parts,
    listPartsResponse_vaultARN,
    listPartsResponse_httpStatus,
  )
where

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

-- | Provides options for retrieving a list of parts of an archive that have
-- been uploaded in a specific multipart upload.
--
-- /See:/ 'newListParts' smart constructor.
data ListParts = ListParts'
  { -- | The maximum number of parts to be returned. The default limit is 50. The
    -- number of parts returned might be fewer than the specified limit, but
    -- the number of returned parts never exceeds the limit.
    ListParts -> Maybe Text
limit :: Prelude.Maybe Prelude.Text,
    -- | An opaque string used for pagination. This value specifies the part at
    -- which the listing of parts should begin. Get the marker value from the
    -- response of a previous List Parts response. You need only include the
    -- marker if you are continuing the pagination of results started in a
    -- previous List Parts request.
    ListParts -> Maybe Text
marker :: 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.
    ListParts -> Text
accountId :: Prelude.Text,
    -- | The name of the vault.
    ListParts -> Text
vaultName :: Prelude.Text,
    -- | The upload ID of the multipart upload.
    ListParts -> Text
uploadId :: Prelude.Text
  }
  deriving (ListParts -> ListParts -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListParts -> ListParts -> Bool
$c/= :: ListParts -> ListParts -> Bool
== :: ListParts -> ListParts -> Bool
$c== :: ListParts -> ListParts -> Bool
Prelude.Eq, ReadPrec [ListParts]
ReadPrec ListParts
Int -> ReadS ListParts
ReadS [ListParts]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListParts]
$creadListPrec :: ReadPrec [ListParts]
readPrec :: ReadPrec ListParts
$creadPrec :: ReadPrec ListParts
readList :: ReadS [ListParts]
$creadList :: ReadS [ListParts]
readsPrec :: Int -> ReadS ListParts
$creadsPrec :: Int -> ReadS ListParts
Prelude.Read, Int -> ListParts -> ShowS
[ListParts] -> ShowS
ListParts -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListParts] -> ShowS
$cshowList :: [ListParts] -> ShowS
show :: ListParts -> String
$cshow :: ListParts -> String
showsPrec :: Int -> ListParts -> ShowS
$cshowsPrec :: Int -> ListParts -> ShowS
Prelude.Show, forall x. Rep ListParts x -> ListParts
forall x. ListParts -> Rep ListParts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListParts x -> ListParts
$cfrom :: forall x. ListParts -> Rep ListParts x
Prelude.Generic)

-- |
-- Create a value of 'ListParts' 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:
--
-- 'limit', 'listParts_limit' - The maximum number of parts to be returned. The default limit is 50. The
-- number of parts returned might be fewer than the specified limit, but
-- the number of returned parts never exceeds the limit.
--
-- 'marker', 'listParts_marker' - An opaque string used for pagination. This value specifies the part at
-- which the listing of parts should begin. Get the marker value from the
-- response of a previous List Parts response. You need only include the
-- marker if you are continuing the pagination of results started in a
-- previous List Parts request.
--
-- 'accountId', 'listParts_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', 'listParts_vaultName' - The name of the vault.
--
-- 'uploadId', 'listParts_uploadId' - The upload ID of the multipart upload.
newListParts ::
  -- | 'accountId'
  Prelude.Text ->
  -- | 'vaultName'
  Prelude.Text ->
  -- | 'uploadId'
  Prelude.Text ->
  ListParts
newListParts :: Text -> Text -> Text -> ListParts
newListParts Text
pAccountId_ Text
pVaultName_ Text
pUploadId_ =
  ListParts'
    { $sel:limit:ListParts' :: Maybe Text
limit = forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListParts' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:accountId:ListParts' :: Text
accountId = Text
pAccountId_,
      $sel:vaultName:ListParts' :: Text
vaultName = Text
pVaultName_,
      $sel:uploadId:ListParts' :: Text
uploadId = Text
pUploadId_
    }

-- | The maximum number of parts to be returned. The default limit is 50. The
-- number of parts returned might be fewer than the specified limit, but
-- the number of returned parts never exceeds the limit.
listParts_limit :: Lens.Lens' ListParts (Prelude.Maybe Prelude.Text)
listParts_limit :: Lens' ListParts (Maybe Text)
listParts_limit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListParts' {Maybe Text
limit :: Maybe Text
$sel:limit:ListParts' :: ListParts -> Maybe Text
limit} -> Maybe Text
limit) (\s :: ListParts
s@ListParts' {} Maybe Text
a -> ListParts
s {$sel:limit:ListParts' :: Maybe Text
limit = Maybe Text
a} :: ListParts)

-- | An opaque string used for pagination. This value specifies the part at
-- which the listing of parts should begin. Get the marker value from the
-- response of a previous List Parts response. You need only include the
-- marker if you are continuing the pagination of results started in a
-- previous List Parts request.
listParts_marker :: Lens.Lens' ListParts (Prelude.Maybe Prelude.Text)
listParts_marker :: Lens' ListParts (Maybe Text)
listParts_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListParts' {Maybe Text
marker :: Maybe Text
$sel:marker:ListParts' :: ListParts -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListParts
s@ListParts' {} Maybe Text
a -> ListParts
s {$sel:marker:ListParts' :: Maybe Text
marker = Maybe Text
a} :: ListParts)

-- | 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.
listParts_accountId :: Lens.Lens' ListParts Prelude.Text
listParts_accountId :: Lens' ListParts Text
listParts_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListParts' {Text
accountId :: Text
$sel:accountId:ListParts' :: ListParts -> Text
accountId} -> Text
accountId) (\s :: ListParts
s@ListParts' {} Text
a -> ListParts
s {$sel:accountId:ListParts' :: Text
accountId = Text
a} :: ListParts)

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

-- | The upload ID of the multipart upload.
listParts_uploadId :: Lens.Lens' ListParts Prelude.Text
listParts_uploadId :: Lens' ListParts Text
listParts_uploadId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListParts' {Text
uploadId :: Text
$sel:uploadId:ListParts' :: ListParts -> Text
uploadId} -> Text
uploadId) (\s :: ListParts
s@ListParts' {} Text
a -> ListParts
s {$sel:uploadId:ListParts' :: Text
uploadId = Text
a} :: ListParts)

instance Core.AWSPager ListParts where
  page :: ListParts -> AWSResponse ListParts -> Maybe ListParts
page ListParts
rq AWSResponse ListParts
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListParts
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListPartsResponse (Maybe Text)
listPartsResponse_marker
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListParts
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListPartsResponse (Maybe [PartListElement])
listPartsResponse_parts
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListParts
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListParts (Maybe Text)
listParts_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListParts
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListPartsResponse (Maybe Text)
listPartsResponse_marker
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListParts where
  type AWSResponse ListParts = ListPartsResponse
  request :: (Service -> Service) -> ListParts -> Request ListParts
request Service -> Service
overrides =
    forall a. ByteString -> Request a -> Request a
Request.glacierVersionHeader (Service -> ByteString
Core.version Service
defaultService)
      forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListParts
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListParts)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe [PartListElement]
-> Maybe Text
-> Int
-> ListPartsResponse
ListPartsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ArchiveDescription")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CreationDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Marker")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"MultipartUploadId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"PartSizeInBytes")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Parts" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"VaultARN")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListParts where
  hashWithSalt :: Int -> ListParts -> Int
hashWithSalt Int
_salt ListParts' {Maybe Text
Text
uploadId :: Text
vaultName :: Text
accountId :: Text
marker :: Maybe Text
limit :: Maybe Text
$sel:uploadId:ListParts' :: ListParts -> Text
$sel:vaultName:ListParts' :: ListParts -> Text
$sel:accountId:ListParts' :: ListParts -> Text
$sel:marker:ListParts' :: ListParts -> Maybe Text
$sel:limit:ListParts' :: ListParts -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
limit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
accountId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vaultName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
uploadId

instance Prelude.NFData ListParts where
  rnf :: ListParts -> ()
rnf ListParts' {Maybe Text
Text
uploadId :: Text
vaultName :: Text
accountId :: Text
marker :: Maybe Text
limit :: Maybe Text
$sel:uploadId:ListParts' :: ListParts -> Text
$sel:vaultName:ListParts' :: ListParts -> Text
$sel:accountId:ListParts' :: ListParts -> Text
$sel:marker:ListParts' :: ListParts -> Maybe Text
$sel:limit:ListParts' :: ListParts -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
limit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
accountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
vaultName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
uploadId

instance Data.ToHeaders ListParts where
  toHeaders :: ListParts -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath ListParts where
  toPath :: ListParts -> ByteString
toPath ListParts' {Maybe Text
Text
uploadId :: Text
vaultName :: Text
accountId :: Text
marker :: Maybe Text
limit :: Maybe Text
$sel:uploadId:ListParts' :: ListParts -> Text
$sel:vaultName:ListParts' :: ListParts -> Text
$sel:accountId:ListParts' :: ListParts -> Text
$sel:marker:ListParts' :: ListParts -> Maybe Text
$sel:limit:ListParts' :: ListParts -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
accountId,
        ByteString
"/vaults/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
vaultName,
        ByteString
"/multipart-uploads/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
uploadId
      ]

instance Data.ToQuery ListParts where
  toQuery :: ListParts -> QueryString
toQuery ListParts' {Maybe Text
Text
uploadId :: Text
vaultName :: Text
accountId :: Text
marker :: Maybe Text
limit :: Maybe Text
$sel:uploadId:ListParts' :: ListParts -> Text
$sel:vaultName:ListParts' :: ListParts -> Text
$sel:accountId:ListParts' :: ListParts -> Text
$sel:marker:ListParts' :: ListParts -> Maybe Text
$sel:limit:ListParts' :: ListParts -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"limit" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
limit, ByteString
"marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker]

-- | Contains the Amazon S3 Glacier response to your request.
--
-- /See:/ 'newListPartsResponse' smart constructor.
data ListPartsResponse = ListPartsResponse'
  { -- | The description of the archive that was specified in the Initiate
    -- Multipart Upload request.
    ListPartsResponse -> Maybe Text
archiveDescription :: Prelude.Maybe Prelude.Text,
    -- | The UTC time at which the multipart upload was initiated.
    ListPartsResponse -> Maybe Text
creationDate :: Prelude.Maybe Prelude.Text,
    -- | An opaque string that represents where to continue pagination of the
    -- results. You use the marker in a new List Parts request to obtain more
    -- jobs in the list. If there are no more parts, this value is @null@.
    ListPartsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The ID of the upload to which the parts are associated.
    ListPartsResponse -> Maybe Text
multipartUploadId :: Prelude.Maybe Prelude.Text,
    -- | The part size in bytes. This is the same value that you specified in the
    -- Initiate Multipart Upload request.
    ListPartsResponse -> Maybe Integer
partSizeInBytes :: Prelude.Maybe Prelude.Integer,
    -- | A list of the part sizes of the multipart upload. Each object in the
    -- array contains a @RangeBytes@ and @sha256-tree-hash@ name\/value pair.
    ListPartsResponse -> Maybe [PartListElement]
parts :: Prelude.Maybe [PartListElement],
    -- | The Amazon Resource Name (ARN) of the vault to which the multipart
    -- upload was initiated.
    ListPartsResponse -> Maybe Text
vaultARN :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListPartsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListPartsResponse -> ListPartsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPartsResponse -> ListPartsResponse -> Bool
$c/= :: ListPartsResponse -> ListPartsResponse -> Bool
== :: ListPartsResponse -> ListPartsResponse -> Bool
$c== :: ListPartsResponse -> ListPartsResponse -> Bool
Prelude.Eq, ReadPrec [ListPartsResponse]
ReadPrec ListPartsResponse
Int -> ReadS ListPartsResponse
ReadS [ListPartsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPartsResponse]
$creadListPrec :: ReadPrec [ListPartsResponse]
readPrec :: ReadPrec ListPartsResponse
$creadPrec :: ReadPrec ListPartsResponse
readList :: ReadS [ListPartsResponse]
$creadList :: ReadS [ListPartsResponse]
readsPrec :: Int -> ReadS ListPartsResponse
$creadsPrec :: Int -> ReadS ListPartsResponse
Prelude.Read, Int -> ListPartsResponse -> ShowS
[ListPartsResponse] -> ShowS
ListPartsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPartsResponse] -> ShowS
$cshowList :: [ListPartsResponse] -> ShowS
show :: ListPartsResponse -> String
$cshow :: ListPartsResponse -> String
showsPrec :: Int -> ListPartsResponse -> ShowS
$cshowsPrec :: Int -> ListPartsResponse -> ShowS
Prelude.Show, forall x. Rep ListPartsResponse x -> ListPartsResponse
forall x. ListPartsResponse -> Rep ListPartsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPartsResponse x -> ListPartsResponse
$cfrom :: forall x. ListPartsResponse -> Rep ListPartsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListPartsResponse' 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', 'listPartsResponse_archiveDescription' - The description of the archive that was specified in the Initiate
-- Multipart Upload request.
--
-- 'creationDate', 'listPartsResponse_creationDate' - The UTC time at which the multipart upload was initiated.
--
-- 'marker', 'listPartsResponse_marker' - An opaque string that represents where to continue pagination of the
-- results. You use the marker in a new List Parts request to obtain more
-- jobs in the list. If there are no more parts, this value is @null@.
--
-- 'multipartUploadId', 'listPartsResponse_multipartUploadId' - The ID of the upload to which the parts are associated.
--
-- 'partSizeInBytes', 'listPartsResponse_partSizeInBytes' - The part size in bytes. This is the same value that you specified in the
-- Initiate Multipart Upload request.
--
-- 'parts', 'listPartsResponse_parts' - A list of the part sizes of the multipart upload. Each object in the
-- array contains a @RangeBytes@ and @sha256-tree-hash@ name\/value pair.
--
-- 'vaultARN', 'listPartsResponse_vaultARN' - The Amazon Resource Name (ARN) of the vault to which the multipart
-- upload was initiated.
--
-- 'httpStatus', 'listPartsResponse_httpStatus' - The response's http status code.
newListPartsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPartsResponse
newListPartsResponse :: Int -> ListPartsResponse
newListPartsResponse Int
pHttpStatus_ =
  ListPartsResponse'
    { $sel:archiveDescription:ListPartsResponse' :: Maybe Text
archiveDescription =
        forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:ListPartsResponse' :: Maybe Text
creationDate = forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListPartsResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:multipartUploadId:ListPartsResponse' :: Maybe Text
multipartUploadId = forall a. Maybe a
Prelude.Nothing,
      $sel:partSizeInBytes:ListPartsResponse' :: Maybe Integer
partSizeInBytes = forall a. Maybe a
Prelude.Nothing,
      $sel:parts:ListPartsResponse' :: Maybe [PartListElement]
parts = forall a. Maybe a
Prelude.Nothing,
      $sel:vaultARN:ListPartsResponse' :: Maybe Text
vaultARN = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListPartsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The description of the archive that was specified in the Initiate
-- Multipart Upload request.
listPartsResponse_archiveDescription :: Lens.Lens' ListPartsResponse (Prelude.Maybe Prelude.Text)
listPartsResponse_archiveDescription :: Lens' ListPartsResponse (Maybe Text)
listPartsResponse_archiveDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartsResponse' {Maybe Text
archiveDescription :: Maybe Text
$sel:archiveDescription:ListPartsResponse' :: ListPartsResponse -> Maybe Text
archiveDescription} -> Maybe Text
archiveDescription) (\s :: ListPartsResponse
s@ListPartsResponse' {} Maybe Text
a -> ListPartsResponse
s {$sel:archiveDescription:ListPartsResponse' :: Maybe Text
archiveDescription = Maybe Text
a} :: ListPartsResponse)

-- | The UTC time at which the multipart upload was initiated.
listPartsResponse_creationDate :: Lens.Lens' ListPartsResponse (Prelude.Maybe Prelude.Text)
listPartsResponse_creationDate :: Lens' ListPartsResponse (Maybe Text)
listPartsResponse_creationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartsResponse' {Maybe Text
creationDate :: Maybe Text
$sel:creationDate:ListPartsResponse' :: ListPartsResponse -> Maybe Text
creationDate} -> Maybe Text
creationDate) (\s :: ListPartsResponse
s@ListPartsResponse' {} Maybe Text
a -> ListPartsResponse
s {$sel:creationDate:ListPartsResponse' :: Maybe Text
creationDate = Maybe Text
a} :: ListPartsResponse)

-- | An opaque string that represents where to continue pagination of the
-- results. You use the marker in a new List Parts request to obtain more
-- jobs in the list. If there are no more parts, this value is @null@.
listPartsResponse_marker :: Lens.Lens' ListPartsResponse (Prelude.Maybe Prelude.Text)
listPartsResponse_marker :: Lens' ListPartsResponse (Maybe Text)
listPartsResponse_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:ListPartsResponse' :: ListPartsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListPartsResponse
s@ListPartsResponse' {} Maybe Text
a -> ListPartsResponse
s {$sel:marker:ListPartsResponse' :: Maybe Text
marker = Maybe Text
a} :: ListPartsResponse)

-- | The ID of the upload to which the parts are associated.
listPartsResponse_multipartUploadId :: Lens.Lens' ListPartsResponse (Prelude.Maybe Prelude.Text)
listPartsResponse_multipartUploadId :: Lens' ListPartsResponse (Maybe Text)
listPartsResponse_multipartUploadId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartsResponse' {Maybe Text
multipartUploadId :: Maybe Text
$sel:multipartUploadId:ListPartsResponse' :: ListPartsResponse -> Maybe Text
multipartUploadId} -> Maybe Text
multipartUploadId) (\s :: ListPartsResponse
s@ListPartsResponse' {} Maybe Text
a -> ListPartsResponse
s {$sel:multipartUploadId:ListPartsResponse' :: Maybe Text
multipartUploadId = Maybe Text
a} :: ListPartsResponse)

-- | The part size in bytes. This is the same value that you specified in the
-- Initiate Multipart Upload request.
listPartsResponse_partSizeInBytes :: Lens.Lens' ListPartsResponse (Prelude.Maybe Prelude.Integer)
listPartsResponse_partSizeInBytes :: Lens' ListPartsResponse (Maybe Integer)
listPartsResponse_partSizeInBytes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartsResponse' {Maybe Integer
partSizeInBytes :: Maybe Integer
$sel:partSizeInBytes:ListPartsResponse' :: ListPartsResponse -> Maybe Integer
partSizeInBytes} -> Maybe Integer
partSizeInBytes) (\s :: ListPartsResponse
s@ListPartsResponse' {} Maybe Integer
a -> ListPartsResponse
s {$sel:partSizeInBytes:ListPartsResponse' :: Maybe Integer
partSizeInBytes = Maybe Integer
a} :: ListPartsResponse)

-- | A list of the part sizes of the multipart upload. Each object in the
-- array contains a @RangeBytes@ and @sha256-tree-hash@ name\/value pair.
listPartsResponse_parts :: Lens.Lens' ListPartsResponse (Prelude.Maybe [PartListElement])
listPartsResponse_parts :: Lens' ListPartsResponse (Maybe [PartListElement])
listPartsResponse_parts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartsResponse' {Maybe [PartListElement]
parts :: Maybe [PartListElement]
$sel:parts:ListPartsResponse' :: ListPartsResponse -> Maybe [PartListElement]
parts} -> Maybe [PartListElement]
parts) (\s :: ListPartsResponse
s@ListPartsResponse' {} Maybe [PartListElement]
a -> ListPartsResponse
s {$sel:parts:ListPartsResponse' :: Maybe [PartListElement]
parts = Maybe [PartListElement]
a} :: ListPartsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the vault to which the multipart
-- upload was initiated.
listPartsResponse_vaultARN :: Lens.Lens' ListPartsResponse (Prelude.Maybe Prelude.Text)
listPartsResponse_vaultARN :: Lens' ListPartsResponse (Maybe Text)
listPartsResponse_vaultARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartsResponse' {Maybe Text
vaultARN :: Maybe Text
$sel:vaultARN:ListPartsResponse' :: ListPartsResponse -> Maybe Text
vaultARN} -> Maybe Text
vaultARN) (\s :: ListPartsResponse
s@ListPartsResponse' {} Maybe Text
a -> ListPartsResponse
s {$sel:vaultARN:ListPartsResponse' :: Maybe Text
vaultARN = Maybe Text
a} :: ListPartsResponse)

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

instance Prelude.NFData ListPartsResponse where
  rnf :: ListPartsResponse -> ()
rnf ListPartsResponse' {Int
Maybe Integer
Maybe [PartListElement]
Maybe Text
httpStatus :: Int
vaultARN :: Maybe Text
parts :: Maybe [PartListElement]
partSizeInBytes :: Maybe Integer
multipartUploadId :: Maybe Text
marker :: Maybe Text
creationDate :: Maybe Text
archiveDescription :: Maybe Text
$sel:httpStatus:ListPartsResponse' :: ListPartsResponse -> Int
$sel:vaultARN:ListPartsResponse' :: ListPartsResponse -> Maybe Text
$sel:parts:ListPartsResponse' :: ListPartsResponse -> Maybe [PartListElement]
$sel:partSizeInBytes:ListPartsResponse' :: ListPartsResponse -> Maybe Integer
$sel:multipartUploadId:ListPartsResponse' :: ListPartsResponse -> Maybe Text
$sel:marker:ListPartsResponse' :: ListPartsResponse -> Maybe Text
$sel:creationDate:ListPartsResponse' :: ListPartsResponse -> Maybe Text
$sel:archiveDescription:ListPartsResponse' :: ListPartsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
archiveDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
creationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
multipartUploadId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
partSizeInBytes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [PartListElement]
parts
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vaultARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus