{-# 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.ListMultipartUploads
-- 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 lists in-progress multipart uploads for the specified
-- vault. An in-progress multipart upload is a multipart upload that has
-- been initiated by an InitiateMultipartUpload request, but has not yet
-- been completed or aborted. The list returned in the List Multipart
-- Upload response has no guaranteed order.
--
-- The List Multipart Uploads operation supports pagination. By default,
-- this operation returns up to 50 multipart uploads 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 multipart uploads that begins at a specific upload, set the
-- @marker@ request parameter to the value you obtained from a previous
-- List Multipart Upload request. You can also limit the number of uploads
-- returned in the response by specifying the @limit@ parameter in the
-- request.
--
-- Note the difference between this operation and listing parts
-- (ListParts). The List Multipart Uploads operation lists all multipart
-- uploads for a vault and does not require a multipart upload ID. The List
-- Parts operation requires a multipart upload ID since parts are
-- associated with a single upload.
--
-- 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-uploads.html List Multipart Uploads>
-- in the /Amazon Glacier Developer Guide/.
--
-- This operation returns paginated results.
module Amazonka.Glacier.ListMultipartUploads
  ( -- * Creating a Request
    ListMultipartUploads (..),
    newListMultipartUploads,

    -- * Request Lenses
    listMultipartUploads_marker,
    listMultipartUploads_limit,
    listMultipartUploads_accountId,
    listMultipartUploads_vaultName,

    -- * Destructuring the Response
    ListMultipartUploadsResponse (..),
    newListMultipartUploadsResponse,

    -- * Response Lenses
    listMultipartUploadsResponse_uploadsList,
    listMultipartUploadsResponse_marker,
    listMultipartUploadsResponse_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 retrieving list of in-progress multipart uploads
-- for an Amazon Glacier vault.
--
-- /See:/ 'newListMultipartUploads' smart constructor.
data ListMultipartUploads = ListMultipartUploads'
  { -- | An opaque string used for pagination. This value specifies the upload at
    -- which the listing of uploads should begin. Get the marker value from a
    -- previous List Uploads response. You need only include the marker if you
    -- are continuing the pagination of results started in a previous List
    -- Uploads request.
    ListMultipartUploads -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Specifies the maximum number of uploads returned in the response body.
    -- If this value is not specified, the List Uploads operation returns up to
    -- 50 uploads.
    ListMultipartUploads -> Maybe Text
limit :: 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.
    ListMultipartUploads -> Text
accountId :: Prelude.Text,
    -- | The name of the vault.
    ListMultipartUploads -> Text
vaultName :: Prelude.Text
  }
  deriving (ListMultipartUploads -> ListMultipartUploads -> Bool
(ListMultipartUploads -> ListMultipartUploads -> Bool)
-> (ListMultipartUploads -> ListMultipartUploads -> Bool)
-> Eq ListMultipartUploads
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListMultipartUploads -> ListMultipartUploads -> Bool
$c/= :: ListMultipartUploads -> ListMultipartUploads -> Bool
== :: ListMultipartUploads -> ListMultipartUploads -> Bool
$c== :: ListMultipartUploads -> ListMultipartUploads -> Bool
Prelude.Eq, ReadPrec [ListMultipartUploads]
ReadPrec ListMultipartUploads
Int -> ReadS ListMultipartUploads
ReadS [ListMultipartUploads]
(Int -> ReadS ListMultipartUploads)
-> ReadS [ListMultipartUploads]
-> ReadPrec ListMultipartUploads
-> ReadPrec [ListMultipartUploads]
-> Read ListMultipartUploads
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListMultipartUploads]
$creadListPrec :: ReadPrec [ListMultipartUploads]
readPrec :: ReadPrec ListMultipartUploads
$creadPrec :: ReadPrec ListMultipartUploads
readList :: ReadS [ListMultipartUploads]
$creadList :: ReadS [ListMultipartUploads]
readsPrec :: Int -> ReadS ListMultipartUploads
$creadsPrec :: Int -> ReadS ListMultipartUploads
Prelude.Read, Int -> ListMultipartUploads -> ShowS
[ListMultipartUploads] -> ShowS
ListMultipartUploads -> String
(Int -> ListMultipartUploads -> ShowS)
-> (ListMultipartUploads -> String)
-> ([ListMultipartUploads] -> ShowS)
-> Show ListMultipartUploads
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListMultipartUploads] -> ShowS
$cshowList :: [ListMultipartUploads] -> ShowS
show :: ListMultipartUploads -> String
$cshow :: ListMultipartUploads -> String
showsPrec :: Int -> ListMultipartUploads -> ShowS
$cshowsPrec :: Int -> ListMultipartUploads -> ShowS
Prelude.Show, (forall x. ListMultipartUploads -> Rep ListMultipartUploads x)
-> (forall x. Rep ListMultipartUploads x -> ListMultipartUploads)
-> Generic ListMultipartUploads
forall x. Rep ListMultipartUploads x -> ListMultipartUploads
forall x. ListMultipartUploads -> Rep ListMultipartUploads x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListMultipartUploads x -> ListMultipartUploads
$cfrom :: forall x. ListMultipartUploads -> Rep ListMultipartUploads x
Prelude.Generic)

-- |
-- Create a value of 'ListMultipartUploads' 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:
--
-- 'marker', 'listMultipartUploads_marker' - An opaque string used for pagination. This value specifies the upload at
-- which the listing of uploads should begin. Get the marker value from a
-- previous List Uploads response. You need only include the marker if you
-- are continuing the pagination of results started in a previous List
-- Uploads request.
--
-- 'limit', 'listMultipartUploads_limit' - Specifies the maximum number of uploads returned in the response body.
-- If this value is not specified, the List Uploads operation returns up to
-- 50 uploads.
--
-- 'accountId', 'listMultipartUploads_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', 'listMultipartUploads_vaultName' - The name of the vault.
newListMultipartUploads ::
  -- | 'accountId'
  Prelude.Text ->
  -- | 'vaultName'
  Prelude.Text ->
  ListMultipartUploads
newListMultipartUploads :: Text -> Text -> ListMultipartUploads
newListMultipartUploads Text
pAccountId_ Text
pVaultName_ =
  ListMultipartUploads' :: Maybe Text -> Maybe Text -> Text -> Text -> ListMultipartUploads
ListMultipartUploads'
    { $sel:marker:ListMultipartUploads' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListMultipartUploads' :: Maybe Text
limit = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:accountId:ListMultipartUploads' :: Text
accountId = Text
pAccountId_,
      $sel:vaultName:ListMultipartUploads' :: Text
vaultName = Text
pVaultName_
    }

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

-- | Specifies the maximum number of uploads returned in the response body.
-- If this value is not specified, the List Uploads operation returns up to
-- 50 uploads.
listMultipartUploads_limit :: Lens.Lens' ListMultipartUploads (Prelude.Maybe Prelude.Text)
listMultipartUploads_limit :: (Maybe Text -> f (Maybe Text))
-> ListMultipartUploads -> f ListMultipartUploads
listMultipartUploads_limit = (ListMultipartUploads -> Maybe Text)
-> (ListMultipartUploads -> Maybe Text -> ListMultipartUploads)
-> Lens
     ListMultipartUploads ListMultipartUploads (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMultipartUploads' {Maybe Text
limit :: Maybe Text
$sel:limit:ListMultipartUploads' :: ListMultipartUploads -> Maybe Text
limit} -> Maybe Text
limit) (\s :: ListMultipartUploads
s@ListMultipartUploads' {} Maybe Text
a -> ListMultipartUploads
s {$sel:limit:ListMultipartUploads' :: Maybe Text
limit = Maybe Text
a} :: ListMultipartUploads)

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

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

instance Core.AWSPager ListMultipartUploads where
  page :: ListMultipartUploads
-> AWSResponse ListMultipartUploads -> Maybe ListMultipartUploads
page ListMultipartUploads
rq AWSResponse ListMultipartUploads
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListMultipartUploads
ListMultipartUploadsResponse
rs
            ListMultipartUploadsResponse
-> Getting (First Text) ListMultipartUploadsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListMultipartUploadsResponse
-> Const (First Text) ListMultipartUploadsResponse
Lens' ListMultipartUploadsResponse (Maybe Text)
listMultipartUploadsResponse_marker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListMultipartUploadsResponse
 -> Const (First Text) ListMultipartUploadsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListMultipartUploadsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListMultipartUploads
forall a. Maybe a
Prelude.Nothing
    | Maybe [UploadListElement] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListMultipartUploads
ListMultipartUploadsResponse
rs
            ListMultipartUploadsResponse
-> Getting
     (First [UploadListElement])
     ListMultipartUploadsResponse
     [UploadListElement]
-> Maybe [UploadListElement]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [UploadListElement]
 -> Const (First [UploadListElement]) (Maybe [UploadListElement]))
-> ListMultipartUploadsResponse
-> Const (First [UploadListElement]) ListMultipartUploadsResponse
Lens' ListMultipartUploadsResponse (Maybe [UploadListElement])
listMultipartUploadsResponse_uploadsList
              ((Maybe [UploadListElement]
  -> Const (First [UploadListElement]) (Maybe [UploadListElement]))
 -> ListMultipartUploadsResponse
 -> Const (First [UploadListElement]) ListMultipartUploadsResponse)
-> (([UploadListElement]
     -> Const (First [UploadListElement]) [UploadListElement])
    -> Maybe [UploadListElement]
    -> Const (First [UploadListElement]) (Maybe [UploadListElement]))
-> Getting
     (First [UploadListElement])
     ListMultipartUploadsResponse
     [UploadListElement]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([UploadListElement]
 -> Const (First [UploadListElement]) [UploadListElement])
-> Maybe [UploadListElement]
-> Const (First [UploadListElement]) (Maybe [UploadListElement])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListMultipartUploads
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListMultipartUploads -> Maybe ListMultipartUploads
forall a. a -> Maybe a
Prelude.Just (ListMultipartUploads -> Maybe ListMultipartUploads)
-> ListMultipartUploads -> Maybe ListMultipartUploads
forall a b. (a -> b) -> a -> b
Prelude.$
        ListMultipartUploads
rq
          ListMultipartUploads
-> (ListMultipartUploads -> ListMultipartUploads)
-> ListMultipartUploads
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListMultipartUploads -> Identity ListMultipartUploads
Lens
  ListMultipartUploads ListMultipartUploads (Maybe Text) (Maybe Text)
listMultipartUploads_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListMultipartUploads -> Identity ListMultipartUploads)
-> Maybe Text -> ListMultipartUploads -> ListMultipartUploads
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListMultipartUploads
ListMultipartUploadsResponse
rs
          ListMultipartUploadsResponse
-> Getting (First Text) ListMultipartUploadsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListMultipartUploadsResponse
-> Const (First Text) ListMultipartUploadsResponse
Lens' ListMultipartUploadsResponse (Maybe Text)
listMultipartUploadsResponse_marker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListMultipartUploadsResponse
 -> Const (First Text) ListMultipartUploadsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListMultipartUploadsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListMultipartUploads where
  type
    AWSResponse ListMultipartUploads =
      ListMultipartUploadsResponse
  request :: ListMultipartUploads -> Request ListMultipartUploads
request =
    ByteString
-> Request ListMultipartUploads -> Request ListMultipartUploads
forall a. ByteString -> Request a -> Request a
Request.glacierVersionHeader (Service -> ByteString
Core._serviceVersion Service
defaultService)
      (Request ListMultipartUploads -> Request ListMultipartUploads)
-> (ListMultipartUploads -> Request ListMultipartUploads)
-> ListMultipartUploads
-> Request ListMultipartUploads
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> ListMultipartUploads -> Request ListMultipartUploads
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListMultipartUploads
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListMultipartUploads)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListMultipartUploads))
-> Logger
-> Service
-> Proxy ListMultipartUploads
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListMultipartUploads)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [UploadListElement]
-> Maybe Text -> Int -> ListMultipartUploadsResponse
ListMultipartUploadsResponse'
            (Maybe [UploadListElement]
 -> Maybe Text -> Int -> ListMultipartUploadsResponse)
-> Either String (Maybe [UploadListElement])
-> Either
     String (Maybe Text -> Int -> ListMultipartUploadsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [UploadListElement]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UploadsList" Either String (Maybe (Maybe [UploadListElement]))
-> Maybe [UploadListElement]
-> Either String (Maybe [UploadListElement])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [UploadListElement]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListMultipartUploadsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListMultipartUploadsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Marker")
            Either String (Int -> ListMultipartUploadsResponse)
-> Either String Int -> Either String ListMultipartUploadsResponse
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 ListMultipartUploads

instance Prelude.NFData ListMultipartUploads

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

instance Core.ToPath ListMultipartUploads where
  toPath :: ListMultipartUploads -> ByteString
toPath ListMultipartUploads' {Maybe Text
Text
vaultName :: Text
accountId :: Text
limit :: Maybe Text
marker :: Maybe Text
$sel:vaultName:ListMultipartUploads' :: ListMultipartUploads -> Text
$sel:accountId:ListMultipartUploads' :: ListMultipartUploads -> Text
$sel:limit:ListMultipartUploads' :: ListMultipartUploads -> Maybe Text
$sel:marker:ListMultipartUploads' :: ListMultipartUploads -> 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 ListMultipartUploads where
  toQuery :: ListMultipartUploads -> QueryString
toQuery ListMultipartUploads' {Maybe Text
Text
vaultName :: Text
accountId :: Text
limit :: Maybe Text
marker :: Maybe Text
$sel:vaultName:ListMultipartUploads' :: ListMultipartUploads -> Text
$sel:accountId:ListMultipartUploads' :: ListMultipartUploads -> Text
$sel:limit:ListMultipartUploads' :: ListMultipartUploads -> Maybe Text
$sel:marker:ListMultipartUploads' :: ListMultipartUploads -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker, ByteString
"limit" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
limit]

-- | Contains the Amazon S3 Glacier response to your request.
--
-- /See:/ 'newListMultipartUploadsResponse' smart constructor.
data ListMultipartUploadsResponse = ListMultipartUploadsResponse'
  { -- | A list of in-progress multipart uploads.
    ListMultipartUploadsResponse -> Maybe [UploadListElement]
uploadsList :: Prelude.Maybe [UploadListElement],
    -- | An opaque string that represents where to continue pagination of the
    -- results. You use the marker in a new List Multipart Uploads request to
    -- obtain more uploads in the list. If there are no more uploads, this
    -- value is @null@.
    ListMultipartUploadsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListMultipartUploadsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListMultipartUploadsResponse
-> ListMultipartUploadsResponse -> Bool
(ListMultipartUploadsResponse
 -> ListMultipartUploadsResponse -> Bool)
-> (ListMultipartUploadsResponse
    -> ListMultipartUploadsResponse -> Bool)
-> Eq ListMultipartUploadsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListMultipartUploadsResponse
-> ListMultipartUploadsResponse -> Bool
$c/= :: ListMultipartUploadsResponse
-> ListMultipartUploadsResponse -> Bool
== :: ListMultipartUploadsResponse
-> ListMultipartUploadsResponse -> Bool
$c== :: ListMultipartUploadsResponse
-> ListMultipartUploadsResponse -> Bool
Prelude.Eq, ReadPrec [ListMultipartUploadsResponse]
ReadPrec ListMultipartUploadsResponse
Int -> ReadS ListMultipartUploadsResponse
ReadS [ListMultipartUploadsResponse]
(Int -> ReadS ListMultipartUploadsResponse)
-> ReadS [ListMultipartUploadsResponse]
-> ReadPrec ListMultipartUploadsResponse
-> ReadPrec [ListMultipartUploadsResponse]
-> Read ListMultipartUploadsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListMultipartUploadsResponse]
$creadListPrec :: ReadPrec [ListMultipartUploadsResponse]
readPrec :: ReadPrec ListMultipartUploadsResponse
$creadPrec :: ReadPrec ListMultipartUploadsResponse
readList :: ReadS [ListMultipartUploadsResponse]
$creadList :: ReadS [ListMultipartUploadsResponse]
readsPrec :: Int -> ReadS ListMultipartUploadsResponse
$creadsPrec :: Int -> ReadS ListMultipartUploadsResponse
Prelude.Read, Int -> ListMultipartUploadsResponse -> ShowS
[ListMultipartUploadsResponse] -> ShowS
ListMultipartUploadsResponse -> String
(Int -> ListMultipartUploadsResponse -> ShowS)
-> (ListMultipartUploadsResponse -> String)
-> ([ListMultipartUploadsResponse] -> ShowS)
-> Show ListMultipartUploadsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListMultipartUploadsResponse] -> ShowS
$cshowList :: [ListMultipartUploadsResponse] -> ShowS
show :: ListMultipartUploadsResponse -> String
$cshow :: ListMultipartUploadsResponse -> String
showsPrec :: Int -> ListMultipartUploadsResponse -> ShowS
$cshowsPrec :: Int -> ListMultipartUploadsResponse -> ShowS
Prelude.Show, (forall x.
 ListMultipartUploadsResponse -> Rep ListMultipartUploadsResponse x)
-> (forall x.
    Rep ListMultipartUploadsResponse x -> ListMultipartUploadsResponse)
-> Generic ListMultipartUploadsResponse
forall x.
Rep ListMultipartUploadsResponse x -> ListMultipartUploadsResponse
forall x.
ListMultipartUploadsResponse -> Rep ListMultipartUploadsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListMultipartUploadsResponse x -> ListMultipartUploadsResponse
$cfrom :: forall x.
ListMultipartUploadsResponse -> Rep ListMultipartUploadsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListMultipartUploadsResponse' 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:
--
-- 'uploadsList', 'listMultipartUploadsResponse_uploadsList' - A list of in-progress multipart uploads.
--
-- 'marker', 'listMultipartUploadsResponse_marker' - An opaque string that represents where to continue pagination of the
-- results. You use the marker in a new List Multipart Uploads request to
-- obtain more uploads in the list. If there are no more uploads, this
-- value is @null@.
--
-- 'httpStatus', 'listMultipartUploadsResponse_httpStatus' - The response's http status code.
newListMultipartUploadsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListMultipartUploadsResponse
newListMultipartUploadsResponse :: Int -> ListMultipartUploadsResponse
newListMultipartUploadsResponse Int
pHttpStatus_ =
  ListMultipartUploadsResponse' :: Maybe [UploadListElement]
-> Maybe Text -> Int -> ListMultipartUploadsResponse
ListMultipartUploadsResponse'
    { $sel:uploadsList:ListMultipartUploadsResponse' :: Maybe [UploadListElement]
uploadsList =
        Maybe [UploadListElement]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListMultipartUploadsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListMultipartUploadsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of in-progress multipart uploads.
listMultipartUploadsResponse_uploadsList :: Lens.Lens' ListMultipartUploadsResponse (Prelude.Maybe [UploadListElement])
listMultipartUploadsResponse_uploadsList :: (Maybe [UploadListElement] -> f (Maybe [UploadListElement]))
-> ListMultipartUploadsResponse -> f ListMultipartUploadsResponse
listMultipartUploadsResponse_uploadsList = (ListMultipartUploadsResponse -> Maybe [UploadListElement])
-> (ListMultipartUploadsResponse
    -> Maybe [UploadListElement] -> ListMultipartUploadsResponse)
-> Lens' ListMultipartUploadsResponse (Maybe [UploadListElement])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMultipartUploadsResponse' {Maybe [UploadListElement]
uploadsList :: Maybe [UploadListElement]
$sel:uploadsList:ListMultipartUploadsResponse' :: ListMultipartUploadsResponse -> Maybe [UploadListElement]
uploadsList} -> Maybe [UploadListElement]
uploadsList) (\s :: ListMultipartUploadsResponse
s@ListMultipartUploadsResponse' {} Maybe [UploadListElement]
a -> ListMultipartUploadsResponse
s {$sel:uploadsList:ListMultipartUploadsResponse' :: Maybe [UploadListElement]
uploadsList = Maybe [UploadListElement]
a} :: ListMultipartUploadsResponse) ((Maybe [UploadListElement] -> f (Maybe [UploadListElement]))
 -> ListMultipartUploadsResponse -> f ListMultipartUploadsResponse)
-> ((Maybe [UploadListElement] -> f (Maybe [UploadListElement]))
    -> Maybe [UploadListElement] -> f (Maybe [UploadListElement]))
-> (Maybe [UploadListElement] -> f (Maybe [UploadListElement]))
-> ListMultipartUploadsResponse
-> f ListMultipartUploadsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [UploadListElement]
  [UploadListElement]
  [UploadListElement]
  [UploadListElement]
-> Iso
     (Maybe [UploadListElement])
     (Maybe [UploadListElement])
     (Maybe [UploadListElement])
     (Maybe [UploadListElement])
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
  [UploadListElement]
  [UploadListElement]
  [UploadListElement]
  [UploadListElement]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance Prelude.NFData ListMultipartUploadsResponse