{-# 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-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 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_platformApplications,
    listPlatformApplicationsResponse_nextToken,
    listPlatformApplicationsResponse_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 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
/= :: ListPlatformApplications -> ListPlatformApplications -> Bool
$c/= :: ListPlatformApplications -> ListPlatformApplications -> Bool
== :: ListPlatformApplications -> ListPlatformApplications -> Bool
$c== :: 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
readListPrec :: ReadPrec [ListPlatformApplications]
$creadListPrec :: ReadPrec [ListPlatformApplications]
readPrec :: ReadPrec ListPlatformApplications
$creadPrec :: ReadPrec ListPlatformApplications
readList :: ReadS [ListPlatformApplications]
$creadList :: ReadS [ListPlatformApplications]
readsPrec :: Int -> ReadS ListPlatformApplications
$creadsPrec :: Int -> ReadS 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
showList :: [ListPlatformApplications] -> ShowS
$cshowList :: [ListPlatformApplications] -> ShowS
show :: ListPlatformApplications -> String
$cshow :: ListPlatformApplications -> String
showsPrec :: Int -> ListPlatformApplications -> ShowS
$cshowsPrec :: Int -> 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
$cto :: forall x.
Rep ListPlatformApplications x -> ListPlatformApplications
$cfrom :: forall x.
ListPlatformApplications -> Rep ListPlatformApplications x
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' :: Maybe Text -> ListPlatformApplications
ListPlatformApplications'
    { $sel:nextToken:ListPlatformApplications' :: 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 :: (Maybe Text -> f (Maybe Text))
-> ListPlatformApplications -> f ListPlatformApplications
listPlatformApplications_nextToken = (ListPlatformApplications -> Maybe Text)
-> (ListPlatformApplications
    -> Maybe Text -> ListPlatformApplications)
-> Lens
     ListPlatformApplications
     ListPlatformApplications
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlatformApplications' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPlatformApplications' :: ListPlatformApplications -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPlatformApplications
s@ListPlatformApplications' {} Maybe Text
a -> ListPlatformApplications
s {$sel:nextToken:ListPlatformApplications' :: Maybe Text
nextToken = Maybe Text
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 b. Prism (Maybe a) (Maybe b) a b
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 b. Prism (Maybe a) (Maybe b) a b
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
  ListPlatformApplications
  (Maybe Text)
  (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 b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListPlatformApplications where
  type
    AWSResponse ListPlatformApplications =
      ListPlatformApplicationsResponse
  request :: ListPlatformApplications -> Request ListPlatformApplications
request = Service
-> ListPlatformApplications -> Request ListPlatformApplications
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListPlatformApplications
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListPlatformApplications)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListPlatformApplications))
-> Logger
-> Service
-> Proxy ListPlatformApplications
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListPlatformApplications)))
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
"ListPlatformApplicationsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [PlatformApplication]
-> Maybe Text -> Int -> ListPlatformApplicationsResponse
ListPlatformApplicationsResponse'
            (Maybe [PlatformApplication]
 -> Maybe Text -> Int -> ListPlatformApplicationsResponse)
-> Either String (Maybe [PlatformApplication])
-> Either
     String (Maybe Text -> Int -> ListPlatformApplicationsResponse)
forall (f :: * -> *) a b. Functor 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
"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 (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]
Core.parseXMLList Text
"member")
                        )
            Either
  String (Maybe Text -> Int -> ListPlatformApplicationsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListPlatformApplicationsResponse)
forall (f :: * -> *) a b. Applicative f => 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 (Int -> ListPlatformApplicationsResponse)
-> Either String Int
-> Either String ListPlatformApplicationsResponse
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 ListPlatformApplications

instance Prelude.NFData ListPlatformApplications

instance Core.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 Core.ToPath ListPlatformApplications where
  toPath :: ListPlatformApplications -> ByteString
toPath = ByteString -> ListPlatformApplications -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery ListPlatformApplications where
  toQuery :: ListPlatformApplications -> QueryString
toQuery ListPlatformApplications' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPlatformApplications' :: ListPlatformApplications -> 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
"ListPlatformApplications" :: 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
      ]

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

-- | Platform applications returned when calling ListPlatformApplications
-- action.
listPlatformApplicationsResponse_platformApplications :: Lens.Lens' ListPlatformApplicationsResponse (Prelude.Maybe [PlatformApplication])
listPlatformApplicationsResponse_platformApplications :: (Maybe [PlatformApplication] -> f (Maybe [PlatformApplication]))
-> ListPlatformApplicationsResponse
-> f ListPlatformApplicationsResponse
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 :: Maybe [PlatformApplication]
$sel:platformApplications:ListPlatformApplicationsResponse' :: ListPlatformApplicationsResponse -> Maybe [PlatformApplication]
platformApplications} -> Maybe [PlatformApplication]
platformApplications) (\s :: ListPlatformApplicationsResponse
s@ListPlatformApplicationsResponse' {} Maybe [PlatformApplication]
a -> ListPlatformApplicationsResponse
s {$sel:platformApplications:ListPlatformApplicationsResponse' :: Maybe [PlatformApplication]
platformApplications = Maybe [PlatformApplication]
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
Lens.coerced

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ListPlatformApplicationsResponse
-> f ListPlatformApplicationsResponse
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 :: Maybe Text
$sel:nextToken:ListPlatformApplicationsResponse' :: ListPlatformApplicationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPlatformApplicationsResponse
s@ListPlatformApplicationsResponse' {} Maybe Text
a -> ListPlatformApplicationsResponse
s {$sel:nextToken:ListPlatformApplicationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPlatformApplicationsResponse)

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

instance
  Prelude.NFData
    ListPlatformApplicationsResponse