{-# 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.SSM.ListDocumentVersions
-- 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)
--
-- List all versions for a document.
--
-- This operation returns paginated results.
module Amazonka.SSM.ListDocumentVersions
  ( -- * Creating a Request
    ListDocumentVersions (..),
    newListDocumentVersions,

    -- * Request Lenses
    listDocumentVersions_nextToken,
    listDocumentVersions_maxResults,
    listDocumentVersions_name,

    -- * Destructuring the Response
    ListDocumentVersionsResponse (..),
    newListDocumentVersionsResponse,

    -- * Response Lenses
    listDocumentVersionsResponse_documentVersions,
    listDocumentVersionsResponse_nextToken,
    listDocumentVersionsResponse_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.SSM.Types

-- | /See:/ 'newListDocumentVersions' smart constructor.
data ListDocumentVersions = ListDocumentVersions'
  { -- | The token for the next set of items to return. (You received this token
    -- from a previous call.)
    ListDocumentVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to return for this call. The call also
    -- returns a token that you can specify in a subsequent call to get the
    -- next set of results.
    ListDocumentVersions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the document. You can specify an Amazon Resource Name (ARN).
    ListDocumentVersions -> Text
name :: Prelude.Text
  }
  deriving (ListDocumentVersions -> ListDocumentVersions -> Bool
(ListDocumentVersions -> ListDocumentVersions -> Bool)
-> (ListDocumentVersions -> ListDocumentVersions -> Bool)
-> Eq ListDocumentVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDocumentVersions -> ListDocumentVersions -> Bool
$c/= :: ListDocumentVersions -> ListDocumentVersions -> Bool
== :: ListDocumentVersions -> ListDocumentVersions -> Bool
$c== :: ListDocumentVersions -> ListDocumentVersions -> Bool
Prelude.Eq, ReadPrec [ListDocumentVersions]
ReadPrec ListDocumentVersions
Int -> ReadS ListDocumentVersions
ReadS [ListDocumentVersions]
(Int -> ReadS ListDocumentVersions)
-> ReadS [ListDocumentVersions]
-> ReadPrec ListDocumentVersions
-> ReadPrec [ListDocumentVersions]
-> Read ListDocumentVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDocumentVersions]
$creadListPrec :: ReadPrec [ListDocumentVersions]
readPrec :: ReadPrec ListDocumentVersions
$creadPrec :: ReadPrec ListDocumentVersions
readList :: ReadS [ListDocumentVersions]
$creadList :: ReadS [ListDocumentVersions]
readsPrec :: Int -> ReadS ListDocumentVersions
$creadsPrec :: Int -> ReadS ListDocumentVersions
Prelude.Read, Int -> ListDocumentVersions -> ShowS
[ListDocumentVersions] -> ShowS
ListDocumentVersions -> String
(Int -> ListDocumentVersions -> ShowS)
-> (ListDocumentVersions -> String)
-> ([ListDocumentVersions] -> ShowS)
-> Show ListDocumentVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDocumentVersions] -> ShowS
$cshowList :: [ListDocumentVersions] -> ShowS
show :: ListDocumentVersions -> String
$cshow :: ListDocumentVersions -> String
showsPrec :: Int -> ListDocumentVersions -> ShowS
$cshowsPrec :: Int -> ListDocumentVersions -> ShowS
Prelude.Show, (forall x. ListDocumentVersions -> Rep ListDocumentVersions x)
-> (forall x. Rep ListDocumentVersions x -> ListDocumentVersions)
-> Generic ListDocumentVersions
forall x. Rep ListDocumentVersions x -> ListDocumentVersions
forall x. ListDocumentVersions -> Rep ListDocumentVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDocumentVersions x -> ListDocumentVersions
$cfrom :: forall x. ListDocumentVersions -> Rep ListDocumentVersions x
Prelude.Generic)

-- |
-- Create a value of 'ListDocumentVersions' 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:
--
-- 'nextToken', 'listDocumentVersions_nextToken' - The token for the next set of items to return. (You received this token
-- from a previous call.)
--
-- 'maxResults', 'listDocumentVersions_maxResults' - The maximum number of items to return for this call. The call also
-- returns a token that you can specify in a subsequent call to get the
-- next set of results.
--
-- 'name', 'listDocumentVersions_name' - The name of the document. You can specify an Amazon Resource Name (ARN).
newListDocumentVersions ::
  -- | 'name'
  Prelude.Text ->
  ListDocumentVersions
newListDocumentVersions :: Text -> ListDocumentVersions
newListDocumentVersions Text
pName_ =
  ListDocumentVersions' :: Maybe Text -> Maybe Natural -> Text -> ListDocumentVersions
ListDocumentVersions'
    { $sel:nextToken:ListDocumentVersions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListDocumentVersions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ListDocumentVersions' :: Text
name = Text
pName_
    }

-- | The token for the next set of items to return. (You received this token
-- from a previous call.)
listDocumentVersions_nextToken :: Lens.Lens' ListDocumentVersions (Prelude.Maybe Prelude.Text)
listDocumentVersions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDocumentVersions -> f ListDocumentVersions
listDocumentVersions_nextToken = (ListDocumentVersions -> Maybe Text)
-> (ListDocumentVersions -> Maybe Text -> ListDocumentVersions)
-> Lens
     ListDocumentVersions ListDocumentVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDocumentVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDocumentVersions' :: ListDocumentVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDocumentVersions
s@ListDocumentVersions' {} Maybe Text
a -> ListDocumentVersions
s {$sel:nextToken:ListDocumentVersions' :: Maybe Text
nextToken = Maybe Text
a} :: ListDocumentVersions)

-- | The maximum number of items to return for this call. The call also
-- returns a token that you can specify in a subsequent call to get the
-- next set of results.
listDocumentVersions_maxResults :: Lens.Lens' ListDocumentVersions (Prelude.Maybe Prelude.Natural)
listDocumentVersions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListDocumentVersions -> f ListDocumentVersions
listDocumentVersions_maxResults = (ListDocumentVersions -> Maybe Natural)
-> (ListDocumentVersions -> Maybe Natural -> ListDocumentVersions)
-> Lens
     ListDocumentVersions
     ListDocumentVersions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDocumentVersions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDocumentVersions' :: ListDocumentVersions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDocumentVersions
s@ListDocumentVersions' {} Maybe Natural
a -> ListDocumentVersions
s {$sel:maxResults:ListDocumentVersions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDocumentVersions)

-- | The name of the document. You can specify an Amazon Resource Name (ARN).
listDocumentVersions_name :: Lens.Lens' ListDocumentVersions Prelude.Text
listDocumentVersions_name :: (Text -> f Text) -> ListDocumentVersions -> f ListDocumentVersions
listDocumentVersions_name = (ListDocumentVersions -> Text)
-> (ListDocumentVersions -> Text -> ListDocumentVersions)
-> Lens ListDocumentVersions ListDocumentVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDocumentVersions' {Text
name :: Text
$sel:name:ListDocumentVersions' :: ListDocumentVersions -> Text
name} -> Text
name) (\s :: ListDocumentVersions
s@ListDocumentVersions' {} Text
a -> ListDocumentVersions
s {$sel:name:ListDocumentVersions' :: Text
name = Text
a} :: ListDocumentVersions)

instance Core.AWSPager ListDocumentVersions where
  page :: ListDocumentVersions
-> AWSResponse ListDocumentVersions -> Maybe ListDocumentVersions
page ListDocumentVersions
rq AWSResponse ListDocumentVersions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDocumentVersions
ListDocumentVersionsResponse
rs
            ListDocumentVersionsResponse
-> Getting (First Text) ListDocumentVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDocumentVersionsResponse
-> Const (First Text) ListDocumentVersionsResponse
Lens' ListDocumentVersionsResponse (Maybe Text)
listDocumentVersionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDocumentVersionsResponse
 -> Const (First Text) ListDocumentVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDocumentVersionsResponse 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 ListDocumentVersions
forall a. Maybe a
Prelude.Nothing
    | Maybe [DocumentVersionInfo] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDocumentVersions
ListDocumentVersionsResponse
rs
            ListDocumentVersionsResponse
-> Getting
     (First [DocumentVersionInfo])
     ListDocumentVersionsResponse
     [DocumentVersionInfo]
-> Maybe [DocumentVersionInfo]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe (NonEmpty DocumentVersionInfo)
 -> Const
      (First [DocumentVersionInfo])
      (Maybe (NonEmpty DocumentVersionInfo)))
-> ListDocumentVersionsResponse
-> Const (First [DocumentVersionInfo]) ListDocumentVersionsResponse
Lens'
  ListDocumentVersionsResponse (Maybe (NonEmpty DocumentVersionInfo))
listDocumentVersionsResponse_documentVersions
              ((Maybe (NonEmpty DocumentVersionInfo)
  -> Const
       (First [DocumentVersionInfo])
       (Maybe (NonEmpty DocumentVersionInfo)))
 -> ListDocumentVersionsResponse
 -> Const
      (First [DocumentVersionInfo]) ListDocumentVersionsResponse)
-> (([DocumentVersionInfo]
     -> Const (First [DocumentVersionInfo]) [DocumentVersionInfo])
    -> Maybe (NonEmpty DocumentVersionInfo)
    -> Const
         (First [DocumentVersionInfo])
         (Maybe (NonEmpty DocumentVersionInfo)))
-> Getting
     (First [DocumentVersionInfo])
     ListDocumentVersionsResponse
     [DocumentVersionInfo]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty DocumentVersionInfo
 -> Const
      (First [DocumentVersionInfo]) (NonEmpty DocumentVersionInfo))
-> Maybe (NonEmpty DocumentVersionInfo)
-> Const
     (First [DocumentVersionInfo])
     (Maybe (NonEmpty DocumentVersionInfo))
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
              ((NonEmpty DocumentVersionInfo
  -> Const
       (First [DocumentVersionInfo]) (NonEmpty DocumentVersionInfo))
 -> Maybe (NonEmpty DocumentVersionInfo)
 -> Const
      (First [DocumentVersionInfo])
      (Maybe (NonEmpty DocumentVersionInfo)))
-> (([DocumentVersionInfo]
     -> Const (First [DocumentVersionInfo]) [DocumentVersionInfo])
    -> NonEmpty DocumentVersionInfo
    -> Const
         (First [DocumentVersionInfo]) (NonEmpty DocumentVersionInfo))
-> ([DocumentVersionInfo]
    -> Const (First [DocumentVersionInfo]) [DocumentVersionInfo])
-> Maybe (NonEmpty DocumentVersionInfo)
-> Const
     (First [DocumentVersionInfo])
     (Maybe (NonEmpty DocumentVersionInfo))
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty DocumentVersionInfo -> [DocumentVersionInfo])
-> ([DocumentVersionInfo]
    -> Const (First [DocumentVersionInfo]) [DocumentVersionInfo])
-> NonEmpty DocumentVersionInfo
-> Const
     (First [DocumentVersionInfo]) (NonEmpty DocumentVersionInfo)
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to NonEmpty DocumentVersionInfo -> [DocumentVersionInfo]
forall l. IsList l => l -> [Item l]
Prelude.toList
        ) =
      Maybe ListDocumentVersions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListDocumentVersions -> Maybe ListDocumentVersions
forall a. a -> Maybe a
Prelude.Just (ListDocumentVersions -> Maybe ListDocumentVersions)
-> ListDocumentVersions -> Maybe ListDocumentVersions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListDocumentVersions
rq
          ListDocumentVersions
-> (ListDocumentVersions -> ListDocumentVersions)
-> ListDocumentVersions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListDocumentVersions -> Identity ListDocumentVersions
Lens
  ListDocumentVersions ListDocumentVersions (Maybe Text) (Maybe Text)
listDocumentVersions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListDocumentVersions -> Identity ListDocumentVersions)
-> Maybe Text -> ListDocumentVersions -> ListDocumentVersions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDocumentVersions
ListDocumentVersionsResponse
rs
          ListDocumentVersionsResponse
-> Getting (First Text) ListDocumentVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDocumentVersionsResponse
-> Const (First Text) ListDocumentVersionsResponse
Lens' ListDocumentVersionsResponse (Maybe Text)
listDocumentVersionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDocumentVersionsResponse
 -> Const (First Text) ListDocumentVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDocumentVersionsResponse 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 ListDocumentVersions where
  type
    AWSResponse ListDocumentVersions =
      ListDocumentVersionsResponse
  request :: ListDocumentVersions -> Request ListDocumentVersions
request = Service -> ListDocumentVersions -> Request ListDocumentVersions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListDocumentVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListDocumentVersions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListDocumentVersions))
-> Logger
-> Service
-> Proxy ListDocumentVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListDocumentVersions)))
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 (NonEmpty DocumentVersionInfo)
-> Maybe Text -> Int -> ListDocumentVersionsResponse
ListDocumentVersionsResponse'
            (Maybe (NonEmpty DocumentVersionInfo)
 -> Maybe Text -> Int -> ListDocumentVersionsResponse)
-> Either String (Maybe (NonEmpty DocumentVersionInfo))
-> Either
     String (Maybe Text -> Int -> ListDocumentVersionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (NonEmpty DocumentVersionInfo))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DocumentVersions")
            Either String (Maybe Text -> Int -> ListDocumentVersionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListDocumentVersionsResponse)
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
"NextToken")
            Either String (Int -> ListDocumentVersionsResponse)
-> Either String Int -> Either String ListDocumentVersionsResponse
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 ListDocumentVersions

instance Prelude.NFData ListDocumentVersions

instance Core.ToHeaders ListDocumentVersions where
  toHeaders :: ListDocumentVersions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListDocumentVersions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonSSM.ListDocumentVersions" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ListDocumentVersions where
  toJSON :: ListDocumentVersions -> Value
toJSON ListDocumentVersions' {Maybe Natural
Maybe Text
Text
name :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:name:ListDocumentVersions' :: ListDocumentVersions -> Text
$sel:maxResults:ListDocumentVersions' :: ListDocumentVersions -> Maybe Natural
$sel:nextToken:ListDocumentVersions' :: ListDocumentVersions -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
          ]
      )

instance Core.ToPath ListDocumentVersions where
  toPath :: ListDocumentVersions -> ByteString
toPath = ByteString -> ListDocumentVersions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newListDocumentVersionsResponse' smart constructor.
data ListDocumentVersionsResponse = ListDocumentVersionsResponse'
  { -- | The document versions.
    ListDocumentVersionsResponse
-> Maybe (NonEmpty DocumentVersionInfo)
documentVersions :: Prelude.Maybe (Prelude.NonEmpty DocumentVersionInfo),
    -- | The token to use when requesting the next set of items. If there are no
    -- additional items to return, the string is empty.
    ListDocumentVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDocumentVersionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDocumentVersionsResponse
-> ListDocumentVersionsResponse -> Bool
(ListDocumentVersionsResponse
 -> ListDocumentVersionsResponse -> Bool)
-> (ListDocumentVersionsResponse
    -> ListDocumentVersionsResponse -> Bool)
-> Eq ListDocumentVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDocumentVersionsResponse
-> ListDocumentVersionsResponse -> Bool
$c/= :: ListDocumentVersionsResponse
-> ListDocumentVersionsResponse -> Bool
== :: ListDocumentVersionsResponse
-> ListDocumentVersionsResponse -> Bool
$c== :: ListDocumentVersionsResponse
-> ListDocumentVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListDocumentVersionsResponse]
ReadPrec ListDocumentVersionsResponse
Int -> ReadS ListDocumentVersionsResponse
ReadS [ListDocumentVersionsResponse]
(Int -> ReadS ListDocumentVersionsResponse)
-> ReadS [ListDocumentVersionsResponse]
-> ReadPrec ListDocumentVersionsResponse
-> ReadPrec [ListDocumentVersionsResponse]
-> Read ListDocumentVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDocumentVersionsResponse]
$creadListPrec :: ReadPrec [ListDocumentVersionsResponse]
readPrec :: ReadPrec ListDocumentVersionsResponse
$creadPrec :: ReadPrec ListDocumentVersionsResponse
readList :: ReadS [ListDocumentVersionsResponse]
$creadList :: ReadS [ListDocumentVersionsResponse]
readsPrec :: Int -> ReadS ListDocumentVersionsResponse
$creadsPrec :: Int -> ReadS ListDocumentVersionsResponse
Prelude.Read, Int -> ListDocumentVersionsResponse -> ShowS
[ListDocumentVersionsResponse] -> ShowS
ListDocumentVersionsResponse -> String
(Int -> ListDocumentVersionsResponse -> ShowS)
-> (ListDocumentVersionsResponse -> String)
-> ([ListDocumentVersionsResponse] -> ShowS)
-> Show ListDocumentVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDocumentVersionsResponse] -> ShowS
$cshowList :: [ListDocumentVersionsResponse] -> ShowS
show :: ListDocumentVersionsResponse -> String
$cshow :: ListDocumentVersionsResponse -> String
showsPrec :: Int -> ListDocumentVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListDocumentVersionsResponse -> ShowS
Prelude.Show, (forall x.
 ListDocumentVersionsResponse -> Rep ListDocumentVersionsResponse x)
-> (forall x.
    Rep ListDocumentVersionsResponse x -> ListDocumentVersionsResponse)
-> Generic ListDocumentVersionsResponse
forall x.
Rep ListDocumentVersionsResponse x -> ListDocumentVersionsResponse
forall x.
ListDocumentVersionsResponse -> Rep ListDocumentVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDocumentVersionsResponse x -> ListDocumentVersionsResponse
$cfrom :: forall x.
ListDocumentVersionsResponse -> Rep ListDocumentVersionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDocumentVersionsResponse' 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:
--
-- 'documentVersions', 'listDocumentVersionsResponse_documentVersions' - The document versions.
--
-- 'nextToken', 'listDocumentVersionsResponse_nextToken' - The token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
--
-- 'httpStatus', 'listDocumentVersionsResponse_httpStatus' - The response's http status code.
newListDocumentVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDocumentVersionsResponse
newListDocumentVersionsResponse :: Int -> ListDocumentVersionsResponse
newListDocumentVersionsResponse Int
pHttpStatus_ =
  ListDocumentVersionsResponse' :: Maybe (NonEmpty DocumentVersionInfo)
-> Maybe Text -> Int -> ListDocumentVersionsResponse
ListDocumentVersionsResponse'
    { $sel:documentVersions:ListDocumentVersionsResponse' :: Maybe (NonEmpty DocumentVersionInfo)
documentVersions =
        Maybe (NonEmpty DocumentVersionInfo)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDocumentVersionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDocumentVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The document versions.
listDocumentVersionsResponse_documentVersions :: Lens.Lens' ListDocumentVersionsResponse (Prelude.Maybe (Prelude.NonEmpty DocumentVersionInfo))
listDocumentVersionsResponse_documentVersions :: (Maybe (NonEmpty DocumentVersionInfo)
 -> f (Maybe (NonEmpty DocumentVersionInfo)))
-> ListDocumentVersionsResponse -> f ListDocumentVersionsResponse
listDocumentVersionsResponse_documentVersions = (ListDocumentVersionsResponse
 -> Maybe (NonEmpty DocumentVersionInfo))
-> (ListDocumentVersionsResponse
    -> Maybe (NonEmpty DocumentVersionInfo)
    -> ListDocumentVersionsResponse)
-> Lens'
     ListDocumentVersionsResponse (Maybe (NonEmpty DocumentVersionInfo))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDocumentVersionsResponse' {Maybe (NonEmpty DocumentVersionInfo)
documentVersions :: Maybe (NonEmpty DocumentVersionInfo)
$sel:documentVersions:ListDocumentVersionsResponse' :: ListDocumentVersionsResponse
-> Maybe (NonEmpty DocumentVersionInfo)
documentVersions} -> Maybe (NonEmpty DocumentVersionInfo)
documentVersions) (\s :: ListDocumentVersionsResponse
s@ListDocumentVersionsResponse' {} Maybe (NonEmpty DocumentVersionInfo)
a -> ListDocumentVersionsResponse
s {$sel:documentVersions:ListDocumentVersionsResponse' :: Maybe (NonEmpty DocumentVersionInfo)
documentVersions = Maybe (NonEmpty DocumentVersionInfo)
a} :: ListDocumentVersionsResponse) ((Maybe (NonEmpty DocumentVersionInfo)
  -> f (Maybe (NonEmpty DocumentVersionInfo)))
 -> ListDocumentVersionsResponse -> f ListDocumentVersionsResponse)
-> ((Maybe (NonEmpty DocumentVersionInfo)
     -> f (Maybe (NonEmpty DocumentVersionInfo)))
    -> Maybe (NonEmpty DocumentVersionInfo)
    -> f (Maybe (NonEmpty DocumentVersionInfo)))
-> (Maybe (NonEmpty DocumentVersionInfo)
    -> f (Maybe (NonEmpty DocumentVersionInfo)))
-> ListDocumentVersionsResponse
-> f ListDocumentVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty DocumentVersionInfo)
  (NonEmpty DocumentVersionInfo)
  (NonEmpty DocumentVersionInfo)
  (NonEmpty DocumentVersionInfo)
-> Iso
     (Maybe (NonEmpty DocumentVersionInfo))
     (Maybe (NonEmpty DocumentVersionInfo))
     (Maybe (NonEmpty DocumentVersionInfo))
     (Maybe (NonEmpty DocumentVersionInfo))
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
  (NonEmpty DocumentVersionInfo)
  (NonEmpty DocumentVersionInfo)
  (NonEmpty DocumentVersionInfo)
  (NonEmpty DocumentVersionInfo)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
listDocumentVersionsResponse_nextToken :: Lens.Lens' ListDocumentVersionsResponse (Prelude.Maybe Prelude.Text)
listDocumentVersionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDocumentVersionsResponse -> f ListDocumentVersionsResponse
listDocumentVersionsResponse_nextToken = (ListDocumentVersionsResponse -> Maybe Text)
-> (ListDocumentVersionsResponse
    -> Maybe Text -> ListDocumentVersionsResponse)
-> Lens' ListDocumentVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDocumentVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDocumentVersionsResponse' :: ListDocumentVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDocumentVersionsResponse
s@ListDocumentVersionsResponse' {} Maybe Text
a -> ListDocumentVersionsResponse
s {$sel:nextToken:ListDocumentVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDocumentVersionsResponse)

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

instance Prelude.NFData ListDocumentVersionsResponse