{-# 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.GetFirewallRuleGroupPolicy
(
GetFirewallRuleGroupPolicy (..),
newGetFirewallRuleGroupPolicy,
getFirewallRuleGroupPolicy_arn,
GetFirewallRuleGroupPolicyResponse (..),
newGetFirewallRuleGroupPolicyResponse,
getFirewallRuleGroupPolicyResponse_firewallRuleGroupPolicy,
getFirewallRuleGroupPolicyResponse_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 GetFirewallRuleGroupPolicy = GetFirewallRuleGroupPolicy'
{
GetFirewallRuleGroupPolicy -> Text
arn :: Prelude.Text
}
deriving (GetFirewallRuleGroupPolicy -> GetFirewallRuleGroupPolicy -> Bool
(GetFirewallRuleGroupPolicy -> GetFirewallRuleGroupPolicy -> Bool)
-> (GetFirewallRuleGroupPolicy
-> GetFirewallRuleGroupPolicy -> Bool)
-> Eq GetFirewallRuleGroupPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetFirewallRuleGroupPolicy -> GetFirewallRuleGroupPolicy -> Bool
$c/= :: GetFirewallRuleGroupPolicy -> GetFirewallRuleGroupPolicy -> Bool
== :: GetFirewallRuleGroupPolicy -> GetFirewallRuleGroupPolicy -> Bool
$c== :: GetFirewallRuleGroupPolicy -> GetFirewallRuleGroupPolicy -> Bool
Prelude.Eq, ReadPrec [GetFirewallRuleGroupPolicy]
ReadPrec GetFirewallRuleGroupPolicy
Int -> ReadS GetFirewallRuleGroupPolicy
ReadS [GetFirewallRuleGroupPolicy]
(Int -> ReadS GetFirewallRuleGroupPolicy)
-> ReadS [GetFirewallRuleGroupPolicy]
-> ReadPrec GetFirewallRuleGroupPolicy
-> ReadPrec [GetFirewallRuleGroupPolicy]
-> Read GetFirewallRuleGroupPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetFirewallRuleGroupPolicy]
$creadListPrec :: ReadPrec [GetFirewallRuleGroupPolicy]
readPrec :: ReadPrec GetFirewallRuleGroupPolicy
$creadPrec :: ReadPrec GetFirewallRuleGroupPolicy
readList :: ReadS [GetFirewallRuleGroupPolicy]
$creadList :: ReadS [GetFirewallRuleGroupPolicy]
readsPrec :: Int -> ReadS GetFirewallRuleGroupPolicy
$creadsPrec :: Int -> ReadS GetFirewallRuleGroupPolicy
Prelude.Read, Int -> GetFirewallRuleGroupPolicy -> ShowS
[GetFirewallRuleGroupPolicy] -> ShowS
GetFirewallRuleGroupPolicy -> String
(Int -> GetFirewallRuleGroupPolicy -> ShowS)
-> (GetFirewallRuleGroupPolicy -> String)
-> ([GetFirewallRuleGroupPolicy] -> ShowS)
-> Show GetFirewallRuleGroupPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetFirewallRuleGroupPolicy] -> ShowS
$cshowList :: [GetFirewallRuleGroupPolicy] -> ShowS
show :: GetFirewallRuleGroupPolicy -> String
$cshow :: GetFirewallRuleGroupPolicy -> String
showsPrec :: Int -> GetFirewallRuleGroupPolicy -> ShowS
$cshowsPrec :: Int -> GetFirewallRuleGroupPolicy -> ShowS
Prelude.Show, (forall x.
GetFirewallRuleGroupPolicy -> Rep GetFirewallRuleGroupPolicy x)
-> (forall x.
Rep GetFirewallRuleGroupPolicy x -> GetFirewallRuleGroupPolicy)
-> Generic GetFirewallRuleGroupPolicy
forall x.
Rep GetFirewallRuleGroupPolicy x -> GetFirewallRuleGroupPolicy
forall x.
GetFirewallRuleGroupPolicy -> Rep GetFirewallRuleGroupPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetFirewallRuleGroupPolicy x -> GetFirewallRuleGroupPolicy
$cfrom :: forall x.
GetFirewallRuleGroupPolicy -> Rep GetFirewallRuleGroupPolicy x
Prelude.Generic)
newGetFirewallRuleGroupPolicy ::
Prelude.Text ->
GetFirewallRuleGroupPolicy
newGetFirewallRuleGroupPolicy :: Text -> GetFirewallRuleGroupPolicy
newGetFirewallRuleGroupPolicy Text
pArn_ =
GetFirewallRuleGroupPolicy' :: Text -> GetFirewallRuleGroupPolicy
GetFirewallRuleGroupPolicy' {$sel:arn:GetFirewallRuleGroupPolicy' :: Text
arn = Text
pArn_}
getFirewallRuleGroupPolicy_arn :: Lens.Lens' GetFirewallRuleGroupPolicy Prelude.Text
getFirewallRuleGroupPolicy_arn :: (Text -> f Text)
-> GetFirewallRuleGroupPolicy -> f GetFirewallRuleGroupPolicy
getFirewallRuleGroupPolicy_arn = (GetFirewallRuleGroupPolicy -> Text)
-> (GetFirewallRuleGroupPolicy
-> Text -> GetFirewallRuleGroupPolicy)
-> Lens
GetFirewallRuleGroupPolicy GetFirewallRuleGroupPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFirewallRuleGroupPolicy' {Text
arn :: Text
$sel:arn:GetFirewallRuleGroupPolicy' :: GetFirewallRuleGroupPolicy -> Text
arn} -> Text
arn) (\s :: GetFirewallRuleGroupPolicy
s@GetFirewallRuleGroupPolicy' {} Text
a -> GetFirewallRuleGroupPolicy
s {$sel:arn:GetFirewallRuleGroupPolicy' :: Text
arn = Text
a} :: GetFirewallRuleGroupPolicy)
instance Core.AWSRequest GetFirewallRuleGroupPolicy where
type
AWSResponse GetFirewallRuleGroupPolicy =
GetFirewallRuleGroupPolicyResponse
request :: GetFirewallRuleGroupPolicy -> Request GetFirewallRuleGroupPolicy
request = Service
-> GetFirewallRuleGroupPolicy -> Request GetFirewallRuleGroupPolicy
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetFirewallRuleGroupPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetFirewallRuleGroupPolicy)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetFirewallRuleGroupPolicy))
-> Logger
-> Service
-> Proxy GetFirewallRuleGroupPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetFirewallRuleGroupPolicy)))
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 Text -> Int -> GetFirewallRuleGroupPolicyResponse
GetFirewallRuleGroupPolicyResponse'
(Maybe Text -> Int -> GetFirewallRuleGroupPolicyResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetFirewallRuleGroupPolicyResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FirewallRuleGroupPolicy")
Either String (Int -> GetFirewallRuleGroupPolicyResponse)
-> Either String Int
-> Either String GetFirewallRuleGroupPolicyResponse
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 GetFirewallRuleGroupPolicy
instance Prelude.NFData GetFirewallRuleGroupPolicy
instance Core.ToHeaders GetFirewallRuleGroupPolicy where
toHeaders :: GetFirewallRuleGroupPolicy -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetFirewallRuleGroupPolicy -> 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.GetFirewallRuleGroupPolicy" ::
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 GetFirewallRuleGroupPolicy where
toJSON :: GetFirewallRuleGroupPolicy -> Value
toJSON GetFirewallRuleGroupPolicy' {Text
arn :: Text
$sel:arn:GetFirewallRuleGroupPolicy' :: GetFirewallRuleGroupPolicy -> 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)]
)
instance Core.ToPath GetFirewallRuleGroupPolicy where
toPath :: GetFirewallRuleGroupPolicy -> ByteString
toPath = ByteString -> GetFirewallRuleGroupPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetFirewallRuleGroupPolicy where
toQuery :: GetFirewallRuleGroupPolicy -> QueryString
toQuery = QueryString -> GetFirewallRuleGroupPolicy -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetFirewallRuleGroupPolicyResponse = GetFirewallRuleGroupPolicyResponse'
{
GetFirewallRuleGroupPolicyResponse -> Maybe Text
firewallRuleGroupPolicy :: Prelude.Maybe Prelude.Text,
GetFirewallRuleGroupPolicyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetFirewallRuleGroupPolicyResponse
-> GetFirewallRuleGroupPolicyResponse -> Bool
(GetFirewallRuleGroupPolicyResponse
-> GetFirewallRuleGroupPolicyResponse -> Bool)
-> (GetFirewallRuleGroupPolicyResponse
-> GetFirewallRuleGroupPolicyResponse -> Bool)
-> Eq GetFirewallRuleGroupPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetFirewallRuleGroupPolicyResponse
-> GetFirewallRuleGroupPolicyResponse -> Bool
$c/= :: GetFirewallRuleGroupPolicyResponse
-> GetFirewallRuleGroupPolicyResponse -> Bool
== :: GetFirewallRuleGroupPolicyResponse
-> GetFirewallRuleGroupPolicyResponse -> Bool
$c== :: GetFirewallRuleGroupPolicyResponse
-> GetFirewallRuleGroupPolicyResponse -> Bool
Prelude.Eq, ReadPrec [GetFirewallRuleGroupPolicyResponse]
ReadPrec GetFirewallRuleGroupPolicyResponse
Int -> ReadS GetFirewallRuleGroupPolicyResponse
ReadS [GetFirewallRuleGroupPolicyResponse]
(Int -> ReadS GetFirewallRuleGroupPolicyResponse)
-> ReadS [GetFirewallRuleGroupPolicyResponse]
-> ReadPrec GetFirewallRuleGroupPolicyResponse
-> ReadPrec [GetFirewallRuleGroupPolicyResponse]
-> Read GetFirewallRuleGroupPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetFirewallRuleGroupPolicyResponse]
$creadListPrec :: ReadPrec [GetFirewallRuleGroupPolicyResponse]
readPrec :: ReadPrec GetFirewallRuleGroupPolicyResponse
$creadPrec :: ReadPrec GetFirewallRuleGroupPolicyResponse
readList :: ReadS [GetFirewallRuleGroupPolicyResponse]
$creadList :: ReadS [GetFirewallRuleGroupPolicyResponse]
readsPrec :: Int -> ReadS GetFirewallRuleGroupPolicyResponse
$creadsPrec :: Int -> ReadS GetFirewallRuleGroupPolicyResponse
Prelude.Read, Int -> GetFirewallRuleGroupPolicyResponse -> ShowS
[GetFirewallRuleGroupPolicyResponse] -> ShowS
GetFirewallRuleGroupPolicyResponse -> String
(Int -> GetFirewallRuleGroupPolicyResponse -> ShowS)
-> (GetFirewallRuleGroupPolicyResponse -> String)
-> ([GetFirewallRuleGroupPolicyResponse] -> ShowS)
-> Show GetFirewallRuleGroupPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetFirewallRuleGroupPolicyResponse] -> ShowS
$cshowList :: [GetFirewallRuleGroupPolicyResponse] -> ShowS
show :: GetFirewallRuleGroupPolicyResponse -> String
$cshow :: GetFirewallRuleGroupPolicyResponse -> String
showsPrec :: Int -> GetFirewallRuleGroupPolicyResponse -> ShowS
$cshowsPrec :: Int -> GetFirewallRuleGroupPolicyResponse -> ShowS
Prelude.Show, (forall x.
GetFirewallRuleGroupPolicyResponse
-> Rep GetFirewallRuleGroupPolicyResponse x)
-> (forall x.
Rep GetFirewallRuleGroupPolicyResponse x
-> GetFirewallRuleGroupPolicyResponse)
-> Generic GetFirewallRuleGroupPolicyResponse
forall x.
Rep GetFirewallRuleGroupPolicyResponse x
-> GetFirewallRuleGroupPolicyResponse
forall x.
GetFirewallRuleGroupPolicyResponse
-> Rep GetFirewallRuleGroupPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetFirewallRuleGroupPolicyResponse x
-> GetFirewallRuleGroupPolicyResponse
$cfrom :: forall x.
GetFirewallRuleGroupPolicyResponse
-> Rep GetFirewallRuleGroupPolicyResponse x
Prelude.Generic)
newGetFirewallRuleGroupPolicyResponse ::
Prelude.Int ->
GetFirewallRuleGroupPolicyResponse
newGetFirewallRuleGroupPolicyResponse :: Int -> GetFirewallRuleGroupPolicyResponse
newGetFirewallRuleGroupPolicyResponse Int
pHttpStatus_ =
GetFirewallRuleGroupPolicyResponse' :: Maybe Text -> Int -> GetFirewallRuleGroupPolicyResponse
GetFirewallRuleGroupPolicyResponse'
{ $sel:firewallRuleGroupPolicy:GetFirewallRuleGroupPolicyResponse' :: Maybe Text
firewallRuleGroupPolicy =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetFirewallRuleGroupPolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getFirewallRuleGroupPolicyResponse_firewallRuleGroupPolicy :: Lens.Lens' GetFirewallRuleGroupPolicyResponse (Prelude.Maybe Prelude.Text)
getFirewallRuleGroupPolicyResponse_firewallRuleGroupPolicy :: (Maybe Text -> f (Maybe Text))
-> GetFirewallRuleGroupPolicyResponse
-> f GetFirewallRuleGroupPolicyResponse
getFirewallRuleGroupPolicyResponse_firewallRuleGroupPolicy = (GetFirewallRuleGroupPolicyResponse -> Maybe Text)
-> (GetFirewallRuleGroupPolicyResponse
-> Maybe Text -> GetFirewallRuleGroupPolicyResponse)
-> Lens
GetFirewallRuleGroupPolicyResponse
GetFirewallRuleGroupPolicyResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFirewallRuleGroupPolicyResponse' {Maybe Text
firewallRuleGroupPolicy :: Maybe Text
$sel:firewallRuleGroupPolicy:GetFirewallRuleGroupPolicyResponse' :: GetFirewallRuleGroupPolicyResponse -> Maybe Text
firewallRuleGroupPolicy} -> Maybe Text
firewallRuleGroupPolicy) (\s :: GetFirewallRuleGroupPolicyResponse
s@GetFirewallRuleGroupPolicyResponse' {} Maybe Text
a -> GetFirewallRuleGroupPolicyResponse
s {$sel:firewallRuleGroupPolicy:GetFirewallRuleGroupPolicyResponse' :: Maybe Text
firewallRuleGroupPolicy = Maybe Text
a} :: GetFirewallRuleGroupPolicyResponse)
getFirewallRuleGroupPolicyResponse_httpStatus :: Lens.Lens' GetFirewallRuleGroupPolicyResponse Prelude.Int
getFirewallRuleGroupPolicyResponse_httpStatus :: (Int -> f Int)
-> GetFirewallRuleGroupPolicyResponse
-> f GetFirewallRuleGroupPolicyResponse
getFirewallRuleGroupPolicyResponse_httpStatus = (GetFirewallRuleGroupPolicyResponse -> Int)
-> (GetFirewallRuleGroupPolicyResponse
-> Int -> GetFirewallRuleGroupPolicyResponse)
-> Lens
GetFirewallRuleGroupPolicyResponse
GetFirewallRuleGroupPolicyResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFirewallRuleGroupPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetFirewallRuleGroupPolicyResponse' :: GetFirewallRuleGroupPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetFirewallRuleGroupPolicyResponse
s@GetFirewallRuleGroupPolicyResponse' {} Int
a -> GetFirewallRuleGroupPolicyResponse
s {$sel:httpStatus:GetFirewallRuleGroupPolicyResponse' :: Int
httpStatus = Int
a} :: GetFirewallRuleGroupPolicyResponse)
instance
Prelude.NFData
GetFirewallRuleGroupPolicyResponse