{-# 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.SSMContacts.ListPageReceipts
-- 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)
--
-- Lists all of the engagements to contact channels that have been
-- acknowledged.
--
-- This operation returns paginated results.
module Amazonka.SSMContacts.ListPageReceipts
  ( -- * Creating a Request
    ListPageReceipts (..),
    newListPageReceipts,

    -- * Request Lenses
    listPageReceipts_nextToken,
    listPageReceipts_maxResults,
    listPageReceipts_pageId,

    -- * Destructuring the Response
    ListPageReceiptsResponse (..),
    newListPageReceiptsResponse,

    -- * Response Lenses
    listPageReceiptsResponse_nextToken,
    listPageReceiptsResponse_receipts,
    listPageReceiptsResponse_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.SSMContacts.Types

-- | /See:/ 'newListPageReceipts' smart constructor.
data ListPageReceipts = ListPageReceipts'
  { -- | The pagination token to continue to the next page of results.
    ListPageReceipts -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of acknowledgements per page of results.
    ListPageReceipts -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of the engagement to a specific contact
    -- channel.
    ListPageReceipts -> Text
pageId :: Prelude.Text
  }
  deriving (ListPageReceipts -> ListPageReceipts -> Bool
(ListPageReceipts -> ListPageReceipts -> Bool)
-> (ListPageReceipts -> ListPageReceipts -> Bool)
-> Eq ListPageReceipts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPageReceipts -> ListPageReceipts -> Bool
$c/= :: ListPageReceipts -> ListPageReceipts -> Bool
== :: ListPageReceipts -> ListPageReceipts -> Bool
$c== :: ListPageReceipts -> ListPageReceipts -> Bool
Prelude.Eq, ReadPrec [ListPageReceipts]
ReadPrec ListPageReceipts
Int -> ReadS ListPageReceipts
ReadS [ListPageReceipts]
(Int -> ReadS ListPageReceipts)
-> ReadS [ListPageReceipts]
-> ReadPrec ListPageReceipts
-> ReadPrec [ListPageReceipts]
-> Read ListPageReceipts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPageReceipts]
$creadListPrec :: ReadPrec [ListPageReceipts]
readPrec :: ReadPrec ListPageReceipts
$creadPrec :: ReadPrec ListPageReceipts
readList :: ReadS [ListPageReceipts]
$creadList :: ReadS [ListPageReceipts]
readsPrec :: Int -> ReadS ListPageReceipts
$creadsPrec :: Int -> ReadS ListPageReceipts
Prelude.Read, Int -> ListPageReceipts -> ShowS
[ListPageReceipts] -> ShowS
ListPageReceipts -> String
(Int -> ListPageReceipts -> ShowS)
-> (ListPageReceipts -> String)
-> ([ListPageReceipts] -> ShowS)
-> Show ListPageReceipts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPageReceipts] -> ShowS
$cshowList :: [ListPageReceipts] -> ShowS
show :: ListPageReceipts -> String
$cshow :: ListPageReceipts -> String
showsPrec :: Int -> ListPageReceipts -> ShowS
$cshowsPrec :: Int -> ListPageReceipts -> ShowS
Prelude.Show, (forall x. ListPageReceipts -> Rep ListPageReceipts x)
-> (forall x. Rep ListPageReceipts x -> ListPageReceipts)
-> Generic ListPageReceipts
forall x. Rep ListPageReceipts x -> ListPageReceipts
forall x. ListPageReceipts -> Rep ListPageReceipts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPageReceipts x -> ListPageReceipts
$cfrom :: forall x. ListPageReceipts -> Rep ListPageReceipts x
Prelude.Generic)

-- |
-- Create a value of 'ListPageReceipts' 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', 'listPageReceipts_nextToken' - The pagination token to continue to the next page of results.
--
-- 'maxResults', 'listPageReceipts_maxResults' - The maximum number of acknowledgements per page of results.
--
-- 'pageId', 'listPageReceipts_pageId' - The Amazon Resource Name (ARN) of the engagement to a specific contact
-- channel.
newListPageReceipts ::
  -- | 'pageId'
  Prelude.Text ->
  ListPageReceipts
newListPageReceipts :: Text -> ListPageReceipts
newListPageReceipts Text
pPageId_ =
  ListPageReceipts' :: Maybe Text -> Maybe Natural -> Text -> ListPageReceipts
ListPageReceipts'
    { $sel:nextToken:ListPageReceipts' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListPageReceipts' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:pageId:ListPageReceipts' :: Text
pageId = Text
pPageId_
    }

-- | The pagination token to continue to the next page of results.
listPageReceipts_nextToken :: Lens.Lens' ListPageReceipts (Prelude.Maybe Prelude.Text)
listPageReceipts_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPageReceipts -> f ListPageReceipts
listPageReceipts_nextToken = (ListPageReceipts -> Maybe Text)
-> (ListPageReceipts -> Maybe Text -> ListPageReceipts)
-> Lens ListPageReceipts ListPageReceipts (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPageReceipts' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPageReceipts' :: ListPageReceipts -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPageReceipts
s@ListPageReceipts' {} Maybe Text
a -> ListPageReceipts
s {$sel:nextToken:ListPageReceipts' :: Maybe Text
nextToken = Maybe Text
a} :: ListPageReceipts)

-- | The maximum number of acknowledgements per page of results.
listPageReceipts_maxResults :: Lens.Lens' ListPageReceipts (Prelude.Maybe Prelude.Natural)
listPageReceipts_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListPageReceipts -> f ListPageReceipts
listPageReceipts_maxResults = (ListPageReceipts -> Maybe Natural)
-> (ListPageReceipts -> Maybe Natural -> ListPageReceipts)
-> Lens
     ListPageReceipts ListPageReceipts (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPageReceipts' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListPageReceipts' :: ListPageReceipts -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListPageReceipts
s@ListPageReceipts' {} Maybe Natural
a -> ListPageReceipts
s {$sel:maxResults:ListPageReceipts' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListPageReceipts)

-- | The Amazon Resource Name (ARN) of the engagement to a specific contact
-- channel.
listPageReceipts_pageId :: Lens.Lens' ListPageReceipts Prelude.Text
listPageReceipts_pageId :: (Text -> f Text) -> ListPageReceipts -> f ListPageReceipts
listPageReceipts_pageId = (ListPageReceipts -> Text)
-> (ListPageReceipts -> Text -> ListPageReceipts)
-> Lens ListPageReceipts ListPageReceipts Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPageReceipts' {Text
pageId :: Text
$sel:pageId:ListPageReceipts' :: ListPageReceipts -> Text
pageId} -> Text
pageId) (\s :: ListPageReceipts
s@ListPageReceipts' {} Text
a -> ListPageReceipts
s {$sel:pageId:ListPageReceipts' :: Text
pageId = Text
a} :: ListPageReceipts)

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

instance Prelude.NFData ListPageReceipts

instance Core.ToHeaders ListPageReceipts where
  toHeaders :: ListPageReceipts -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListPageReceipts -> 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
"SSMContacts.ListPageReceipts" ::
                          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 ListPageReceipts where
  toJSON :: ListPageReceipts -> Value
toJSON ListPageReceipts' {Maybe Natural
Maybe Text
Text
pageId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:pageId:ListPageReceipts' :: ListPageReceipts -> Text
$sel:maxResults:ListPageReceipts' :: ListPageReceipts -> Maybe Natural
$sel:nextToken:ListPageReceipts' :: ListPageReceipts -> 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
"PageId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
pageId)
          ]
      )

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

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

-- | /See:/ 'newListPageReceiptsResponse' smart constructor.
data ListPageReceiptsResponse = ListPageReceiptsResponse'
  { -- | The pagination token to continue to the next page of results.
    ListPageReceiptsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of each acknowledgement.
    ListPageReceiptsResponse -> Maybe [Receipt]
receipts :: Prelude.Maybe [Receipt],
    -- | The response's http status code.
    ListPageReceiptsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListPageReceiptsResponse -> ListPageReceiptsResponse -> Bool
(ListPageReceiptsResponse -> ListPageReceiptsResponse -> Bool)
-> (ListPageReceiptsResponse -> ListPageReceiptsResponse -> Bool)
-> Eq ListPageReceiptsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPageReceiptsResponse -> ListPageReceiptsResponse -> Bool
$c/= :: ListPageReceiptsResponse -> ListPageReceiptsResponse -> Bool
== :: ListPageReceiptsResponse -> ListPageReceiptsResponse -> Bool
$c== :: ListPageReceiptsResponse -> ListPageReceiptsResponse -> Bool
Prelude.Eq, ReadPrec [ListPageReceiptsResponse]
ReadPrec ListPageReceiptsResponse
Int -> ReadS ListPageReceiptsResponse
ReadS [ListPageReceiptsResponse]
(Int -> ReadS ListPageReceiptsResponse)
-> ReadS [ListPageReceiptsResponse]
-> ReadPrec ListPageReceiptsResponse
-> ReadPrec [ListPageReceiptsResponse]
-> Read ListPageReceiptsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPageReceiptsResponse]
$creadListPrec :: ReadPrec [ListPageReceiptsResponse]
readPrec :: ReadPrec ListPageReceiptsResponse
$creadPrec :: ReadPrec ListPageReceiptsResponse
readList :: ReadS [ListPageReceiptsResponse]
$creadList :: ReadS [ListPageReceiptsResponse]
readsPrec :: Int -> ReadS ListPageReceiptsResponse
$creadsPrec :: Int -> ReadS ListPageReceiptsResponse
Prelude.Read, Int -> ListPageReceiptsResponse -> ShowS
[ListPageReceiptsResponse] -> ShowS
ListPageReceiptsResponse -> String
(Int -> ListPageReceiptsResponse -> ShowS)
-> (ListPageReceiptsResponse -> String)
-> ([ListPageReceiptsResponse] -> ShowS)
-> Show ListPageReceiptsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPageReceiptsResponse] -> ShowS
$cshowList :: [ListPageReceiptsResponse] -> ShowS
show :: ListPageReceiptsResponse -> String
$cshow :: ListPageReceiptsResponse -> String
showsPrec :: Int -> ListPageReceiptsResponse -> ShowS
$cshowsPrec :: Int -> ListPageReceiptsResponse -> ShowS
Prelude.Show, (forall x.
 ListPageReceiptsResponse -> Rep ListPageReceiptsResponse x)
-> (forall x.
    Rep ListPageReceiptsResponse x -> ListPageReceiptsResponse)
-> Generic ListPageReceiptsResponse
forall x.
Rep ListPageReceiptsResponse x -> ListPageReceiptsResponse
forall x.
ListPageReceiptsResponse -> Rep ListPageReceiptsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPageReceiptsResponse x -> ListPageReceiptsResponse
$cfrom :: forall x.
ListPageReceiptsResponse -> Rep ListPageReceiptsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListPageReceiptsResponse' 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', 'listPageReceiptsResponse_nextToken' - The pagination token to continue to the next page of results.
--
-- 'receipts', 'listPageReceiptsResponse_receipts' - A list of each acknowledgement.
--
-- 'httpStatus', 'listPageReceiptsResponse_httpStatus' - The response's http status code.
newListPageReceiptsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPageReceiptsResponse
newListPageReceiptsResponse :: Int -> ListPageReceiptsResponse
newListPageReceiptsResponse Int
pHttpStatus_ =
  ListPageReceiptsResponse' :: Maybe Text -> Maybe [Receipt] -> Int -> ListPageReceiptsResponse
ListPageReceiptsResponse'
    { $sel:nextToken:ListPageReceiptsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:receipts:ListPageReceiptsResponse' :: Maybe [Receipt]
receipts = Maybe [Receipt]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListPageReceiptsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The pagination token to continue to the next page of results.
listPageReceiptsResponse_nextToken :: Lens.Lens' ListPageReceiptsResponse (Prelude.Maybe Prelude.Text)
listPageReceiptsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPageReceiptsResponse -> f ListPageReceiptsResponse
listPageReceiptsResponse_nextToken = (ListPageReceiptsResponse -> Maybe Text)
-> (ListPageReceiptsResponse
    -> Maybe Text -> ListPageReceiptsResponse)
-> Lens' ListPageReceiptsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPageReceiptsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPageReceiptsResponse' :: ListPageReceiptsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPageReceiptsResponse
s@ListPageReceiptsResponse' {} Maybe Text
a -> ListPageReceiptsResponse
s {$sel:nextToken:ListPageReceiptsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPageReceiptsResponse)

-- | A list of each acknowledgement.
listPageReceiptsResponse_receipts :: Lens.Lens' ListPageReceiptsResponse (Prelude.Maybe [Receipt])
listPageReceiptsResponse_receipts :: (Maybe [Receipt] -> f (Maybe [Receipt]))
-> ListPageReceiptsResponse -> f ListPageReceiptsResponse
listPageReceiptsResponse_receipts = (ListPageReceiptsResponse -> Maybe [Receipt])
-> (ListPageReceiptsResponse
    -> Maybe [Receipt] -> ListPageReceiptsResponse)
-> Lens' ListPageReceiptsResponse (Maybe [Receipt])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPageReceiptsResponse' {Maybe [Receipt]
receipts :: Maybe [Receipt]
$sel:receipts:ListPageReceiptsResponse' :: ListPageReceiptsResponse -> Maybe [Receipt]
receipts} -> Maybe [Receipt]
receipts) (\s :: ListPageReceiptsResponse
s@ListPageReceiptsResponse' {} Maybe [Receipt]
a -> ListPageReceiptsResponse
s {$sel:receipts:ListPageReceiptsResponse' :: Maybe [Receipt]
receipts = Maybe [Receipt]
a} :: ListPageReceiptsResponse) ((Maybe [Receipt] -> f (Maybe [Receipt]))
 -> ListPageReceiptsResponse -> f ListPageReceiptsResponse)
-> ((Maybe [Receipt] -> f (Maybe [Receipt]))
    -> Maybe [Receipt] -> f (Maybe [Receipt]))
-> (Maybe [Receipt] -> f (Maybe [Receipt]))
-> ListPageReceiptsResponse
-> f ListPageReceiptsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Receipt] [Receipt] [Receipt] [Receipt]
-> Iso
     (Maybe [Receipt])
     (Maybe [Receipt])
     (Maybe [Receipt])
     (Maybe [Receipt])
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 [Receipt] [Receipt] [Receipt] [Receipt]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListPageReceiptsResponse