{-# 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.ListFirewallRuleGroupAssociations
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves the firewall rule group associations that you have defined.
-- Each association enables DNS filtering for a VPC with one rule group.
--
-- A single call might return only a partial list of the associations. For
-- information, see @MaxResults@.
--
-- This operation returns paginated results.
module Amazonka.Route53Resolver.ListFirewallRuleGroupAssociations
  ( -- * Creating a Request
    ListFirewallRuleGroupAssociations (..),
    newListFirewallRuleGroupAssociations,

    -- * Request Lenses
    listFirewallRuleGroupAssociations_firewallRuleGroupId,
    listFirewallRuleGroupAssociations_maxResults,
    listFirewallRuleGroupAssociations_nextToken,
    listFirewallRuleGroupAssociations_priority,
    listFirewallRuleGroupAssociations_status,
    listFirewallRuleGroupAssociations_vpcId,

    -- * Destructuring the Response
    ListFirewallRuleGroupAssociationsResponse (..),
    newListFirewallRuleGroupAssociationsResponse,

    -- * Response Lenses
    listFirewallRuleGroupAssociationsResponse_firewallRuleGroupAssociations,
    listFirewallRuleGroupAssociationsResponse_nextToken,
    listFirewallRuleGroupAssociationsResponse_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:/ 'newListFirewallRuleGroupAssociations' smart constructor.
data ListFirewallRuleGroupAssociations = ListFirewallRuleGroupAssociations'
  { -- | The unique identifier of the firewall rule group that you want to
    -- retrieve the associations for. Leave this blank to retrieve associations
    -- for any rule group.
    ListFirewallRuleGroupAssociations -> Maybe Text
firewallRuleGroupId :: 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.
    ListFirewallRuleGroupAssociations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | 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.
    ListFirewallRuleGroupAssociations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The setting that determines the processing order of the rule group among
    -- the rule groups that are associated with a single VPC. DNS Firewall
    -- filters VPC traffic starting from the rule group with the lowest numeric
    -- priority setting.
    ListFirewallRuleGroupAssociations -> Maybe Int
priority :: Prelude.Maybe Prelude.Int,
    -- | The association @Status@ setting that you want DNS Firewall to filter on
    -- for the list. If you don\'t specify this, then DNS Firewall returns all
    -- associations, regardless of status.
    ListFirewallRuleGroupAssociations
-> Maybe FirewallRuleGroupAssociationStatus
status :: Prelude.Maybe FirewallRuleGroupAssociationStatus,
    -- | The unique identifier of the VPC that you want to retrieve the
    -- associations for. Leave this blank to retrieve associations for any VPC.
    ListFirewallRuleGroupAssociations -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text
  }
  deriving (ListFirewallRuleGroupAssociations
-> ListFirewallRuleGroupAssociations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFirewallRuleGroupAssociations
-> ListFirewallRuleGroupAssociations -> Bool
$c/= :: ListFirewallRuleGroupAssociations
-> ListFirewallRuleGroupAssociations -> Bool
== :: ListFirewallRuleGroupAssociations
-> ListFirewallRuleGroupAssociations -> Bool
$c== :: ListFirewallRuleGroupAssociations
-> ListFirewallRuleGroupAssociations -> Bool
Prelude.Eq, ReadPrec [ListFirewallRuleGroupAssociations]
ReadPrec ListFirewallRuleGroupAssociations
Int -> ReadS ListFirewallRuleGroupAssociations
ReadS [ListFirewallRuleGroupAssociations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFirewallRuleGroupAssociations]
$creadListPrec :: ReadPrec [ListFirewallRuleGroupAssociations]
readPrec :: ReadPrec ListFirewallRuleGroupAssociations
$creadPrec :: ReadPrec ListFirewallRuleGroupAssociations
readList :: ReadS [ListFirewallRuleGroupAssociations]
$creadList :: ReadS [ListFirewallRuleGroupAssociations]
readsPrec :: Int -> ReadS ListFirewallRuleGroupAssociations
$creadsPrec :: Int -> ReadS ListFirewallRuleGroupAssociations
Prelude.Read, Int -> ListFirewallRuleGroupAssociations -> ShowS
[ListFirewallRuleGroupAssociations] -> ShowS
ListFirewallRuleGroupAssociations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFirewallRuleGroupAssociations] -> ShowS
$cshowList :: [ListFirewallRuleGroupAssociations] -> ShowS
show :: ListFirewallRuleGroupAssociations -> String
$cshow :: ListFirewallRuleGroupAssociations -> String
showsPrec :: Int -> ListFirewallRuleGroupAssociations -> ShowS
$cshowsPrec :: Int -> ListFirewallRuleGroupAssociations -> ShowS
Prelude.Show, forall x.
Rep ListFirewallRuleGroupAssociations x
-> ListFirewallRuleGroupAssociations
forall x.
ListFirewallRuleGroupAssociations
-> Rep ListFirewallRuleGroupAssociations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListFirewallRuleGroupAssociations x
-> ListFirewallRuleGroupAssociations
$cfrom :: forall x.
ListFirewallRuleGroupAssociations
-> Rep ListFirewallRuleGroupAssociations x
Prelude.Generic)

-- |
-- Create a value of 'ListFirewallRuleGroupAssociations' 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:
--
-- 'firewallRuleGroupId', 'listFirewallRuleGroupAssociations_firewallRuleGroupId' - The unique identifier of the firewall rule group that you want to
-- retrieve the associations for. Leave this blank to retrieve associations
-- for any rule group.
--
-- 'maxResults', 'listFirewallRuleGroupAssociations_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.
--
-- 'nextToken', 'listFirewallRuleGroupAssociations_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.
--
-- 'priority', 'listFirewallRuleGroupAssociations_priority' - The setting that determines the processing order of the rule group among
-- the rule groups that are associated with a single VPC. DNS Firewall
-- filters VPC traffic starting from the rule group with the lowest numeric
-- priority setting.
--
-- 'status', 'listFirewallRuleGroupAssociations_status' - The association @Status@ setting that you want DNS Firewall to filter on
-- for the list. If you don\'t specify this, then DNS Firewall returns all
-- associations, regardless of status.
--
-- 'vpcId', 'listFirewallRuleGroupAssociations_vpcId' - The unique identifier of the VPC that you want to retrieve the
-- associations for. Leave this blank to retrieve associations for any VPC.
newListFirewallRuleGroupAssociations ::
  ListFirewallRuleGroupAssociations
newListFirewallRuleGroupAssociations :: ListFirewallRuleGroupAssociations
newListFirewallRuleGroupAssociations =
  ListFirewallRuleGroupAssociations'
    { $sel:firewallRuleGroupId:ListFirewallRuleGroupAssociations' :: Maybe Text
firewallRuleGroupId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListFirewallRuleGroupAssociations' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListFirewallRuleGroupAssociations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:priority:ListFirewallRuleGroupAssociations' :: Maybe Int
priority = forall a. Maybe a
Prelude.Nothing,
      $sel:status:ListFirewallRuleGroupAssociations' :: Maybe FirewallRuleGroupAssociationStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:ListFirewallRuleGroupAssociations' :: Maybe Text
vpcId = forall a. Maybe a
Prelude.Nothing
    }

-- | The unique identifier of the firewall rule group that you want to
-- retrieve the associations for. Leave this blank to retrieve associations
-- for any rule group.
listFirewallRuleGroupAssociations_firewallRuleGroupId :: Lens.Lens' ListFirewallRuleGroupAssociations (Prelude.Maybe Prelude.Text)
listFirewallRuleGroupAssociations_firewallRuleGroupId :: Lens' ListFirewallRuleGroupAssociations (Maybe Text)
listFirewallRuleGroupAssociations_firewallRuleGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallRuleGroupAssociations' {Maybe Text
firewallRuleGroupId :: Maybe Text
$sel:firewallRuleGroupId:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Text
firewallRuleGroupId} -> Maybe Text
firewallRuleGroupId) (\s :: ListFirewallRuleGroupAssociations
s@ListFirewallRuleGroupAssociations' {} Maybe Text
a -> ListFirewallRuleGroupAssociations
s {$sel:firewallRuleGroupId:ListFirewallRuleGroupAssociations' :: Maybe Text
firewallRuleGroupId = Maybe Text
a} :: ListFirewallRuleGroupAssociations)

-- | 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.
listFirewallRuleGroupAssociations_maxResults :: Lens.Lens' ListFirewallRuleGroupAssociations (Prelude.Maybe Prelude.Natural)
listFirewallRuleGroupAssociations_maxResults :: Lens' ListFirewallRuleGroupAssociations (Maybe Natural)
listFirewallRuleGroupAssociations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallRuleGroupAssociations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListFirewallRuleGroupAssociations
s@ListFirewallRuleGroupAssociations' {} Maybe Natural
a -> ListFirewallRuleGroupAssociations
s {$sel:maxResults:ListFirewallRuleGroupAssociations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListFirewallRuleGroupAssociations)

-- | 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.
listFirewallRuleGroupAssociations_nextToken :: Lens.Lens' ListFirewallRuleGroupAssociations (Prelude.Maybe Prelude.Text)
listFirewallRuleGroupAssociations_nextToken :: Lens' ListFirewallRuleGroupAssociations (Maybe Text)
listFirewallRuleGroupAssociations_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallRuleGroupAssociations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFirewallRuleGroupAssociations
s@ListFirewallRuleGroupAssociations' {} Maybe Text
a -> ListFirewallRuleGroupAssociations
s {$sel:nextToken:ListFirewallRuleGroupAssociations' :: Maybe Text
nextToken = Maybe Text
a} :: ListFirewallRuleGroupAssociations)

-- | The setting that determines the processing order of the rule group among
-- the rule groups that are associated with a single VPC. DNS Firewall
-- filters VPC traffic starting from the rule group with the lowest numeric
-- priority setting.
listFirewallRuleGroupAssociations_priority :: Lens.Lens' ListFirewallRuleGroupAssociations (Prelude.Maybe Prelude.Int)
listFirewallRuleGroupAssociations_priority :: Lens' ListFirewallRuleGroupAssociations (Maybe Int)
listFirewallRuleGroupAssociations_priority = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallRuleGroupAssociations' {Maybe Int
priority :: Maybe Int
$sel:priority:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Int
priority} -> Maybe Int
priority) (\s :: ListFirewallRuleGroupAssociations
s@ListFirewallRuleGroupAssociations' {} Maybe Int
a -> ListFirewallRuleGroupAssociations
s {$sel:priority:ListFirewallRuleGroupAssociations' :: Maybe Int
priority = Maybe Int
a} :: ListFirewallRuleGroupAssociations)

-- | The association @Status@ setting that you want DNS Firewall to filter on
-- for the list. If you don\'t specify this, then DNS Firewall returns all
-- associations, regardless of status.
listFirewallRuleGroupAssociations_status :: Lens.Lens' ListFirewallRuleGroupAssociations (Prelude.Maybe FirewallRuleGroupAssociationStatus)
listFirewallRuleGroupAssociations_status :: Lens'
  ListFirewallRuleGroupAssociations
  (Maybe FirewallRuleGroupAssociationStatus)
listFirewallRuleGroupAssociations_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallRuleGroupAssociations' {Maybe FirewallRuleGroupAssociationStatus
status :: Maybe FirewallRuleGroupAssociationStatus
$sel:status:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations
-> Maybe FirewallRuleGroupAssociationStatus
status} -> Maybe FirewallRuleGroupAssociationStatus
status) (\s :: ListFirewallRuleGroupAssociations
s@ListFirewallRuleGroupAssociations' {} Maybe FirewallRuleGroupAssociationStatus
a -> ListFirewallRuleGroupAssociations
s {$sel:status:ListFirewallRuleGroupAssociations' :: Maybe FirewallRuleGroupAssociationStatus
status = Maybe FirewallRuleGroupAssociationStatus
a} :: ListFirewallRuleGroupAssociations)

-- | The unique identifier of the VPC that you want to retrieve the
-- associations for. Leave this blank to retrieve associations for any VPC.
listFirewallRuleGroupAssociations_vpcId :: Lens.Lens' ListFirewallRuleGroupAssociations (Prelude.Maybe Prelude.Text)
listFirewallRuleGroupAssociations_vpcId :: Lens' ListFirewallRuleGroupAssociations (Maybe Text)
listFirewallRuleGroupAssociations_vpcId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallRuleGroupAssociations' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: ListFirewallRuleGroupAssociations
s@ListFirewallRuleGroupAssociations' {} Maybe Text
a -> ListFirewallRuleGroupAssociations
s {$sel:vpcId:ListFirewallRuleGroupAssociations' :: Maybe Text
vpcId = Maybe Text
a} :: ListFirewallRuleGroupAssociations)

instance
  Core.AWSPager
    ListFirewallRuleGroupAssociations
  where
  page :: ListFirewallRuleGroupAssociations
-> AWSResponse ListFirewallRuleGroupAssociations
-> Maybe ListFirewallRuleGroupAssociations
page ListFirewallRuleGroupAssociations
rq AWSResponse ListFirewallRuleGroupAssociations
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListFirewallRuleGroupAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListFirewallRuleGroupAssociationsResponse (Maybe Text)
listFirewallRuleGroupAssociationsResponse_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 ListFirewallRuleGroupAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  ListFirewallRuleGroupAssociationsResponse
  (Maybe [FirewallRuleGroupAssociation])
listFirewallRuleGroupAssociationsResponse_firewallRuleGroupAssociations
            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.$ ListFirewallRuleGroupAssociations
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListFirewallRuleGroupAssociations (Maybe Text)
listFirewallRuleGroupAssociations_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListFirewallRuleGroupAssociations
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListFirewallRuleGroupAssociationsResponse (Maybe Text)
listFirewallRuleGroupAssociationsResponse_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
    ListFirewallRuleGroupAssociations
  where
  type
    AWSResponse ListFirewallRuleGroupAssociations =
      ListFirewallRuleGroupAssociationsResponse
  request :: (Service -> Service)
-> ListFirewallRuleGroupAssociations
-> Request ListFirewallRuleGroupAssociations
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 ListFirewallRuleGroupAssociations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListFirewallRuleGroupAssociations)))
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 [FirewallRuleGroupAssociation]
-> Maybe Text -> Int -> ListFirewallRuleGroupAssociationsResponse
ListFirewallRuleGroupAssociationsResponse'
            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
"FirewallRuleGroupAssociations"
                            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.<*> (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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ListFirewallRuleGroupAssociations
  where
  hashWithSalt :: Int -> ListFirewallRuleGroupAssociations -> Int
hashWithSalt
    Int
_salt
    ListFirewallRuleGroupAssociations' {Maybe Int
Maybe Natural
Maybe Text
Maybe FirewallRuleGroupAssociationStatus
vpcId :: Maybe Text
status :: Maybe FirewallRuleGroupAssociationStatus
priority :: Maybe Int
nextToken :: Maybe Text
maxResults :: Maybe Natural
firewallRuleGroupId :: Maybe Text
$sel:vpcId:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Text
$sel:status:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations
-> Maybe FirewallRuleGroupAssociationStatus
$sel:priority:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Int
$sel:nextToken:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Text
$sel:maxResults:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Natural
$sel:firewallRuleGroupId:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
firewallRuleGroupId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
priority
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FirewallRuleGroupAssociationStatus
status
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpcId

instance
  Prelude.NFData
    ListFirewallRuleGroupAssociations
  where
  rnf :: ListFirewallRuleGroupAssociations -> ()
rnf ListFirewallRuleGroupAssociations' {Maybe Int
Maybe Natural
Maybe Text
Maybe FirewallRuleGroupAssociationStatus
vpcId :: Maybe Text
status :: Maybe FirewallRuleGroupAssociationStatus
priority :: Maybe Int
nextToken :: Maybe Text
maxResults :: Maybe Natural
firewallRuleGroupId :: Maybe Text
$sel:vpcId:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Text
$sel:status:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations
-> Maybe FirewallRuleGroupAssociationStatus
$sel:priority:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Int
$sel:nextToken:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Text
$sel:maxResults:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Natural
$sel:firewallRuleGroupId:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
firewallRuleGroupId
      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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
priority
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FirewallRuleGroupAssociationStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpcId

instance
  Data.ToHeaders
    ListFirewallRuleGroupAssociations
  where
  toHeaders :: ListFirewallRuleGroupAssociations -> 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.ListFirewallRuleGroupAssociations" ::
                          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
    ListFirewallRuleGroupAssociations
  where
  toJSON :: ListFirewallRuleGroupAssociations -> Value
toJSON ListFirewallRuleGroupAssociations' {Maybe Int
Maybe Natural
Maybe Text
Maybe FirewallRuleGroupAssociationStatus
vpcId :: Maybe Text
status :: Maybe FirewallRuleGroupAssociationStatus
priority :: Maybe Int
nextToken :: Maybe Text
maxResults :: Maybe Natural
firewallRuleGroupId :: Maybe Text
$sel:vpcId:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Text
$sel:status:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations
-> Maybe FirewallRuleGroupAssociationStatus
$sel:priority:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Int
$sel:nextToken:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Text
$sel:maxResults:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Natural
$sel:firewallRuleGroupId:ListFirewallRuleGroupAssociations' :: ListFirewallRuleGroupAssociations -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"FirewallRuleGroupId" 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
firewallRuleGroupId,
            (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,
            (Key
"Priority" 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 Int
priority,
            (Key
"Status" 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 FirewallRuleGroupAssociationStatus
status,
            (Key
"VpcId" 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
vpcId
          ]
      )

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

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

-- | /See:/ 'newListFirewallRuleGroupAssociationsResponse' smart constructor.
data ListFirewallRuleGroupAssociationsResponse = ListFirewallRuleGroupAssociationsResponse'
  { -- | A list of your firewall rule group associations.
    --
    -- This might be a partial list of the associations that you have defined.
    -- For information, see @MaxResults@.
    ListFirewallRuleGroupAssociationsResponse
-> Maybe [FirewallRuleGroupAssociation]
firewallRuleGroupAssociations :: Prelude.Maybe [FirewallRuleGroupAssociation],
    -- | 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.
    ListFirewallRuleGroupAssociationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListFirewallRuleGroupAssociationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListFirewallRuleGroupAssociationsResponse
-> ListFirewallRuleGroupAssociationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFirewallRuleGroupAssociationsResponse
-> ListFirewallRuleGroupAssociationsResponse -> Bool
$c/= :: ListFirewallRuleGroupAssociationsResponse
-> ListFirewallRuleGroupAssociationsResponse -> Bool
== :: ListFirewallRuleGroupAssociationsResponse
-> ListFirewallRuleGroupAssociationsResponse -> Bool
$c== :: ListFirewallRuleGroupAssociationsResponse
-> ListFirewallRuleGroupAssociationsResponse -> Bool
Prelude.Eq, ReadPrec [ListFirewallRuleGroupAssociationsResponse]
ReadPrec ListFirewallRuleGroupAssociationsResponse
Int -> ReadS ListFirewallRuleGroupAssociationsResponse
ReadS [ListFirewallRuleGroupAssociationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFirewallRuleGroupAssociationsResponse]
$creadListPrec :: ReadPrec [ListFirewallRuleGroupAssociationsResponse]
readPrec :: ReadPrec ListFirewallRuleGroupAssociationsResponse
$creadPrec :: ReadPrec ListFirewallRuleGroupAssociationsResponse
readList :: ReadS [ListFirewallRuleGroupAssociationsResponse]
$creadList :: ReadS [ListFirewallRuleGroupAssociationsResponse]
readsPrec :: Int -> ReadS ListFirewallRuleGroupAssociationsResponse
$creadsPrec :: Int -> ReadS ListFirewallRuleGroupAssociationsResponse
Prelude.Read, Int -> ListFirewallRuleGroupAssociationsResponse -> ShowS
[ListFirewallRuleGroupAssociationsResponse] -> ShowS
ListFirewallRuleGroupAssociationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFirewallRuleGroupAssociationsResponse] -> ShowS
$cshowList :: [ListFirewallRuleGroupAssociationsResponse] -> ShowS
show :: ListFirewallRuleGroupAssociationsResponse -> String
$cshow :: ListFirewallRuleGroupAssociationsResponse -> String
showsPrec :: Int -> ListFirewallRuleGroupAssociationsResponse -> ShowS
$cshowsPrec :: Int -> ListFirewallRuleGroupAssociationsResponse -> ShowS
Prelude.Show, forall x.
Rep ListFirewallRuleGroupAssociationsResponse x
-> ListFirewallRuleGroupAssociationsResponse
forall x.
ListFirewallRuleGroupAssociationsResponse
-> Rep ListFirewallRuleGroupAssociationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListFirewallRuleGroupAssociationsResponse x
-> ListFirewallRuleGroupAssociationsResponse
$cfrom :: forall x.
ListFirewallRuleGroupAssociationsResponse
-> Rep ListFirewallRuleGroupAssociationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListFirewallRuleGroupAssociationsResponse' 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:
--
-- 'firewallRuleGroupAssociations', 'listFirewallRuleGroupAssociationsResponse_firewallRuleGroupAssociations' - A list of your firewall rule group associations.
--
-- This might be a partial list of the associations that you have defined.
-- For information, see @MaxResults@.
--
-- 'nextToken', 'listFirewallRuleGroupAssociationsResponse_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.
--
-- 'httpStatus', 'listFirewallRuleGroupAssociationsResponse_httpStatus' - The response's http status code.
newListFirewallRuleGroupAssociationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListFirewallRuleGroupAssociationsResponse
newListFirewallRuleGroupAssociationsResponse :: Int -> ListFirewallRuleGroupAssociationsResponse
newListFirewallRuleGroupAssociationsResponse
  Int
pHttpStatus_ =
    ListFirewallRuleGroupAssociationsResponse'
      { $sel:firewallRuleGroupAssociations:ListFirewallRuleGroupAssociationsResponse' :: Maybe [FirewallRuleGroupAssociation]
firewallRuleGroupAssociations =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListFirewallRuleGroupAssociationsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListFirewallRuleGroupAssociationsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | A list of your firewall rule group associations.
--
-- This might be a partial list of the associations that you have defined.
-- For information, see @MaxResults@.
listFirewallRuleGroupAssociationsResponse_firewallRuleGroupAssociations :: Lens.Lens' ListFirewallRuleGroupAssociationsResponse (Prelude.Maybe [FirewallRuleGroupAssociation])
listFirewallRuleGroupAssociationsResponse_firewallRuleGroupAssociations :: Lens'
  ListFirewallRuleGroupAssociationsResponse
  (Maybe [FirewallRuleGroupAssociation])
listFirewallRuleGroupAssociationsResponse_firewallRuleGroupAssociations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallRuleGroupAssociationsResponse' {Maybe [FirewallRuleGroupAssociation]
firewallRuleGroupAssociations :: Maybe [FirewallRuleGroupAssociation]
$sel:firewallRuleGroupAssociations:ListFirewallRuleGroupAssociationsResponse' :: ListFirewallRuleGroupAssociationsResponse
-> Maybe [FirewallRuleGroupAssociation]
firewallRuleGroupAssociations} -> Maybe [FirewallRuleGroupAssociation]
firewallRuleGroupAssociations) (\s :: ListFirewallRuleGroupAssociationsResponse
s@ListFirewallRuleGroupAssociationsResponse' {} Maybe [FirewallRuleGroupAssociation]
a -> ListFirewallRuleGroupAssociationsResponse
s {$sel:firewallRuleGroupAssociations:ListFirewallRuleGroupAssociationsResponse' :: Maybe [FirewallRuleGroupAssociation]
firewallRuleGroupAssociations = Maybe [FirewallRuleGroupAssociation]
a} :: ListFirewallRuleGroupAssociationsResponse) 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

-- | 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.
listFirewallRuleGroupAssociationsResponse_nextToken :: Lens.Lens' ListFirewallRuleGroupAssociationsResponse (Prelude.Maybe Prelude.Text)
listFirewallRuleGroupAssociationsResponse_nextToken :: Lens' ListFirewallRuleGroupAssociationsResponse (Maybe Text)
listFirewallRuleGroupAssociationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallRuleGroupAssociationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFirewallRuleGroupAssociationsResponse' :: ListFirewallRuleGroupAssociationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFirewallRuleGroupAssociationsResponse
s@ListFirewallRuleGroupAssociationsResponse' {} Maybe Text
a -> ListFirewallRuleGroupAssociationsResponse
s {$sel:nextToken:ListFirewallRuleGroupAssociationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFirewallRuleGroupAssociationsResponse)

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

instance
  Prelude.NFData
    ListFirewallRuleGroupAssociationsResponse
  where
  rnf :: ListFirewallRuleGroupAssociationsResponse -> ()
rnf ListFirewallRuleGroupAssociationsResponse' {Int
Maybe [FirewallRuleGroupAssociation]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
firewallRuleGroupAssociations :: Maybe [FirewallRuleGroupAssociation]
$sel:httpStatus:ListFirewallRuleGroupAssociationsResponse' :: ListFirewallRuleGroupAssociationsResponse -> Int
$sel:nextToken:ListFirewallRuleGroupAssociationsResponse' :: ListFirewallRuleGroupAssociationsResponse -> Maybe Text
$sel:firewallRuleGroupAssociations:ListFirewallRuleGroupAssociationsResponse' :: ListFirewallRuleGroupAssociationsResponse
-> Maybe [FirewallRuleGroupAssociation]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [FirewallRuleGroupAssociation]
firewallRuleGroupAssociations
      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 Int
httpStatus