{-# 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.FMS.ListAppsLists
-- 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)
--
-- Returns an array of @AppsListDataSummary@ objects.
--
-- This operation returns paginated results.
module Amazonka.FMS.ListAppsLists
  ( -- * Creating a Request
    ListAppsLists (..),
    newListAppsLists,

    -- * Request Lenses
    listAppsLists_defaultLists,
    listAppsLists_nextToken,
    listAppsLists_maxResults,

    -- * Destructuring the Response
    ListAppsListsResponse (..),
    newListAppsListsResponse,

    -- * Response Lenses
    listAppsListsResponse_nextToken,
    listAppsListsResponse_appsLists,
    listAppsListsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.FMS.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListAppsLists' smart constructor.
data ListAppsLists = ListAppsLists'
  { -- | Specifies whether the lists to retrieve are default lists owned by
    -- Firewall Manager.
    ListAppsLists -> Maybe Bool
defaultLists :: Prelude.Maybe Prelude.Bool,
    -- | If you specify a value for @MaxResults@ in your list request, and you
    -- have more objects than the maximum, Firewall Manager returns this token
    -- in the response. For all but the first request, you provide the token
    -- returned by the prior request in the request parameters, to retrieve the
    -- next batch of objects.
    ListAppsLists -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of objects that you want Firewall Manager to return
    -- for this request. If more objects are available, in the response,
    -- Firewall Manager provides a @NextToken@ value that you can use in a
    -- subsequent call to get the next batch of objects.
    --
    -- If you don\'t specify this, Firewall Manager returns all available
    -- objects.
    ListAppsLists -> Natural
maxResults :: Prelude.Natural
  }
  deriving (ListAppsLists -> ListAppsLists -> Bool
(ListAppsLists -> ListAppsLists -> Bool)
-> (ListAppsLists -> ListAppsLists -> Bool) -> Eq ListAppsLists
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAppsLists -> ListAppsLists -> Bool
$c/= :: ListAppsLists -> ListAppsLists -> Bool
== :: ListAppsLists -> ListAppsLists -> Bool
$c== :: ListAppsLists -> ListAppsLists -> Bool
Prelude.Eq, ReadPrec [ListAppsLists]
ReadPrec ListAppsLists
Int -> ReadS ListAppsLists
ReadS [ListAppsLists]
(Int -> ReadS ListAppsLists)
-> ReadS [ListAppsLists]
-> ReadPrec ListAppsLists
-> ReadPrec [ListAppsLists]
-> Read ListAppsLists
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAppsLists]
$creadListPrec :: ReadPrec [ListAppsLists]
readPrec :: ReadPrec ListAppsLists
$creadPrec :: ReadPrec ListAppsLists
readList :: ReadS [ListAppsLists]
$creadList :: ReadS [ListAppsLists]
readsPrec :: Int -> ReadS ListAppsLists
$creadsPrec :: Int -> ReadS ListAppsLists
Prelude.Read, Int -> ListAppsLists -> ShowS
[ListAppsLists] -> ShowS
ListAppsLists -> String
(Int -> ListAppsLists -> ShowS)
-> (ListAppsLists -> String)
-> ([ListAppsLists] -> ShowS)
-> Show ListAppsLists
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAppsLists] -> ShowS
$cshowList :: [ListAppsLists] -> ShowS
show :: ListAppsLists -> String
$cshow :: ListAppsLists -> String
showsPrec :: Int -> ListAppsLists -> ShowS
$cshowsPrec :: Int -> ListAppsLists -> ShowS
Prelude.Show, (forall x. ListAppsLists -> Rep ListAppsLists x)
-> (forall x. Rep ListAppsLists x -> ListAppsLists)
-> Generic ListAppsLists
forall x. Rep ListAppsLists x -> ListAppsLists
forall x. ListAppsLists -> Rep ListAppsLists x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAppsLists x -> ListAppsLists
$cfrom :: forall x. ListAppsLists -> Rep ListAppsLists x
Prelude.Generic)

-- |
-- Create a value of 'ListAppsLists' 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:
--
-- 'defaultLists', 'listAppsLists_defaultLists' - Specifies whether the lists to retrieve are default lists owned by
-- Firewall Manager.
--
-- 'nextToken', 'listAppsLists_nextToken' - If you specify a value for @MaxResults@ in your list request, and you
-- have more objects than the maximum, Firewall Manager returns this token
-- in the response. For all but the first request, you provide the token
-- returned by the prior request in the request parameters, to retrieve the
-- next batch of objects.
--
-- 'maxResults', 'listAppsLists_maxResults' - The maximum number of objects that you want Firewall Manager to return
-- for this request. If more objects are available, in the response,
-- Firewall Manager provides a @NextToken@ value that you can use in a
-- subsequent call to get the next batch of objects.
--
-- If you don\'t specify this, Firewall Manager returns all available
-- objects.
newListAppsLists ::
  -- | 'maxResults'
  Prelude.Natural ->
  ListAppsLists
newListAppsLists :: Natural -> ListAppsLists
newListAppsLists Natural
pMaxResults_ =
  ListAppsLists' :: Maybe Bool -> Maybe Text -> Natural -> ListAppsLists
ListAppsLists'
    { $sel:defaultLists:ListAppsLists' :: Maybe Bool
defaultLists = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAppsLists' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListAppsLists' :: Natural
maxResults = Natural
pMaxResults_
    }

-- | Specifies whether the lists to retrieve are default lists owned by
-- Firewall Manager.
listAppsLists_defaultLists :: Lens.Lens' ListAppsLists (Prelude.Maybe Prelude.Bool)
listAppsLists_defaultLists :: (Maybe Bool -> f (Maybe Bool)) -> ListAppsLists -> f ListAppsLists
listAppsLists_defaultLists = (ListAppsLists -> Maybe Bool)
-> (ListAppsLists -> Maybe Bool -> ListAppsLists)
-> Lens ListAppsLists ListAppsLists (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppsLists' {Maybe Bool
defaultLists :: Maybe Bool
$sel:defaultLists:ListAppsLists' :: ListAppsLists -> Maybe Bool
defaultLists} -> Maybe Bool
defaultLists) (\s :: ListAppsLists
s@ListAppsLists' {} Maybe Bool
a -> ListAppsLists
s {$sel:defaultLists:ListAppsLists' :: Maybe Bool
defaultLists = Maybe Bool
a} :: ListAppsLists)

-- | If you specify a value for @MaxResults@ in your list request, and you
-- have more objects than the maximum, Firewall Manager returns this token
-- in the response. For all but the first request, you provide the token
-- returned by the prior request in the request parameters, to retrieve the
-- next batch of objects.
listAppsLists_nextToken :: Lens.Lens' ListAppsLists (Prelude.Maybe Prelude.Text)
listAppsLists_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListAppsLists -> f ListAppsLists
listAppsLists_nextToken = (ListAppsLists -> Maybe Text)
-> (ListAppsLists -> Maybe Text -> ListAppsLists)
-> Lens ListAppsLists ListAppsLists (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppsLists' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAppsLists' :: ListAppsLists -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAppsLists
s@ListAppsLists' {} Maybe Text
a -> ListAppsLists
s {$sel:nextToken:ListAppsLists' :: Maybe Text
nextToken = Maybe Text
a} :: ListAppsLists)

-- | The maximum number of objects that you want Firewall Manager to return
-- for this request. If more objects are available, in the response,
-- Firewall Manager provides a @NextToken@ value that you can use in a
-- subsequent call to get the next batch of objects.
--
-- If you don\'t specify this, Firewall Manager returns all available
-- objects.
listAppsLists_maxResults :: Lens.Lens' ListAppsLists Prelude.Natural
listAppsLists_maxResults :: (Natural -> f Natural) -> ListAppsLists -> f ListAppsLists
listAppsLists_maxResults = (ListAppsLists -> Natural)
-> (ListAppsLists -> Natural -> ListAppsLists)
-> Lens ListAppsLists ListAppsLists Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppsLists' {Natural
maxResults :: Natural
$sel:maxResults:ListAppsLists' :: ListAppsLists -> Natural
maxResults} -> Natural
maxResults) (\s :: ListAppsLists
s@ListAppsLists' {} Natural
a -> ListAppsLists
s {$sel:maxResults:ListAppsLists' :: Natural
maxResults = Natural
a} :: ListAppsLists)

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

instance Prelude.NFData ListAppsLists

instance Core.ToHeaders ListAppsLists where
  toHeaders :: ListAppsLists -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListAppsLists -> 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
"AWSFMS_20180101.ListAppsLists" ::
                          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 ListAppsLists where
  toJSON :: ListAppsLists -> Value
toJSON ListAppsLists' {Natural
Maybe Bool
Maybe Text
maxResults :: Natural
nextToken :: Maybe Text
defaultLists :: Maybe Bool
$sel:maxResults:ListAppsLists' :: ListAppsLists -> Natural
$sel:nextToken:ListAppsLists' :: ListAppsLists -> Maybe Text
$sel:defaultLists:ListAppsLists' :: ListAppsLists -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DefaultLists" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
defaultLists,
            (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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
maxResults)
          ]
      )

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

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

-- | /See:/ 'newListAppsListsResponse' smart constructor.
data ListAppsListsResponse = ListAppsListsResponse'
  { -- | If you specify a value for @MaxResults@ in your list request, and you
    -- have more objects than the maximum, Firewall Manager returns this token
    -- in the response. You can use this token in subsequent requests to
    -- retrieve the next batch of objects.
    ListAppsListsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array of @AppsListDataSummary@ objects.
    ListAppsListsResponse -> Maybe [AppsListDataSummary]
appsLists :: Prelude.Maybe [AppsListDataSummary],
    -- | The response's http status code.
    ListAppsListsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListAppsListsResponse -> ListAppsListsResponse -> Bool
(ListAppsListsResponse -> ListAppsListsResponse -> Bool)
-> (ListAppsListsResponse -> ListAppsListsResponse -> Bool)
-> Eq ListAppsListsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAppsListsResponse -> ListAppsListsResponse -> Bool
$c/= :: ListAppsListsResponse -> ListAppsListsResponse -> Bool
== :: ListAppsListsResponse -> ListAppsListsResponse -> Bool
$c== :: ListAppsListsResponse -> ListAppsListsResponse -> Bool
Prelude.Eq, ReadPrec [ListAppsListsResponse]
ReadPrec ListAppsListsResponse
Int -> ReadS ListAppsListsResponse
ReadS [ListAppsListsResponse]
(Int -> ReadS ListAppsListsResponse)
-> ReadS [ListAppsListsResponse]
-> ReadPrec ListAppsListsResponse
-> ReadPrec [ListAppsListsResponse]
-> Read ListAppsListsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAppsListsResponse]
$creadListPrec :: ReadPrec [ListAppsListsResponse]
readPrec :: ReadPrec ListAppsListsResponse
$creadPrec :: ReadPrec ListAppsListsResponse
readList :: ReadS [ListAppsListsResponse]
$creadList :: ReadS [ListAppsListsResponse]
readsPrec :: Int -> ReadS ListAppsListsResponse
$creadsPrec :: Int -> ReadS ListAppsListsResponse
Prelude.Read, Int -> ListAppsListsResponse -> ShowS
[ListAppsListsResponse] -> ShowS
ListAppsListsResponse -> String
(Int -> ListAppsListsResponse -> ShowS)
-> (ListAppsListsResponse -> String)
-> ([ListAppsListsResponse] -> ShowS)
-> Show ListAppsListsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAppsListsResponse] -> ShowS
$cshowList :: [ListAppsListsResponse] -> ShowS
show :: ListAppsListsResponse -> String
$cshow :: ListAppsListsResponse -> String
showsPrec :: Int -> ListAppsListsResponse -> ShowS
$cshowsPrec :: Int -> ListAppsListsResponse -> ShowS
Prelude.Show, (forall x. ListAppsListsResponse -> Rep ListAppsListsResponse x)
-> (forall x. Rep ListAppsListsResponse x -> ListAppsListsResponse)
-> Generic ListAppsListsResponse
forall x. Rep ListAppsListsResponse x -> ListAppsListsResponse
forall x. ListAppsListsResponse -> Rep ListAppsListsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAppsListsResponse x -> ListAppsListsResponse
$cfrom :: forall x. ListAppsListsResponse -> Rep ListAppsListsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAppsListsResponse' 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', 'listAppsListsResponse_nextToken' - If you specify a value for @MaxResults@ in your list request, and you
-- have more objects than the maximum, Firewall Manager returns this token
-- in the response. You can use this token in subsequent requests to
-- retrieve the next batch of objects.
--
-- 'appsLists', 'listAppsListsResponse_appsLists' - An array of @AppsListDataSummary@ objects.
--
-- 'httpStatus', 'listAppsListsResponse_httpStatus' - The response's http status code.
newListAppsListsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAppsListsResponse
newListAppsListsResponse :: Int -> ListAppsListsResponse
newListAppsListsResponse Int
pHttpStatus_ =
  ListAppsListsResponse' :: Maybe Text
-> Maybe [AppsListDataSummary] -> Int -> ListAppsListsResponse
ListAppsListsResponse'
    { $sel:nextToken:ListAppsListsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appsLists:ListAppsListsResponse' :: Maybe [AppsListDataSummary]
appsLists = Maybe [AppsListDataSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAppsListsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If you specify a value for @MaxResults@ in your list request, and you
-- have more objects than the maximum, Firewall Manager returns this token
-- in the response. You can use this token in subsequent requests to
-- retrieve the next batch of objects.
listAppsListsResponse_nextToken :: Lens.Lens' ListAppsListsResponse (Prelude.Maybe Prelude.Text)
listAppsListsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAppsListsResponse -> f ListAppsListsResponse
listAppsListsResponse_nextToken = (ListAppsListsResponse -> Maybe Text)
-> (ListAppsListsResponse -> Maybe Text -> ListAppsListsResponse)
-> Lens' ListAppsListsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppsListsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAppsListsResponse' :: ListAppsListsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAppsListsResponse
s@ListAppsListsResponse' {} Maybe Text
a -> ListAppsListsResponse
s {$sel:nextToken:ListAppsListsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAppsListsResponse)

-- | An array of @AppsListDataSummary@ objects.
listAppsListsResponse_appsLists :: Lens.Lens' ListAppsListsResponse (Prelude.Maybe [AppsListDataSummary])
listAppsListsResponse_appsLists :: (Maybe [AppsListDataSummary] -> f (Maybe [AppsListDataSummary]))
-> ListAppsListsResponse -> f ListAppsListsResponse
listAppsListsResponse_appsLists = (ListAppsListsResponse -> Maybe [AppsListDataSummary])
-> (ListAppsListsResponse
    -> Maybe [AppsListDataSummary] -> ListAppsListsResponse)
-> Lens' ListAppsListsResponse (Maybe [AppsListDataSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppsListsResponse' {Maybe [AppsListDataSummary]
appsLists :: Maybe [AppsListDataSummary]
$sel:appsLists:ListAppsListsResponse' :: ListAppsListsResponse -> Maybe [AppsListDataSummary]
appsLists} -> Maybe [AppsListDataSummary]
appsLists) (\s :: ListAppsListsResponse
s@ListAppsListsResponse' {} Maybe [AppsListDataSummary]
a -> ListAppsListsResponse
s {$sel:appsLists:ListAppsListsResponse' :: Maybe [AppsListDataSummary]
appsLists = Maybe [AppsListDataSummary]
a} :: ListAppsListsResponse) ((Maybe [AppsListDataSummary] -> f (Maybe [AppsListDataSummary]))
 -> ListAppsListsResponse -> f ListAppsListsResponse)
-> ((Maybe [AppsListDataSummary]
     -> f (Maybe [AppsListDataSummary]))
    -> Maybe [AppsListDataSummary] -> f (Maybe [AppsListDataSummary]))
-> (Maybe [AppsListDataSummary] -> f (Maybe [AppsListDataSummary]))
-> ListAppsListsResponse
-> f ListAppsListsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AppsListDataSummary]
  [AppsListDataSummary]
  [AppsListDataSummary]
  [AppsListDataSummary]
-> Iso
     (Maybe [AppsListDataSummary])
     (Maybe [AppsListDataSummary])
     (Maybe [AppsListDataSummary])
     (Maybe [AppsListDataSummary])
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
  [AppsListDataSummary]
  [AppsListDataSummary]
  [AppsListDataSummary]
  [AppsListDataSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListAppsListsResponse