{-# 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.Route53Resolver.ListFirewallDomains
-- 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)
--
-- Retrieves the domains that you have defined for the specified firewall
-- domain list.
--
-- A single call might return only a partial list of the domains. For
-- information, see @MaxResults@.
--
-- This operation returns paginated results.
module Amazonka.Route53Resolver.ListFirewallDomains
  ( -- * Creating a Request
    ListFirewallDomains (..),
    newListFirewallDomains,

    -- * Request Lenses
    listFirewallDomains_nextToken,
    listFirewallDomains_maxResults,
    listFirewallDomains_firewallDomainListId,

    -- * Destructuring the Response
    ListFirewallDomainsResponse (..),
    newListFirewallDomainsResponse,

    -- * Response Lenses
    listFirewallDomainsResponse_nextToken,
    listFirewallDomainsResponse_domains,
    listFirewallDomainsResponse_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.Route53Resolver.Types

-- | /See:/ 'newListFirewallDomains' smart constructor.
data ListFirewallDomains = ListFirewallDomains'
  { -- | For the first call to this list request, omit this value.
    --
    -- When you request a list of objects, Resolver returns at most the number
    -- of objects specified in @MaxResults@. If more objects are available for
    -- retrieval, Resolver returns a @NextToken@ value in the response. To
    -- retrieve the next batch of objects, use the token that was returned for
    -- the prior request in your next request.
    ListFirewallDomains -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of objects that you want Resolver to return for this
    -- request. If more objects are available, in the response, Resolver
    -- provides a @NextToken@ value that you can use in a subsequent call to
    -- get the next batch of objects.
    --
    -- If you don\'t specify a value for @MaxResults@, Resolver returns up to
    -- 100 objects.
    ListFirewallDomains -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the domain list whose domains you want to retrieve.
    ListFirewallDomains -> Text
firewallDomainListId :: Prelude.Text
  }
  deriving (ListFirewallDomains -> ListFirewallDomains -> Bool
(ListFirewallDomains -> ListFirewallDomains -> Bool)
-> (ListFirewallDomains -> ListFirewallDomains -> Bool)
-> Eq ListFirewallDomains
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFirewallDomains -> ListFirewallDomains -> Bool
$c/= :: ListFirewallDomains -> ListFirewallDomains -> Bool
== :: ListFirewallDomains -> ListFirewallDomains -> Bool
$c== :: ListFirewallDomains -> ListFirewallDomains -> Bool
Prelude.Eq, ReadPrec [ListFirewallDomains]
ReadPrec ListFirewallDomains
Int -> ReadS ListFirewallDomains
ReadS [ListFirewallDomains]
(Int -> ReadS ListFirewallDomains)
-> ReadS [ListFirewallDomains]
-> ReadPrec ListFirewallDomains
-> ReadPrec [ListFirewallDomains]
-> Read ListFirewallDomains
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFirewallDomains]
$creadListPrec :: ReadPrec [ListFirewallDomains]
readPrec :: ReadPrec ListFirewallDomains
$creadPrec :: ReadPrec ListFirewallDomains
readList :: ReadS [ListFirewallDomains]
$creadList :: ReadS [ListFirewallDomains]
readsPrec :: Int -> ReadS ListFirewallDomains
$creadsPrec :: Int -> ReadS ListFirewallDomains
Prelude.Read, Int -> ListFirewallDomains -> ShowS
[ListFirewallDomains] -> ShowS
ListFirewallDomains -> String
(Int -> ListFirewallDomains -> ShowS)
-> (ListFirewallDomains -> String)
-> ([ListFirewallDomains] -> ShowS)
-> Show ListFirewallDomains
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFirewallDomains] -> ShowS
$cshowList :: [ListFirewallDomains] -> ShowS
show :: ListFirewallDomains -> String
$cshow :: ListFirewallDomains -> String
showsPrec :: Int -> ListFirewallDomains -> ShowS
$cshowsPrec :: Int -> ListFirewallDomains -> ShowS
Prelude.Show, (forall x. ListFirewallDomains -> Rep ListFirewallDomains x)
-> (forall x. Rep ListFirewallDomains x -> ListFirewallDomains)
-> Generic ListFirewallDomains
forall x. Rep ListFirewallDomains x -> ListFirewallDomains
forall x. ListFirewallDomains -> Rep ListFirewallDomains x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFirewallDomains x -> ListFirewallDomains
$cfrom :: forall x. ListFirewallDomains -> Rep ListFirewallDomains x
Prelude.Generic)

-- |
-- Create a value of 'ListFirewallDomains' 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', 'listFirewallDomains_nextToken' - For the first call to this list request, omit this value.
--
-- When you request a list of objects, Resolver returns at most the number
-- of objects specified in @MaxResults@. If more objects are available for
-- retrieval, Resolver returns a @NextToken@ value in the response. To
-- retrieve the next batch of objects, use the token that was returned for
-- the prior request in your next request.
--
-- 'maxResults', 'listFirewallDomains_maxResults' - The maximum number of objects that you want Resolver to return for this
-- request. If more objects are available, in the response, Resolver
-- provides a @NextToken@ value that you can use in a subsequent call to
-- get the next batch of objects.
--
-- If you don\'t specify a value for @MaxResults@, Resolver returns up to
-- 100 objects.
--
-- 'firewallDomainListId', 'listFirewallDomains_firewallDomainListId' - The ID of the domain list whose domains you want to retrieve.
newListFirewallDomains ::
  -- | 'firewallDomainListId'
  Prelude.Text ->
  ListFirewallDomains
newListFirewallDomains :: Text -> ListFirewallDomains
newListFirewallDomains Text
pFirewallDomainListId_ =
  ListFirewallDomains' :: Maybe Text -> Maybe Natural -> Text -> ListFirewallDomains
ListFirewallDomains'
    { $sel:nextToken:ListFirewallDomains' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListFirewallDomains' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:firewallDomainListId:ListFirewallDomains' :: Text
firewallDomainListId = Text
pFirewallDomainListId_
    }

-- | For the first call to this list request, omit this value.
--
-- When you request a list of objects, Resolver returns at most the number
-- of objects specified in @MaxResults@. If more objects are available for
-- retrieval, Resolver returns a @NextToken@ value in the response. To
-- retrieve the next batch of objects, use the token that was returned for
-- the prior request in your next request.
listFirewallDomains_nextToken :: Lens.Lens' ListFirewallDomains (Prelude.Maybe Prelude.Text)
listFirewallDomains_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFirewallDomains -> f ListFirewallDomains
listFirewallDomains_nextToken = (ListFirewallDomains -> Maybe Text)
-> (ListFirewallDomains -> Maybe Text -> ListFirewallDomains)
-> Lens
     ListFirewallDomains ListFirewallDomains (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallDomains' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFirewallDomains' :: ListFirewallDomains -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFirewallDomains
s@ListFirewallDomains' {} Maybe Text
a -> ListFirewallDomains
s {$sel:nextToken:ListFirewallDomains' :: Maybe Text
nextToken = Maybe Text
a} :: ListFirewallDomains)

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

-- | The ID of the domain list whose domains you want to retrieve.
listFirewallDomains_firewallDomainListId :: Lens.Lens' ListFirewallDomains Prelude.Text
listFirewallDomains_firewallDomainListId :: (Text -> f Text) -> ListFirewallDomains -> f ListFirewallDomains
listFirewallDomains_firewallDomainListId = (ListFirewallDomains -> Text)
-> (ListFirewallDomains -> Text -> ListFirewallDomains)
-> Lens ListFirewallDomains ListFirewallDomains Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallDomains' {Text
firewallDomainListId :: Text
$sel:firewallDomainListId:ListFirewallDomains' :: ListFirewallDomains -> Text
firewallDomainListId} -> Text
firewallDomainListId) (\s :: ListFirewallDomains
s@ListFirewallDomains' {} Text
a -> ListFirewallDomains
s {$sel:firewallDomainListId:ListFirewallDomains' :: Text
firewallDomainListId = Text
a} :: ListFirewallDomains)

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

instance Prelude.NFData ListFirewallDomains

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

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

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

-- | /See:/ 'newListFirewallDomainsResponse' smart constructor.
data ListFirewallDomainsResponse = ListFirewallDomainsResponse'
  { -- | If objects are still available for retrieval, Resolver returns this
    -- token in the response. To retrieve the next batch of objects, provide
    -- this token in your next request.
    ListFirewallDomainsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of the domains in the firewall domain list.
    --
    -- This might be a partial list of the domains that you\'ve defined in the
    -- domain list. For information, see @MaxResults@.
    ListFirewallDomainsResponse -> Maybe [Text]
domains :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    ListFirewallDomainsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListFirewallDomainsResponse -> ListFirewallDomainsResponse -> Bool
(ListFirewallDomainsResponse
 -> ListFirewallDomainsResponse -> Bool)
-> (ListFirewallDomainsResponse
    -> ListFirewallDomainsResponse -> Bool)
-> Eq ListFirewallDomainsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFirewallDomainsResponse -> ListFirewallDomainsResponse -> Bool
$c/= :: ListFirewallDomainsResponse -> ListFirewallDomainsResponse -> Bool
== :: ListFirewallDomainsResponse -> ListFirewallDomainsResponse -> Bool
$c== :: ListFirewallDomainsResponse -> ListFirewallDomainsResponse -> Bool
Prelude.Eq, ReadPrec [ListFirewallDomainsResponse]
ReadPrec ListFirewallDomainsResponse
Int -> ReadS ListFirewallDomainsResponse
ReadS [ListFirewallDomainsResponse]
(Int -> ReadS ListFirewallDomainsResponse)
-> ReadS [ListFirewallDomainsResponse]
-> ReadPrec ListFirewallDomainsResponse
-> ReadPrec [ListFirewallDomainsResponse]
-> Read ListFirewallDomainsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFirewallDomainsResponse]
$creadListPrec :: ReadPrec [ListFirewallDomainsResponse]
readPrec :: ReadPrec ListFirewallDomainsResponse
$creadPrec :: ReadPrec ListFirewallDomainsResponse
readList :: ReadS [ListFirewallDomainsResponse]
$creadList :: ReadS [ListFirewallDomainsResponse]
readsPrec :: Int -> ReadS ListFirewallDomainsResponse
$creadsPrec :: Int -> ReadS ListFirewallDomainsResponse
Prelude.Read, Int -> ListFirewallDomainsResponse -> ShowS
[ListFirewallDomainsResponse] -> ShowS
ListFirewallDomainsResponse -> String
(Int -> ListFirewallDomainsResponse -> ShowS)
-> (ListFirewallDomainsResponse -> String)
-> ([ListFirewallDomainsResponse] -> ShowS)
-> Show ListFirewallDomainsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFirewallDomainsResponse] -> ShowS
$cshowList :: [ListFirewallDomainsResponse] -> ShowS
show :: ListFirewallDomainsResponse -> String
$cshow :: ListFirewallDomainsResponse -> String
showsPrec :: Int -> ListFirewallDomainsResponse -> ShowS
$cshowsPrec :: Int -> ListFirewallDomainsResponse -> ShowS
Prelude.Show, (forall x.
 ListFirewallDomainsResponse -> Rep ListFirewallDomainsResponse x)
-> (forall x.
    Rep ListFirewallDomainsResponse x -> ListFirewallDomainsResponse)
-> Generic ListFirewallDomainsResponse
forall x.
Rep ListFirewallDomainsResponse x -> ListFirewallDomainsResponse
forall x.
ListFirewallDomainsResponse -> Rep ListFirewallDomainsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListFirewallDomainsResponse x -> ListFirewallDomainsResponse
$cfrom :: forall x.
ListFirewallDomainsResponse -> Rep ListFirewallDomainsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListFirewallDomainsResponse' 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', 'listFirewallDomainsResponse_nextToken' - If objects are still available for retrieval, Resolver returns this
-- token in the response. To retrieve the next batch of objects, provide
-- this token in your next request.
--
-- 'domains', 'listFirewallDomainsResponse_domains' - A list of the domains in the firewall domain list.
--
-- This might be a partial list of the domains that you\'ve defined in the
-- domain list. For information, see @MaxResults@.
--
-- 'httpStatus', 'listFirewallDomainsResponse_httpStatus' - The response's http status code.
newListFirewallDomainsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListFirewallDomainsResponse
newListFirewallDomainsResponse :: Int -> ListFirewallDomainsResponse
newListFirewallDomainsResponse Int
pHttpStatus_ =
  ListFirewallDomainsResponse' :: Maybe Text -> Maybe [Text] -> Int -> ListFirewallDomainsResponse
ListFirewallDomainsResponse'
    { $sel:nextToken:ListFirewallDomainsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domains:ListFirewallDomainsResponse' :: Maybe [Text]
domains = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListFirewallDomainsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If objects are still available for retrieval, Resolver returns this
-- token in the response. To retrieve the next batch of objects, provide
-- this token in your next request.
listFirewallDomainsResponse_nextToken :: Lens.Lens' ListFirewallDomainsResponse (Prelude.Maybe Prelude.Text)
listFirewallDomainsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFirewallDomainsResponse -> f ListFirewallDomainsResponse
listFirewallDomainsResponse_nextToken = (ListFirewallDomainsResponse -> Maybe Text)
-> (ListFirewallDomainsResponse
    -> Maybe Text -> ListFirewallDomainsResponse)
-> Lens' ListFirewallDomainsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallDomainsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFirewallDomainsResponse' :: ListFirewallDomainsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFirewallDomainsResponse
s@ListFirewallDomainsResponse' {} Maybe Text
a -> ListFirewallDomainsResponse
s {$sel:nextToken:ListFirewallDomainsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFirewallDomainsResponse)

-- | A list of the domains in the firewall domain list.
--
-- This might be a partial list of the domains that you\'ve defined in the
-- domain list. For information, see @MaxResults@.
listFirewallDomainsResponse_domains :: Lens.Lens' ListFirewallDomainsResponse (Prelude.Maybe [Prelude.Text])
listFirewallDomainsResponse_domains :: (Maybe [Text] -> f (Maybe [Text]))
-> ListFirewallDomainsResponse -> f ListFirewallDomainsResponse
listFirewallDomainsResponse_domains = (ListFirewallDomainsResponse -> Maybe [Text])
-> (ListFirewallDomainsResponse
    -> Maybe [Text] -> ListFirewallDomainsResponse)
-> Lens' ListFirewallDomainsResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallDomainsResponse' {Maybe [Text]
domains :: Maybe [Text]
$sel:domains:ListFirewallDomainsResponse' :: ListFirewallDomainsResponse -> Maybe [Text]
domains} -> Maybe [Text]
domains) (\s :: ListFirewallDomainsResponse
s@ListFirewallDomainsResponse' {} Maybe [Text]
a -> ListFirewallDomainsResponse
s {$sel:domains:ListFirewallDomainsResponse' :: Maybe [Text]
domains = Maybe [Text]
a} :: ListFirewallDomainsResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListFirewallDomainsResponse -> f ListFirewallDomainsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListFirewallDomainsResponse
-> f ListFirewallDomainsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListFirewallDomainsResponse