{-# 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.ServiceCatalog.ListRecordHistory
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the specified requests or all performed requests.
--
-- This operation returns paginated results.
module Amazonka.ServiceCatalog.ListRecordHistory
  ( -- * Creating a Request
    ListRecordHistory (..),
    newListRecordHistory,

    -- * Request Lenses
    listRecordHistory_acceptLanguage,
    listRecordHistory_accessLevelFilter,
    listRecordHistory_pageSize,
    listRecordHistory_pageToken,
    listRecordHistory_searchFilter,

    -- * Destructuring the Response
    ListRecordHistoryResponse (..),
    newListRecordHistoryResponse,

    -- * Response Lenses
    listRecordHistoryResponse_nextPageToken,
    listRecordHistoryResponse_recordDetails,
    listRecordHistoryResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListRecordHistory' smart constructor.
data ListRecordHistory = ListRecordHistory'
  { -- | The language code.
    --
    -- -   @en@ - English (default)
    --
    -- -   @jp@ - Japanese
    --
    -- -   @zh@ - Chinese
    ListRecordHistory -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
    -- | The access level to use to obtain results. The default is @User@.
    ListRecordHistory -> Maybe AccessLevelFilter
accessLevelFilter :: Prelude.Maybe AccessLevelFilter,
    -- | The maximum number of items to return with this call.
    ListRecordHistory -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural,
    -- | The page token for the next set of results. To retrieve the first set of
    -- results, use null.
    ListRecordHistory -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text,
    -- | The search filter to scope the results.
    ListRecordHistory -> Maybe ListRecordHistorySearchFilter
searchFilter :: Prelude.Maybe ListRecordHistorySearchFilter
  }
  deriving (ListRecordHistory -> ListRecordHistory -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRecordHistory -> ListRecordHistory -> Bool
$c/= :: ListRecordHistory -> ListRecordHistory -> Bool
== :: ListRecordHistory -> ListRecordHistory -> Bool
$c== :: ListRecordHistory -> ListRecordHistory -> Bool
Prelude.Eq, ReadPrec [ListRecordHistory]
ReadPrec ListRecordHistory
Int -> ReadS ListRecordHistory
ReadS [ListRecordHistory]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRecordHistory]
$creadListPrec :: ReadPrec [ListRecordHistory]
readPrec :: ReadPrec ListRecordHistory
$creadPrec :: ReadPrec ListRecordHistory
readList :: ReadS [ListRecordHistory]
$creadList :: ReadS [ListRecordHistory]
readsPrec :: Int -> ReadS ListRecordHistory
$creadsPrec :: Int -> ReadS ListRecordHistory
Prelude.Read, Int -> ListRecordHistory -> ShowS
[ListRecordHistory] -> ShowS
ListRecordHistory -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRecordHistory] -> ShowS
$cshowList :: [ListRecordHistory] -> ShowS
show :: ListRecordHistory -> String
$cshow :: ListRecordHistory -> String
showsPrec :: Int -> ListRecordHistory -> ShowS
$cshowsPrec :: Int -> ListRecordHistory -> ShowS
Prelude.Show, forall x. Rep ListRecordHistory x -> ListRecordHistory
forall x. ListRecordHistory -> Rep ListRecordHistory x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRecordHistory x -> ListRecordHistory
$cfrom :: forall x. ListRecordHistory -> Rep ListRecordHistory x
Prelude.Generic)

-- |
-- Create a value of 'ListRecordHistory' 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:
--
-- 'acceptLanguage', 'listRecordHistory_acceptLanguage' - The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
--
-- 'accessLevelFilter', 'listRecordHistory_accessLevelFilter' - The access level to use to obtain results. The default is @User@.
--
-- 'pageSize', 'listRecordHistory_pageSize' - The maximum number of items to return with this call.
--
-- 'pageToken', 'listRecordHistory_pageToken' - The page token for the next set of results. To retrieve the first set of
-- results, use null.
--
-- 'searchFilter', 'listRecordHistory_searchFilter' - The search filter to scope the results.
newListRecordHistory ::
  ListRecordHistory
newListRecordHistory :: ListRecordHistory
newListRecordHistory =
  ListRecordHistory'
    { $sel:acceptLanguage:ListRecordHistory' :: Maybe Text
acceptLanguage =
        forall a. Maybe a
Prelude.Nothing,
      $sel:accessLevelFilter:ListRecordHistory' :: Maybe AccessLevelFilter
accessLevelFilter = forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:ListRecordHistory' :: Maybe Natural
pageSize = forall a. Maybe a
Prelude.Nothing,
      $sel:pageToken:ListRecordHistory' :: Maybe Text
pageToken = forall a. Maybe a
Prelude.Nothing,
      $sel:searchFilter:ListRecordHistory' :: Maybe ListRecordHistorySearchFilter
searchFilter = forall a. Maybe a
Prelude.Nothing
    }

-- | The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
listRecordHistory_acceptLanguage :: Lens.Lens' ListRecordHistory (Prelude.Maybe Prelude.Text)
listRecordHistory_acceptLanguage :: Lens' ListRecordHistory (Maybe Text)
listRecordHistory_acceptLanguage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecordHistory' {Maybe Text
acceptLanguage :: Maybe Text
$sel:acceptLanguage:ListRecordHistory' :: ListRecordHistory -> Maybe Text
acceptLanguage} -> Maybe Text
acceptLanguage) (\s :: ListRecordHistory
s@ListRecordHistory' {} Maybe Text
a -> ListRecordHistory
s {$sel:acceptLanguage:ListRecordHistory' :: Maybe Text
acceptLanguage = Maybe Text
a} :: ListRecordHistory)

-- | The access level to use to obtain results. The default is @User@.
listRecordHistory_accessLevelFilter :: Lens.Lens' ListRecordHistory (Prelude.Maybe AccessLevelFilter)
listRecordHistory_accessLevelFilter :: Lens' ListRecordHistory (Maybe AccessLevelFilter)
listRecordHistory_accessLevelFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecordHistory' {Maybe AccessLevelFilter
accessLevelFilter :: Maybe AccessLevelFilter
$sel:accessLevelFilter:ListRecordHistory' :: ListRecordHistory -> Maybe AccessLevelFilter
accessLevelFilter} -> Maybe AccessLevelFilter
accessLevelFilter) (\s :: ListRecordHistory
s@ListRecordHistory' {} Maybe AccessLevelFilter
a -> ListRecordHistory
s {$sel:accessLevelFilter:ListRecordHistory' :: Maybe AccessLevelFilter
accessLevelFilter = Maybe AccessLevelFilter
a} :: ListRecordHistory)

-- | The maximum number of items to return with this call.
listRecordHistory_pageSize :: Lens.Lens' ListRecordHistory (Prelude.Maybe Prelude.Natural)
listRecordHistory_pageSize :: Lens' ListRecordHistory (Maybe Natural)
listRecordHistory_pageSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecordHistory' {Maybe Natural
pageSize :: Maybe Natural
$sel:pageSize:ListRecordHistory' :: ListRecordHistory -> Maybe Natural
pageSize} -> Maybe Natural
pageSize) (\s :: ListRecordHistory
s@ListRecordHistory' {} Maybe Natural
a -> ListRecordHistory
s {$sel:pageSize:ListRecordHistory' :: Maybe Natural
pageSize = Maybe Natural
a} :: ListRecordHistory)

-- | The page token for the next set of results. To retrieve the first set of
-- results, use null.
listRecordHistory_pageToken :: Lens.Lens' ListRecordHistory (Prelude.Maybe Prelude.Text)
listRecordHistory_pageToken :: Lens' ListRecordHistory (Maybe Text)
listRecordHistory_pageToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecordHistory' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:ListRecordHistory' :: ListRecordHistory -> Maybe Text
pageToken} -> Maybe Text
pageToken) (\s :: ListRecordHistory
s@ListRecordHistory' {} Maybe Text
a -> ListRecordHistory
s {$sel:pageToken:ListRecordHistory' :: Maybe Text
pageToken = Maybe Text
a} :: ListRecordHistory)

-- | The search filter to scope the results.
listRecordHistory_searchFilter :: Lens.Lens' ListRecordHistory (Prelude.Maybe ListRecordHistorySearchFilter)
listRecordHistory_searchFilter :: Lens' ListRecordHistory (Maybe ListRecordHistorySearchFilter)
listRecordHistory_searchFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecordHistory' {Maybe ListRecordHistorySearchFilter
searchFilter :: Maybe ListRecordHistorySearchFilter
$sel:searchFilter:ListRecordHistory' :: ListRecordHistory -> Maybe ListRecordHistorySearchFilter
searchFilter} -> Maybe ListRecordHistorySearchFilter
searchFilter) (\s :: ListRecordHistory
s@ListRecordHistory' {} Maybe ListRecordHistorySearchFilter
a -> ListRecordHistory
s {$sel:searchFilter:ListRecordHistory' :: Maybe ListRecordHistorySearchFilter
searchFilter = Maybe ListRecordHistorySearchFilter
a} :: ListRecordHistory)

instance Core.AWSPager ListRecordHistory where
  page :: ListRecordHistory
-> AWSResponse ListRecordHistory -> Maybe ListRecordHistory
page ListRecordHistory
rq AWSResponse ListRecordHistory
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRecordHistory
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRecordHistoryResponse (Maybe Text)
listRecordHistoryResponse_nextPageToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRecordHistory
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRecordHistoryResponse (Maybe [RecordDetail])
listRecordHistoryResponse_recordDetails
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListRecordHistory
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListRecordHistory (Maybe Text)
listRecordHistory_pageToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListRecordHistory
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRecordHistoryResponse (Maybe Text)
listRecordHistoryResponse_nextPageToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListRecordHistory where
  type
    AWSResponse ListRecordHistory =
      ListRecordHistoryResponse
  request :: (Service -> Service)
-> ListRecordHistory -> Request ListRecordHistory
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListRecordHistory
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListRecordHistory)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [RecordDetail] -> Int -> ListRecordHistoryResponse
ListRecordHistoryResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextPageToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RecordDetails" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListRecordHistory where
  hashWithSalt :: Int -> ListRecordHistory -> Int
hashWithSalt Int
_salt ListRecordHistory' {Maybe Natural
Maybe Text
Maybe AccessLevelFilter
Maybe ListRecordHistorySearchFilter
searchFilter :: Maybe ListRecordHistorySearchFilter
pageToken :: Maybe Text
pageSize :: Maybe Natural
accessLevelFilter :: Maybe AccessLevelFilter
acceptLanguage :: Maybe Text
$sel:searchFilter:ListRecordHistory' :: ListRecordHistory -> Maybe ListRecordHistorySearchFilter
$sel:pageToken:ListRecordHistory' :: ListRecordHistory -> Maybe Text
$sel:pageSize:ListRecordHistory' :: ListRecordHistory -> Maybe Natural
$sel:accessLevelFilter:ListRecordHistory' :: ListRecordHistory -> Maybe AccessLevelFilter
$sel:acceptLanguage:ListRecordHistory' :: ListRecordHistory -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
acceptLanguage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AccessLevelFilter
accessLevelFilter
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
pageSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pageToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ListRecordHistorySearchFilter
searchFilter

instance Prelude.NFData ListRecordHistory where
  rnf :: ListRecordHistory -> ()
rnf ListRecordHistory' {Maybe Natural
Maybe Text
Maybe AccessLevelFilter
Maybe ListRecordHistorySearchFilter
searchFilter :: Maybe ListRecordHistorySearchFilter
pageToken :: Maybe Text
pageSize :: Maybe Natural
accessLevelFilter :: Maybe AccessLevelFilter
acceptLanguage :: Maybe Text
$sel:searchFilter:ListRecordHistory' :: ListRecordHistory -> Maybe ListRecordHistorySearchFilter
$sel:pageToken:ListRecordHistory' :: ListRecordHistory -> Maybe Text
$sel:pageSize:ListRecordHistory' :: ListRecordHistory -> Maybe Natural
$sel:accessLevelFilter:ListRecordHistory' :: ListRecordHistory -> Maybe AccessLevelFilter
$sel:acceptLanguage:ListRecordHistory' :: ListRecordHistory -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
acceptLanguage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AccessLevelFilter
accessLevelFilter
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
pageSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pageToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ListRecordHistorySearchFilter
searchFilter

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

instance Data.ToJSON ListRecordHistory where
  toJSON :: ListRecordHistory -> Value
toJSON ListRecordHistory' {Maybe Natural
Maybe Text
Maybe AccessLevelFilter
Maybe ListRecordHistorySearchFilter
searchFilter :: Maybe ListRecordHistorySearchFilter
pageToken :: Maybe Text
pageSize :: Maybe Natural
accessLevelFilter :: Maybe AccessLevelFilter
acceptLanguage :: Maybe Text
$sel:searchFilter:ListRecordHistory' :: ListRecordHistory -> Maybe ListRecordHistorySearchFilter
$sel:pageToken:ListRecordHistory' :: ListRecordHistory -> Maybe Text
$sel:pageSize:ListRecordHistory' :: ListRecordHistory -> Maybe Natural
$sel:accessLevelFilter:ListRecordHistory' :: ListRecordHistory -> Maybe AccessLevelFilter
$sel:acceptLanguage:ListRecordHistory' :: ListRecordHistory -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AcceptLanguage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
acceptLanguage,
            (Key
"AccessLevelFilter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AccessLevelFilter
accessLevelFilter,
            (Key
"PageSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
pageSize,
            (Key
"PageToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
pageToken,
            (Key
"SearchFilter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ListRecordHistorySearchFilter
searchFilter
          ]
      )

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

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

-- | /See:/ 'newListRecordHistoryResponse' smart constructor.
data ListRecordHistoryResponse = ListRecordHistoryResponse'
  { -- | The page token to use to retrieve the next set of results. If there are
    -- no additional results, this value is null.
    ListRecordHistoryResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | The records, in reverse chronological order.
    ListRecordHistoryResponse -> Maybe [RecordDetail]
recordDetails :: Prelude.Maybe [RecordDetail],
    -- | The response's http status code.
    ListRecordHistoryResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListRecordHistoryResponse -> ListRecordHistoryResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRecordHistoryResponse -> ListRecordHistoryResponse -> Bool
$c/= :: ListRecordHistoryResponse -> ListRecordHistoryResponse -> Bool
== :: ListRecordHistoryResponse -> ListRecordHistoryResponse -> Bool
$c== :: ListRecordHistoryResponse -> ListRecordHistoryResponse -> Bool
Prelude.Eq, ReadPrec [ListRecordHistoryResponse]
ReadPrec ListRecordHistoryResponse
Int -> ReadS ListRecordHistoryResponse
ReadS [ListRecordHistoryResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRecordHistoryResponse]
$creadListPrec :: ReadPrec [ListRecordHistoryResponse]
readPrec :: ReadPrec ListRecordHistoryResponse
$creadPrec :: ReadPrec ListRecordHistoryResponse
readList :: ReadS [ListRecordHistoryResponse]
$creadList :: ReadS [ListRecordHistoryResponse]
readsPrec :: Int -> ReadS ListRecordHistoryResponse
$creadsPrec :: Int -> ReadS ListRecordHistoryResponse
Prelude.Read, Int -> ListRecordHistoryResponse -> ShowS
[ListRecordHistoryResponse] -> ShowS
ListRecordHistoryResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRecordHistoryResponse] -> ShowS
$cshowList :: [ListRecordHistoryResponse] -> ShowS
show :: ListRecordHistoryResponse -> String
$cshow :: ListRecordHistoryResponse -> String
showsPrec :: Int -> ListRecordHistoryResponse -> ShowS
$cshowsPrec :: Int -> ListRecordHistoryResponse -> ShowS
Prelude.Show, forall x.
Rep ListRecordHistoryResponse x -> ListRecordHistoryResponse
forall x.
ListRecordHistoryResponse -> Rep ListRecordHistoryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRecordHistoryResponse x -> ListRecordHistoryResponse
$cfrom :: forall x.
ListRecordHistoryResponse -> Rep ListRecordHistoryResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRecordHistoryResponse' 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:
--
-- 'nextPageToken', 'listRecordHistoryResponse_nextPageToken' - The page token to use to retrieve the next set of results. If there are
-- no additional results, this value is null.
--
-- 'recordDetails', 'listRecordHistoryResponse_recordDetails' - The records, in reverse chronological order.
--
-- 'httpStatus', 'listRecordHistoryResponse_httpStatus' - The response's http status code.
newListRecordHistoryResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRecordHistoryResponse
newListRecordHistoryResponse :: Int -> ListRecordHistoryResponse
newListRecordHistoryResponse Int
pHttpStatus_ =
  ListRecordHistoryResponse'
    { $sel:nextPageToken:ListRecordHistoryResponse' :: Maybe Text
nextPageToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:recordDetails:ListRecordHistoryResponse' :: Maybe [RecordDetail]
recordDetails = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRecordHistoryResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The page token to use to retrieve the next set of results. If there are
-- no additional results, this value is null.
listRecordHistoryResponse_nextPageToken :: Lens.Lens' ListRecordHistoryResponse (Prelude.Maybe Prelude.Text)
listRecordHistoryResponse_nextPageToken :: Lens' ListRecordHistoryResponse (Maybe Text)
listRecordHistoryResponse_nextPageToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecordHistoryResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:ListRecordHistoryResponse' :: ListRecordHistoryResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: ListRecordHistoryResponse
s@ListRecordHistoryResponse' {} Maybe Text
a -> ListRecordHistoryResponse
s {$sel:nextPageToken:ListRecordHistoryResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: ListRecordHistoryResponse)

-- | The records, in reverse chronological order.
listRecordHistoryResponse_recordDetails :: Lens.Lens' ListRecordHistoryResponse (Prelude.Maybe [RecordDetail])
listRecordHistoryResponse_recordDetails :: Lens' ListRecordHistoryResponse (Maybe [RecordDetail])
listRecordHistoryResponse_recordDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecordHistoryResponse' {Maybe [RecordDetail]
recordDetails :: Maybe [RecordDetail]
$sel:recordDetails:ListRecordHistoryResponse' :: ListRecordHistoryResponse -> Maybe [RecordDetail]
recordDetails} -> Maybe [RecordDetail]
recordDetails) (\s :: ListRecordHistoryResponse
s@ListRecordHistoryResponse' {} Maybe [RecordDetail]
a -> ListRecordHistoryResponse
s {$sel:recordDetails:ListRecordHistoryResponse' :: Maybe [RecordDetail]
recordDetails = Maybe [RecordDetail]
a} :: ListRecordHistoryResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListRecordHistoryResponse where
  rnf :: ListRecordHistoryResponse -> ()
rnf ListRecordHistoryResponse' {Int
Maybe [RecordDetail]
Maybe Text
httpStatus :: Int
recordDetails :: Maybe [RecordDetail]
nextPageToken :: Maybe Text
$sel:httpStatus:ListRecordHistoryResponse' :: ListRecordHistoryResponse -> Int
$sel:recordDetails:ListRecordHistoryResponse' :: ListRecordHistoryResponse -> Maybe [RecordDetail]
$sel:nextPageToken:ListRecordHistoryResponse' :: ListRecordHistoryResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextPageToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RecordDetail]
recordDetails
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus