{-# 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.AssociateFirewallRuleGroup
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Associates a FirewallRuleGroup with a VPC, to provide DNS filtering for
-- the VPC.
module Amazonka.Route53Resolver.AssociateFirewallRuleGroup
  ( -- * Creating a Request
    AssociateFirewallRuleGroup (..),
    newAssociateFirewallRuleGroup,

    -- * Request Lenses
    associateFirewallRuleGroup_mutationProtection,
    associateFirewallRuleGroup_tags,
    associateFirewallRuleGroup_creatorRequestId,
    associateFirewallRuleGroup_firewallRuleGroupId,
    associateFirewallRuleGroup_vpcId,
    associateFirewallRuleGroup_priority,
    associateFirewallRuleGroup_name,

    -- * Destructuring the Response
    AssociateFirewallRuleGroupResponse (..),
    newAssociateFirewallRuleGroupResponse,

    -- * Response Lenses
    associateFirewallRuleGroupResponse_firewallRuleGroupAssociation,
    associateFirewallRuleGroupResponse_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:/ 'newAssociateFirewallRuleGroup' smart constructor.
data AssociateFirewallRuleGroup = AssociateFirewallRuleGroup'
  { -- | If enabled, this setting disallows modification or removal of the
    -- association, to help prevent against accidentally altering DNS firewall
    -- protections. When you create the association, the default setting is
    -- @DISABLED@.
    AssociateFirewallRuleGroup -> Maybe MutationProtectionStatus
mutationProtection :: Prelude.Maybe MutationProtectionStatus,
    -- | A list of the tag keys and values that you want to associate with the
    -- rule group association.
    AssociateFirewallRuleGroup -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | A unique string that identifies the request and that allows failed
    -- requests to be retried without the risk of running the operation twice.
    -- @CreatorRequestId@ can be any unique string, for example, a date\/time
    -- stamp.
    AssociateFirewallRuleGroup -> Text
creatorRequestId :: Prelude.Text,
    -- | The unique identifier of the firewall rule group.
    AssociateFirewallRuleGroup -> Text
firewallRuleGroupId :: Prelude.Text,
    -- | The unique identifier of the VPC that you want to associate with the
    -- rule group.
    AssociateFirewallRuleGroup -> Text
vpcId :: Prelude.Text,
    -- | The setting that determines the processing order of the rule group among
    -- the rule groups that you associate with the specified VPC. DNS Firewall
    -- filters VPC traffic starting from the rule group with the lowest numeric
    -- priority setting.
    --
    -- You must specify a unique priority for each rule group that you
    -- associate with a single VPC. To make it easier to insert rule groups
    -- later, leave space between the numbers, for example, use 101, 200, and
    -- so on. You can change the priority setting for a rule group association
    -- after you create it.
    --
    -- The allowed values for @Priority@ are between 100 and 9900.
    AssociateFirewallRuleGroup -> Int
priority :: Prelude.Int,
    -- | A name that lets you identify the association, to manage and use it.
    AssociateFirewallRuleGroup -> Text
name :: Prelude.Text
  }
  deriving (AssociateFirewallRuleGroup -> AssociateFirewallRuleGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateFirewallRuleGroup -> AssociateFirewallRuleGroup -> Bool
$c/= :: AssociateFirewallRuleGroup -> AssociateFirewallRuleGroup -> Bool
== :: AssociateFirewallRuleGroup -> AssociateFirewallRuleGroup -> Bool
$c== :: AssociateFirewallRuleGroup -> AssociateFirewallRuleGroup -> Bool
Prelude.Eq, ReadPrec [AssociateFirewallRuleGroup]
ReadPrec AssociateFirewallRuleGroup
Int -> ReadS AssociateFirewallRuleGroup
ReadS [AssociateFirewallRuleGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateFirewallRuleGroup]
$creadListPrec :: ReadPrec [AssociateFirewallRuleGroup]
readPrec :: ReadPrec AssociateFirewallRuleGroup
$creadPrec :: ReadPrec AssociateFirewallRuleGroup
readList :: ReadS [AssociateFirewallRuleGroup]
$creadList :: ReadS [AssociateFirewallRuleGroup]
readsPrec :: Int -> ReadS AssociateFirewallRuleGroup
$creadsPrec :: Int -> ReadS AssociateFirewallRuleGroup
Prelude.Read, Int -> AssociateFirewallRuleGroup -> ShowS
[AssociateFirewallRuleGroup] -> ShowS
AssociateFirewallRuleGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateFirewallRuleGroup] -> ShowS
$cshowList :: [AssociateFirewallRuleGroup] -> ShowS
show :: AssociateFirewallRuleGroup -> String
$cshow :: AssociateFirewallRuleGroup -> String
showsPrec :: Int -> AssociateFirewallRuleGroup -> ShowS
$cshowsPrec :: Int -> AssociateFirewallRuleGroup -> ShowS
Prelude.Show, forall x.
Rep AssociateFirewallRuleGroup x -> AssociateFirewallRuleGroup
forall x.
AssociateFirewallRuleGroup -> Rep AssociateFirewallRuleGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateFirewallRuleGroup x -> AssociateFirewallRuleGroup
$cfrom :: forall x.
AssociateFirewallRuleGroup -> Rep AssociateFirewallRuleGroup x
Prelude.Generic)

-- |
-- Create a value of 'AssociateFirewallRuleGroup' 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:
--
-- 'mutationProtection', 'associateFirewallRuleGroup_mutationProtection' - If enabled, this setting disallows modification or removal of the
-- association, to help prevent against accidentally altering DNS firewall
-- protections. When you create the association, the default setting is
-- @DISABLED@.
--
-- 'tags', 'associateFirewallRuleGroup_tags' - A list of the tag keys and values that you want to associate with the
-- rule group association.
--
-- 'creatorRequestId', 'associateFirewallRuleGroup_creatorRequestId' - A unique string that identifies the request and that allows failed
-- requests to be retried without the risk of running the operation twice.
-- @CreatorRequestId@ can be any unique string, for example, a date\/time
-- stamp.
--
-- 'firewallRuleGroupId', 'associateFirewallRuleGroup_firewallRuleGroupId' - The unique identifier of the firewall rule group.
--
-- 'vpcId', 'associateFirewallRuleGroup_vpcId' - The unique identifier of the VPC that you want to associate with the
-- rule group.
--
-- 'priority', 'associateFirewallRuleGroup_priority' - The setting that determines the processing order of the rule group among
-- the rule groups that you associate with the specified VPC. DNS Firewall
-- filters VPC traffic starting from the rule group with the lowest numeric
-- priority setting.
--
-- You must specify a unique priority for each rule group that you
-- associate with a single VPC. To make it easier to insert rule groups
-- later, leave space between the numbers, for example, use 101, 200, and
-- so on. You can change the priority setting for a rule group association
-- after you create it.
--
-- The allowed values for @Priority@ are between 100 and 9900.
--
-- 'name', 'associateFirewallRuleGroup_name' - A name that lets you identify the association, to manage and use it.
newAssociateFirewallRuleGroup ::
  -- | 'creatorRequestId'
  Prelude.Text ->
  -- | 'firewallRuleGroupId'
  Prelude.Text ->
  -- | 'vpcId'
  Prelude.Text ->
  -- | 'priority'
  Prelude.Int ->
  -- | 'name'
  Prelude.Text ->
  AssociateFirewallRuleGroup
newAssociateFirewallRuleGroup :: Text -> Text -> Text -> Int -> Text -> AssociateFirewallRuleGroup
newAssociateFirewallRuleGroup
  Text
pCreatorRequestId_
  Text
pFirewallRuleGroupId_
  Text
pVpcId_
  Int
pPriority_
  Text
pName_ =
    AssociateFirewallRuleGroup'
      { $sel:mutationProtection:AssociateFirewallRuleGroup' :: Maybe MutationProtectionStatus
mutationProtection =
          forall a. Maybe a
Prelude.Nothing,
        $sel:tags:AssociateFirewallRuleGroup' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:creatorRequestId:AssociateFirewallRuleGroup' :: Text
creatorRequestId = Text
pCreatorRequestId_,
        $sel:firewallRuleGroupId:AssociateFirewallRuleGroup' :: Text
firewallRuleGroupId = Text
pFirewallRuleGroupId_,
        $sel:vpcId:AssociateFirewallRuleGroup' :: Text
vpcId = Text
pVpcId_,
        $sel:priority:AssociateFirewallRuleGroup' :: Int
priority = Int
pPriority_,
        $sel:name:AssociateFirewallRuleGroup' :: Text
name = Text
pName_
      }

-- | If enabled, this setting disallows modification or removal of the
-- association, to help prevent against accidentally altering DNS firewall
-- protections. When you create the association, the default setting is
-- @DISABLED@.
associateFirewallRuleGroup_mutationProtection :: Lens.Lens' AssociateFirewallRuleGroup (Prelude.Maybe MutationProtectionStatus)
associateFirewallRuleGroup_mutationProtection :: Lens' AssociateFirewallRuleGroup (Maybe MutationProtectionStatus)
associateFirewallRuleGroup_mutationProtection = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateFirewallRuleGroup' {Maybe MutationProtectionStatus
mutationProtection :: Maybe MutationProtectionStatus
$sel:mutationProtection:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Maybe MutationProtectionStatus
mutationProtection} -> Maybe MutationProtectionStatus
mutationProtection) (\s :: AssociateFirewallRuleGroup
s@AssociateFirewallRuleGroup' {} Maybe MutationProtectionStatus
a -> AssociateFirewallRuleGroup
s {$sel:mutationProtection:AssociateFirewallRuleGroup' :: Maybe MutationProtectionStatus
mutationProtection = Maybe MutationProtectionStatus
a} :: AssociateFirewallRuleGroup)

-- | A list of the tag keys and values that you want to associate with the
-- rule group association.
associateFirewallRuleGroup_tags :: Lens.Lens' AssociateFirewallRuleGroup (Prelude.Maybe [Tag])
associateFirewallRuleGroup_tags :: Lens' AssociateFirewallRuleGroup (Maybe [Tag])
associateFirewallRuleGroup_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateFirewallRuleGroup' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: AssociateFirewallRuleGroup
s@AssociateFirewallRuleGroup' {} Maybe [Tag]
a -> AssociateFirewallRuleGroup
s {$sel:tags:AssociateFirewallRuleGroup' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: AssociateFirewallRuleGroup) 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

-- | A unique string that identifies the request and that allows failed
-- requests to be retried without the risk of running the operation twice.
-- @CreatorRequestId@ can be any unique string, for example, a date\/time
-- stamp.
associateFirewallRuleGroup_creatorRequestId :: Lens.Lens' AssociateFirewallRuleGroup Prelude.Text
associateFirewallRuleGroup_creatorRequestId :: Lens' AssociateFirewallRuleGroup Text
associateFirewallRuleGroup_creatorRequestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateFirewallRuleGroup' {Text
creatorRequestId :: Text
$sel:creatorRequestId:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Text
creatorRequestId} -> Text
creatorRequestId) (\s :: AssociateFirewallRuleGroup
s@AssociateFirewallRuleGroup' {} Text
a -> AssociateFirewallRuleGroup
s {$sel:creatorRequestId:AssociateFirewallRuleGroup' :: Text
creatorRequestId = Text
a} :: AssociateFirewallRuleGroup)

-- | The unique identifier of the firewall rule group.
associateFirewallRuleGroup_firewallRuleGroupId :: Lens.Lens' AssociateFirewallRuleGroup Prelude.Text
associateFirewallRuleGroup_firewallRuleGroupId :: Lens' AssociateFirewallRuleGroup Text
associateFirewallRuleGroup_firewallRuleGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateFirewallRuleGroup' {Text
firewallRuleGroupId :: Text
$sel:firewallRuleGroupId:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Text
firewallRuleGroupId} -> Text
firewallRuleGroupId) (\s :: AssociateFirewallRuleGroup
s@AssociateFirewallRuleGroup' {} Text
a -> AssociateFirewallRuleGroup
s {$sel:firewallRuleGroupId:AssociateFirewallRuleGroup' :: Text
firewallRuleGroupId = Text
a} :: AssociateFirewallRuleGroup)

-- | The unique identifier of the VPC that you want to associate with the
-- rule group.
associateFirewallRuleGroup_vpcId :: Lens.Lens' AssociateFirewallRuleGroup Prelude.Text
associateFirewallRuleGroup_vpcId :: Lens' AssociateFirewallRuleGroup Text
associateFirewallRuleGroup_vpcId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateFirewallRuleGroup' {Text
vpcId :: Text
$sel:vpcId:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Text
vpcId} -> Text
vpcId) (\s :: AssociateFirewallRuleGroup
s@AssociateFirewallRuleGroup' {} Text
a -> AssociateFirewallRuleGroup
s {$sel:vpcId:AssociateFirewallRuleGroup' :: Text
vpcId = Text
a} :: AssociateFirewallRuleGroup)

-- | The setting that determines the processing order of the rule group among
-- the rule groups that you associate with the specified VPC. DNS Firewall
-- filters VPC traffic starting from the rule group with the lowest numeric
-- priority setting.
--
-- You must specify a unique priority for each rule group that you
-- associate with a single VPC. To make it easier to insert rule groups
-- later, leave space between the numbers, for example, use 101, 200, and
-- so on. You can change the priority setting for a rule group association
-- after you create it.
--
-- The allowed values for @Priority@ are between 100 and 9900.
associateFirewallRuleGroup_priority :: Lens.Lens' AssociateFirewallRuleGroup Prelude.Int
associateFirewallRuleGroup_priority :: Lens' AssociateFirewallRuleGroup Int
associateFirewallRuleGroup_priority = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateFirewallRuleGroup' {Int
priority :: Int
$sel:priority:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Int
priority} -> Int
priority) (\s :: AssociateFirewallRuleGroup
s@AssociateFirewallRuleGroup' {} Int
a -> AssociateFirewallRuleGroup
s {$sel:priority:AssociateFirewallRuleGroup' :: Int
priority = Int
a} :: AssociateFirewallRuleGroup)

-- | A name that lets you identify the association, to manage and use it.
associateFirewallRuleGroup_name :: Lens.Lens' AssociateFirewallRuleGroup Prelude.Text
associateFirewallRuleGroup_name :: Lens' AssociateFirewallRuleGroup Text
associateFirewallRuleGroup_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateFirewallRuleGroup' {Text
name :: Text
$sel:name:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Text
name} -> Text
name) (\s :: AssociateFirewallRuleGroup
s@AssociateFirewallRuleGroup' {} Text
a -> AssociateFirewallRuleGroup
s {$sel:name:AssociateFirewallRuleGroup' :: Text
name = Text
a} :: AssociateFirewallRuleGroup)

instance Core.AWSRequest AssociateFirewallRuleGroup where
  type
    AWSResponse AssociateFirewallRuleGroup =
      AssociateFirewallRuleGroupResponse
  request :: (Service -> Service)
-> AssociateFirewallRuleGroup -> Request AssociateFirewallRuleGroup
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 AssociateFirewallRuleGroup
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AssociateFirewallRuleGroup)))
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
-> Int -> AssociateFirewallRuleGroupResponse
AssociateFirewallRuleGroupResponse'
            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
"FirewallRuleGroupAssociation")
            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 AssociateFirewallRuleGroup where
  hashWithSalt :: Int -> AssociateFirewallRuleGroup -> Int
hashWithSalt Int
_salt AssociateFirewallRuleGroup' {Int
Maybe [Tag]
Maybe MutationProtectionStatus
Text
name :: Text
priority :: Int
vpcId :: Text
firewallRuleGroupId :: Text
creatorRequestId :: Text
tags :: Maybe [Tag]
mutationProtection :: Maybe MutationProtectionStatus
$sel:name:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Text
$sel:priority:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Int
$sel:vpcId:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Text
$sel:firewallRuleGroupId:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Text
$sel:creatorRequestId:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Text
$sel:tags:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Maybe [Tag]
$sel:mutationProtection:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Maybe MutationProtectionStatus
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MutationProtectionStatus
mutationProtection
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
creatorRequestId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
firewallRuleGroupId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vpcId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
priority
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData AssociateFirewallRuleGroup where
  rnf :: AssociateFirewallRuleGroup -> ()
rnf AssociateFirewallRuleGroup' {Int
Maybe [Tag]
Maybe MutationProtectionStatus
Text
name :: Text
priority :: Int
vpcId :: Text
firewallRuleGroupId :: Text
creatorRequestId :: Text
tags :: Maybe [Tag]
mutationProtection :: Maybe MutationProtectionStatus
$sel:name:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Text
$sel:priority:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Int
$sel:vpcId:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Text
$sel:firewallRuleGroupId:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Text
$sel:creatorRequestId:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Text
$sel:tags:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Maybe [Tag]
$sel:mutationProtection:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Maybe MutationProtectionStatus
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe MutationProtectionStatus
mutationProtection
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
creatorRequestId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
firewallRuleGroupId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
vpcId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
priority
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

instance Data.ToHeaders AssociateFirewallRuleGroup where
  toHeaders :: AssociateFirewallRuleGroup -> 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.AssociateFirewallRuleGroup" ::
                          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 AssociateFirewallRuleGroup where
  toJSON :: AssociateFirewallRuleGroup -> Value
toJSON AssociateFirewallRuleGroup' {Int
Maybe [Tag]
Maybe MutationProtectionStatus
Text
name :: Text
priority :: Int
vpcId :: Text
firewallRuleGroupId :: Text
creatorRequestId :: Text
tags :: Maybe [Tag]
mutationProtection :: Maybe MutationProtectionStatus
$sel:name:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Text
$sel:priority:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Int
$sel:vpcId:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Text
$sel:firewallRuleGroupId:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Text
$sel:creatorRequestId:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Text
$sel:tags:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Maybe [Tag]
$sel:mutationProtection:AssociateFirewallRuleGroup' :: AssociateFirewallRuleGroup -> Maybe MutationProtectionStatus
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MutationProtection" 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 MutationProtectionStatus
mutationProtection,
            (Key
"Tags" 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 [Tag]
tags,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"CreatorRequestId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
creatorRequestId),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"FirewallRuleGroupId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
firewallRuleGroupId),
            forall a. a -> Maybe a
Prelude.Just (Key
"VpcId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
vpcId),
            forall a. a -> Maybe a
Prelude.Just (Key
"Priority" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
priority),
            forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
          ]
      )

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

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

-- | /See:/ 'newAssociateFirewallRuleGroupResponse' smart constructor.
data AssociateFirewallRuleGroupResponse = AssociateFirewallRuleGroupResponse'
  { -- | The association that you just created. The association has an ID that
    -- you can use to identify it in other requests, like update and delete.
    AssociateFirewallRuleGroupResponse
-> Maybe FirewallRuleGroupAssociation
firewallRuleGroupAssociation :: Prelude.Maybe FirewallRuleGroupAssociation,
    -- | The response's http status code.
    AssociateFirewallRuleGroupResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AssociateFirewallRuleGroupResponse
-> AssociateFirewallRuleGroupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateFirewallRuleGroupResponse
-> AssociateFirewallRuleGroupResponse -> Bool
$c/= :: AssociateFirewallRuleGroupResponse
-> AssociateFirewallRuleGroupResponse -> Bool
== :: AssociateFirewallRuleGroupResponse
-> AssociateFirewallRuleGroupResponse -> Bool
$c== :: AssociateFirewallRuleGroupResponse
-> AssociateFirewallRuleGroupResponse -> Bool
Prelude.Eq, ReadPrec [AssociateFirewallRuleGroupResponse]
ReadPrec AssociateFirewallRuleGroupResponse
Int -> ReadS AssociateFirewallRuleGroupResponse
ReadS [AssociateFirewallRuleGroupResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateFirewallRuleGroupResponse]
$creadListPrec :: ReadPrec [AssociateFirewallRuleGroupResponse]
readPrec :: ReadPrec AssociateFirewallRuleGroupResponse
$creadPrec :: ReadPrec AssociateFirewallRuleGroupResponse
readList :: ReadS [AssociateFirewallRuleGroupResponse]
$creadList :: ReadS [AssociateFirewallRuleGroupResponse]
readsPrec :: Int -> ReadS AssociateFirewallRuleGroupResponse
$creadsPrec :: Int -> ReadS AssociateFirewallRuleGroupResponse
Prelude.Read, Int -> AssociateFirewallRuleGroupResponse -> ShowS
[AssociateFirewallRuleGroupResponse] -> ShowS
AssociateFirewallRuleGroupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateFirewallRuleGroupResponse] -> ShowS
$cshowList :: [AssociateFirewallRuleGroupResponse] -> ShowS
show :: AssociateFirewallRuleGroupResponse -> String
$cshow :: AssociateFirewallRuleGroupResponse -> String
showsPrec :: Int -> AssociateFirewallRuleGroupResponse -> ShowS
$cshowsPrec :: Int -> AssociateFirewallRuleGroupResponse -> ShowS
Prelude.Show, forall x.
Rep AssociateFirewallRuleGroupResponse x
-> AssociateFirewallRuleGroupResponse
forall x.
AssociateFirewallRuleGroupResponse
-> Rep AssociateFirewallRuleGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateFirewallRuleGroupResponse x
-> AssociateFirewallRuleGroupResponse
$cfrom :: forall x.
AssociateFirewallRuleGroupResponse
-> Rep AssociateFirewallRuleGroupResponse x
Prelude.Generic)

-- |
-- Create a value of 'AssociateFirewallRuleGroupResponse' 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:
--
-- 'firewallRuleGroupAssociation', 'associateFirewallRuleGroupResponse_firewallRuleGroupAssociation' - The association that you just created. The association has an ID that
-- you can use to identify it in other requests, like update and delete.
--
-- 'httpStatus', 'associateFirewallRuleGroupResponse_httpStatus' - The response's http status code.
newAssociateFirewallRuleGroupResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AssociateFirewallRuleGroupResponse
newAssociateFirewallRuleGroupResponse :: Int -> AssociateFirewallRuleGroupResponse
newAssociateFirewallRuleGroupResponse Int
pHttpStatus_ =
  AssociateFirewallRuleGroupResponse'
    { $sel:firewallRuleGroupAssociation:AssociateFirewallRuleGroupResponse' :: Maybe FirewallRuleGroupAssociation
firewallRuleGroupAssociation =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:AssociateFirewallRuleGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The association that you just created. The association has an ID that
-- you can use to identify it in other requests, like update and delete.
associateFirewallRuleGroupResponse_firewallRuleGroupAssociation :: Lens.Lens' AssociateFirewallRuleGroupResponse (Prelude.Maybe FirewallRuleGroupAssociation)
associateFirewallRuleGroupResponse_firewallRuleGroupAssociation :: Lens'
  AssociateFirewallRuleGroupResponse
  (Maybe FirewallRuleGroupAssociation)
associateFirewallRuleGroupResponse_firewallRuleGroupAssociation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateFirewallRuleGroupResponse' {Maybe FirewallRuleGroupAssociation
firewallRuleGroupAssociation :: Maybe FirewallRuleGroupAssociation
$sel:firewallRuleGroupAssociation:AssociateFirewallRuleGroupResponse' :: AssociateFirewallRuleGroupResponse
-> Maybe FirewallRuleGroupAssociation
firewallRuleGroupAssociation} -> Maybe FirewallRuleGroupAssociation
firewallRuleGroupAssociation) (\s :: AssociateFirewallRuleGroupResponse
s@AssociateFirewallRuleGroupResponse' {} Maybe FirewallRuleGroupAssociation
a -> AssociateFirewallRuleGroupResponse
s {$sel:firewallRuleGroupAssociation:AssociateFirewallRuleGroupResponse' :: Maybe FirewallRuleGroupAssociation
firewallRuleGroupAssociation = Maybe FirewallRuleGroupAssociation
a} :: AssociateFirewallRuleGroupResponse)

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

instance
  Prelude.NFData
    AssociateFirewallRuleGroupResponse
  where
  rnf :: AssociateFirewallRuleGroupResponse -> ()
rnf AssociateFirewallRuleGroupResponse' {Int
Maybe FirewallRuleGroupAssociation
httpStatus :: Int
firewallRuleGroupAssociation :: Maybe FirewallRuleGroupAssociation
$sel:httpStatus:AssociateFirewallRuleGroupResponse' :: AssociateFirewallRuleGroupResponse -> Int
$sel:firewallRuleGroupAssociation:AssociateFirewallRuleGroupResponse' :: AssociateFirewallRuleGroupResponse
-> Maybe FirewallRuleGroupAssociation
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe FirewallRuleGroupAssociation
firewallRuleGroupAssociation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus