{-# 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.ListPagesByEngagement
-- 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 the engagements to contact channels that occurred by engaging a
-- contact.
--
-- This operation returns paginated results.
module Amazonka.SSMContacts.ListPagesByEngagement
  ( -- * Creating a Request
    ListPagesByEngagement (..),
    newListPagesByEngagement,

    -- * Request Lenses
    listPagesByEngagement_nextToken,
    listPagesByEngagement_maxResults,
    listPagesByEngagement_engagementId,

    -- * Destructuring the Response
    ListPagesByEngagementResponse (..),
    newListPagesByEngagementResponse,

    -- * Response Lenses
    listPagesByEngagementResponse_nextToken,
    listPagesByEngagementResponse_httpStatus,
    listPagesByEngagementResponse_pages,
  )
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:/ 'newListPagesByEngagement' smart constructor.
data ListPagesByEngagement = ListPagesByEngagement'
  { -- | The pagination token to continue to the next page of results.
    ListPagesByEngagement -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of engagements to contact channels to list per page
    -- of results.
    ListPagesByEngagement -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of the engagement.
    ListPagesByEngagement -> Text
engagementId :: Prelude.Text
  }
  deriving (ListPagesByEngagement -> ListPagesByEngagement -> Bool
(ListPagesByEngagement -> ListPagesByEngagement -> Bool)
-> (ListPagesByEngagement -> ListPagesByEngagement -> Bool)
-> Eq ListPagesByEngagement
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPagesByEngagement -> ListPagesByEngagement -> Bool
$c/= :: ListPagesByEngagement -> ListPagesByEngagement -> Bool
== :: ListPagesByEngagement -> ListPagesByEngagement -> Bool
$c== :: ListPagesByEngagement -> ListPagesByEngagement -> Bool
Prelude.Eq, ReadPrec [ListPagesByEngagement]
ReadPrec ListPagesByEngagement
Int -> ReadS ListPagesByEngagement
ReadS [ListPagesByEngagement]
(Int -> ReadS ListPagesByEngagement)
-> ReadS [ListPagesByEngagement]
-> ReadPrec ListPagesByEngagement
-> ReadPrec [ListPagesByEngagement]
-> Read ListPagesByEngagement
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPagesByEngagement]
$creadListPrec :: ReadPrec [ListPagesByEngagement]
readPrec :: ReadPrec ListPagesByEngagement
$creadPrec :: ReadPrec ListPagesByEngagement
readList :: ReadS [ListPagesByEngagement]
$creadList :: ReadS [ListPagesByEngagement]
readsPrec :: Int -> ReadS ListPagesByEngagement
$creadsPrec :: Int -> ReadS ListPagesByEngagement
Prelude.Read, Int -> ListPagesByEngagement -> ShowS
[ListPagesByEngagement] -> ShowS
ListPagesByEngagement -> String
(Int -> ListPagesByEngagement -> ShowS)
-> (ListPagesByEngagement -> String)
-> ([ListPagesByEngagement] -> ShowS)
-> Show ListPagesByEngagement
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPagesByEngagement] -> ShowS
$cshowList :: [ListPagesByEngagement] -> ShowS
show :: ListPagesByEngagement -> String
$cshow :: ListPagesByEngagement -> String
showsPrec :: Int -> ListPagesByEngagement -> ShowS
$cshowsPrec :: Int -> ListPagesByEngagement -> ShowS
Prelude.Show, (forall x. ListPagesByEngagement -> Rep ListPagesByEngagement x)
-> (forall x. Rep ListPagesByEngagement x -> ListPagesByEngagement)
-> Generic ListPagesByEngagement
forall x. Rep ListPagesByEngagement x -> ListPagesByEngagement
forall x. ListPagesByEngagement -> Rep ListPagesByEngagement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPagesByEngagement x -> ListPagesByEngagement
$cfrom :: forall x. ListPagesByEngagement -> Rep ListPagesByEngagement x
Prelude.Generic)

-- |
-- Create a value of 'ListPagesByEngagement' 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', 'listPagesByEngagement_nextToken' - The pagination token to continue to the next page of results.
--
-- 'maxResults', 'listPagesByEngagement_maxResults' - The maximum number of engagements to contact channels to list per page
-- of results.
--
-- 'engagementId', 'listPagesByEngagement_engagementId' - The Amazon Resource Name (ARN) of the engagement.
newListPagesByEngagement ::
  -- | 'engagementId'
  Prelude.Text ->
  ListPagesByEngagement
newListPagesByEngagement :: Text -> ListPagesByEngagement
newListPagesByEngagement Text
pEngagementId_ =
  ListPagesByEngagement' :: Maybe Text -> Maybe Natural -> Text -> ListPagesByEngagement
ListPagesByEngagement'
    { $sel:nextToken:ListPagesByEngagement' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListPagesByEngagement' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:engagementId:ListPagesByEngagement' :: Text
engagementId = Text
pEngagementId_
    }

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

-- | The maximum number of engagements to contact channels to list per page
-- of results.
listPagesByEngagement_maxResults :: Lens.Lens' ListPagesByEngagement (Prelude.Maybe Prelude.Natural)
listPagesByEngagement_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListPagesByEngagement -> f ListPagesByEngagement
listPagesByEngagement_maxResults = (ListPagesByEngagement -> Maybe Natural)
-> (ListPagesByEngagement
    -> Maybe Natural -> ListPagesByEngagement)
-> Lens
     ListPagesByEngagement
     ListPagesByEngagement
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPagesByEngagement' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListPagesByEngagement' :: ListPagesByEngagement -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListPagesByEngagement
s@ListPagesByEngagement' {} Maybe Natural
a -> ListPagesByEngagement
s {$sel:maxResults:ListPagesByEngagement' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListPagesByEngagement)

-- | The Amazon Resource Name (ARN) of the engagement.
listPagesByEngagement_engagementId :: Lens.Lens' ListPagesByEngagement Prelude.Text
listPagesByEngagement_engagementId :: (Text -> f Text)
-> ListPagesByEngagement -> f ListPagesByEngagement
listPagesByEngagement_engagementId = (ListPagesByEngagement -> Text)
-> (ListPagesByEngagement -> Text -> ListPagesByEngagement)
-> Lens ListPagesByEngagement ListPagesByEngagement Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPagesByEngagement' {Text
engagementId :: Text
$sel:engagementId:ListPagesByEngagement' :: ListPagesByEngagement -> Text
engagementId} -> Text
engagementId) (\s :: ListPagesByEngagement
s@ListPagesByEngagement' {} Text
a -> ListPagesByEngagement
s {$sel:engagementId:ListPagesByEngagement' :: Text
engagementId = Text
a} :: ListPagesByEngagement)

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

instance Prelude.Hashable ListPagesByEngagement

instance Prelude.NFData ListPagesByEngagement

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

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

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

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

-- |
-- Create a value of 'ListPagesByEngagementResponse' 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', 'listPagesByEngagementResponse_nextToken' - The pagination token to continue to the next page of results.
--
-- 'httpStatus', 'listPagesByEngagementResponse_httpStatus' - The response's http status code.
--
-- 'pages', 'listPagesByEngagementResponse_pages' - The list of engagements to contact channels.
newListPagesByEngagementResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPagesByEngagementResponse
newListPagesByEngagementResponse :: Int -> ListPagesByEngagementResponse
newListPagesByEngagementResponse Int
pHttpStatus_ =
  ListPagesByEngagementResponse' :: Maybe Text -> Int -> [Page] -> ListPagesByEngagementResponse
ListPagesByEngagementResponse'
    { $sel:nextToken:ListPagesByEngagementResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListPagesByEngagementResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:pages:ListPagesByEngagementResponse' :: [Page]
pages = [Page]
forall a. Monoid a => a
Prelude.mempty
    }

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

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

-- | The list of engagements to contact channels.
listPagesByEngagementResponse_pages :: Lens.Lens' ListPagesByEngagementResponse [Page]
listPagesByEngagementResponse_pages :: ([Page] -> f [Page])
-> ListPagesByEngagementResponse -> f ListPagesByEngagementResponse
listPagesByEngagementResponse_pages = (ListPagesByEngagementResponse -> [Page])
-> (ListPagesByEngagementResponse
    -> [Page] -> ListPagesByEngagementResponse)
-> Lens' ListPagesByEngagementResponse [Page]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPagesByEngagementResponse' {[Page]
pages :: [Page]
$sel:pages:ListPagesByEngagementResponse' :: ListPagesByEngagementResponse -> [Page]
pages} -> [Page]
pages) (\s :: ListPagesByEngagementResponse
s@ListPagesByEngagementResponse' {} [Page]
a -> ListPagesByEngagementResponse
s {$sel:pages:ListPagesByEngagementResponse' :: [Page]
pages = [Page]
a} :: ListPagesByEngagementResponse) (([Page] -> f [Page])
 -> ListPagesByEngagementResponse
 -> f ListPagesByEngagementResponse)
-> (([Page] -> f [Page]) -> [Page] -> f [Page])
-> ([Page] -> f [Page])
-> ListPagesByEngagementResponse
-> f ListPagesByEngagementResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Page] -> f [Page]) -> [Page] -> f [Page]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListPagesByEngagementResponse