{-# 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.SNS.ListEndpointsByPlatformApplication
-- 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 endpoints and endpoint attributes for devices in a supported
-- push notification service, such as GCM (Firebase Cloud Messaging) and
-- APNS. The results for @ListEndpointsByPlatformApplication@ are paginated
-- and return a limited list of endpoints, up to 100. If additional records
-- are available after the first page results, then a NextToken string will
-- be returned. To receive the next page, you call
-- @ListEndpointsByPlatformApplication@ again using the NextToken string
-- received from the previous call. When there are no more records to
-- return, NextToken will be null. For more information, see
-- <https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html Using Amazon SNS Mobile Push Notifications>.
--
-- This action is throttled at 30 transactions per second (TPS).
--
-- This operation returns paginated results.
module Amazonka.SNS.ListEndpointsByPlatformApplication
  ( -- * Creating a Request
    ListEndpointsByPlatformApplication (..),
    newListEndpointsByPlatformApplication,

    -- * Request Lenses
    listEndpointsByPlatformApplication_nextToken,
    listEndpointsByPlatformApplication_platformApplicationArn,

    -- * Destructuring the Response
    ListEndpointsByPlatformApplicationResponse (..),
    newListEndpointsByPlatformApplicationResponse,

    -- * Response Lenses
    listEndpointsByPlatformApplicationResponse_nextToken,
    listEndpointsByPlatformApplicationResponse_endpoints,
    listEndpointsByPlatformApplicationResponse_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.SNS.Types

-- | Input for ListEndpointsByPlatformApplication action.
--
-- /See:/ 'newListEndpointsByPlatformApplication' smart constructor.
data ListEndpointsByPlatformApplication = ListEndpointsByPlatformApplication'
  { -- | NextToken string is used when calling ListEndpointsByPlatformApplication
    -- action to retrieve additional records that are available after the first
    -- page results.
    ListEndpointsByPlatformApplication -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | PlatformApplicationArn for ListEndpointsByPlatformApplicationInput
    -- action.
    ListEndpointsByPlatformApplication -> Text
platformApplicationArn :: Prelude.Text
  }
  deriving (ListEndpointsByPlatformApplication
-> ListEndpointsByPlatformApplication -> Bool
(ListEndpointsByPlatformApplication
 -> ListEndpointsByPlatformApplication -> Bool)
-> (ListEndpointsByPlatformApplication
    -> ListEndpointsByPlatformApplication -> Bool)
-> Eq ListEndpointsByPlatformApplication
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEndpointsByPlatformApplication
-> ListEndpointsByPlatformApplication -> Bool
$c/= :: ListEndpointsByPlatformApplication
-> ListEndpointsByPlatformApplication -> Bool
== :: ListEndpointsByPlatformApplication
-> ListEndpointsByPlatformApplication -> Bool
$c== :: ListEndpointsByPlatformApplication
-> ListEndpointsByPlatformApplication -> Bool
Prelude.Eq, ReadPrec [ListEndpointsByPlatformApplication]
ReadPrec ListEndpointsByPlatformApplication
Int -> ReadS ListEndpointsByPlatformApplication
ReadS [ListEndpointsByPlatformApplication]
(Int -> ReadS ListEndpointsByPlatformApplication)
-> ReadS [ListEndpointsByPlatformApplication]
-> ReadPrec ListEndpointsByPlatformApplication
-> ReadPrec [ListEndpointsByPlatformApplication]
-> Read ListEndpointsByPlatformApplication
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEndpointsByPlatformApplication]
$creadListPrec :: ReadPrec [ListEndpointsByPlatformApplication]
readPrec :: ReadPrec ListEndpointsByPlatformApplication
$creadPrec :: ReadPrec ListEndpointsByPlatformApplication
readList :: ReadS [ListEndpointsByPlatformApplication]
$creadList :: ReadS [ListEndpointsByPlatformApplication]
readsPrec :: Int -> ReadS ListEndpointsByPlatformApplication
$creadsPrec :: Int -> ReadS ListEndpointsByPlatformApplication
Prelude.Read, Int -> ListEndpointsByPlatformApplication -> ShowS
[ListEndpointsByPlatformApplication] -> ShowS
ListEndpointsByPlatformApplication -> String
(Int -> ListEndpointsByPlatformApplication -> ShowS)
-> (ListEndpointsByPlatformApplication -> String)
-> ([ListEndpointsByPlatformApplication] -> ShowS)
-> Show ListEndpointsByPlatformApplication
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEndpointsByPlatformApplication] -> ShowS
$cshowList :: [ListEndpointsByPlatformApplication] -> ShowS
show :: ListEndpointsByPlatformApplication -> String
$cshow :: ListEndpointsByPlatformApplication -> String
showsPrec :: Int -> ListEndpointsByPlatformApplication -> ShowS
$cshowsPrec :: Int -> ListEndpointsByPlatformApplication -> ShowS
Prelude.Show, (forall x.
 ListEndpointsByPlatformApplication
 -> Rep ListEndpointsByPlatformApplication x)
-> (forall x.
    Rep ListEndpointsByPlatformApplication x
    -> ListEndpointsByPlatformApplication)
-> Generic ListEndpointsByPlatformApplication
forall x.
Rep ListEndpointsByPlatformApplication x
-> ListEndpointsByPlatformApplication
forall x.
ListEndpointsByPlatformApplication
-> Rep ListEndpointsByPlatformApplication x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListEndpointsByPlatformApplication x
-> ListEndpointsByPlatformApplication
$cfrom :: forall x.
ListEndpointsByPlatformApplication
-> Rep ListEndpointsByPlatformApplication x
Prelude.Generic)

-- |
-- Create a value of 'ListEndpointsByPlatformApplication' 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', 'listEndpointsByPlatformApplication_nextToken' - NextToken string is used when calling ListEndpointsByPlatformApplication
-- action to retrieve additional records that are available after the first
-- page results.
--
-- 'platformApplicationArn', 'listEndpointsByPlatformApplication_platformApplicationArn' - PlatformApplicationArn for ListEndpointsByPlatformApplicationInput
-- action.
newListEndpointsByPlatformApplication ::
  -- | 'platformApplicationArn'
  Prelude.Text ->
  ListEndpointsByPlatformApplication
newListEndpointsByPlatformApplication :: Text -> ListEndpointsByPlatformApplication
newListEndpointsByPlatformApplication
  Text
pPlatformApplicationArn_ =
    ListEndpointsByPlatformApplication' :: Maybe Text -> Text -> ListEndpointsByPlatformApplication
ListEndpointsByPlatformApplication'
      { $sel:nextToken:ListEndpointsByPlatformApplication' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:platformApplicationArn:ListEndpointsByPlatformApplication' :: Text
platformApplicationArn =
          Text
pPlatformApplicationArn_
      }

-- | NextToken string is used when calling ListEndpointsByPlatformApplication
-- action to retrieve additional records that are available after the first
-- page results.
listEndpointsByPlatformApplication_nextToken :: Lens.Lens' ListEndpointsByPlatformApplication (Prelude.Maybe Prelude.Text)
listEndpointsByPlatformApplication_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListEndpointsByPlatformApplication
-> f ListEndpointsByPlatformApplication
listEndpointsByPlatformApplication_nextToken = (ListEndpointsByPlatformApplication -> Maybe Text)
-> (ListEndpointsByPlatformApplication
    -> Maybe Text -> ListEndpointsByPlatformApplication)
-> Lens
     ListEndpointsByPlatformApplication
     ListEndpointsByPlatformApplication
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEndpointsByPlatformApplication' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEndpointsByPlatformApplication' :: ListEndpointsByPlatformApplication -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEndpointsByPlatformApplication
s@ListEndpointsByPlatformApplication' {} Maybe Text
a -> ListEndpointsByPlatformApplication
s {$sel:nextToken:ListEndpointsByPlatformApplication' :: Maybe Text
nextToken = Maybe Text
a} :: ListEndpointsByPlatformApplication)

-- | PlatformApplicationArn for ListEndpointsByPlatformApplicationInput
-- action.
listEndpointsByPlatformApplication_platformApplicationArn :: Lens.Lens' ListEndpointsByPlatformApplication Prelude.Text
listEndpointsByPlatformApplication_platformApplicationArn :: (Text -> f Text)
-> ListEndpointsByPlatformApplication
-> f ListEndpointsByPlatformApplication
listEndpointsByPlatformApplication_platformApplicationArn = (ListEndpointsByPlatformApplication -> Text)
-> (ListEndpointsByPlatformApplication
    -> Text -> ListEndpointsByPlatformApplication)
-> Lens
     ListEndpointsByPlatformApplication
     ListEndpointsByPlatformApplication
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEndpointsByPlatformApplication' {Text
platformApplicationArn :: Text
$sel:platformApplicationArn:ListEndpointsByPlatformApplication' :: ListEndpointsByPlatformApplication -> Text
platformApplicationArn} -> Text
platformApplicationArn) (\s :: ListEndpointsByPlatformApplication
s@ListEndpointsByPlatformApplication' {} Text
a -> ListEndpointsByPlatformApplication
s {$sel:platformApplicationArn:ListEndpointsByPlatformApplication' :: Text
platformApplicationArn = Text
a} :: ListEndpointsByPlatformApplication)

instance
  Core.AWSPager
    ListEndpointsByPlatformApplication
  where
  page :: ListEndpointsByPlatformApplication
-> AWSResponse ListEndpointsByPlatformApplication
-> Maybe ListEndpointsByPlatformApplication
page ListEndpointsByPlatformApplication
rq AWSResponse ListEndpointsByPlatformApplication
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListEndpointsByPlatformApplication
ListEndpointsByPlatformApplicationResponse
rs
            ListEndpointsByPlatformApplicationResponse
-> Getting
     (First Text) ListEndpointsByPlatformApplicationResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListEndpointsByPlatformApplicationResponse
-> Const (First Text) ListEndpointsByPlatformApplicationResponse
Lens' ListEndpointsByPlatformApplicationResponse (Maybe Text)
listEndpointsByPlatformApplicationResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListEndpointsByPlatformApplicationResponse
 -> Const (First Text) ListEndpointsByPlatformApplicationResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
     (First Text) ListEndpointsByPlatformApplicationResponse 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 ListEndpointsByPlatformApplication
forall a. Maybe a
Prelude.Nothing
    | Maybe [Endpoint] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListEndpointsByPlatformApplication
ListEndpointsByPlatformApplicationResponse
rs
            ListEndpointsByPlatformApplicationResponse
-> Getting
     (First [Endpoint])
     ListEndpointsByPlatformApplicationResponse
     [Endpoint]
-> Maybe [Endpoint]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Endpoint] -> Const (First [Endpoint]) (Maybe [Endpoint]))
-> ListEndpointsByPlatformApplicationResponse
-> Const
     (First [Endpoint]) ListEndpointsByPlatformApplicationResponse
Lens' ListEndpointsByPlatformApplicationResponse (Maybe [Endpoint])
listEndpointsByPlatformApplicationResponse_endpoints
              ((Maybe [Endpoint] -> Const (First [Endpoint]) (Maybe [Endpoint]))
 -> ListEndpointsByPlatformApplicationResponse
 -> Const
      (First [Endpoint]) ListEndpointsByPlatformApplicationResponse)
-> (([Endpoint] -> Const (First [Endpoint]) [Endpoint])
    -> Maybe [Endpoint] -> Const (First [Endpoint]) (Maybe [Endpoint]))
-> Getting
     (First [Endpoint])
     ListEndpointsByPlatformApplicationResponse
     [Endpoint]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Endpoint] -> Const (First [Endpoint]) [Endpoint])
-> Maybe [Endpoint] -> Const (First [Endpoint]) (Maybe [Endpoint])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListEndpointsByPlatformApplication
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListEndpointsByPlatformApplication
-> Maybe ListEndpointsByPlatformApplication
forall a. a -> Maybe a
Prelude.Just (ListEndpointsByPlatformApplication
 -> Maybe ListEndpointsByPlatformApplication)
-> ListEndpointsByPlatformApplication
-> Maybe ListEndpointsByPlatformApplication
forall a b. (a -> b) -> a -> b
Prelude.$
        ListEndpointsByPlatformApplication
rq
          ListEndpointsByPlatformApplication
-> (ListEndpointsByPlatformApplication
    -> ListEndpointsByPlatformApplication)
-> ListEndpointsByPlatformApplication
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListEndpointsByPlatformApplication
-> Identity ListEndpointsByPlatformApplication
Lens
  ListEndpointsByPlatformApplication
  ListEndpointsByPlatformApplication
  (Maybe Text)
  (Maybe Text)
listEndpointsByPlatformApplication_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListEndpointsByPlatformApplication
 -> Identity ListEndpointsByPlatformApplication)
-> Maybe Text
-> ListEndpointsByPlatformApplication
-> ListEndpointsByPlatformApplication
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListEndpointsByPlatformApplication
ListEndpointsByPlatformApplicationResponse
rs
          ListEndpointsByPlatformApplicationResponse
-> Getting
     (First Text) ListEndpointsByPlatformApplicationResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListEndpointsByPlatformApplicationResponse
-> Const (First Text) ListEndpointsByPlatformApplicationResponse
Lens' ListEndpointsByPlatformApplicationResponse (Maybe Text)
listEndpointsByPlatformApplicationResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListEndpointsByPlatformApplicationResponse
 -> Const (First Text) ListEndpointsByPlatformApplicationResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
     (First Text) ListEndpointsByPlatformApplicationResponse 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
    ListEndpointsByPlatformApplication
  where
  type
    AWSResponse ListEndpointsByPlatformApplication =
      ListEndpointsByPlatformApplicationResponse
  request :: ListEndpointsByPlatformApplication
-> Request ListEndpointsByPlatformApplication
request = Service
-> ListEndpointsByPlatformApplication
-> Request ListEndpointsByPlatformApplication
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListEndpointsByPlatformApplication
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListEndpointsByPlatformApplication)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListEndpointsByPlatformApplication))
-> Logger
-> Service
-> Proxy ListEndpointsByPlatformApplication
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListEndpointsByPlatformApplication)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ListEndpointsByPlatformApplicationResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [Endpoint]
-> Int
-> ListEndpointsByPlatformApplicationResponse
ListEndpointsByPlatformApplicationResponse'
            (Maybe Text
 -> Maybe [Endpoint]
 -> Int
 -> ListEndpointsByPlatformApplicationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Endpoint]
      -> Int -> ListEndpointsByPlatformApplicationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NextToken")
              Either
  String
  (Maybe [Endpoint]
   -> Int -> ListEndpointsByPlatformApplicationResponse)
-> Either String (Maybe [Endpoint])
-> Either
     String (Int -> ListEndpointsByPlatformApplicationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Endpoints" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                              Either String [Node]
-> ([Node] -> Either String (Maybe [Endpoint]))
-> Either String (Maybe [Endpoint])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Endpoint])
-> [Node] -> Either String (Maybe [Endpoint])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Endpoint]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                          )
              Either String (Int -> ListEndpointsByPlatformApplicationResponse)
-> Either String Int
-> Either String ListEndpointsByPlatformApplicationResponse
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
    ListEndpointsByPlatformApplication

instance
  Prelude.NFData
    ListEndpointsByPlatformApplication

instance
  Core.ToHeaders
    ListEndpointsByPlatformApplication
  where
  toHeaders :: ListEndpointsByPlatformApplication -> ResponseHeaders
toHeaders = ResponseHeaders
-> ListEndpointsByPlatformApplication -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance
  Core.ToQuery
    ListEndpointsByPlatformApplication
  where
  toQuery :: ListEndpointsByPlatformApplication -> QueryString
toQuery ListEndpointsByPlatformApplication' {Maybe Text
Text
platformApplicationArn :: Text
nextToken :: Maybe Text
$sel:platformApplicationArn:ListEndpointsByPlatformApplication' :: ListEndpointsByPlatformApplication -> Text
$sel:nextToken:ListEndpointsByPlatformApplication' :: ListEndpointsByPlatformApplication -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"ListEndpointsByPlatformApplication" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-03-31" :: Prelude.ByteString),
        ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"PlatformApplicationArn"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
platformApplicationArn
      ]

-- | Response for ListEndpointsByPlatformApplication action.
--
-- /See:/ 'newListEndpointsByPlatformApplicationResponse' smart constructor.
data ListEndpointsByPlatformApplicationResponse = ListEndpointsByPlatformApplicationResponse'
  { -- | NextToken string is returned when calling
    -- ListEndpointsByPlatformApplication action if additional records are
    -- available after the first page results.
    ListEndpointsByPlatformApplicationResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Endpoints returned for ListEndpointsByPlatformApplication action.
    ListEndpointsByPlatformApplicationResponse -> Maybe [Endpoint]
endpoints :: Prelude.Maybe [Endpoint],
    -- | The response's http status code.
    ListEndpointsByPlatformApplicationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListEndpointsByPlatformApplicationResponse
-> ListEndpointsByPlatformApplicationResponse -> Bool
(ListEndpointsByPlatformApplicationResponse
 -> ListEndpointsByPlatformApplicationResponse -> Bool)
-> (ListEndpointsByPlatformApplicationResponse
    -> ListEndpointsByPlatformApplicationResponse -> Bool)
-> Eq ListEndpointsByPlatformApplicationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEndpointsByPlatformApplicationResponse
-> ListEndpointsByPlatformApplicationResponse -> Bool
$c/= :: ListEndpointsByPlatformApplicationResponse
-> ListEndpointsByPlatformApplicationResponse -> Bool
== :: ListEndpointsByPlatformApplicationResponse
-> ListEndpointsByPlatformApplicationResponse -> Bool
$c== :: ListEndpointsByPlatformApplicationResponse
-> ListEndpointsByPlatformApplicationResponse -> Bool
Prelude.Eq, ReadPrec [ListEndpointsByPlatformApplicationResponse]
ReadPrec ListEndpointsByPlatformApplicationResponse
Int -> ReadS ListEndpointsByPlatformApplicationResponse
ReadS [ListEndpointsByPlatformApplicationResponse]
(Int -> ReadS ListEndpointsByPlatformApplicationResponse)
-> ReadS [ListEndpointsByPlatformApplicationResponse]
-> ReadPrec ListEndpointsByPlatformApplicationResponse
-> ReadPrec [ListEndpointsByPlatformApplicationResponse]
-> Read ListEndpointsByPlatformApplicationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEndpointsByPlatformApplicationResponse]
$creadListPrec :: ReadPrec [ListEndpointsByPlatformApplicationResponse]
readPrec :: ReadPrec ListEndpointsByPlatformApplicationResponse
$creadPrec :: ReadPrec ListEndpointsByPlatformApplicationResponse
readList :: ReadS [ListEndpointsByPlatformApplicationResponse]
$creadList :: ReadS [ListEndpointsByPlatformApplicationResponse]
readsPrec :: Int -> ReadS ListEndpointsByPlatformApplicationResponse
$creadsPrec :: Int -> ReadS ListEndpointsByPlatformApplicationResponse
Prelude.Read, Int -> ListEndpointsByPlatformApplicationResponse -> ShowS
[ListEndpointsByPlatformApplicationResponse] -> ShowS
ListEndpointsByPlatformApplicationResponse -> String
(Int -> ListEndpointsByPlatformApplicationResponse -> ShowS)
-> (ListEndpointsByPlatformApplicationResponse -> String)
-> ([ListEndpointsByPlatformApplicationResponse] -> ShowS)
-> Show ListEndpointsByPlatformApplicationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEndpointsByPlatformApplicationResponse] -> ShowS
$cshowList :: [ListEndpointsByPlatformApplicationResponse] -> ShowS
show :: ListEndpointsByPlatformApplicationResponse -> String
$cshow :: ListEndpointsByPlatformApplicationResponse -> String
showsPrec :: Int -> ListEndpointsByPlatformApplicationResponse -> ShowS
$cshowsPrec :: Int -> ListEndpointsByPlatformApplicationResponse -> ShowS
Prelude.Show, (forall x.
 ListEndpointsByPlatformApplicationResponse
 -> Rep ListEndpointsByPlatformApplicationResponse x)
-> (forall x.
    Rep ListEndpointsByPlatformApplicationResponse x
    -> ListEndpointsByPlatformApplicationResponse)
-> Generic ListEndpointsByPlatformApplicationResponse
forall x.
Rep ListEndpointsByPlatformApplicationResponse x
-> ListEndpointsByPlatformApplicationResponse
forall x.
ListEndpointsByPlatformApplicationResponse
-> Rep ListEndpointsByPlatformApplicationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListEndpointsByPlatformApplicationResponse x
-> ListEndpointsByPlatformApplicationResponse
$cfrom :: forall x.
ListEndpointsByPlatformApplicationResponse
-> Rep ListEndpointsByPlatformApplicationResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListEndpointsByPlatformApplicationResponse' 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', 'listEndpointsByPlatformApplicationResponse_nextToken' - NextToken string is returned when calling
-- ListEndpointsByPlatformApplication action if additional records are
-- available after the first page results.
--
-- 'endpoints', 'listEndpointsByPlatformApplicationResponse_endpoints' - Endpoints returned for ListEndpointsByPlatformApplication action.
--
-- 'httpStatus', 'listEndpointsByPlatformApplicationResponse_httpStatus' - The response's http status code.
newListEndpointsByPlatformApplicationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListEndpointsByPlatformApplicationResponse
newListEndpointsByPlatformApplicationResponse :: Int -> ListEndpointsByPlatformApplicationResponse
newListEndpointsByPlatformApplicationResponse
  Int
pHttpStatus_ =
    ListEndpointsByPlatformApplicationResponse' :: Maybe Text
-> Maybe [Endpoint]
-> Int
-> ListEndpointsByPlatformApplicationResponse
ListEndpointsByPlatformApplicationResponse'
      { $sel:nextToken:ListEndpointsByPlatformApplicationResponse' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:endpoints:ListEndpointsByPlatformApplicationResponse' :: Maybe [Endpoint]
endpoints = Maybe [Endpoint]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListEndpointsByPlatformApplicationResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | NextToken string is returned when calling
-- ListEndpointsByPlatformApplication action if additional records are
-- available after the first page results.
listEndpointsByPlatformApplicationResponse_nextToken :: Lens.Lens' ListEndpointsByPlatformApplicationResponse (Prelude.Maybe Prelude.Text)
listEndpointsByPlatformApplicationResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListEndpointsByPlatformApplicationResponse
-> f ListEndpointsByPlatformApplicationResponse
listEndpointsByPlatformApplicationResponse_nextToken = (ListEndpointsByPlatformApplicationResponse -> Maybe Text)
-> (ListEndpointsByPlatformApplicationResponse
    -> Maybe Text -> ListEndpointsByPlatformApplicationResponse)
-> Lens' ListEndpointsByPlatformApplicationResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEndpointsByPlatformApplicationResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEndpointsByPlatformApplicationResponse' :: ListEndpointsByPlatformApplicationResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEndpointsByPlatformApplicationResponse
s@ListEndpointsByPlatformApplicationResponse' {} Maybe Text
a -> ListEndpointsByPlatformApplicationResponse
s {$sel:nextToken:ListEndpointsByPlatformApplicationResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListEndpointsByPlatformApplicationResponse)

-- | Endpoints returned for ListEndpointsByPlatformApplication action.
listEndpointsByPlatformApplicationResponse_endpoints :: Lens.Lens' ListEndpointsByPlatformApplicationResponse (Prelude.Maybe [Endpoint])
listEndpointsByPlatformApplicationResponse_endpoints :: (Maybe [Endpoint] -> f (Maybe [Endpoint]))
-> ListEndpointsByPlatformApplicationResponse
-> f ListEndpointsByPlatformApplicationResponse
listEndpointsByPlatformApplicationResponse_endpoints = (ListEndpointsByPlatformApplicationResponse -> Maybe [Endpoint])
-> (ListEndpointsByPlatformApplicationResponse
    -> Maybe [Endpoint] -> ListEndpointsByPlatformApplicationResponse)
-> Lens'
     ListEndpointsByPlatformApplicationResponse (Maybe [Endpoint])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEndpointsByPlatformApplicationResponse' {Maybe [Endpoint]
endpoints :: Maybe [Endpoint]
$sel:endpoints:ListEndpointsByPlatformApplicationResponse' :: ListEndpointsByPlatformApplicationResponse -> Maybe [Endpoint]
endpoints} -> Maybe [Endpoint]
endpoints) (\s :: ListEndpointsByPlatformApplicationResponse
s@ListEndpointsByPlatformApplicationResponse' {} Maybe [Endpoint]
a -> ListEndpointsByPlatformApplicationResponse
s {$sel:endpoints:ListEndpointsByPlatformApplicationResponse' :: Maybe [Endpoint]
endpoints = Maybe [Endpoint]
a} :: ListEndpointsByPlatformApplicationResponse) ((Maybe [Endpoint] -> f (Maybe [Endpoint]))
 -> ListEndpointsByPlatformApplicationResponse
 -> f ListEndpointsByPlatformApplicationResponse)
-> ((Maybe [Endpoint] -> f (Maybe [Endpoint]))
    -> Maybe [Endpoint] -> f (Maybe [Endpoint]))
-> (Maybe [Endpoint] -> f (Maybe [Endpoint]))
-> ListEndpointsByPlatformApplicationResponse
-> f ListEndpointsByPlatformApplicationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Endpoint] [Endpoint] [Endpoint] [Endpoint]
-> Iso
     (Maybe [Endpoint])
     (Maybe [Endpoint])
     (Maybe [Endpoint])
     (Maybe [Endpoint])
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 [Endpoint] [Endpoint] [Endpoint] [Endpoint]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListEndpointsByPlatformApplicationResponse