{-# 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.DataExchange.ListDataSetRevisions
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- This operation lists a data set\'s revisions sorted by CreatedAt in
-- descending order.
--
-- This operation returns paginated results.
module Amazonka.DataExchange.ListDataSetRevisions
  ( -- * Creating a Request
    ListDataSetRevisions (..),
    newListDataSetRevisions,

    -- * Request Lenses
    listDataSetRevisions_nextToken,
    listDataSetRevisions_maxResults,
    listDataSetRevisions_dataSetId,

    -- * Destructuring the Response
    ListDataSetRevisionsResponse (..),
    newListDataSetRevisionsResponse,

    -- * Response Lenses
    listDataSetRevisionsResponse_nextToken,
    listDataSetRevisionsResponse_revisions,
    listDataSetRevisionsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListDataSetRevisions' smart constructor.
data ListDataSetRevisions = ListDataSetRevisions'
  { -- | The token value retrieved from a previous call to access the next page
    -- of results.
    ListDataSetRevisions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results returned by a single call.
    ListDataSetRevisions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The unique identifier for a data set.
    ListDataSetRevisions -> Text
dataSetId :: Prelude.Text
  }
  deriving (ListDataSetRevisions -> ListDataSetRevisions -> Bool
(ListDataSetRevisions -> ListDataSetRevisions -> Bool)
-> (ListDataSetRevisions -> ListDataSetRevisions -> Bool)
-> Eq ListDataSetRevisions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDataSetRevisions -> ListDataSetRevisions -> Bool
$c/= :: ListDataSetRevisions -> ListDataSetRevisions -> Bool
== :: ListDataSetRevisions -> ListDataSetRevisions -> Bool
$c== :: ListDataSetRevisions -> ListDataSetRevisions -> Bool
Prelude.Eq, ReadPrec [ListDataSetRevisions]
ReadPrec ListDataSetRevisions
Int -> ReadS ListDataSetRevisions
ReadS [ListDataSetRevisions]
(Int -> ReadS ListDataSetRevisions)
-> ReadS [ListDataSetRevisions]
-> ReadPrec ListDataSetRevisions
-> ReadPrec [ListDataSetRevisions]
-> Read ListDataSetRevisions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDataSetRevisions]
$creadListPrec :: ReadPrec [ListDataSetRevisions]
readPrec :: ReadPrec ListDataSetRevisions
$creadPrec :: ReadPrec ListDataSetRevisions
readList :: ReadS [ListDataSetRevisions]
$creadList :: ReadS [ListDataSetRevisions]
readsPrec :: Int -> ReadS ListDataSetRevisions
$creadsPrec :: Int -> ReadS ListDataSetRevisions
Prelude.Read, Int -> ListDataSetRevisions -> ShowS
[ListDataSetRevisions] -> ShowS
ListDataSetRevisions -> String
(Int -> ListDataSetRevisions -> ShowS)
-> (ListDataSetRevisions -> String)
-> ([ListDataSetRevisions] -> ShowS)
-> Show ListDataSetRevisions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDataSetRevisions] -> ShowS
$cshowList :: [ListDataSetRevisions] -> ShowS
show :: ListDataSetRevisions -> String
$cshow :: ListDataSetRevisions -> String
showsPrec :: Int -> ListDataSetRevisions -> ShowS
$cshowsPrec :: Int -> ListDataSetRevisions -> ShowS
Prelude.Show, (forall x. ListDataSetRevisions -> Rep ListDataSetRevisions x)
-> (forall x. Rep ListDataSetRevisions x -> ListDataSetRevisions)
-> Generic ListDataSetRevisions
forall x. Rep ListDataSetRevisions x -> ListDataSetRevisions
forall x. ListDataSetRevisions -> Rep ListDataSetRevisions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDataSetRevisions x -> ListDataSetRevisions
$cfrom :: forall x. ListDataSetRevisions -> Rep ListDataSetRevisions x
Prelude.Generic)

-- |
-- Create a value of 'ListDataSetRevisions' 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', 'listDataSetRevisions_nextToken' - The token value retrieved from a previous call to access the next page
-- of results.
--
-- 'maxResults', 'listDataSetRevisions_maxResults' - The maximum number of results returned by a single call.
--
-- 'dataSetId', 'listDataSetRevisions_dataSetId' - The unique identifier for a data set.
newListDataSetRevisions ::
  -- | 'dataSetId'
  Prelude.Text ->
  ListDataSetRevisions
newListDataSetRevisions :: Text -> ListDataSetRevisions
newListDataSetRevisions Text
pDataSetId_ =
  ListDataSetRevisions' :: Maybe Text -> Maybe Natural -> Text -> ListDataSetRevisions
ListDataSetRevisions'
    { $sel:nextToken:ListDataSetRevisions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListDataSetRevisions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSetId:ListDataSetRevisions' :: Text
dataSetId = Text
pDataSetId_
    }

-- | The token value retrieved from a previous call to access the next page
-- of results.
listDataSetRevisions_nextToken :: Lens.Lens' ListDataSetRevisions (Prelude.Maybe Prelude.Text)
listDataSetRevisions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDataSetRevisions -> f ListDataSetRevisions
listDataSetRevisions_nextToken = (ListDataSetRevisions -> Maybe Text)
-> (ListDataSetRevisions -> Maybe Text -> ListDataSetRevisions)
-> Lens
     ListDataSetRevisions ListDataSetRevisions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSetRevisions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDataSetRevisions' :: ListDataSetRevisions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDataSetRevisions
s@ListDataSetRevisions' {} Maybe Text
a -> ListDataSetRevisions
s {$sel:nextToken:ListDataSetRevisions' :: Maybe Text
nextToken = Maybe Text
a} :: ListDataSetRevisions)

-- | The maximum number of results returned by a single call.
listDataSetRevisions_maxResults :: Lens.Lens' ListDataSetRevisions (Prelude.Maybe Prelude.Natural)
listDataSetRevisions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListDataSetRevisions -> f ListDataSetRevisions
listDataSetRevisions_maxResults = (ListDataSetRevisions -> Maybe Natural)
-> (ListDataSetRevisions -> Maybe Natural -> ListDataSetRevisions)
-> Lens
     ListDataSetRevisions
     ListDataSetRevisions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSetRevisions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDataSetRevisions' :: ListDataSetRevisions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDataSetRevisions
s@ListDataSetRevisions' {} Maybe Natural
a -> ListDataSetRevisions
s {$sel:maxResults:ListDataSetRevisions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDataSetRevisions)

-- | The unique identifier for a data set.
listDataSetRevisions_dataSetId :: Lens.Lens' ListDataSetRevisions Prelude.Text
listDataSetRevisions_dataSetId :: (Text -> f Text) -> ListDataSetRevisions -> f ListDataSetRevisions
listDataSetRevisions_dataSetId = (ListDataSetRevisions -> Text)
-> (ListDataSetRevisions -> Text -> ListDataSetRevisions)
-> Lens ListDataSetRevisions ListDataSetRevisions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSetRevisions' {Text
dataSetId :: Text
$sel:dataSetId:ListDataSetRevisions' :: ListDataSetRevisions -> Text
dataSetId} -> Text
dataSetId) (\s :: ListDataSetRevisions
s@ListDataSetRevisions' {} Text
a -> ListDataSetRevisions
s {$sel:dataSetId:ListDataSetRevisions' :: Text
dataSetId = Text
a} :: ListDataSetRevisions)

instance Core.AWSPager ListDataSetRevisions where
  page :: ListDataSetRevisions
-> AWSResponse ListDataSetRevisions -> Maybe ListDataSetRevisions
page ListDataSetRevisions
rq AWSResponse ListDataSetRevisions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDataSetRevisions
ListDataSetRevisionsResponse
rs
            ListDataSetRevisionsResponse
-> Getting (First Text) ListDataSetRevisionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDataSetRevisionsResponse
-> Const (First Text) ListDataSetRevisionsResponse
Lens' ListDataSetRevisionsResponse (Maybe Text)
listDataSetRevisionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDataSetRevisionsResponse
 -> Const (First Text) ListDataSetRevisionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDataSetRevisionsResponse 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 ListDataSetRevisions
forall a. Maybe a
Prelude.Nothing
    | Maybe [RevisionEntry] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDataSetRevisions
ListDataSetRevisionsResponse
rs
            ListDataSetRevisionsResponse
-> Getting
     (First [RevisionEntry])
     ListDataSetRevisionsResponse
     [RevisionEntry]
-> Maybe [RevisionEntry]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [RevisionEntry]
 -> Const (First [RevisionEntry]) (Maybe [RevisionEntry]))
-> ListDataSetRevisionsResponse
-> Const (First [RevisionEntry]) ListDataSetRevisionsResponse
Lens' ListDataSetRevisionsResponse (Maybe [RevisionEntry])
listDataSetRevisionsResponse_revisions
              ((Maybe [RevisionEntry]
  -> Const (First [RevisionEntry]) (Maybe [RevisionEntry]))
 -> ListDataSetRevisionsResponse
 -> Const (First [RevisionEntry]) ListDataSetRevisionsResponse)
-> (([RevisionEntry]
     -> Const (First [RevisionEntry]) [RevisionEntry])
    -> Maybe [RevisionEntry]
    -> Const (First [RevisionEntry]) (Maybe [RevisionEntry]))
-> Getting
     (First [RevisionEntry])
     ListDataSetRevisionsResponse
     [RevisionEntry]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([RevisionEntry] -> Const (First [RevisionEntry]) [RevisionEntry])
-> Maybe [RevisionEntry]
-> Const (First [RevisionEntry]) (Maybe [RevisionEntry])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListDataSetRevisions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListDataSetRevisions -> Maybe ListDataSetRevisions
forall a. a -> Maybe a
Prelude.Just (ListDataSetRevisions -> Maybe ListDataSetRevisions)
-> ListDataSetRevisions -> Maybe ListDataSetRevisions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListDataSetRevisions
rq
          ListDataSetRevisions
-> (ListDataSetRevisions -> ListDataSetRevisions)
-> ListDataSetRevisions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListDataSetRevisions -> Identity ListDataSetRevisions
Lens
  ListDataSetRevisions ListDataSetRevisions (Maybe Text) (Maybe Text)
listDataSetRevisions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListDataSetRevisions -> Identity ListDataSetRevisions)
-> Maybe Text -> ListDataSetRevisions -> ListDataSetRevisions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDataSetRevisions
ListDataSetRevisionsResponse
rs
          ListDataSetRevisionsResponse
-> Getting (First Text) ListDataSetRevisionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDataSetRevisionsResponse
-> Const (First Text) ListDataSetRevisionsResponse
Lens' ListDataSetRevisionsResponse (Maybe Text)
listDataSetRevisionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDataSetRevisionsResponse
 -> Const (First Text) ListDataSetRevisionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDataSetRevisionsResponse 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 ListDataSetRevisions where
  type
    AWSResponse ListDataSetRevisions =
      ListDataSetRevisionsResponse
  request :: ListDataSetRevisions -> Request ListDataSetRevisions
request = Service -> ListDataSetRevisions -> Request ListDataSetRevisions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListDataSetRevisions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListDataSetRevisions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListDataSetRevisions))
-> Logger
-> Service
-> Proxy ListDataSetRevisions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListDataSetRevisions)))
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 Text
-> Maybe [RevisionEntry] -> Int -> ListDataSetRevisionsResponse
ListDataSetRevisionsResponse'
            (Maybe Text
 -> Maybe [RevisionEntry] -> Int -> ListDataSetRevisionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [RevisionEntry] -> Int -> ListDataSetRevisionsResponse)
forall (f :: * -> *) a b. Functor 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
  (Maybe [RevisionEntry] -> Int -> ListDataSetRevisionsResponse)
-> Either String (Maybe [RevisionEntry])
-> Either String (Int -> ListDataSetRevisionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [RevisionEntry]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Revisions" Either String (Maybe (Maybe [RevisionEntry]))
-> Maybe [RevisionEntry] -> Either String (Maybe [RevisionEntry])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [RevisionEntry]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> ListDataSetRevisionsResponse)
-> Either String Int -> Either String ListDataSetRevisionsResponse
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 ListDataSetRevisions

instance Prelude.NFData ListDataSetRevisions

instance Core.ToHeaders ListDataSetRevisions where
  toHeaders :: ListDataSetRevisions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListDataSetRevisions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath ListDataSetRevisions where
  toPath :: ListDataSetRevisions -> ByteString
toPath ListDataSetRevisions' {Maybe Natural
Maybe Text
Text
dataSetId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:dataSetId:ListDataSetRevisions' :: ListDataSetRevisions -> Text
$sel:maxResults:ListDataSetRevisions' :: ListDataSetRevisions -> Maybe Natural
$sel:nextToken:ListDataSetRevisions' :: ListDataSetRevisions -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v1/data-sets/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
dataSetId, ByteString
"/revisions"]

instance Core.ToQuery ListDataSetRevisions where
  toQuery :: ListDataSetRevisions -> QueryString
toQuery ListDataSetRevisions' {Maybe Natural
Maybe Text
Text
dataSetId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:dataSetId:ListDataSetRevisions' :: ListDataSetRevisions -> Text
$sel:maxResults:ListDataSetRevisions' :: ListDataSetRevisions -> Maybe Natural
$sel:nextToken:ListDataSetRevisions' :: ListDataSetRevisions -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListDataSetRevisionsResponse' smart constructor.
data ListDataSetRevisionsResponse = ListDataSetRevisionsResponse'
  { -- | The token value retrieved from a previous call to access the next page
    -- of results.
    ListDataSetRevisionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The asset objects listed by the request.
    ListDataSetRevisionsResponse -> Maybe [RevisionEntry]
revisions :: Prelude.Maybe [RevisionEntry],
    -- | The response's http status code.
    ListDataSetRevisionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDataSetRevisionsResponse
-> ListDataSetRevisionsResponse -> Bool
(ListDataSetRevisionsResponse
 -> ListDataSetRevisionsResponse -> Bool)
-> (ListDataSetRevisionsResponse
    -> ListDataSetRevisionsResponse -> Bool)
-> Eq ListDataSetRevisionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDataSetRevisionsResponse
-> ListDataSetRevisionsResponse -> Bool
$c/= :: ListDataSetRevisionsResponse
-> ListDataSetRevisionsResponse -> Bool
== :: ListDataSetRevisionsResponse
-> ListDataSetRevisionsResponse -> Bool
$c== :: ListDataSetRevisionsResponse
-> ListDataSetRevisionsResponse -> Bool
Prelude.Eq, ReadPrec [ListDataSetRevisionsResponse]
ReadPrec ListDataSetRevisionsResponse
Int -> ReadS ListDataSetRevisionsResponse
ReadS [ListDataSetRevisionsResponse]
(Int -> ReadS ListDataSetRevisionsResponse)
-> ReadS [ListDataSetRevisionsResponse]
-> ReadPrec ListDataSetRevisionsResponse
-> ReadPrec [ListDataSetRevisionsResponse]
-> Read ListDataSetRevisionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDataSetRevisionsResponse]
$creadListPrec :: ReadPrec [ListDataSetRevisionsResponse]
readPrec :: ReadPrec ListDataSetRevisionsResponse
$creadPrec :: ReadPrec ListDataSetRevisionsResponse
readList :: ReadS [ListDataSetRevisionsResponse]
$creadList :: ReadS [ListDataSetRevisionsResponse]
readsPrec :: Int -> ReadS ListDataSetRevisionsResponse
$creadsPrec :: Int -> ReadS ListDataSetRevisionsResponse
Prelude.Read, Int -> ListDataSetRevisionsResponse -> ShowS
[ListDataSetRevisionsResponse] -> ShowS
ListDataSetRevisionsResponse -> String
(Int -> ListDataSetRevisionsResponse -> ShowS)
-> (ListDataSetRevisionsResponse -> String)
-> ([ListDataSetRevisionsResponse] -> ShowS)
-> Show ListDataSetRevisionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDataSetRevisionsResponse] -> ShowS
$cshowList :: [ListDataSetRevisionsResponse] -> ShowS
show :: ListDataSetRevisionsResponse -> String
$cshow :: ListDataSetRevisionsResponse -> String
showsPrec :: Int -> ListDataSetRevisionsResponse -> ShowS
$cshowsPrec :: Int -> ListDataSetRevisionsResponse -> ShowS
Prelude.Show, (forall x.
 ListDataSetRevisionsResponse -> Rep ListDataSetRevisionsResponse x)
-> (forall x.
    Rep ListDataSetRevisionsResponse x -> ListDataSetRevisionsResponse)
-> Generic ListDataSetRevisionsResponse
forall x.
Rep ListDataSetRevisionsResponse x -> ListDataSetRevisionsResponse
forall x.
ListDataSetRevisionsResponse -> Rep ListDataSetRevisionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDataSetRevisionsResponse x -> ListDataSetRevisionsResponse
$cfrom :: forall x.
ListDataSetRevisionsResponse -> Rep ListDataSetRevisionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDataSetRevisionsResponse' 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', 'listDataSetRevisionsResponse_nextToken' - The token value retrieved from a previous call to access the next page
-- of results.
--
-- 'revisions', 'listDataSetRevisionsResponse_revisions' - The asset objects listed by the request.
--
-- 'httpStatus', 'listDataSetRevisionsResponse_httpStatus' - The response's http status code.
newListDataSetRevisionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDataSetRevisionsResponse
newListDataSetRevisionsResponse :: Int -> ListDataSetRevisionsResponse
newListDataSetRevisionsResponse Int
pHttpStatus_ =
  ListDataSetRevisionsResponse' :: Maybe Text
-> Maybe [RevisionEntry] -> Int -> ListDataSetRevisionsResponse
ListDataSetRevisionsResponse'
    { $sel:nextToken:ListDataSetRevisionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:revisions:ListDataSetRevisionsResponse' :: Maybe [RevisionEntry]
revisions = Maybe [RevisionEntry]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDataSetRevisionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token value retrieved from a previous call to access the next page
-- of results.
listDataSetRevisionsResponse_nextToken :: Lens.Lens' ListDataSetRevisionsResponse (Prelude.Maybe Prelude.Text)
listDataSetRevisionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDataSetRevisionsResponse -> f ListDataSetRevisionsResponse
listDataSetRevisionsResponse_nextToken = (ListDataSetRevisionsResponse -> Maybe Text)
-> (ListDataSetRevisionsResponse
    -> Maybe Text -> ListDataSetRevisionsResponse)
-> Lens' ListDataSetRevisionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSetRevisionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDataSetRevisionsResponse' :: ListDataSetRevisionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDataSetRevisionsResponse
s@ListDataSetRevisionsResponse' {} Maybe Text
a -> ListDataSetRevisionsResponse
s {$sel:nextToken:ListDataSetRevisionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDataSetRevisionsResponse)

-- | The asset objects listed by the request.
listDataSetRevisionsResponse_revisions :: Lens.Lens' ListDataSetRevisionsResponse (Prelude.Maybe [RevisionEntry])
listDataSetRevisionsResponse_revisions :: (Maybe [RevisionEntry] -> f (Maybe [RevisionEntry]))
-> ListDataSetRevisionsResponse -> f ListDataSetRevisionsResponse
listDataSetRevisionsResponse_revisions = (ListDataSetRevisionsResponse -> Maybe [RevisionEntry])
-> (ListDataSetRevisionsResponse
    -> Maybe [RevisionEntry] -> ListDataSetRevisionsResponse)
-> Lens' ListDataSetRevisionsResponse (Maybe [RevisionEntry])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSetRevisionsResponse' {Maybe [RevisionEntry]
revisions :: Maybe [RevisionEntry]
$sel:revisions:ListDataSetRevisionsResponse' :: ListDataSetRevisionsResponse -> Maybe [RevisionEntry]
revisions} -> Maybe [RevisionEntry]
revisions) (\s :: ListDataSetRevisionsResponse
s@ListDataSetRevisionsResponse' {} Maybe [RevisionEntry]
a -> ListDataSetRevisionsResponse
s {$sel:revisions:ListDataSetRevisionsResponse' :: Maybe [RevisionEntry]
revisions = Maybe [RevisionEntry]
a} :: ListDataSetRevisionsResponse) ((Maybe [RevisionEntry] -> f (Maybe [RevisionEntry]))
 -> ListDataSetRevisionsResponse -> f ListDataSetRevisionsResponse)
-> ((Maybe [RevisionEntry] -> f (Maybe [RevisionEntry]))
    -> Maybe [RevisionEntry] -> f (Maybe [RevisionEntry]))
-> (Maybe [RevisionEntry] -> f (Maybe [RevisionEntry]))
-> ListDataSetRevisionsResponse
-> f ListDataSetRevisionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RevisionEntry] [RevisionEntry] [RevisionEntry] [RevisionEntry]
-> Iso
     (Maybe [RevisionEntry])
     (Maybe [RevisionEntry])
     (Maybe [RevisionEntry])
     (Maybe [RevisionEntry])
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
  [RevisionEntry] [RevisionEntry] [RevisionEntry] [RevisionEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListDataSetRevisionsResponse