{-# 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.ListResolverRules
-- 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 Resolver rules that were created using the current Amazon Web
-- Services account.
--
-- This operation returns paginated results.
module Amazonka.Route53Resolver.ListResolverRules
  ( -- * Creating a Request
    ListResolverRules (..),
    newListResolverRules,

    -- * Request Lenses
    listResolverRules_filters,
    listResolverRules_nextToken,
    listResolverRules_maxResults,

    -- * Destructuring the Response
    ListResolverRulesResponse (..),
    newListResolverRulesResponse,

    -- * Response Lenses
    listResolverRulesResponse_resolverRules,
    listResolverRulesResponse_nextToken,
    listResolverRulesResponse_maxResults,
    listResolverRulesResponse_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:/ 'newListResolverRules' smart constructor.
data ListResolverRules = ListResolverRules'
  { -- | An optional specification to return a subset of Resolver rules, such as
    -- all Resolver rules that are associated with the same Resolver endpoint.
    --
    -- If you submit a second or subsequent @ListResolverRules@ request and
    -- specify the @NextToken@ parameter, you must use the same values for
    -- @Filters@, if any, as in the previous request.
    ListResolverRules -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | For the first @ListResolverRules@ request, omit this value.
    --
    -- If you have more than @MaxResults@ Resolver rules, you can submit
    -- another @ListResolverRules@ request to get the next group of Resolver
    -- rules. In the next request, specify the value of @NextToken@ from the
    -- previous response.
    ListResolverRules -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of Resolver rules that you want to return in the
    -- response to a @ListResolverRules@ request. If you don\'t specify a value
    -- for @MaxResults@, Resolver returns up to 100 Resolver rules.
    ListResolverRules -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListResolverRules -> ListResolverRules -> Bool
(ListResolverRules -> ListResolverRules -> Bool)
-> (ListResolverRules -> ListResolverRules -> Bool)
-> Eq ListResolverRules
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListResolverRules -> ListResolverRules -> Bool
$c/= :: ListResolverRules -> ListResolverRules -> Bool
== :: ListResolverRules -> ListResolverRules -> Bool
$c== :: ListResolverRules -> ListResolverRules -> Bool
Prelude.Eq, ReadPrec [ListResolverRules]
ReadPrec ListResolverRules
Int -> ReadS ListResolverRules
ReadS [ListResolverRules]
(Int -> ReadS ListResolverRules)
-> ReadS [ListResolverRules]
-> ReadPrec ListResolverRules
-> ReadPrec [ListResolverRules]
-> Read ListResolverRules
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListResolverRules]
$creadListPrec :: ReadPrec [ListResolverRules]
readPrec :: ReadPrec ListResolverRules
$creadPrec :: ReadPrec ListResolverRules
readList :: ReadS [ListResolverRules]
$creadList :: ReadS [ListResolverRules]
readsPrec :: Int -> ReadS ListResolverRules
$creadsPrec :: Int -> ReadS ListResolverRules
Prelude.Read, Int -> ListResolverRules -> ShowS
[ListResolverRules] -> ShowS
ListResolverRules -> String
(Int -> ListResolverRules -> ShowS)
-> (ListResolverRules -> String)
-> ([ListResolverRules] -> ShowS)
-> Show ListResolverRules
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListResolverRules] -> ShowS
$cshowList :: [ListResolverRules] -> ShowS
show :: ListResolverRules -> String
$cshow :: ListResolverRules -> String
showsPrec :: Int -> ListResolverRules -> ShowS
$cshowsPrec :: Int -> ListResolverRules -> ShowS
Prelude.Show, (forall x. ListResolverRules -> Rep ListResolverRules x)
-> (forall x. Rep ListResolverRules x -> ListResolverRules)
-> Generic ListResolverRules
forall x. Rep ListResolverRules x -> ListResolverRules
forall x. ListResolverRules -> Rep ListResolverRules x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListResolverRules x -> ListResolverRules
$cfrom :: forall x. ListResolverRules -> Rep ListResolverRules x
Prelude.Generic)

-- |
-- Create a value of 'ListResolverRules' 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:
--
-- 'filters', 'listResolverRules_filters' - An optional specification to return a subset of Resolver rules, such as
-- all Resolver rules that are associated with the same Resolver endpoint.
--
-- If you submit a second or subsequent @ListResolverRules@ request and
-- specify the @NextToken@ parameter, you must use the same values for
-- @Filters@, if any, as in the previous request.
--
-- 'nextToken', 'listResolverRules_nextToken' - For the first @ListResolverRules@ request, omit this value.
--
-- If you have more than @MaxResults@ Resolver rules, you can submit
-- another @ListResolverRules@ request to get the next group of Resolver
-- rules. In the next request, specify the value of @NextToken@ from the
-- previous response.
--
-- 'maxResults', 'listResolverRules_maxResults' - The maximum number of Resolver rules that you want to return in the
-- response to a @ListResolverRules@ request. If you don\'t specify a value
-- for @MaxResults@, Resolver returns up to 100 Resolver rules.
newListResolverRules ::
  ListResolverRules
newListResolverRules :: ListResolverRules
newListResolverRules =
  ListResolverRules' :: Maybe [Filter] -> Maybe Text -> Maybe Natural -> ListResolverRules
ListResolverRules'
    { $sel:filters:ListResolverRules' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListResolverRules' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListResolverRules' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | An optional specification to return a subset of Resolver rules, such as
-- all Resolver rules that are associated with the same Resolver endpoint.
--
-- If you submit a second or subsequent @ListResolverRules@ request and
-- specify the @NextToken@ parameter, you must use the same values for
-- @Filters@, if any, as in the previous request.
listResolverRules_filters :: Lens.Lens' ListResolverRules (Prelude.Maybe [Filter])
listResolverRules_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> ListResolverRules -> f ListResolverRules
listResolverRules_filters = (ListResolverRules -> Maybe [Filter])
-> (ListResolverRules -> Maybe [Filter] -> ListResolverRules)
-> Lens
     ListResolverRules
     ListResolverRules
     (Maybe [Filter])
     (Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResolverRules' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:ListResolverRules' :: ListResolverRules -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: ListResolverRules
s@ListResolverRules' {} Maybe [Filter]
a -> ListResolverRules
s {$sel:filters:ListResolverRules' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: ListResolverRules) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> ListResolverRules -> f ListResolverRules)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> ListResolverRules
-> f ListResolverRules
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Filter] [Filter] [Filter] [Filter]
-> Iso
     (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter])
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 [Filter] [Filter] [Filter] [Filter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | For the first @ListResolverRules@ request, omit this value.
--
-- If you have more than @MaxResults@ Resolver rules, you can submit
-- another @ListResolverRules@ request to get the next group of Resolver
-- rules. In the next request, specify the value of @NextToken@ from the
-- previous response.
listResolverRules_nextToken :: Lens.Lens' ListResolverRules (Prelude.Maybe Prelude.Text)
listResolverRules_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListResolverRules -> f ListResolverRules
listResolverRules_nextToken = (ListResolverRules -> Maybe Text)
-> (ListResolverRules -> Maybe Text -> ListResolverRules)
-> Lens
     ListResolverRules ListResolverRules (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResolverRules' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListResolverRules' :: ListResolverRules -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListResolverRules
s@ListResolverRules' {} Maybe Text
a -> ListResolverRules
s {$sel:nextToken:ListResolverRules' :: Maybe Text
nextToken = Maybe Text
a} :: ListResolverRules)

-- | The maximum number of Resolver rules that you want to return in the
-- response to a @ListResolverRules@ request. If you don\'t specify a value
-- for @MaxResults@, Resolver returns up to 100 Resolver rules.
listResolverRules_maxResults :: Lens.Lens' ListResolverRules (Prelude.Maybe Prelude.Natural)
listResolverRules_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListResolverRules -> f ListResolverRules
listResolverRules_maxResults = (ListResolverRules -> Maybe Natural)
-> (ListResolverRules -> Maybe Natural -> ListResolverRules)
-> Lens
     ListResolverRules ListResolverRules (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResolverRules' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListResolverRules' :: ListResolverRules -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListResolverRules
s@ListResolverRules' {} Maybe Natural
a -> ListResolverRules
s {$sel:maxResults:ListResolverRules' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListResolverRules)

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

instance Prelude.NFData ListResolverRules

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

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

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

-- | /See:/ 'newListResolverRulesResponse' smart constructor.
data ListResolverRulesResponse = ListResolverRulesResponse'
  { -- | The Resolver rules that were created using the current Amazon Web
    -- Services account and that match the specified filters, if any.
    ListResolverRulesResponse -> Maybe [ResolverRule]
resolverRules :: Prelude.Maybe [ResolverRule],
    -- | If more than @MaxResults@ Resolver rules match the specified criteria,
    -- you can submit another @ListResolverRules@ request to get the next group
    -- of results. In the next request, specify the value of @NextToken@ from
    -- the previous response.
    ListResolverRulesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The value that you specified for @MaxResults@ in the request.
    ListResolverRulesResponse -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The response's http status code.
    ListResolverRulesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListResolverRulesResponse -> ListResolverRulesResponse -> Bool
(ListResolverRulesResponse -> ListResolverRulesResponse -> Bool)
-> (ListResolverRulesResponse -> ListResolverRulesResponse -> Bool)
-> Eq ListResolverRulesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListResolverRulesResponse -> ListResolverRulesResponse -> Bool
$c/= :: ListResolverRulesResponse -> ListResolverRulesResponse -> Bool
== :: ListResolverRulesResponse -> ListResolverRulesResponse -> Bool
$c== :: ListResolverRulesResponse -> ListResolverRulesResponse -> Bool
Prelude.Eq, ReadPrec [ListResolverRulesResponse]
ReadPrec ListResolverRulesResponse
Int -> ReadS ListResolverRulesResponse
ReadS [ListResolverRulesResponse]
(Int -> ReadS ListResolverRulesResponse)
-> ReadS [ListResolverRulesResponse]
-> ReadPrec ListResolverRulesResponse
-> ReadPrec [ListResolverRulesResponse]
-> Read ListResolverRulesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListResolverRulesResponse]
$creadListPrec :: ReadPrec [ListResolverRulesResponse]
readPrec :: ReadPrec ListResolverRulesResponse
$creadPrec :: ReadPrec ListResolverRulesResponse
readList :: ReadS [ListResolverRulesResponse]
$creadList :: ReadS [ListResolverRulesResponse]
readsPrec :: Int -> ReadS ListResolverRulesResponse
$creadsPrec :: Int -> ReadS ListResolverRulesResponse
Prelude.Read, Int -> ListResolverRulesResponse -> ShowS
[ListResolverRulesResponse] -> ShowS
ListResolverRulesResponse -> String
(Int -> ListResolverRulesResponse -> ShowS)
-> (ListResolverRulesResponse -> String)
-> ([ListResolverRulesResponse] -> ShowS)
-> Show ListResolverRulesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListResolverRulesResponse] -> ShowS
$cshowList :: [ListResolverRulesResponse] -> ShowS
show :: ListResolverRulesResponse -> String
$cshow :: ListResolverRulesResponse -> String
showsPrec :: Int -> ListResolverRulesResponse -> ShowS
$cshowsPrec :: Int -> ListResolverRulesResponse -> ShowS
Prelude.Show, (forall x.
 ListResolverRulesResponse -> Rep ListResolverRulesResponse x)
-> (forall x.
    Rep ListResolverRulesResponse x -> ListResolverRulesResponse)
-> Generic ListResolverRulesResponse
forall x.
Rep ListResolverRulesResponse x -> ListResolverRulesResponse
forall x.
ListResolverRulesResponse -> Rep ListResolverRulesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListResolverRulesResponse x -> ListResolverRulesResponse
$cfrom :: forall x.
ListResolverRulesResponse -> Rep ListResolverRulesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListResolverRulesResponse' 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:
--
-- 'resolverRules', 'listResolverRulesResponse_resolverRules' - The Resolver rules that were created using the current Amazon Web
-- Services account and that match the specified filters, if any.
--
-- 'nextToken', 'listResolverRulesResponse_nextToken' - If more than @MaxResults@ Resolver rules match the specified criteria,
-- you can submit another @ListResolverRules@ request to get the next group
-- of results. In the next request, specify the value of @NextToken@ from
-- the previous response.
--
-- 'maxResults', 'listResolverRulesResponse_maxResults' - The value that you specified for @MaxResults@ in the request.
--
-- 'httpStatus', 'listResolverRulesResponse_httpStatus' - The response's http status code.
newListResolverRulesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListResolverRulesResponse
newListResolverRulesResponse :: Int -> ListResolverRulesResponse
newListResolverRulesResponse Int
pHttpStatus_ =
  ListResolverRulesResponse' :: Maybe [ResolverRule]
-> Maybe Text -> Maybe Natural -> Int -> ListResolverRulesResponse
ListResolverRulesResponse'
    { $sel:resolverRules:ListResolverRulesResponse' :: Maybe [ResolverRule]
resolverRules =
        Maybe [ResolverRule]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListResolverRulesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListResolverRulesResponse' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListResolverRulesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Resolver rules that were created using the current Amazon Web
-- Services account and that match the specified filters, if any.
listResolverRulesResponse_resolverRules :: Lens.Lens' ListResolverRulesResponse (Prelude.Maybe [ResolverRule])
listResolverRulesResponse_resolverRules :: (Maybe [ResolverRule] -> f (Maybe [ResolverRule]))
-> ListResolverRulesResponse -> f ListResolverRulesResponse
listResolverRulesResponse_resolverRules = (ListResolverRulesResponse -> Maybe [ResolverRule])
-> (ListResolverRulesResponse
    -> Maybe [ResolverRule] -> ListResolverRulesResponse)
-> Lens' ListResolverRulesResponse (Maybe [ResolverRule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResolverRulesResponse' {Maybe [ResolverRule]
resolverRules :: Maybe [ResolverRule]
$sel:resolverRules:ListResolverRulesResponse' :: ListResolverRulesResponse -> Maybe [ResolverRule]
resolverRules} -> Maybe [ResolverRule]
resolverRules) (\s :: ListResolverRulesResponse
s@ListResolverRulesResponse' {} Maybe [ResolverRule]
a -> ListResolverRulesResponse
s {$sel:resolverRules:ListResolverRulesResponse' :: Maybe [ResolverRule]
resolverRules = Maybe [ResolverRule]
a} :: ListResolverRulesResponse) ((Maybe [ResolverRule] -> f (Maybe [ResolverRule]))
 -> ListResolverRulesResponse -> f ListResolverRulesResponse)
-> ((Maybe [ResolverRule] -> f (Maybe [ResolverRule]))
    -> Maybe [ResolverRule] -> f (Maybe [ResolverRule]))
-> (Maybe [ResolverRule] -> f (Maybe [ResolverRule]))
-> ListResolverRulesResponse
-> f ListResolverRulesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ResolverRule] [ResolverRule] [ResolverRule] [ResolverRule]
-> Iso
     (Maybe [ResolverRule])
     (Maybe [ResolverRule])
     (Maybe [ResolverRule])
     (Maybe [ResolverRule])
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 [ResolverRule] [ResolverRule] [ResolverRule] [ResolverRule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If more than @MaxResults@ Resolver rules match the specified criteria,
-- you can submit another @ListResolverRules@ request to get the next group
-- of results. In the next request, specify the value of @NextToken@ from
-- the previous response.
listResolverRulesResponse_nextToken :: Lens.Lens' ListResolverRulesResponse (Prelude.Maybe Prelude.Text)
listResolverRulesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListResolverRulesResponse -> f ListResolverRulesResponse
listResolverRulesResponse_nextToken = (ListResolverRulesResponse -> Maybe Text)
-> (ListResolverRulesResponse
    -> Maybe Text -> ListResolverRulesResponse)
-> Lens' ListResolverRulesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResolverRulesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListResolverRulesResponse' :: ListResolverRulesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListResolverRulesResponse
s@ListResolverRulesResponse' {} Maybe Text
a -> ListResolverRulesResponse
s {$sel:nextToken:ListResolverRulesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListResolverRulesResponse)

-- | The value that you specified for @MaxResults@ in the request.
listResolverRulesResponse_maxResults :: Lens.Lens' ListResolverRulesResponse (Prelude.Maybe Prelude.Natural)
listResolverRulesResponse_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListResolverRulesResponse -> f ListResolverRulesResponse
listResolverRulesResponse_maxResults = (ListResolverRulesResponse -> Maybe Natural)
-> (ListResolverRulesResponse
    -> Maybe Natural -> ListResolverRulesResponse)
-> Lens
     ListResolverRulesResponse
     ListResolverRulesResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResolverRulesResponse' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListResolverRulesResponse' :: ListResolverRulesResponse -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListResolverRulesResponse
s@ListResolverRulesResponse' {} Maybe Natural
a -> ListResolverRulesResponse
s {$sel:maxResults:ListResolverRulesResponse' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListResolverRulesResponse)

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

instance Prelude.NFData ListResolverRulesResponse