{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.S3.ListObjectVersions
-- 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)
--
-- Returns metadata about all versions of the objects in a bucket. You can
-- also use request parameters as selection criteria to return metadata
-- about a subset of all the object versions.
--
-- To use this operation, you must have permissions to perform the
-- @s3:ListBucketVersions@ action. Be aware of the name difference.
--
-- A 200 OK response can contain valid or invalid XML. Make sure to design
-- your application to parse the contents of the response and handle it
-- appropriately.
--
-- To use this operation, you must have READ access to the bucket.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- The following operations are related to @ListObjectVersions@:
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html ListObjectsV2>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html GetObject>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html PutObject>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html DeleteObject>
--
-- This operation returns paginated results.
module Amazonka.S3.ListObjectVersions
  ( -- * Creating a Request
    ListObjectVersions (..),
    newListObjectVersions,

    -- * Request Lenses
    listObjectVersions_keyMarker,
    listObjectVersions_prefix,
    listObjectVersions_encodingType,
    listObjectVersions_versionIdMarker,
    listObjectVersions_maxKeys,
    listObjectVersions_delimiter,
    listObjectVersions_expectedBucketOwner,
    listObjectVersions_bucket,

    -- * Destructuring the Response
    ListObjectVersionsResponse (..),
    newListObjectVersionsResponse,

    -- * Response Lenses
    listObjectVersionsResponse_nextVersionIdMarker,
    listObjectVersionsResponse_keyMarker,
    listObjectVersionsResponse_deleteMarkers,
    listObjectVersionsResponse_prefix,
    listObjectVersionsResponse_commonPrefixes,
    listObjectVersionsResponse_encodingType,
    listObjectVersionsResponse_versions,
    listObjectVersionsResponse_name,
    listObjectVersionsResponse_nextKeyMarker,
    listObjectVersionsResponse_versionIdMarker,
    listObjectVersionsResponse_maxKeys,
    listObjectVersionsResponse_isTruncated,
    listObjectVersionsResponse_delimiter,
    listObjectVersionsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListObjectVersions' smart constructor.
data ListObjectVersions = ListObjectVersions'
  { -- | Specifies the key to start with when listing objects in a bucket.
    ListObjectVersions -> Maybe Text
keyMarker :: Prelude.Maybe Prelude.Text,
    -- | Use this parameter to select only those keys that begin with the
    -- specified prefix. You can use prefixes to separate a bucket into
    -- different groupings of keys. (You can think of using prefix to make
    -- groups in the same way you\'d use a folder in a file system.) You can
    -- use prefix with delimiter to roll up numerous objects into a single
    -- result under CommonPrefixes.
    ListObjectVersions -> Maybe Text
prefix :: Prelude.Maybe Prelude.Text,
    ListObjectVersions -> Maybe EncodingType
encodingType :: Prelude.Maybe EncodingType,
    -- | Specifies the object version you want to start listing from.
    ListObjectVersions -> Maybe Text
versionIdMarker :: Prelude.Maybe Prelude.Text,
    -- | Sets the maximum number of keys returned in the response. By default the
    -- action returns up to 1,000 key names. The response might contain fewer
    -- keys but will never contain more. If additional keys satisfy the search
    -- criteria, but were not returned because max-keys was exceeded, the
    -- response contains \<isTruncated>true\<\/isTruncated>. To return the
    -- additional keys, see key-marker and version-id-marker.
    ListObjectVersions -> Maybe Int
maxKeys :: Prelude.Maybe Prelude.Int,
    -- | A delimiter is a character that you specify to group keys. All keys that
    -- contain the same string between the @prefix@ and the first occurrence of
    -- the delimiter are grouped under a single result element in
    -- CommonPrefixes. These groups are counted as one result against the
    -- max-keys limitation. These keys are not returned elsewhere in the
    -- response.
    ListObjectVersions -> Maybe Delimiter
delimiter :: Prelude.Maybe Delimiter,
    -- | The account ID of the expected bucket owner. If the bucket is owned by a
    -- different account, the request will fail with an HTTP
    -- @403 (Access Denied)@ error.
    ListObjectVersions -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | The bucket name that contains the objects.
    ListObjectVersions -> BucketName
bucket :: BucketName
  }
  deriving (ListObjectVersions -> ListObjectVersions -> Bool
(ListObjectVersions -> ListObjectVersions -> Bool)
-> (ListObjectVersions -> ListObjectVersions -> Bool)
-> Eq ListObjectVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListObjectVersions -> ListObjectVersions -> Bool
$c/= :: ListObjectVersions -> ListObjectVersions -> Bool
== :: ListObjectVersions -> ListObjectVersions -> Bool
$c== :: ListObjectVersions -> ListObjectVersions -> Bool
Prelude.Eq, ReadPrec [ListObjectVersions]
ReadPrec ListObjectVersions
Int -> ReadS ListObjectVersions
ReadS [ListObjectVersions]
(Int -> ReadS ListObjectVersions)
-> ReadS [ListObjectVersions]
-> ReadPrec ListObjectVersions
-> ReadPrec [ListObjectVersions]
-> Read ListObjectVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListObjectVersions]
$creadListPrec :: ReadPrec [ListObjectVersions]
readPrec :: ReadPrec ListObjectVersions
$creadPrec :: ReadPrec ListObjectVersions
readList :: ReadS [ListObjectVersions]
$creadList :: ReadS [ListObjectVersions]
readsPrec :: Int -> ReadS ListObjectVersions
$creadsPrec :: Int -> ReadS ListObjectVersions
Prelude.Read, Int -> ListObjectVersions -> ShowS
[ListObjectVersions] -> ShowS
ListObjectVersions -> String
(Int -> ListObjectVersions -> ShowS)
-> (ListObjectVersions -> String)
-> ([ListObjectVersions] -> ShowS)
-> Show ListObjectVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListObjectVersions] -> ShowS
$cshowList :: [ListObjectVersions] -> ShowS
show :: ListObjectVersions -> String
$cshow :: ListObjectVersions -> String
showsPrec :: Int -> ListObjectVersions -> ShowS
$cshowsPrec :: Int -> ListObjectVersions -> ShowS
Prelude.Show, (forall x. ListObjectVersions -> Rep ListObjectVersions x)
-> (forall x. Rep ListObjectVersions x -> ListObjectVersions)
-> Generic ListObjectVersions
forall x. Rep ListObjectVersions x -> ListObjectVersions
forall x. ListObjectVersions -> Rep ListObjectVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListObjectVersions x -> ListObjectVersions
$cfrom :: forall x. ListObjectVersions -> Rep ListObjectVersions x
Prelude.Generic)

-- |
-- Create a value of 'ListObjectVersions' 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:
--
-- 'keyMarker', 'listObjectVersions_keyMarker' - Specifies the key to start with when listing objects in a bucket.
--
-- 'prefix', 'listObjectVersions_prefix' - Use this parameter to select only those keys that begin with the
-- specified prefix. You can use prefixes to separate a bucket into
-- different groupings of keys. (You can think of using prefix to make
-- groups in the same way you\'d use a folder in a file system.) You can
-- use prefix with delimiter to roll up numerous objects into a single
-- result under CommonPrefixes.
--
-- 'encodingType', 'listObjectVersions_encodingType' - Undocumented member.
--
-- 'versionIdMarker', 'listObjectVersions_versionIdMarker' - Specifies the object version you want to start listing from.
--
-- 'maxKeys', 'listObjectVersions_maxKeys' - Sets the maximum number of keys returned in the response. By default the
-- action returns up to 1,000 key names. The response might contain fewer
-- keys but will never contain more. If additional keys satisfy the search
-- criteria, but were not returned because max-keys was exceeded, the
-- response contains \<isTruncated>true\<\/isTruncated>. To return the
-- additional keys, see key-marker and version-id-marker.
--
-- 'delimiter', 'listObjectVersions_delimiter' - A delimiter is a character that you specify to group keys. All keys that
-- contain the same string between the @prefix@ and the first occurrence of
-- the delimiter are grouped under a single result element in
-- CommonPrefixes. These groups are counted as one result against the
-- max-keys limitation. These keys are not returned elsewhere in the
-- response.
--
-- 'expectedBucketOwner', 'listObjectVersions_expectedBucketOwner' - The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request will fail with an HTTP
-- @403 (Access Denied)@ error.
--
-- 'bucket', 'listObjectVersions_bucket' - The bucket name that contains the objects.
newListObjectVersions ::
  -- | 'bucket'
  BucketName ->
  ListObjectVersions
newListObjectVersions :: BucketName -> ListObjectVersions
newListObjectVersions BucketName
pBucket_ =
  ListObjectVersions' :: Maybe Text
-> Maybe Text
-> Maybe EncodingType
-> Maybe Text
-> Maybe Int
-> Maybe Delimiter
-> Maybe Text
-> BucketName
-> ListObjectVersions
ListObjectVersions'
    { $sel:keyMarker:ListObjectVersions' :: Maybe Text
keyMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:prefix:ListObjectVersions' :: Maybe Text
prefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:encodingType:ListObjectVersions' :: Maybe EncodingType
encodingType = Maybe EncodingType
forall a. Maybe a
Prelude.Nothing,
      $sel:versionIdMarker:ListObjectVersions' :: Maybe Text
versionIdMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxKeys:ListObjectVersions' :: Maybe Int
maxKeys = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:delimiter:ListObjectVersions' :: Maybe Delimiter
delimiter = Maybe Delimiter
forall a. Maybe a
Prelude.Nothing,
      $sel:expectedBucketOwner:ListObjectVersions' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucket:ListObjectVersions' :: BucketName
bucket = BucketName
pBucket_
    }

-- | Specifies the key to start with when listing objects in a bucket.
listObjectVersions_keyMarker :: Lens.Lens' ListObjectVersions (Prelude.Maybe Prelude.Text)
listObjectVersions_keyMarker :: (Maybe Text -> f (Maybe Text))
-> ListObjectVersions -> f ListObjectVersions
listObjectVersions_keyMarker = (ListObjectVersions -> Maybe Text)
-> (ListObjectVersions -> Maybe Text -> ListObjectVersions)
-> Lens
     ListObjectVersions ListObjectVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersions' {Maybe Text
keyMarker :: Maybe Text
$sel:keyMarker:ListObjectVersions' :: ListObjectVersions -> Maybe Text
keyMarker} -> Maybe Text
keyMarker) (\s :: ListObjectVersions
s@ListObjectVersions' {} Maybe Text
a -> ListObjectVersions
s {$sel:keyMarker:ListObjectVersions' :: Maybe Text
keyMarker = Maybe Text
a} :: ListObjectVersions)

-- | Use this parameter to select only those keys that begin with the
-- specified prefix. You can use prefixes to separate a bucket into
-- different groupings of keys. (You can think of using prefix to make
-- groups in the same way you\'d use a folder in a file system.) You can
-- use prefix with delimiter to roll up numerous objects into a single
-- result under CommonPrefixes.
listObjectVersions_prefix :: Lens.Lens' ListObjectVersions (Prelude.Maybe Prelude.Text)
listObjectVersions_prefix :: (Maybe Text -> f (Maybe Text))
-> ListObjectVersions -> f ListObjectVersions
listObjectVersions_prefix = (ListObjectVersions -> Maybe Text)
-> (ListObjectVersions -> Maybe Text -> ListObjectVersions)
-> Lens
     ListObjectVersions ListObjectVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersions' {Maybe Text
prefix :: Maybe Text
$sel:prefix:ListObjectVersions' :: ListObjectVersions -> Maybe Text
prefix} -> Maybe Text
prefix) (\s :: ListObjectVersions
s@ListObjectVersions' {} Maybe Text
a -> ListObjectVersions
s {$sel:prefix:ListObjectVersions' :: Maybe Text
prefix = Maybe Text
a} :: ListObjectVersions)

-- | Undocumented member.
listObjectVersions_encodingType :: Lens.Lens' ListObjectVersions (Prelude.Maybe EncodingType)
listObjectVersions_encodingType :: (Maybe EncodingType -> f (Maybe EncodingType))
-> ListObjectVersions -> f ListObjectVersions
listObjectVersions_encodingType = (ListObjectVersions -> Maybe EncodingType)
-> (ListObjectVersions -> Maybe EncodingType -> ListObjectVersions)
-> Lens
     ListObjectVersions
     ListObjectVersions
     (Maybe EncodingType)
     (Maybe EncodingType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersions' {Maybe EncodingType
encodingType :: Maybe EncodingType
$sel:encodingType:ListObjectVersions' :: ListObjectVersions -> Maybe EncodingType
encodingType} -> Maybe EncodingType
encodingType) (\s :: ListObjectVersions
s@ListObjectVersions' {} Maybe EncodingType
a -> ListObjectVersions
s {$sel:encodingType:ListObjectVersions' :: Maybe EncodingType
encodingType = Maybe EncodingType
a} :: ListObjectVersions)

-- | Specifies the object version you want to start listing from.
listObjectVersions_versionIdMarker :: Lens.Lens' ListObjectVersions (Prelude.Maybe Prelude.Text)
listObjectVersions_versionIdMarker :: (Maybe Text -> f (Maybe Text))
-> ListObjectVersions -> f ListObjectVersions
listObjectVersions_versionIdMarker = (ListObjectVersions -> Maybe Text)
-> (ListObjectVersions -> Maybe Text -> ListObjectVersions)
-> Lens
     ListObjectVersions ListObjectVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersions' {Maybe Text
versionIdMarker :: Maybe Text
$sel:versionIdMarker:ListObjectVersions' :: ListObjectVersions -> Maybe Text
versionIdMarker} -> Maybe Text
versionIdMarker) (\s :: ListObjectVersions
s@ListObjectVersions' {} Maybe Text
a -> ListObjectVersions
s {$sel:versionIdMarker:ListObjectVersions' :: Maybe Text
versionIdMarker = Maybe Text
a} :: ListObjectVersions)

-- | Sets the maximum number of keys returned in the response. By default the
-- action returns up to 1,000 key names. The response might contain fewer
-- keys but will never contain more. If additional keys satisfy the search
-- criteria, but were not returned because max-keys was exceeded, the
-- response contains \<isTruncated>true\<\/isTruncated>. To return the
-- additional keys, see key-marker and version-id-marker.
listObjectVersions_maxKeys :: Lens.Lens' ListObjectVersions (Prelude.Maybe Prelude.Int)
listObjectVersions_maxKeys :: (Maybe Int -> f (Maybe Int))
-> ListObjectVersions -> f ListObjectVersions
listObjectVersions_maxKeys = (ListObjectVersions -> Maybe Int)
-> (ListObjectVersions -> Maybe Int -> ListObjectVersions)
-> Lens
     ListObjectVersions ListObjectVersions (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersions' {Maybe Int
maxKeys :: Maybe Int
$sel:maxKeys:ListObjectVersions' :: ListObjectVersions -> Maybe Int
maxKeys} -> Maybe Int
maxKeys) (\s :: ListObjectVersions
s@ListObjectVersions' {} Maybe Int
a -> ListObjectVersions
s {$sel:maxKeys:ListObjectVersions' :: Maybe Int
maxKeys = Maybe Int
a} :: ListObjectVersions)

-- | A delimiter is a character that you specify to group keys. All keys that
-- contain the same string between the @prefix@ and the first occurrence of
-- the delimiter are grouped under a single result element in
-- CommonPrefixes. These groups are counted as one result against the
-- max-keys limitation. These keys are not returned elsewhere in the
-- response.
listObjectVersions_delimiter :: Lens.Lens' ListObjectVersions (Prelude.Maybe Delimiter)
listObjectVersions_delimiter :: (Maybe Delimiter -> f (Maybe Delimiter))
-> ListObjectVersions -> f ListObjectVersions
listObjectVersions_delimiter = (ListObjectVersions -> Maybe Delimiter)
-> (ListObjectVersions -> Maybe Delimiter -> ListObjectVersions)
-> Lens
     ListObjectVersions
     ListObjectVersions
     (Maybe Delimiter)
     (Maybe Delimiter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersions' {Maybe Delimiter
delimiter :: Maybe Delimiter
$sel:delimiter:ListObjectVersions' :: ListObjectVersions -> Maybe Delimiter
delimiter} -> Maybe Delimiter
delimiter) (\s :: ListObjectVersions
s@ListObjectVersions' {} Maybe Delimiter
a -> ListObjectVersions
s {$sel:delimiter:ListObjectVersions' :: Maybe Delimiter
delimiter = Maybe Delimiter
a} :: ListObjectVersions)

-- | The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request will fail with an HTTP
-- @403 (Access Denied)@ error.
listObjectVersions_expectedBucketOwner :: Lens.Lens' ListObjectVersions (Prelude.Maybe Prelude.Text)
listObjectVersions_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> ListObjectVersions -> f ListObjectVersions
listObjectVersions_expectedBucketOwner = (ListObjectVersions -> Maybe Text)
-> (ListObjectVersions -> Maybe Text -> ListObjectVersions)
-> Lens
     ListObjectVersions ListObjectVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersions' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:ListObjectVersions' :: ListObjectVersions -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: ListObjectVersions
s@ListObjectVersions' {} Maybe Text
a -> ListObjectVersions
s {$sel:expectedBucketOwner:ListObjectVersions' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: ListObjectVersions)

-- | The bucket name that contains the objects.
listObjectVersions_bucket :: Lens.Lens' ListObjectVersions BucketName
listObjectVersions_bucket :: (BucketName -> f BucketName)
-> ListObjectVersions -> f ListObjectVersions
listObjectVersions_bucket = (ListObjectVersions -> BucketName)
-> (ListObjectVersions -> BucketName -> ListObjectVersions)
-> Lens ListObjectVersions ListObjectVersions BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersions' {BucketName
bucket :: BucketName
$sel:bucket:ListObjectVersions' :: ListObjectVersions -> BucketName
bucket} -> BucketName
bucket) (\s :: ListObjectVersions
s@ListObjectVersions' {} BucketName
a -> ListObjectVersions
s {$sel:bucket:ListObjectVersions' :: BucketName
bucket = BucketName
a} :: ListObjectVersions)

instance Core.AWSPager ListObjectVersions where
  page :: ListObjectVersions
-> AWSResponse ListObjectVersions -> Maybe ListObjectVersions
page ListObjectVersions
rq AWSResponse ListObjectVersions
rs
    | Maybe Bool -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListObjectVersions
ListObjectVersionsResponse
rs
            ListObjectVersionsResponse
-> Getting (First Bool) ListObjectVersionsResponse Bool
-> Maybe Bool
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Bool -> Const (First Bool) (Maybe Bool))
-> ListObjectVersionsResponse
-> Const (First Bool) ListObjectVersionsResponse
Lens' ListObjectVersionsResponse (Maybe Bool)
listObjectVersionsResponse_isTruncated
              ((Maybe Bool -> Const (First Bool) (Maybe Bool))
 -> ListObjectVersionsResponse
 -> Const (First Bool) ListObjectVersionsResponse)
-> ((Bool -> Const (First Bool) Bool)
    -> Maybe Bool -> Const (First Bool) (Maybe Bool))
-> Getting (First Bool) ListObjectVersionsResponse Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Bool -> Const (First Bool) Bool)
-> Maybe Bool -> Const (First Bool) (Maybe Bool)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListObjectVersions
forall a. Maybe a
Prelude.Nothing
    | Maybe Text -> Bool
forall a. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse ListObjectVersions
ListObjectVersionsResponse
rs
            ListObjectVersionsResponse
-> Getting (First Text) ListObjectVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListObjectVersionsResponse
-> Const (First Text) ListObjectVersionsResponse
Lens' ListObjectVersionsResponse (Maybe Text)
listObjectVersionsResponse_nextKeyMarker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListObjectVersionsResponse
 -> Const (First Text) ListObjectVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListObjectVersionsResponse 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
        )
        Bool -> Bool -> Bool
Prelude.&& Maybe Text -> Bool
forall a. Maybe a -> Bool
Prelude.isNothing
          ( AWSResponse ListObjectVersions
ListObjectVersionsResponse
rs
              ListObjectVersionsResponse
-> Getting (First Text) ListObjectVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListObjectVersionsResponse
-> Const (First Text) ListObjectVersionsResponse
Lens' ListObjectVersionsResponse (Maybe Text)
listObjectVersionsResponse_nextVersionIdMarker
                ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListObjectVersionsResponse
 -> Const (First Text) ListObjectVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListObjectVersionsResponse 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 ListObjectVersions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListObjectVersions -> Maybe ListObjectVersions
forall a. a -> Maybe a
Prelude.Just (ListObjectVersions -> Maybe ListObjectVersions)
-> ListObjectVersions -> Maybe ListObjectVersions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListObjectVersions
rq
          ListObjectVersions
-> (ListObjectVersions -> ListObjectVersions) -> ListObjectVersions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListObjectVersions -> Identity ListObjectVersions
Lens
  ListObjectVersions ListObjectVersions (Maybe Text) (Maybe Text)
listObjectVersions_keyMarker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListObjectVersions -> Identity ListObjectVersions)
-> Maybe Text -> ListObjectVersions -> ListObjectVersions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListObjectVersions
ListObjectVersionsResponse
rs
          ListObjectVersionsResponse
-> Getting (First Text) ListObjectVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListObjectVersionsResponse
-> Const (First Text) ListObjectVersionsResponse
Lens' ListObjectVersionsResponse (Maybe Text)
listObjectVersionsResponse_nextKeyMarker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListObjectVersionsResponse
 -> Const (First Text) ListObjectVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListObjectVersionsResponse 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
          ListObjectVersions
-> (ListObjectVersions -> ListObjectVersions) -> ListObjectVersions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListObjectVersions -> Identity ListObjectVersions
Lens
  ListObjectVersions ListObjectVersions (Maybe Text) (Maybe Text)
listObjectVersions_versionIdMarker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListObjectVersions -> Identity ListObjectVersions)
-> Maybe Text -> ListObjectVersions -> ListObjectVersions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListObjectVersions
ListObjectVersionsResponse
rs
          ListObjectVersionsResponse
-> Getting (First Text) ListObjectVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListObjectVersionsResponse
-> Const (First Text) ListObjectVersionsResponse
Lens' ListObjectVersionsResponse (Maybe Text)
listObjectVersionsResponse_nextVersionIdMarker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListObjectVersionsResponse
 -> Const (First Text) ListObjectVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListObjectVersionsResponse 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 ListObjectVersions where
  type
    AWSResponse ListObjectVersions =
      ListObjectVersionsResponse
  request :: ListObjectVersions -> Request ListObjectVersions
request =
    Request ListObjectVersions -> Request ListObjectVersions
forall a. Request a -> Request a
Request.s3vhost
      (Request ListObjectVersions -> Request ListObjectVersions)
-> (ListObjectVersions -> Request ListObjectVersions)
-> ListObjectVersions
-> Request ListObjectVersions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> ListObjectVersions -> Request ListObjectVersions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListObjectVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListObjectVersions)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse ListObjectVersions))
-> Logger
-> Service
-> Proxy ListObjectVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListObjectVersions)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe Text
-> Maybe [DeleteMarkerEntry]
-> Maybe Text
-> Maybe [CommonPrefix]
-> Maybe EncodingType
-> Maybe [ObjectVersion]
-> Maybe BucketName
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Bool
-> Maybe Delimiter
-> Int
-> ListObjectVersionsResponse
ListObjectVersionsResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe [DeleteMarkerEntry]
 -> Maybe Text
 -> Maybe [CommonPrefix]
 -> Maybe EncodingType
 -> Maybe [ObjectVersion]
 -> Maybe BucketName
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe Bool
 -> Maybe Delimiter
 -> Int
 -> ListObjectVersionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [DeleteMarkerEntry]
      -> Maybe Text
      -> Maybe [CommonPrefix]
      -> Maybe EncodingType
      -> Maybe [ObjectVersion]
      -> Maybe BucketName
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Delimiter
      -> Int
      -> ListObjectVersionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NextVersionIdMarker")
            Either
  String
  (Maybe Text
   -> Maybe [DeleteMarkerEntry]
   -> Maybe Text
   -> Maybe [CommonPrefix]
   -> Maybe EncodingType
   -> Maybe [ObjectVersion]
   -> Maybe BucketName
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Delimiter
   -> Int
   -> ListObjectVersionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [DeleteMarkerEntry]
      -> Maybe Text
      -> Maybe [CommonPrefix]
      -> Maybe EncodingType
      -> Maybe [ObjectVersion]
      -> Maybe BucketName
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Delimiter
      -> Int
      -> ListObjectVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"KeyMarker")
            Either
  String
  (Maybe [DeleteMarkerEntry]
   -> Maybe Text
   -> Maybe [CommonPrefix]
   -> Maybe EncodingType
   -> Maybe [ObjectVersion]
   -> Maybe BucketName
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Delimiter
   -> Int
   -> ListObjectVersionsResponse)
-> Either String (Maybe [DeleteMarkerEntry])
-> Either
     String
     (Maybe Text
      -> Maybe [CommonPrefix]
      -> Maybe EncodingType
      -> Maybe [ObjectVersion]
      -> Maybe BucketName
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Delimiter
      -> Int
      -> ListObjectVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (([Node] -> Either String [DeleteMarkerEntry])
-> [Node] -> Either String (Maybe [DeleteMarkerEntry])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [DeleteMarkerEntry]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"DeleteMarker") [Node]
x)
            Either
  String
  (Maybe Text
   -> Maybe [CommonPrefix]
   -> Maybe EncodingType
   -> Maybe [ObjectVersion]
   -> Maybe BucketName
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Delimiter
   -> Int
   -> ListObjectVersionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [CommonPrefix]
      -> Maybe EncodingType
      -> Maybe [ObjectVersion]
      -> Maybe BucketName
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Delimiter
      -> Int
      -> ListObjectVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Prefix")
            Either
  String
  (Maybe [CommonPrefix]
   -> Maybe EncodingType
   -> Maybe [ObjectVersion]
   -> Maybe BucketName
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Delimiter
   -> Int
   -> ListObjectVersionsResponse)
-> Either String (Maybe [CommonPrefix])
-> Either
     String
     (Maybe EncodingType
      -> Maybe [ObjectVersion]
      -> Maybe BucketName
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Delimiter
      -> Int
      -> ListObjectVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (([Node] -> Either String [CommonPrefix])
-> [Node] -> Either String (Maybe [CommonPrefix])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [CommonPrefix]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"CommonPrefixes") [Node]
x)
            Either
  String
  (Maybe EncodingType
   -> Maybe [ObjectVersion]
   -> Maybe BucketName
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Delimiter
   -> Int
   -> ListObjectVersionsResponse)
-> Either String (Maybe EncodingType)
-> Either
     String
     (Maybe [ObjectVersion]
      -> Maybe BucketName
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Delimiter
      -> Int
      -> ListObjectVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe EncodingType)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EncodingType")
            Either
  String
  (Maybe [ObjectVersion]
   -> Maybe BucketName
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Delimiter
   -> Int
   -> ListObjectVersionsResponse)
-> Either String (Maybe [ObjectVersion])
-> Either
     String
     (Maybe BucketName
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Delimiter
      -> Int
      -> ListObjectVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (([Node] -> Either String [ObjectVersion])
-> [Node] -> Either String (Maybe [ObjectVersion])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [ObjectVersion]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"Version") [Node]
x)
            Either
  String
  (Maybe BucketName
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Delimiter
   -> Int
   -> ListObjectVersionsResponse)
-> Either String (Maybe BucketName)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Delimiter
      -> Int
      -> ListObjectVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe BucketName)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Name")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Delimiter
   -> Int
   -> ListObjectVersionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Delimiter
      -> Int
      -> ListObjectVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NextKeyMarker")
            Either
  String
  (Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Delimiter
   -> Int
   -> ListObjectVersionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Int
      -> Maybe Bool
      -> Maybe Delimiter
      -> Int
      -> ListObjectVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"VersionIdMarker")
            Either
  String
  (Maybe Int
   -> Maybe Bool
   -> Maybe Delimiter
   -> Int
   -> ListObjectVersionsResponse)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe Bool
      -> Maybe Delimiter -> Int -> ListObjectVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"MaxKeys")
            Either
  String
  (Maybe Bool
   -> Maybe Delimiter -> Int -> ListObjectVersionsResponse)
-> Either String (Maybe Bool)
-> Either
     String (Maybe Delimiter -> Int -> ListObjectVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"IsTruncated")
            Either
  String (Maybe Delimiter -> Int -> ListObjectVersionsResponse)
-> Either String (Maybe Delimiter)
-> Either String (Int -> ListObjectVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Delimiter)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Delimiter")
            Either String (Int -> ListObjectVersionsResponse)
-> Either String Int -> Either String ListObjectVersionsResponse
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 ListObjectVersions

instance Prelude.NFData ListObjectVersions

instance Core.ToHeaders ListObjectVersions where
  toHeaders :: ListObjectVersions -> ResponseHeaders
toHeaders ListObjectVersions' {Maybe Delimiter
Maybe Int
Maybe Text
Maybe EncodingType
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
delimiter :: Maybe Delimiter
maxKeys :: Maybe Int
versionIdMarker :: Maybe Text
encodingType :: Maybe EncodingType
prefix :: Maybe Text
keyMarker :: Maybe Text
$sel:bucket:ListObjectVersions' :: ListObjectVersions -> BucketName
$sel:expectedBucketOwner:ListObjectVersions' :: ListObjectVersions -> Maybe Text
$sel:delimiter:ListObjectVersions' :: ListObjectVersions -> Maybe Delimiter
$sel:maxKeys:ListObjectVersions' :: ListObjectVersions -> Maybe Int
$sel:versionIdMarker:ListObjectVersions' :: ListObjectVersions -> Maybe Text
$sel:encodingType:ListObjectVersions' :: ListObjectVersions -> Maybe EncodingType
$sel:prefix:ListObjectVersions' :: ListObjectVersions -> Maybe Text
$sel:keyMarker:ListObjectVersions' :: ListObjectVersions -> Maybe Text
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"x-amz-expected-bucket-owner"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
expectedBucketOwner
      ]

instance Core.ToPath ListObjectVersions where
  toPath :: ListObjectVersions -> ByteString
toPath ListObjectVersions' {Maybe Delimiter
Maybe Int
Maybe Text
Maybe EncodingType
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
delimiter :: Maybe Delimiter
maxKeys :: Maybe Int
versionIdMarker :: Maybe Text
encodingType :: Maybe EncodingType
prefix :: Maybe Text
keyMarker :: Maybe Text
$sel:bucket:ListObjectVersions' :: ListObjectVersions -> BucketName
$sel:expectedBucketOwner:ListObjectVersions' :: ListObjectVersions -> Maybe Text
$sel:delimiter:ListObjectVersions' :: ListObjectVersions -> Maybe Delimiter
$sel:maxKeys:ListObjectVersions' :: ListObjectVersions -> Maybe Int
$sel:versionIdMarker:ListObjectVersions' :: ListObjectVersions -> Maybe Text
$sel:encodingType:ListObjectVersions' :: ListObjectVersions -> Maybe EncodingType
$sel:prefix:ListObjectVersions' :: ListObjectVersions -> Maybe Text
$sel:keyMarker:ListObjectVersions' :: ListObjectVersions -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/", BucketName -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS BucketName
bucket]

instance Core.ToQuery ListObjectVersions where
  toQuery :: ListObjectVersions -> QueryString
toQuery ListObjectVersions' {Maybe Delimiter
Maybe Int
Maybe Text
Maybe EncodingType
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
delimiter :: Maybe Delimiter
maxKeys :: Maybe Int
versionIdMarker :: Maybe Text
encodingType :: Maybe EncodingType
prefix :: Maybe Text
keyMarker :: Maybe Text
$sel:bucket:ListObjectVersions' :: ListObjectVersions -> BucketName
$sel:expectedBucketOwner:ListObjectVersions' :: ListObjectVersions -> Maybe Text
$sel:delimiter:ListObjectVersions' :: ListObjectVersions -> Maybe Delimiter
$sel:maxKeys:ListObjectVersions' :: ListObjectVersions -> Maybe Int
$sel:versionIdMarker:ListObjectVersions' :: ListObjectVersions -> Maybe Text
$sel:encodingType:ListObjectVersions' :: ListObjectVersions -> Maybe EncodingType
$sel:prefix:ListObjectVersions' :: ListObjectVersions -> Maybe Text
$sel:keyMarker:ListObjectVersions' :: ListObjectVersions -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"key-marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
keyMarker,
        ByteString
"prefix" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
prefix,
        ByteString
"encoding-type" ByteString -> Maybe EncodingType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe EncodingType
encodingType,
        ByteString
"version-id-marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
versionIdMarker,
        ByteString
"max-keys" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxKeys,
        ByteString
"delimiter" ByteString -> Maybe Delimiter -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Delimiter
delimiter,
        QueryString
"versions"
      ]

-- | /See:/ 'newListObjectVersionsResponse' smart constructor.
data ListObjectVersionsResponse = ListObjectVersionsResponse'
  { -- | When the number of responses exceeds the value of @MaxKeys@,
    -- @NextVersionIdMarker@ specifies the first object version not returned
    -- that satisfies the search criteria. Use this value for the
    -- version-id-marker request parameter in a subsequent request.
    ListObjectVersionsResponse -> Maybe Text
nextVersionIdMarker :: Prelude.Maybe Prelude.Text,
    -- | Marks the last key returned in a truncated response.
    ListObjectVersionsResponse -> Maybe Text
keyMarker :: Prelude.Maybe Prelude.Text,
    -- | Container for an object that is a delete marker.
    ListObjectVersionsResponse -> Maybe [DeleteMarkerEntry]
deleteMarkers :: Prelude.Maybe [DeleteMarkerEntry],
    -- | Selects objects that start with the value supplied by this parameter.
    ListObjectVersionsResponse -> Maybe Text
prefix :: Prelude.Maybe Prelude.Text,
    -- | All of the keys rolled up into a common prefix count as a single return
    -- when calculating the number of returns.
    ListObjectVersionsResponse -> Maybe [CommonPrefix]
commonPrefixes :: Prelude.Maybe [CommonPrefix],
    -- | Encoding type used by Amazon S3 to encode object key names in the XML
    -- response.
    --
    -- If you specify encoding-type request parameter, Amazon S3 includes this
    -- element in the response, and returns encoded key name values in the
    -- following response elements:
    --
    -- @KeyMarker, NextKeyMarker, Prefix, Key@, and @Delimiter@.
    ListObjectVersionsResponse -> Maybe EncodingType
encodingType :: Prelude.Maybe EncodingType,
    -- | Container for version information.
    ListObjectVersionsResponse -> Maybe [ObjectVersion]
versions :: Prelude.Maybe [ObjectVersion],
    -- | The bucket name.
    ListObjectVersionsResponse -> Maybe BucketName
name :: Prelude.Maybe BucketName,
    -- | When the number of responses exceeds the value of @MaxKeys@,
    -- @NextKeyMarker@ specifies the first key not returned that satisfies the
    -- search criteria. Use this value for the key-marker request parameter in
    -- a subsequent request.
    ListObjectVersionsResponse -> Maybe Text
nextKeyMarker :: Prelude.Maybe Prelude.Text,
    -- | Marks the last version of the key returned in a truncated response.
    ListObjectVersionsResponse -> Maybe Text
versionIdMarker :: Prelude.Maybe Prelude.Text,
    -- | Specifies the maximum number of objects to return.
    ListObjectVersionsResponse -> Maybe Int
maxKeys :: Prelude.Maybe Prelude.Int,
    -- | A flag that indicates whether Amazon S3 returned all of the results that
    -- satisfied the search criteria. If your results were truncated, you can
    -- make a follow-up paginated request using the NextKeyMarker and
    -- NextVersionIdMarker response parameters as a starting place in another
    -- request to return the rest of the results.
    ListObjectVersionsResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
    -- | The delimiter grouping the included keys. A delimiter is a character
    -- that you specify to group keys. All keys that contain the same string
    -- between the prefix and the first occurrence of the delimiter are grouped
    -- under a single result element in @CommonPrefixes@. These groups are
    -- counted as one result against the max-keys limitation. These keys are
    -- not returned elsewhere in the response.
    ListObjectVersionsResponse -> Maybe Delimiter
delimiter :: Prelude.Maybe Delimiter,
    -- | The response's http status code.
    ListObjectVersionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListObjectVersionsResponse -> ListObjectVersionsResponse -> Bool
(ListObjectVersionsResponse -> ListObjectVersionsResponse -> Bool)
-> (ListObjectVersionsResponse
    -> ListObjectVersionsResponse -> Bool)
-> Eq ListObjectVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListObjectVersionsResponse -> ListObjectVersionsResponse -> Bool
$c/= :: ListObjectVersionsResponse -> ListObjectVersionsResponse -> Bool
== :: ListObjectVersionsResponse -> ListObjectVersionsResponse -> Bool
$c== :: ListObjectVersionsResponse -> ListObjectVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListObjectVersionsResponse]
ReadPrec ListObjectVersionsResponse
Int -> ReadS ListObjectVersionsResponse
ReadS [ListObjectVersionsResponse]
(Int -> ReadS ListObjectVersionsResponse)
-> ReadS [ListObjectVersionsResponse]
-> ReadPrec ListObjectVersionsResponse
-> ReadPrec [ListObjectVersionsResponse]
-> Read ListObjectVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListObjectVersionsResponse]
$creadListPrec :: ReadPrec [ListObjectVersionsResponse]
readPrec :: ReadPrec ListObjectVersionsResponse
$creadPrec :: ReadPrec ListObjectVersionsResponse
readList :: ReadS [ListObjectVersionsResponse]
$creadList :: ReadS [ListObjectVersionsResponse]
readsPrec :: Int -> ReadS ListObjectVersionsResponse
$creadsPrec :: Int -> ReadS ListObjectVersionsResponse
Prelude.Read, Int -> ListObjectVersionsResponse -> ShowS
[ListObjectVersionsResponse] -> ShowS
ListObjectVersionsResponse -> String
(Int -> ListObjectVersionsResponse -> ShowS)
-> (ListObjectVersionsResponse -> String)
-> ([ListObjectVersionsResponse] -> ShowS)
-> Show ListObjectVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListObjectVersionsResponse] -> ShowS
$cshowList :: [ListObjectVersionsResponse] -> ShowS
show :: ListObjectVersionsResponse -> String
$cshow :: ListObjectVersionsResponse -> String
showsPrec :: Int -> ListObjectVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListObjectVersionsResponse -> ShowS
Prelude.Show, (forall x.
 ListObjectVersionsResponse -> Rep ListObjectVersionsResponse x)
-> (forall x.
    Rep ListObjectVersionsResponse x -> ListObjectVersionsResponse)
-> Generic ListObjectVersionsResponse
forall x.
Rep ListObjectVersionsResponse x -> ListObjectVersionsResponse
forall x.
ListObjectVersionsResponse -> Rep ListObjectVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListObjectVersionsResponse x -> ListObjectVersionsResponse
$cfrom :: forall x.
ListObjectVersionsResponse -> Rep ListObjectVersionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListObjectVersionsResponse' 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:
--
-- 'nextVersionIdMarker', 'listObjectVersionsResponse_nextVersionIdMarker' - When the number of responses exceeds the value of @MaxKeys@,
-- @NextVersionIdMarker@ specifies the first object version not returned
-- that satisfies the search criteria. Use this value for the
-- version-id-marker request parameter in a subsequent request.
--
-- 'keyMarker', 'listObjectVersionsResponse_keyMarker' - Marks the last key returned in a truncated response.
--
-- 'deleteMarkers', 'listObjectVersionsResponse_deleteMarkers' - Container for an object that is a delete marker.
--
-- 'prefix', 'listObjectVersionsResponse_prefix' - Selects objects that start with the value supplied by this parameter.
--
-- 'commonPrefixes', 'listObjectVersionsResponse_commonPrefixes' - All of the keys rolled up into a common prefix count as a single return
-- when calculating the number of returns.
--
-- 'encodingType', 'listObjectVersionsResponse_encodingType' - Encoding type used by Amazon S3 to encode object key names in the XML
-- response.
--
-- If you specify encoding-type request parameter, Amazon S3 includes this
-- element in the response, and returns encoded key name values in the
-- following response elements:
--
-- @KeyMarker, NextKeyMarker, Prefix, Key@, and @Delimiter@.
--
-- 'versions', 'listObjectVersionsResponse_versions' - Container for version information.
--
-- 'name', 'listObjectVersionsResponse_name' - The bucket name.
--
-- 'nextKeyMarker', 'listObjectVersionsResponse_nextKeyMarker' - When the number of responses exceeds the value of @MaxKeys@,
-- @NextKeyMarker@ specifies the first key not returned that satisfies the
-- search criteria. Use this value for the key-marker request parameter in
-- a subsequent request.
--
-- 'versionIdMarker', 'listObjectVersionsResponse_versionIdMarker' - Marks the last version of the key returned in a truncated response.
--
-- 'maxKeys', 'listObjectVersionsResponse_maxKeys' - Specifies the maximum number of objects to return.
--
-- 'isTruncated', 'listObjectVersionsResponse_isTruncated' - A flag that indicates whether Amazon S3 returned all of the results that
-- satisfied the search criteria. If your results were truncated, you can
-- make a follow-up paginated request using the NextKeyMarker and
-- NextVersionIdMarker response parameters as a starting place in another
-- request to return the rest of the results.
--
-- 'delimiter', 'listObjectVersionsResponse_delimiter' - The delimiter grouping the included keys. A delimiter is a character
-- that you specify to group keys. All keys that contain the same string
-- between the prefix and the first occurrence of the delimiter are grouped
-- under a single result element in @CommonPrefixes@. These groups are
-- counted as one result against the max-keys limitation. These keys are
-- not returned elsewhere in the response.
--
-- 'httpStatus', 'listObjectVersionsResponse_httpStatus' - The response's http status code.
newListObjectVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListObjectVersionsResponse
newListObjectVersionsResponse :: Int -> ListObjectVersionsResponse
newListObjectVersionsResponse Int
pHttpStatus_ =
  ListObjectVersionsResponse' :: Maybe Text
-> Maybe Text
-> Maybe [DeleteMarkerEntry]
-> Maybe Text
-> Maybe [CommonPrefix]
-> Maybe EncodingType
-> Maybe [ObjectVersion]
-> Maybe BucketName
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Bool
-> Maybe Delimiter
-> Int
-> ListObjectVersionsResponse
ListObjectVersionsResponse'
    { $sel:nextVersionIdMarker:ListObjectVersionsResponse' :: Maybe Text
nextVersionIdMarker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:keyMarker:ListObjectVersionsResponse' :: Maybe Text
keyMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deleteMarkers:ListObjectVersionsResponse' :: Maybe [DeleteMarkerEntry]
deleteMarkers = Maybe [DeleteMarkerEntry]
forall a. Maybe a
Prelude.Nothing,
      $sel:prefix:ListObjectVersionsResponse' :: Maybe Text
prefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:commonPrefixes:ListObjectVersionsResponse' :: Maybe [CommonPrefix]
commonPrefixes = Maybe [CommonPrefix]
forall a. Maybe a
Prelude.Nothing,
      $sel:encodingType:ListObjectVersionsResponse' :: Maybe EncodingType
encodingType = Maybe EncodingType
forall a. Maybe a
Prelude.Nothing,
      $sel:versions:ListObjectVersionsResponse' :: Maybe [ObjectVersion]
versions = Maybe [ObjectVersion]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ListObjectVersionsResponse' :: Maybe BucketName
name = Maybe BucketName
forall a. Maybe a
Prelude.Nothing,
      $sel:nextKeyMarker:ListObjectVersionsResponse' :: Maybe Text
nextKeyMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:versionIdMarker:ListObjectVersionsResponse' :: Maybe Text
versionIdMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxKeys:ListObjectVersionsResponse' :: Maybe Int
maxKeys = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:isTruncated:ListObjectVersionsResponse' :: Maybe Bool
isTruncated = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:delimiter:ListObjectVersionsResponse' :: Maybe Delimiter
delimiter = Maybe Delimiter
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListObjectVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | When the number of responses exceeds the value of @MaxKeys@,
-- @NextVersionIdMarker@ specifies the first object version not returned
-- that satisfies the search criteria. Use this value for the
-- version-id-marker request parameter in a subsequent request.
listObjectVersionsResponse_nextVersionIdMarker :: Lens.Lens' ListObjectVersionsResponse (Prelude.Maybe Prelude.Text)
listObjectVersionsResponse_nextVersionIdMarker :: (Maybe Text -> f (Maybe Text))
-> ListObjectVersionsResponse -> f ListObjectVersionsResponse
listObjectVersionsResponse_nextVersionIdMarker = (ListObjectVersionsResponse -> Maybe Text)
-> (ListObjectVersionsResponse
    -> Maybe Text -> ListObjectVersionsResponse)
-> Lens' ListObjectVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersionsResponse' {Maybe Text
nextVersionIdMarker :: Maybe Text
$sel:nextVersionIdMarker:ListObjectVersionsResponse' :: ListObjectVersionsResponse -> Maybe Text
nextVersionIdMarker} -> Maybe Text
nextVersionIdMarker) (\s :: ListObjectVersionsResponse
s@ListObjectVersionsResponse' {} Maybe Text
a -> ListObjectVersionsResponse
s {$sel:nextVersionIdMarker:ListObjectVersionsResponse' :: Maybe Text
nextVersionIdMarker = Maybe Text
a} :: ListObjectVersionsResponse)

-- | Marks the last key returned in a truncated response.
listObjectVersionsResponse_keyMarker :: Lens.Lens' ListObjectVersionsResponse (Prelude.Maybe Prelude.Text)
listObjectVersionsResponse_keyMarker :: (Maybe Text -> f (Maybe Text))
-> ListObjectVersionsResponse -> f ListObjectVersionsResponse
listObjectVersionsResponse_keyMarker = (ListObjectVersionsResponse -> Maybe Text)
-> (ListObjectVersionsResponse
    -> Maybe Text -> ListObjectVersionsResponse)
-> Lens' ListObjectVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersionsResponse' {Maybe Text
keyMarker :: Maybe Text
$sel:keyMarker:ListObjectVersionsResponse' :: ListObjectVersionsResponse -> Maybe Text
keyMarker} -> Maybe Text
keyMarker) (\s :: ListObjectVersionsResponse
s@ListObjectVersionsResponse' {} Maybe Text
a -> ListObjectVersionsResponse
s {$sel:keyMarker:ListObjectVersionsResponse' :: Maybe Text
keyMarker = Maybe Text
a} :: ListObjectVersionsResponse)

-- | Container for an object that is a delete marker.
listObjectVersionsResponse_deleteMarkers :: Lens.Lens' ListObjectVersionsResponse (Prelude.Maybe [DeleteMarkerEntry])
listObjectVersionsResponse_deleteMarkers :: (Maybe [DeleteMarkerEntry] -> f (Maybe [DeleteMarkerEntry]))
-> ListObjectVersionsResponse -> f ListObjectVersionsResponse
listObjectVersionsResponse_deleteMarkers = (ListObjectVersionsResponse -> Maybe [DeleteMarkerEntry])
-> (ListObjectVersionsResponse
    -> Maybe [DeleteMarkerEntry] -> ListObjectVersionsResponse)
-> Lens
     ListObjectVersionsResponse
     ListObjectVersionsResponse
     (Maybe [DeleteMarkerEntry])
     (Maybe [DeleteMarkerEntry])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersionsResponse' {Maybe [DeleteMarkerEntry]
deleteMarkers :: Maybe [DeleteMarkerEntry]
$sel:deleteMarkers:ListObjectVersionsResponse' :: ListObjectVersionsResponse -> Maybe [DeleteMarkerEntry]
deleteMarkers} -> Maybe [DeleteMarkerEntry]
deleteMarkers) (\s :: ListObjectVersionsResponse
s@ListObjectVersionsResponse' {} Maybe [DeleteMarkerEntry]
a -> ListObjectVersionsResponse
s {$sel:deleteMarkers:ListObjectVersionsResponse' :: Maybe [DeleteMarkerEntry]
deleteMarkers = Maybe [DeleteMarkerEntry]
a} :: ListObjectVersionsResponse) ((Maybe [DeleteMarkerEntry] -> f (Maybe [DeleteMarkerEntry]))
 -> ListObjectVersionsResponse -> f ListObjectVersionsResponse)
-> ((Maybe [DeleteMarkerEntry] -> f (Maybe [DeleteMarkerEntry]))
    -> Maybe [DeleteMarkerEntry] -> f (Maybe [DeleteMarkerEntry]))
-> (Maybe [DeleteMarkerEntry] -> f (Maybe [DeleteMarkerEntry]))
-> ListObjectVersionsResponse
-> f ListObjectVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DeleteMarkerEntry]
  [DeleteMarkerEntry]
  [DeleteMarkerEntry]
  [DeleteMarkerEntry]
-> Iso
     (Maybe [DeleteMarkerEntry])
     (Maybe [DeleteMarkerEntry])
     (Maybe [DeleteMarkerEntry])
     (Maybe [DeleteMarkerEntry])
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
  [DeleteMarkerEntry]
  [DeleteMarkerEntry]
  [DeleteMarkerEntry]
  [DeleteMarkerEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Selects objects that start with the value supplied by this parameter.
listObjectVersionsResponse_prefix :: Lens.Lens' ListObjectVersionsResponse (Prelude.Maybe Prelude.Text)
listObjectVersionsResponse_prefix :: (Maybe Text -> f (Maybe Text))
-> ListObjectVersionsResponse -> f ListObjectVersionsResponse
listObjectVersionsResponse_prefix = (ListObjectVersionsResponse -> Maybe Text)
-> (ListObjectVersionsResponse
    -> Maybe Text -> ListObjectVersionsResponse)
-> Lens' ListObjectVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersionsResponse' {Maybe Text
prefix :: Maybe Text
$sel:prefix:ListObjectVersionsResponse' :: ListObjectVersionsResponse -> Maybe Text
prefix} -> Maybe Text
prefix) (\s :: ListObjectVersionsResponse
s@ListObjectVersionsResponse' {} Maybe Text
a -> ListObjectVersionsResponse
s {$sel:prefix:ListObjectVersionsResponse' :: Maybe Text
prefix = Maybe Text
a} :: ListObjectVersionsResponse)

-- | All of the keys rolled up into a common prefix count as a single return
-- when calculating the number of returns.
listObjectVersionsResponse_commonPrefixes :: Lens.Lens' ListObjectVersionsResponse (Prelude.Maybe [CommonPrefix])
listObjectVersionsResponse_commonPrefixes :: (Maybe [CommonPrefix] -> f (Maybe [CommonPrefix]))
-> ListObjectVersionsResponse -> f ListObjectVersionsResponse
listObjectVersionsResponse_commonPrefixes = (ListObjectVersionsResponse -> Maybe [CommonPrefix])
-> (ListObjectVersionsResponse
    -> Maybe [CommonPrefix] -> ListObjectVersionsResponse)
-> Lens
     ListObjectVersionsResponse
     ListObjectVersionsResponse
     (Maybe [CommonPrefix])
     (Maybe [CommonPrefix])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersionsResponse' {Maybe [CommonPrefix]
commonPrefixes :: Maybe [CommonPrefix]
$sel:commonPrefixes:ListObjectVersionsResponse' :: ListObjectVersionsResponse -> Maybe [CommonPrefix]
commonPrefixes} -> Maybe [CommonPrefix]
commonPrefixes) (\s :: ListObjectVersionsResponse
s@ListObjectVersionsResponse' {} Maybe [CommonPrefix]
a -> ListObjectVersionsResponse
s {$sel:commonPrefixes:ListObjectVersionsResponse' :: Maybe [CommonPrefix]
commonPrefixes = Maybe [CommonPrefix]
a} :: ListObjectVersionsResponse) ((Maybe [CommonPrefix] -> f (Maybe [CommonPrefix]))
 -> ListObjectVersionsResponse -> f ListObjectVersionsResponse)
-> ((Maybe [CommonPrefix] -> f (Maybe [CommonPrefix]))
    -> Maybe [CommonPrefix] -> f (Maybe [CommonPrefix]))
-> (Maybe [CommonPrefix] -> f (Maybe [CommonPrefix]))
-> ListObjectVersionsResponse
-> f ListObjectVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [CommonPrefix] [CommonPrefix] [CommonPrefix] [CommonPrefix]
-> Iso
     (Maybe [CommonPrefix])
     (Maybe [CommonPrefix])
     (Maybe [CommonPrefix])
     (Maybe [CommonPrefix])
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 [CommonPrefix] [CommonPrefix] [CommonPrefix] [CommonPrefix]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Encoding type used by Amazon S3 to encode object key names in the XML
-- response.
--
-- If you specify encoding-type request parameter, Amazon S3 includes this
-- element in the response, and returns encoded key name values in the
-- following response elements:
--
-- @KeyMarker, NextKeyMarker, Prefix, Key@, and @Delimiter@.
listObjectVersionsResponse_encodingType :: Lens.Lens' ListObjectVersionsResponse (Prelude.Maybe EncodingType)
listObjectVersionsResponse_encodingType :: (Maybe EncodingType -> f (Maybe EncodingType))
-> ListObjectVersionsResponse -> f ListObjectVersionsResponse
listObjectVersionsResponse_encodingType = (ListObjectVersionsResponse -> Maybe EncodingType)
-> (ListObjectVersionsResponse
    -> Maybe EncodingType -> ListObjectVersionsResponse)
-> Lens
     ListObjectVersionsResponse
     ListObjectVersionsResponse
     (Maybe EncodingType)
     (Maybe EncodingType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersionsResponse' {Maybe EncodingType
encodingType :: Maybe EncodingType
$sel:encodingType:ListObjectVersionsResponse' :: ListObjectVersionsResponse -> Maybe EncodingType
encodingType} -> Maybe EncodingType
encodingType) (\s :: ListObjectVersionsResponse
s@ListObjectVersionsResponse' {} Maybe EncodingType
a -> ListObjectVersionsResponse
s {$sel:encodingType:ListObjectVersionsResponse' :: Maybe EncodingType
encodingType = Maybe EncodingType
a} :: ListObjectVersionsResponse)

-- | Container for version information.
listObjectVersionsResponse_versions :: Lens.Lens' ListObjectVersionsResponse (Prelude.Maybe [ObjectVersion])
listObjectVersionsResponse_versions :: (Maybe [ObjectVersion] -> f (Maybe [ObjectVersion]))
-> ListObjectVersionsResponse -> f ListObjectVersionsResponse
listObjectVersionsResponse_versions = (ListObjectVersionsResponse -> Maybe [ObjectVersion])
-> (ListObjectVersionsResponse
    -> Maybe [ObjectVersion] -> ListObjectVersionsResponse)
-> Lens
     ListObjectVersionsResponse
     ListObjectVersionsResponse
     (Maybe [ObjectVersion])
     (Maybe [ObjectVersion])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersionsResponse' {Maybe [ObjectVersion]
versions :: Maybe [ObjectVersion]
$sel:versions:ListObjectVersionsResponse' :: ListObjectVersionsResponse -> Maybe [ObjectVersion]
versions} -> Maybe [ObjectVersion]
versions) (\s :: ListObjectVersionsResponse
s@ListObjectVersionsResponse' {} Maybe [ObjectVersion]
a -> ListObjectVersionsResponse
s {$sel:versions:ListObjectVersionsResponse' :: Maybe [ObjectVersion]
versions = Maybe [ObjectVersion]
a} :: ListObjectVersionsResponse) ((Maybe [ObjectVersion] -> f (Maybe [ObjectVersion]))
 -> ListObjectVersionsResponse -> f ListObjectVersionsResponse)
-> ((Maybe [ObjectVersion] -> f (Maybe [ObjectVersion]))
    -> Maybe [ObjectVersion] -> f (Maybe [ObjectVersion]))
-> (Maybe [ObjectVersion] -> f (Maybe [ObjectVersion]))
-> ListObjectVersionsResponse
-> f ListObjectVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ObjectVersion] [ObjectVersion] [ObjectVersion] [ObjectVersion]
-> Iso
     (Maybe [ObjectVersion])
     (Maybe [ObjectVersion])
     (Maybe [ObjectVersion])
     (Maybe [ObjectVersion])
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
  [ObjectVersion] [ObjectVersion] [ObjectVersion] [ObjectVersion]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The bucket name.
listObjectVersionsResponse_name :: Lens.Lens' ListObjectVersionsResponse (Prelude.Maybe BucketName)
listObjectVersionsResponse_name :: (Maybe BucketName -> f (Maybe BucketName))
-> ListObjectVersionsResponse -> f ListObjectVersionsResponse
listObjectVersionsResponse_name = (ListObjectVersionsResponse -> Maybe BucketName)
-> (ListObjectVersionsResponse
    -> Maybe BucketName -> ListObjectVersionsResponse)
-> Lens
     ListObjectVersionsResponse
     ListObjectVersionsResponse
     (Maybe BucketName)
     (Maybe BucketName)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersionsResponse' {Maybe BucketName
name :: Maybe BucketName
$sel:name:ListObjectVersionsResponse' :: ListObjectVersionsResponse -> Maybe BucketName
name} -> Maybe BucketName
name) (\s :: ListObjectVersionsResponse
s@ListObjectVersionsResponse' {} Maybe BucketName
a -> ListObjectVersionsResponse
s {$sel:name:ListObjectVersionsResponse' :: Maybe BucketName
name = Maybe BucketName
a} :: ListObjectVersionsResponse)

-- | When the number of responses exceeds the value of @MaxKeys@,
-- @NextKeyMarker@ specifies the first key not returned that satisfies the
-- search criteria. Use this value for the key-marker request parameter in
-- a subsequent request.
listObjectVersionsResponse_nextKeyMarker :: Lens.Lens' ListObjectVersionsResponse (Prelude.Maybe Prelude.Text)
listObjectVersionsResponse_nextKeyMarker :: (Maybe Text -> f (Maybe Text))
-> ListObjectVersionsResponse -> f ListObjectVersionsResponse
listObjectVersionsResponse_nextKeyMarker = (ListObjectVersionsResponse -> Maybe Text)
-> (ListObjectVersionsResponse
    -> Maybe Text -> ListObjectVersionsResponse)
-> Lens' ListObjectVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersionsResponse' {Maybe Text
nextKeyMarker :: Maybe Text
$sel:nextKeyMarker:ListObjectVersionsResponse' :: ListObjectVersionsResponse -> Maybe Text
nextKeyMarker} -> Maybe Text
nextKeyMarker) (\s :: ListObjectVersionsResponse
s@ListObjectVersionsResponse' {} Maybe Text
a -> ListObjectVersionsResponse
s {$sel:nextKeyMarker:ListObjectVersionsResponse' :: Maybe Text
nextKeyMarker = Maybe Text
a} :: ListObjectVersionsResponse)

-- | Marks the last version of the key returned in a truncated response.
listObjectVersionsResponse_versionIdMarker :: Lens.Lens' ListObjectVersionsResponse (Prelude.Maybe Prelude.Text)
listObjectVersionsResponse_versionIdMarker :: (Maybe Text -> f (Maybe Text))
-> ListObjectVersionsResponse -> f ListObjectVersionsResponse
listObjectVersionsResponse_versionIdMarker = (ListObjectVersionsResponse -> Maybe Text)
-> (ListObjectVersionsResponse
    -> Maybe Text -> ListObjectVersionsResponse)
-> Lens' ListObjectVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersionsResponse' {Maybe Text
versionIdMarker :: Maybe Text
$sel:versionIdMarker:ListObjectVersionsResponse' :: ListObjectVersionsResponse -> Maybe Text
versionIdMarker} -> Maybe Text
versionIdMarker) (\s :: ListObjectVersionsResponse
s@ListObjectVersionsResponse' {} Maybe Text
a -> ListObjectVersionsResponse
s {$sel:versionIdMarker:ListObjectVersionsResponse' :: Maybe Text
versionIdMarker = Maybe Text
a} :: ListObjectVersionsResponse)

-- | Specifies the maximum number of objects to return.
listObjectVersionsResponse_maxKeys :: Lens.Lens' ListObjectVersionsResponse (Prelude.Maybe Prelude.Int)
listObjectVersionsResponse_maxKeys :: (Maybe Int -> f (Maybe Int))
-> ListObjectVersionsResponse -> f ListObjectVersionsResponse
listObjectVersionsResponse_maxKeys = (ListObjectVersionsResponse -> Maybe Int)
-> (ListObjectVersionsResponse
    -> Maybe Int -> ListObjectVersionsResponse)
-> Lens
     ListObjectVersionsResponse
     ListObjectVersionsResponse
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersionsResponse' {Maybe Int
maxKeys :: Maybe Int
$sel:maxKeys:ListObjectVersionsResponse' :: ListObjectVersionsResponse -> Maybe Int
maxKeys} -> Maybe Int
maxKeys) (\s :: ListObjectVersionsResponse
s@ListObjectVersionsResponse' {} Maybe Int
a -> ListObjectVersionsResponse
s {$sel:maxKeys:ListObjectVersionsResponse' :: Maybe Int
maxKeys = Maybe Int
a} :: ListObjectVersionsResponse)

-- | A flag that indicates whether Amazon S3 returned all of the results that
-- satisfied the search criteria. If your results were truncated, you can
-- make a follow-up paginated request using the NextKeyMarker and
-- NextVersionIdMarker response parameters as a starting place in another
-- request to return the rest of the results.
listObjectVersionsResponse_isTruncated :: Lens.Lens' ListObjectVersionsResponse (Prelude.Maybe Prelude.Bool)
listObjectVersionsResponse_isTruncated :: (Maybe Bool -> f (Maybe Bool))
-> ListObjectVersionsResponse -> f ListObjectVersionsResponse
listObjectVersionsResponse_isTruncated = (ListObjectVersionsResponse -> Maybe Bool)
-> (ListObjectVersionsResponse
    -> Maybe Bool -> ListObjectVersionsResponse)
-> Lens' ListObjectVersionsResponse (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersionsResponse' {Maybe Bool
isTruncated :: Maybe Bool
$sel:isTruncated:ListObjectVersionsResponse' :: ListObjectVersionsResponse -> Maybe Bool
isTruncated} -> Maybe Bool
isTruncated) (\s :: ListObjectVersionsResponse
s@ListObjectVersionsResponse' {} Maybe Bool
a -> ListObjectVersionsResponse
s {$sel:isTruncated:ListObjectVersionsResponse' :: Maybe Bool
isTruncated = Maybe Bool
a} :: ListObjectVersionsResponse)

-- | The delimiter grouping the included keys. A delimiter is a character
-- that you specify to group keys. All keys that contain the same string
-- between the prefix and the first occurrence of the delimiter are grouped
-- under a single result element in @CommonPrefixes@. These groups are
-- counted as one result against the max-keys limitation. These keys are
-- not returned elsewhere in the response.
listObjectVersionsResponse_delimiter :: Lens.Lens' ListObjectVersionsResponse (Prelude.Maybe Delimiter)
listObjectVersionsResponse_delimiter :: (Maybe Delimiter -> f (Maybe Delimiter))
-> ListObjectVersionsResponse -> f ListObjectVersionsResponse
listObjectVersionsResponse_delimiter = (ListObjectVersionsResponse -> Maybe Delimiter)
-> (ListObjectVersionsResponse
    -> Maybe Delimiter -> ListObjectVersionsResponse)
-> Lens
     ListObjectVersionsResponse
     ListObjectVersionsResponse
     (Maybe Delimiter)
     (Maybe Delimiter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectVersionsResponse' {Maybe Delimiter
delimiter :: Maybe Delimiter
$sel:delimiter:ListObjectVersionsResponse' :: ListObjectVersionsResponse -> Maybe Delimiter
delimiter} -> Maybe Delimiter
delimiter) (\s :: ListObjectVersionsResponse
s@ListObjectVersionsResponse' {} Maybe Delimiter
a -> ListObjectVersionsResponse
s {$sel:delimiter:ListObjectVersionsResponse' :: Maybe Delimiter
delimiter = Maybe Delimiter
a} :: ListObjectVersionsResponse)

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

instance Prelude.NFData ListObjectVersionsResponse