{-# 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 #-}
module Amazonka.Route53Resolver.PutFirewallRuleGroupPolicy
(
PutFirewallRuleGroupPolicy (..),
newPutFirewallRuleGroupPolicy,
putFirewallRuleGroupPolicy_arn,
putFirewallRuleGroupPolicy_firewallRuleGroupPolicy,
PutFirewallRuleGroupPolicyResponse (..),
newPutFirewallRuleGroupPolicyResponse,
putFirewallRuleGroupPolicyResponse_returnValue,
putFirewallRuleGroupPolicyResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Route53Resolver.Types
data PutFirewallRuleGroupPolicy = PutFirewallRuleGroupPolicy'
{
PutFirewallRuleGroupPolicy -> Text
arn :: Prelude.Text,
PutFirewallRuleGroupPolicy -> Text
firewallRuleGroupPolicy :: Prelude.Text
}
deriving (PutFirewallRuleGroupPolicy -> PutFirewallRuleGroupPolicy -> Bool
(PutFirewallRuleGroupPolicy -> PutFirewallRuleGroupPolicy -> Bool)
-> (PutFirewallRuleGroupPolicy
-> PutFirewallRuleGroupPolicy -> Bool)
-> Eq PutFirewallRuleGroupPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutFirewallRuleGroupPolicy -> PutFirewallRuleGroupPolicy -> Bool
$c/= :: PutFirewallRuleGroupPolicy -> PutFirewallRuleGroupPolicy -> Bool
== :: PutFirewallRuleGroupPolicy -> PutFirewallRuleGroupPolicy -> Bool
$c== :: PutFirewallRuleGroupPolicy -> PutFirewallRuleGroupPolicy -> Bool
Prelude.Eq, ReadPrec [PutFirewallRuleGroupPolicy]
ReadPrec PutFirewallRuleGroupPolicy
Int -> ReadS PutFirewallRuleGroupPolicy
ReadS [PutFirewallRuleGroupPolicy]
(Int -> ReadS PutFirewallRuleGroupPolicy)
-> ReadS [PutFirewallRuleGroupPolicy]
-> ReadPrec PutFirewallRuleGroupPolicy
-> ReadPrec [PutFirewallRuleGroupPolicy]
-> Read PutFirewallRuleGroupPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutFirewallRuleGroupPolicy]
$creadListPrec :: ReadPrec [PutFirewallRuleGroupPolicy]
readPrec :: ReadPrec PutFirewallRuleGroupPolicy
$creadPrec :: ReadPrec PutFirewallRuleGroupPolicy
readList :: ReadS [PutFirewallRuleGroupPolicy]
$creadList :: ReadS [PutFirewallRuleGroupPolicy]
readsPrec :: Int -> ReadS PutFirewallRuleGroupPolicy
$creadsPrec :: Int -> ReadS PutFirewallRuleGroupPolicy
Prelude.Read, Int -> PutFirewallRuleGroupPolicy -> ShowS
[PutFirewallRuleGroupPolicy] -> ShowS
PutFirewallRuleGroupPolicy -> String
(Int -> PutFirewallRuleGroupPolicy -> ShowS)
-> (PutFirewallRuleGroupPolicy -> String)
-> ([PutFirewallRuleGroupPolicy] -> ShowS)
-> Show PutFirewallRuleGroupPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutFirewallRuleGroupPolicy] -> ShowS
$cshowList :: [PutFirewallRuleGroupPolicy] -> ShowS
show :: PutFirewallRuleGroupPolicy -> String
$cshow :: PutFirewallRuleGroupPolicy -> String
showsPrec :: Int -> PutFirewallRuleGroupPolicy -> ShowS
$cshowsPrec :: Int -> PutFirewallRuleGroupPolicy -> ShowS
Prelude.Show, (forall x.
PutFirewallRuleGroupPolicy -> Rep PutFirewallRuleGroupPolicy x)
-> (forall x.
Rep PutFirewallRuleGroupPolicy x -> PutFirewallRuleGroupPolicy)
-> Generic PutFirewallRuleGroupPolicy
forall x.
Rep PutFirewallRuleGroupPolicy x -> PutFirewallRuleGroupPolicy
forall x.
PutFirewallRuleGroupPolicy -> Rep PutFirewallRuleGroupPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutFirewallRuleGroupPolicy x -> PutFirewallRuleGroupPolicy
$cfrom :: forall x.
PutFirewallRuleGroupPolicy -> Rep PutFirewallRuleGroupPolicy x
Prelude.Generic)
newPutFirewallRuleGroupPolicy ::
Prelude.Text ->
Prelude.Text ->
PutFirewallRuleGroupPolicy
newPutFirewallRuleGroupPolicy :: Text -> Text -> PutFirewallRuleGroupPolicy
newPutFirewallRuleGroupPolicy
Text
pArn_
Text
pFirewallRuleGroupPolicy_ =
PutFirewallRuleGroupPolicy' :: Text -> Text -> PutFirewallRuleGroupPolicy
PutFirewallRuleGroupPolicy'
{ $sel:arn:PutFirewallRuleGroupPolicy' :: Text
arn = Text
pArn_,
$sel:firewallRuleGroupPolicy:PutFirewallRuleGroupPolicy' :: Text
firewallRuleGroupPolicy =
Text
pFirewallRuleGroupPolicy_
}
putFirewallRuleGroupPolicy_arn :: Lens.Lens' PutFirewallRuleGroupPolicy Prelude.Text
putFirewallRuleGroupPolicy_arn :: (Text -> f Text)
-> PutFirewallRuleGroupPolicy -> f PutFirewallRuleGroupPolicy
putFirewallRuleGroupPolicy_arn = (PutFirewallRuleGroupPolicy -> Text)
-> (PutFirewallRuleGroupPolicy
-> Text -> PutFirewallRuleGroupPolicy)
-> Lens
PutFirewallRuleGroupPolicy PutFirewallRuleGroupPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFirewallRuleGroupPolicy' {Text
arn :: Text
$sel:arn:PutFirewallRuleGroupPolicy' :: PutFirewallRuleGroupPolicy -> Text
arn} -> Text
arn) (\s :: PutFirewallRuleGroupPolicy
s@PutFirewallRuleGroupPolicy' {} Text
a -> PutFirewallRuleGroupPolicy
s {$sel:arn:PutFirewallRuleGroupPolicy' :: Text
arn = Text
a} :: PutFirewallRuleGroupPolicy)
putFirewallRuleGroupPolicy_firewallRuleGroupPolicy :: Lens.Lens' PutFirewallRuleGroupPolicy Prelude.Text
putFirewallRuleGroupPolicy_firewallRuleGroupPolicy :: (Text -> f Text)
-> PutFirewallRuleGroupPolicy -> f PutFirewallRuleGroupPolicy
putFirewallRuleGroupPolicy_firewallRuleGroupPolicy = (PutFirewallRuleGroupPolicy -> Text)
-> (PutFirewallRuleGroupPolicy
-> Text -> PutFirewallRuleGroupPolicy)
-> Lens
PutFirewallRuleGroupPolicy PutFirewallRuleGroupPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFirewallRuleGroupPolicy' {Text
firewallRuleGroupPolicy :: Text
$sel:firewallRuleGroupPolicy:PutFirewallRuleGroupPolicy' :: PutFirewallRuleGroupPolicy -> Text
firewallRuleGroupPolicy} -> Text
firewallRuleGroupPolicy) (\s :: PutFirewallRuleGroupPolicy
s@PutFirewallRuleGroupPolicy' {} Text
a -> PutFirewallRuleGroupPolicy
s {$sel:firewallRuleGroupPolicy:PutFirewallRuleGroupPolicy' :: Text
firewallRuleGroupPolicy = Text
a} :: PutFirewallRuleGroupPolicy)
instance Core.AWSRequest PutFirewallRuleGroupPolicy where
type
AWSResponse PutFirewallRuleGroupPolicy =
PutFirewallRuleGroupPolicyResponse
request :: PutFirewallRuleGroupPolicy -> Request PutFirewallRuleGroupPolicy
request = Service
-> PutFirewallRuleGroupPolicy -> Request PutFirewallRuleGroupPolicy
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutFirewallRuleGroupPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutFirewallRuleGroupPolicy)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse PutFirewallRuleGroupPolicy))
-> Logger
-> Service
-> Proxy PutFirewallRuleGroupPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutFirewallRuleGroupPolicy)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Bool -> Int -> PutFirewallRuleGroupPolicyResponse
PutFirewallRuleGroupPolicyResponse'
(Maybe Bool -> Int -> PutFirewallRuleGroupPolicyResponse)
-> Either String (Maybe Bool)
-> Either String (Int -> PutFirewallRuleGroupPolicyResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ReturnValue")
Either String (Int -> PutFirewallRuleGroupPolicyResponse)
-> Either String Int
-> Either String PutFirewallRuleGroupPolicyResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable PutFirewallRuleGroupPolicy
instance Prelude.NFData PutFirewallRuleGroupPolicy
instance Core.ToHeaders PutFirewallRuleGroupPolicy where
toHeaders :: PutFirewallRuleGroupPolicy -> ResponseHeaders
toHeaders =
ResponseHeaders -> PutFirewallRuleGroupPolicy -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Route53Resolver.PutFirewallRuleGroupPolicy" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON PutFirewallRuleGroupPolicy where
toJSON :: PutFirewallRuleGroupPolicy -> Value
toJSON PutFirewallRuleGroupPolicy' {Text
firewallRuleGroupPolicy :: Text
arn :: Text
$sel:firewallRuleGroupPolicy:PutFirewallRuleGroupPolicy' :: PutFirewallRuleGroupPolicy -> Text
$sel:arn:PutFirewallRuleGroupPolicy' :: PutFirewallRuleGroupPolicy -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"FirewallRuleGroupPolicy"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
firewallRuleGroupPolicy
)
]
)
instance Core.ToPath PutFirewallRuleGroupPolicy where
toPath :: PutFirewallRuleGroupPolicy -> ByteString
toPath = ByteString -> PutFirewallRuleGroupPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutFirewallRuleGroupPolicy where
toQuery :: PutFirewallRuleGroupPolicy -> QueryString
toQuery = QueryString -> PutFirewallRuleGroupPolicy -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutFirewallRuleGroupPolicyResponse = PutFirewallRuleGroupPolicyResponse'
{ PutFirewallRuleGroupPolicyResponse -> Maybe Bool
returnValue :: Prelude.Maybe Prelude.Bool,
PutFirewallRuleGroupPolicyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutFirewallRuleGroupPolicyResponse
-> PutFirewallRuleGroupPolicyResponse -> Bool
(PutFirewallRuleGroupPolicyResponse
-> PutFirewallRuleGroupPolicyResponse -> Bool)
-> (PutFirewallRuleGroupPolicyResponse
-> PutFirewallRuleGroupPolicyResponse -> Bool)
-> Eq PutFirewallRuleGroupPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutFirewallRuleGroupPolicyResponse
-> PutFirewallRuleGroupPolicyResponse -> Bool
$c/= :: PutFirewallRuleGroupPolicyResponse
-> PutFirewallRuleGroupPolicyResponse -> Bool
== :: PutFirewallRuleGroupPolicyResponse
-> PutFirewallRuleGroupPolicyResponse -> Bool
$c== :: PutFirewallRuleGroupPolicyResponse
-> PutFirewallRuleGroupPolicyResponse -> Bool
Prelude.Eq, ReadPrec [PutFirewallRuleGroupPolicyResponse]
ReadPrec PutFirewallRuleGroupPolicyResponse
Int -> ReadS PutFirewallRuleGroupPolicyResponse
ReadS [PutFirewallRuleGroupPolicyResponse]
(Int -> ReadS PutFirewallRuleGroupPolicyResponse)
-> ReadS [PutFirewallRuleGroupPolicyResponse]
-> ReadPrec PutFirewallRuleGroupPolicyResponse
-> ReadPrec [PutFirewallRuleGroupPolicyResponse]
-> Read PutFirewallRuleGroupPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutFirewallRuleGroupPolicyResponse]
$creadListPrec :: ReadPrec [PutFirewallRuleGroupPolicyResponse]
readPrec :: ReadPrec PutFirewallRuleGroupPolicyResponse
$creadPrec :: ReadPrec PutFirewallRuleGroupPolicyResponse
readList :: ReadS [PutFirewallRuleGroupPolicyResponse]
$creadList :: ReadS [PutFirewallRuleGroupPolicyResponse]
readsPrec :: Int -> ReadS PutFirewallRuleGroupPolicyResponse
$creadsPrec :: Int -> ReadS PutFirewallRuleGroupPolicyResponse
Prelude.Read, Int -> PutFirewallRuleGroupPolicyResponse -> ShowS
[PutFirewallRuleGroupPolicyResponse] -> ShowS
PutFirewallRuleGroupPolicyResponse -> String
(Int -> PutFirewallRuleGroupPolicyResponse -> ShowS)
-> (PutFirewallRuleGroupPolicyResponse -> String)
-> ([PutFirewallRuleGroupPolicyResponse] -> ShowS)
-> Show PutFirewallRuleGroupPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutFirewallRuleGroupPolicyResponse] -> ShowS
$cshowList :: [PutFirewallRuleGroupPolicyResponse] -> ShowS
show :: PutFirewallRuleGroupPolicyResponse -> String
$cshow :: PutFirewallRuleGroupPolicyResponse -> String
showsPrec :: Int -> PutFirewallRuleGroupPolicyResponse -> ShowS
$cshowsPrec :: Int -> PutFirewallRuleGroupPolicyResponse -> ShowS
Prelude.Show, (forall x.
PutFirewallRuleGroupPolicyResponse
-> Rep PutFirewallRuleGroupPolicyResponse x)
-> (forall x.
Rep PutFirewallRuleGroupPolicyResponse x
-> PutFirewallRuleGroupPolicyResponse)
-> Generic PutFirewallRuleGroupPolicyResponse
forall x.
Rep PutFirewallRuleGroupPolicyResponse x
-> PutFirewallRuleGroupPolicyResponse
forall x.
PutFirewallRuleGroupPolicyResponse
-> Rep PutFirewallRuleGroupPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutFirewallRuleGroupPolicyResponse x
-> PutFirewallRuleGroupPolicyResponse
$cfrom :: forall x.
PutFirewallRuleGroupPolicyResponse
-> Rep PutFirewallRuleGroupPolicyResponse x
Prelude.Generic)
newPutFirewallRuleGroupPolicyResponse ::
Prelude.Int ->
PutFirewallRuleGroupPolicyResponse
newPutFirewallRuleGroupPolicyResponse :: Int -> PutFirewallRuleGroupPolicyResponse
newPutFirewallRuleGroupPolicyResponse Int
pHttpStatus_ =
PutFirewallRuleGroupPolicyResponse' :: Maybe Bool -> Int -> PutFirewallRuleGroupPolicyResponse
PutFirewallRuleGroupPolicyResponse'
{ $sel:returnValue:PutFirewallRuleGroupPolicyResponse' :: Maybe Bool
returnValue =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PutFirewallRuleGroupPolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
}
putFirewallRuleGroupPolicyResponse_returnValue :: Lens.Lens' PutFirewallRuleGroupPolicyResponse (Prelude.Maybe Prelude.Bool)
putFirewallRuleGroupPolicyResponse_returnValue :: (Maybe Bool -> f (Maybe Bool))
-> PutFirewallRuleGroupPolicyResponse
-> f PutFirewallRuleGroupPolicyResponse
putFirewallRuleGroupPolicyResponse_returnValue = (PutFirewallRuleGroupPolicyResponse -> Maybe Bool)
-> (PutFirewallRuleGroupPolicyResponse
-> Maybe Bool -> PutFirewallRuleGroupPolicyResponse)
-> Lens
PutFirewallRuleGroupPolicyResponse
PutFirewallRuleGroupPolicyResponse
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFirewallRuleGroupPolicyResponse' {Maybe Bool
returnValue :: Maybe Bool
$sel:returnValue:PutFirewallRuleGroupPolicyResponse' :: PutFirewallRuleGroupPolicyResponse -> Maybe Bool
returnValue} -> Maybe Bool
returnValue) (\s :: PutFirewallRuleGroupPolicyResponse
s@PutFirewallRuleGroupPolicyResponse' {} Maybe Bool
a -> PutFirewallRuleGroupPolicyResponse
s {$sel:returnValue:PutFirewallRuleGroupPolicyResponse' :: Maybe Bool
returnValue = Maybe Bool
a} :: PutFirewallRuleGroupPolicyResponse)
putFirewallRuleGroupPolicyResponse_httpStatus :: Lens.Lens' PutFirewallRuleGroupPolicyResponse Prelude.Int
putFirewallRuleGroupPolicyResponse_httpStatus :: (Int -> f Int)
-> PutFirewallRuleGroupPolicyResponse
-> f PutFirewallRuleGroupPolicyResponse
putFirewallRuleGroupPolicyResponse_httpStatus = (PutFirewallRuleGroupPolicyResponse -> Int)
-> (PutFirewallRuleGroupPolicyResponse
-> Int -> PutFirewallRuleGroupPolicyResponse)
-> Lens
PutFirewallRuleGroupPolicyResponse
PutFirewallRuleGroupPolicyResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFirewallRuleGroupPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutFirewallRuleGroupPolicyResponse' :: PutFirewallRuleGroupPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutFirewallRuleGroupPolicyResponse
s@PutFirewallRuleGroupPolicyResponse' {} Int
a -> PutFirewallRuleGroupPolicyResponse
s {$sel:httpStatus:PutFirewallRuleGroupPolicyResponse' :: Int
httpStatus = Int
a} :: PutFirewallRuleGroupPolicyResponse)
instance
Prelude.NFData
PutFirewallRuleGroupPolicyResponse