{-# 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.ListPlatformApplications
-- 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 platform application objects for the supported push
-- notification services, such as APNS and GCM (Firebase Cloud Messaging).
-- The results for @ListPlatformApplications@ are paginated and return a
-- limited list of applications, 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 @ListPlatformApplications@
-- 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 15 transactions per second (TPS).
--
-- This operation returns paginated results.
module Amazonka.SNS.ListPlatformApplications
  ( -- * Creating a Request
    ListPlatformApplications (..),
    newListPlatformApplications,

    -- * Request Lenses
    listPlatformApplications_nextToken,

    -- * Destructuring the Response
    ListPlatformApplicationsResponse (..),
    newListPlatformApplicationsResponse,

    -- * Response Lenses
    listPlatformApplicationsResponse_nextToken,
    listPlatformApplicationsResponse_platformApplications,
    listPlatformApplicationsResponse_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.SNS.Types

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

-- |
-- Create a value of 'ListPlatformApplications' 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', 'listPlatformApplications_nextToken' - NextToken string is used when calling ListPlatformApplications action to
-- retrieve additional records that are available after the first page
-- results.
newListPlatformApplications ::
  ListPlatformApplications
newListPlatformApplications :: ListPlatformApplications
newListPlatformApplications =
  ListPlatformApplications'
    { nextToken :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

instance Core.AWSPager ListPlatformApplications where
  page :: ListPlatformApplications
-> AWSResponse ListPlatformApplications
-> Maybe ListPlatformApplications
page ListPlatformApplications
rq AWSResponse ListPlatformApplications
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListPlatformApplications
ListPlatformApplicationsResponse
rs
            ListPlatformApplicationsResponse
-> Getting (First Text) ListPlatformApplicationsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPlatformApplicationsResponse
-> Const (First Text) ListPlatformApplicationsResponse
Lens' ListPlatformApplicationsResponse (Maybe Text)
listPlatformApplicationsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPlatformApplicationsResponse
 -> Const (First Text) ListPlatformApplicationsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPlatformApplicationsResponse 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 a' (f :: * -> *).
Applicative f =>
(a -> f a') -> Maybe a -> f (Maybe a')
Lens._Just
        ) =
        Maybe ListPlatformApplications
forall a. Maybe a
Prelude.Nothing
    | Maybe [PlatformApplication] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListPlatformApplications
ListPlatformApplicationsResponse
rs
            ListPlatformApplicationsResponse
-> Getting
     (First [PlatformApplication])
     ListPlatformApplicationsResponse
     [PlatformApplication]
-> Maybe [PlatformApplication]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [PlatformApplication]
 -> Const
      (First [PlatformApplication]) (Maybe [PlatformApplication]))
-> ListPlatformApplicationsResponse
-> Const
     (First [PlatformApplication]) ListPlatformApplicationsResponse
Lens'
  ListPlatformApplicationsResponse (Maybe [PlatformApplication])
listPlatformApplicationsResponse_platformApplications
            ((Maybe [PlatformApplication]
  -> Const
       (First [PlatformApplication]) (Maybe [PlatformApplication]))
 -> ListPlatformApplicationsResponse
 -> Const
      (First [PlatformApplication]) ListPlatformApplicationsResponse)
-> (([PlatformApplication]
     -> Const (First [PlatformApplication]) [PlatformApplication])
    -> Maybe [PlatformApplication]
    -> Const
         (First [PlatformApplication]) (Maybe [PlatformApplication]))
-> Getting
     (First [PlatformApplication])
     ListPlatformApplicationsResponse
     [PlatformApplication]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([PlatformApplication]
 -> Const (First [PlatformApplication]) [PlatformApplication])
-> Maybe [PlatformApplication]
-> Const
     (First [PlatformApplication]) (Maybe [PlatformApplication])
forall a a' (f :: * -> *).
Applicative f =>
(a -> f a') -> Maybe a -> f (Maybe a')
Lens._Just
        ) =
        Maybe ListPlatformApplications
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        ListPlatformApplications -> Maybe ListPlatformApplications
forall a. a -> Maybe a
Prelude.Just (ListPlatformApplications -> Maybe ListPlatformApplications)
-> ListPlatformApplications -> Maybe ListPlatformApplications
forall a b. (a -> b) -> a -> b
Prelude.$
          ListPlatformApplications
rq
            ListPlatformApplications
-> (ListPlatformApplications -> ListPlatformApplications)
-> ListPlatformApplications
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListPlatformApplications -> Identity ListPlatformApplications
Lens' ListPlatformApplications (Maybe Text)
listPlatformApplications_nextToken
              ((Maybe Text -> Identity (Maybe Text))
 -> ListPlatformApplications -> Identity ListPlatformApplications)
-> Maybe Text
-> ListPlatformApplications
-> ListPlatformApplications
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListPlatformApplications
ListPlatformApplicationsResponse
rs
              ListPlatformApplicationsResponse
-> Getting (First Text) ListPlatformApplicationsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPlatformApplicationsResponse
-> Const (First Text) ListPlatformApplicationsResponse
Lens' ListPlatformApplicationsResponse (Maybe Text)
listPlatformApplicationsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPlatformApplicationsResponse
 -> Const (First Text) ListPlatformApplicationsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPlatformApplicationsResponse 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 a' (f :: * -> *).
Applicative f =>
(a -> f a') -> Maybe a -> f (Maybe a')
Lens._Just

instance Core.AWSRequest ListPlatformApplications where
  type
    AWSResponse ListPlatformApplications =
      ListPlatformApplicationsResponse
  request :: (Service -> Service)
-> ListPlatformApplications -> Request ListPlatformApplications
request Service -> Service
overrides =
    Service
-> ListPlatformApplications -> Request ListPlatformApplications
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListPlatformApplications
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListPlatformApplications)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListPlatformApplications))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListPlatformApplications
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListPlatformApplications)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ListPlatformApplicationsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [PlatformApplication]
-> Int
-> ListPlatformApplicationsResponse
ListPlatformApplicationsResponse'
            (Maybe Text
 -> Maybe [PlatformApplication]
 -> Int
 -> ListPlatformApplicationsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [PlatformApplication]
      -> Int -> ListPlatformApplicationsResponse)
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)
Data..@? Text
"NextToken")
            Either
  String
  (Maybe [PlatformApplication]
   -> Int -> ListPlatformApplicationsResponse)
-> Either String (Maybe [PlatformApplication])
-> Either String (Int -> ListPlatformApplicationsResponse)
forall a b.
Either String (a -> b) -> Either String a -> Either String b
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)
Data..@? Text
"PlatformApplications"
                            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 [PlatformApplication]))
-> Either String (Maybe [PlatformApplication])
forall a b.
Either String a -> (a -> Either String b) -> Either String b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [PlatformApplication])
-> [Node] -> Either String (Maybe [PlatformApplication])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [PlatformApplication]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                        )
            Either String (Int -> ListPlatformApplicationsResponse)
-> Either String Int
-> Either String ListPlatformApplicationsResponse
forall a b.
Either String (a -> b) -> Either String a -> Either String b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall a. a -> Either String a
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 ListPlatformApplications where
  hashWithSalt :: Int -> ListPlatformApplications -> Int
hashWithSalt Int
_salt ListPlatformApplications' {Maybe Text
nextToken :: ListPlatformApplications -> Maybe Text
nextToken :: Maybe Text
..} =
    Int
_salt Int -> Maybe Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData ListPlatformApplications where
  rnf :: ListPlatformApplications -> ()
rnf ListPlatformApplications' {Maybe Text
nextToken :: ListPlatformApplications -> Maybe Text
nextToken :: Maybe Text
..} =
    Maybe Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

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

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

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

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

-- |
-- Create a value of 'ListPlatformApplicationsResponse' 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', 'listPlatformApplicationsResponse_nextToken' - NextToken string is returned when calling ListPlatformApplications
-- action if additional records are available after the first page results.
--
-- 'platformApplications', 'listPlatformApplicationsResponse_platformApplications' - Platform applications returned when calling ListPlatformApplications
-- action.
--
-- 'httpStatus', 'listPlatformApplicationsResponse_httpStatus' - The response's http status code.
newListPlatformApplicationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPlatformApplicationsResponse
newListPlatformApplicationsResponse :: Int -> ListPlatformApplicationsResponse
newListPlatformApplicationsResponse Int
pHttpStatus_ =
  ListPlatformApplicationsResponse'
    { nextToken :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      platformApplications :: Maybe [PlatformApplication]
platformApplications = Maybe [PlatformApplication]
forall a. Maybe a
Prelude.Nothing,
      httpStatus :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | Platform applications returned when calling ListPlatformApplications
-- action.
listPlatformApplicationsResponse_platformApplications :: Lens.Lens' ListPlatformApplicationsResponse (Prelude.Maybe [PlatformApplication])
listPlatformApplicationsResponse_platformApplications :: Lens'
  ListPlatformApplicationsResponse (Maybe [PlatformApplication])
listPlatformApplicationsResponse_platformApplications = (ListPlatformApplicationsResponse -> Maybe [PlatformApplication])
-> (ListPlatformApplicationsResponse
    -> Maybe [PlatformApplication] -> ListPlatformApplicationsResponse)
-> Lens'
     ListPlatformApplicationsResponse (Maybe [PlatformApplication])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlatformApplicationsResponse' {Maybe [PlatformApplication]
platformApplications :: ListPlatformApplicationsResponse -> Maybe [PlatformApplication]
platformApplications :: Maybe [PlatformApplication]
platformApplications} -> Maybe [PlatformApplication]
platformApplications) (\s :: ListPlatformApplicationsResponse
s@ListPlatformApplicationsResponse' {} Maybe [PlatformApplication]
a -> ListPlatformApplicationsResponse
s {platformApplications = a} :: ListPlatformApplicationsResponse) ((Maybe [PlatformApplication] -> f (Maybe [PlatformApplication]))
 -> ListPlatformApplicationsResponse
 -> f ListPlatformApplicationsResponse)
-> ((Maybe [PlatformApplication]
     -> f (Maybe [PlatformApplication]))
    -> Maybe [PlatformApplication] -> f (Maybe [PlatformApplication]))
-> (Maybe [PlatformApplication] -> f (Maybe [PlatformApplication]))
-> ListPlatformApplicationsResponse
-> f ListPlatformApplicationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PlatformApplication]
  [PlatformApplication]
  [PlatformApplication]
  [PlatformApplication]
-> Iso
     (Maybe [PlatformApplication])
     (Maybe [PlatformApplication])
     (Maybe [PlatformApplication])
     (Maybe [PlatformApplication])
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
  [PlatformApplication]
  [PlatformApplication]
  [PlatformApplication]
  [PlatformApplication]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Iso
  [PlatformApplication]
  [PlatformApplication]
  [PlatformApplication]
  [PlatformApplication]
Lens.coerced

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

instance
  Prelude.NFData
    ListPlatformApplicationsResponse
  where
  rnf :: ListPlatformApplicationsResponse -> ()
rnf ListPlatformApplicationsResponse' {Int
Maybe [PlatformApplication]
Maybe Text
nextToken :: ListPlatformApplicationsResponse -> Maybe Text
platformApplications :: ListPlatformApplicationsResponse -> Maybe [PlatformApplication]
httpStatus :: ListPlatformApplicationsResponse -> Int
nextToken :: Maybe Text
platformApplications :: Maybe [PlatformApplication]
httpStatus :: Int
..} =
    Maybe Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq`
      Maybe [PlatformApplication] -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe [PlatformApplication]
platformApplications () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq`
        Int -> ()
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus