{-# 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.ListResolverRuleAssociations
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the associations that were created between Resolver rules and VPCs
-- using the current Amazon Web Services account.
--
-- This operation returns paginated results.
module Amazonka.Route53Resolver.ListResolverRuleAssociations
  ( -- * Creating a Request
    ListResolverRuleAssociations (..),
    newListResolverRuleAssociations,

    -- * Request Lenses
    listResolverRuleAssociations_filters,
    listResolverRuleAssociations_maxResults,
    listResolverRuleAssociations_nextToken,

    -- * Destructuring the Response
    ListResolverRuleAssociationsResponse (..),
    newListResolverRuleAssociationsResponse,

    -- * Response Lenses
    listResolverRuleAssociationsResponse_maxResults,
    listResolverRuleAssociationsResponse_nextToken,
    listResolverRuleAssociationsResponse_resolverRuleAssociations,
    listResolverRuleAssociationsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Route53Resolver.Types

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

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

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

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

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

instance Core.AWSPager ListResolverRuleAssociations where
  page :: ListResolverRuleAssociations
-> AWSResponse ListResolverRuleAssociations
-> Maybe ListResolverRuleAssociations
page ListResolverRuleAssociations
rq AWSResponse ListResolverRuleAssociations
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListResolverRuleAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListResolverRuleAssociationsResponse (Maybe Text)
listResolverRuleAssociationsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListResolverRuleAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  ListResolverRuleAssociationsResponse
  (Maybe [ResolverRuleAssociation])
listResolverRuleAssociationsResponse_resolverRuleAssociations
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListResolverRuleAssociations
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListResolverRuleAssociations (Maybe Text)
listResolverRuleAssociations_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListResolverRuleAssociations
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListResolverRuleAssociationsResponse (Maybe Text)
listResolverRuleAssociationsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListResolverRuleAssociations where
  type
    AWSResponse ListResolverRuleAssociations =
      ListResolverRuleAssociationsResponse
  request :: (Service -> Service)
-> ListResolverRuleAssociations
-> Request ListResolverRuleAssociations
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListResolverRuleAssociations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListResolverRuleAssociations)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Natural
-> Maybe Text
-> Maybe [ResolverRuleAssociation]
-> Int
-> ListResolverRuleAssociationsResponse
ListResolverRuleAssociationsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"MaxResults")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ResolverRuleAssociations"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ListResolverRuleAssociations
  where
  hashWithSalt :: Int -> ListResolverRuleAssociations -> Int
hashWithSalt Int
_salt ListResolverRuleAssociations' {Maybe Natural
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:nextToken:ListResolverRuleAssociations' :: ListResolverRuleAssociations -> Maybe Text
$sel:maxResults:ListResolverRuleAssociations' :: ListResolverRuleAssociations -> Maybe Natural
$sel:filters:ListResolverRuleAssociations' :: ListResolverRuleAssociations -> Maybe [Filter]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData ListResolverRuleAssociations where
  rnf :: ListResolverRuleAssociations -> ()
rnf ListResolverRuleAssociations' {Maybe Natural
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:nextToken:ListResolverRuleAssociations' :: ListResolverRuleAssociations -> Maybe Text
$sel:maxResults:ListResolverRuleAssociations' :: ListResolverRuleAssociations -> Maybe Natural
$sel:filters:ListResolverRuleAssociations' :: ListResolverRuleAssociations -> Maybe [Filter]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

instance Data.ToHeaders ListResolverRuleAssociations where
  toHeaders :: ListResolverRuleAssociations -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Route53Resolver.ListResolverRuleAssociations" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListResolverRuleAssociations where
  toJSON :: ListResolverRuleAssociations -> Value
toJSON ListResolverRuleAssociations' {Maybe Natural
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:nextToken:ListResolverRuleAssociations' :: ListResolverRuleAssociations -> Maybe Text
$sel:maxResults:ListResolverRuleAssociations' :: ListResolverRuleAssociations -> Maybe Natural
$sel:filters:ListResolverRuleAssociations' :: ListResolverRuleAssociations -> Maybe [Filter]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters,
            (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken
          ]
      )

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

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

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

-- |
-- Create a value of 'ListResolverRuleAssociationsResponse' 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:
--
-- 'maxResults', 'listResolverRuleAssociationsResponse_maxResults' - The value that you specified for @MaxResults@ in the request.
--
-- 'nextToken', 'listResolverRuleAssociationsResponse_nextToken' - If more than @MaxResults@ rule associations match the specified
-- criteria, you can submit another @ListResolverRuleAssociation@ request
-- to get the next group of results. In the next request, specify the value
-- of @NextToken@ from the previous response.
--
-- 'resolverRuleAssociations', 'listResolverRuleAssociationsResponse_resolverRuleAssociations' - The associations that were created between Resolver rules and VPCs using
-- the current Amazon Web Services account, and that match the specified
-- filters, if any.
--
-- 'httpStatus', 'listResolverRuleAssociationsResponse_httpStatus' - The response's http status code.
newListResolverRuleAssociationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListResolverRuleAssociationsResponse
newListResolverRuleAssociationsResponse :: Int -> ListResolverRuleAssociationsResponse
newListResolverRuleAssociationsResponse Int
pHttpStatus_ =
  ListResolverRuleAssociationsResponse'
    { $sel:maxResults:ListResolverRuleAssociationsResponse' :: Maybe Natural
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListResolverRuleAssociationsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:resolverRuleAssociations:ListResolverRuleAssociationsResponse' :: Maybe [ResolverRuleAssociation]
resolverRuleAssociations =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListResolverRuleAssociationsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

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

instance
  Prelude.NFData
    ListResolverRuleAssociationsResponse
  where
  rnf :: ListResolverRuleAssociationsResponse -> ()
rnf ListResolverRuleAssociationsResponse' {Int
Maybe Natural
Maybe [ResolverRuleAssociation]
Maybe Text
httpStatus :: Int
resolverRuleAssociations :: Maybe [ResolverRuleAssociation]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:httpStatus:ListResolverRuleAssociationsResponse' :: ListResolverRuleAssociationsResponse -> Int
$sel:resolverRuleAssociations:ListResolverRuleAssociationsResponse' :: ListResolverRuleAssociationsResponse
-> Maybe [ResolverRuleAssociation]
$sel:nextToken:ListResolverRuleAssociationsResponse' :: ListResolverRuleAssociationsResponse -> Maybe Text
$sel:maxResults:ListResolverRuleAssociationsResponse' :: ListResolverRuleAssociationsResponse -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ResolverRuleAssociation]
resolverRuleAssociations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus