{-# 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.NetworkFirewall.DescribeRuleGroup
(
DescribeRuleGroup (..),
newDescribeRuleGroup,
describeRuleGroup_ruleGroupArn,
describeRuleGroup_ruleGroupName,
describeRuleGroup_type,
DescribeRuleGroupResponse (..),
newDescribeRuleGroupResponse,
describeRuleGroupResponse_ruleGroup,
describeRuleGroupResponse_httpStatus,
describeRuleGroupResponse_updateToken,
describeRuleGroupResponse_ruleGroupResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.NetworkFirewall.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeRuleGroup = DescribeRuleGroup'
{
DescribeRuleGroup -> Maybe Text
ruleGroupArn :: Prelude.Maybe Prelude.Text,
DescribeRuleGroup -> Maybe Text
ruleGroupName :: Prelude.Maybe Prelude.Text,
DescribeRuleGroup -> Maybe RuleGroupType
type' :: Prelude.Maybe RuleGroupType
}
deriving (DescribeRuleGroup -> DescribeRuleGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRuleGroup -> DescribeRuleGroup -> Bool
$c/= :: DescribeRuleGroup -> DescribeRuleGroup -> Bool
== :: DescribeRuleGroup -> DescribeRuleGroup -> Bool
$c== :: DescribeRuleGroup -> DescribeRuleGroup -> Bool
Prelude.Eq, ReadPrec [DescribeRuleGroup]
ReadPrec DescribeRuleGroup
Int -> ReadS DescribeRuleGroup
ReadS [DescribeRuleGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRuleGroup]
$creadListPrec :: ReadPrec [DescribeRuleGroup]
readPrec :: ReadPrec DescribeRuleGroup
$creadPrec :: ReadPrec DescribeRuleGroup
readList :: ReadS [DescribeRuleGroup]
$creadList :: ReadS [DescribeRuleGroup]
readsPrec :: Int -> ReadS DescribeRuleGroup
$creadsPrec :: Int -> ReadS DescribeRuleGroup
Prelude.Read, Int -> DescribeRuleGroup -> ShowS
[DescribeRuleGroup] -> ShowS
DescribeRuleGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRuleGroup] -> ShowS
$cshowList :: [DescribeRuleGroup] -> ShowS
show :: DescribeRuleGroup -> String
$cshow :: DescribeRuleGroup -> String
showsPrec :: Int -> DescribeRuleGroup -> ShowS
$cshowsPrec :: Int -> DescribeRuleGroup -> ShowS
Prelude.Show, forall x. Rep DescribeRuleGroup x -> DescribeRuleGroup
forall x. DescribeRuleGroup -> Rep DescribeRuleGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeRuleGroup x -> DescribeRuleGroup
$cfrom :: forall x. DescribeRuleGroup -> Rep DescribeRuleGroup x
Prelude.Generic)
newDescribeRuleGroup ::
DescribeRuleGroup
newDescribeRuleGroup :: DescribeRuleGroup
newDescribeRuleGroup =
DescribeRuleGroup'
{ $sel:ruleGroupArn:DescribeRuleGroup' :: Maybe Text
ruleGroupArn = forall a. Maybe a
Prelude.Nothing,
$sel:ruleGroupName:DescribeRuleGroup' :: Maybe Text
ruleGroupName = forall a. Maybe a
Prelude.Nothing,
$sel:type':DescribeRuleGroup' :: Maybe RuleGroupType
type' = forall a. Maybe a
Prelude.Nothing
}
describeRuleGroup_ruleGroupArn :: Lens.Lens' DescribeRuleGroup (Prelude.Maybe Prelude.Text)
describeRuleGroup_ruleGroupArn :: Lens' DescribeRuleGroup (Maybe Text)
describeRuleGroup_ruleGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroup' {Maybe Text
ruleGroupArn :: Maybe Text
$sel:ruleGroupArn:DescribeRuleGroup' :: DescribeRuleGroup -> Maybe Text
ruleGroupArn} -> Maybe Text
ruleGroupArn) (\s :: DescribeRuleGroup
s@DescribeRuleGroup' {} Maybe Text
a -> DescribeRuleGroup
s {$sel:ruleGroupArn:DescribeRuleGroup' :: Maybe Text
ruleGroupArn = Maybe Text
a} :: DescribeRuleGroup)
describeRuleGroup_ruleGroupName :: Lens.Lens' DescribeRuleGroup (Prelude.Maybe Prelude.Text)
describeRuleGroup_ruleGroupName :: Lens' DescribeRuleGroup (Maybe Text)
describeRuleGroup_ruleGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroup' {Maybe Text
ruleGroupName :: Maybe Text
$sel:ruleGroupName:DescribeRuleGroup' :: DescribeRuleGroup -> Maybe Text
ruleGroupName} -> Maybe Text
ruleGroupName) (\s :: DescribeRuleGroup
s@DescribeRuleGroup' {} Maybe Text
a -> DescribeRuleGroup
s {$sel:ruleGroupName:DescribeRuleGroup' :: Maybe Text
ruleGroupName = Maybe Text
a} :: DescribeRuleGroup)
describeRuleGroup_type :: Lens.Lens' DescribeRuleGroup (Prelude.Maybe RuleGroupType)
describeRuleGroup_type :: Lens' DescribeRuleGroup (Maybe RuleGroupType)
describeRuleGroup_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroup' {Maybe RuleGroupType
type' :: Maybe RuleGroupType
$sel:type':DescribeRuleGroup' :: DescribeRuleGroup -> Maybe RuleGroupType
type'} -> Maybe RuleGroupType
type') (\s :: DescribeRuleGroup
s@DescribeRuleGroup' {} Maybe RuleGroupType
a -> DescribeRuleGroup
s {$sel:type':DescribeRuleGroup' :: Maybe RuleGroupType
type' = Maybe RuleGroupType
a} :: DescribeRuleGroup)
instance Core.AWSRequest DescribeRuleGroup where
type
AWSResponse DescribeRuleGroup =
DescribeRuleGroupResponse
request :: (Service -> Service)
-> DescribeRuleGroup -> Request DescribeRuleGroup
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 DescribeRuleGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeRuleGroup)))
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 RuleGroup
-> Int -> Text -> RuleGroupResponse -> DescribeRuleGroupResponse
DescribeRuleGroupResponse'
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
"RuleGroup")
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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"UpdateToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"RuleGroupResponse")
)
instance Prelude.Hashable DescribeRuleGroup where
hashWithSalt :: Int -> DescribeRuleGroup -> Int
hashWithSalt Int
_salt DescribeRuleGroup' {Maybe Text
Maybe RuleGroupType
type' :: Maybe RuleGroupType
ruleGroupName :: Maybe Text
ruleGroupArn :: Maybe Text
$sel:type':DescribeRuleGroup' :: DescribeRuleGroup -> Maybe RuleGroupType
$sel:ruleGroupName:DescribeRuleGroup' :: DescribeRuleGroup -> Maybe Text
$sel:ruleGroupArn:DescribeRuleGroup' :: DescribeRuleGroup -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ruleGroupArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ruleGroupName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RuleGroupType
type'
instance Prelude.NFData DescribeRuleGroup where
rnf :: DescribeRuleGroup -> ()
rnf DescribeRuleGroup' {Maybe Text
Maybe RuleGroupType
type' :: Maybe RuleGroupType
ruleGroupName :: Maybe Text
ruleGroupArn :: Maybe Text
$sel:type':DescribeRuleGroup' :: DescribeRuleGroup -> Maybe RuleGroupType
$sel:ruleGroupName:DescribeRuleGroup' :: DescribeRuleGroup -> Maybe Text
$sel:ruleGroupArn:DescribeRuleGroup' :: DescribeRuleGroup -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ruleGroupArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ruleGroupName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RuleGroupType
type'
instance Data.ToHeaders DescribeRuleGroup where
toHeaders :: DescribeRuleGroup -> 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
"NetworkFirewall_20201112.DescribeRuleGroup" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DescribeRuleGroup where
toJSON :: DescribeRuleGroup -> Value
toJSON DescribeRuleGroup' {Maybe Text
Maybe RuleGroupType
type' :: Maybe RuleGroupType
ruleGroupName :: Maybe Text
ruleGroupArn :: Maybe Text
$sel:type':DescribeRuleGroup' :: DescribeRuleGroup -> Maybe RuleGroupType
$sel:ruleGroupName:DescribeRuleGroup' :: DescribeRuleGroup -> Maybe Text
$sel:ruleGroupArn:DescribeRuleGroup' :: DescribeRuleGroup -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"RuleGroupArn" 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
ruleGroupArn,
(Key
"RuleGroupName" 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
ruleGroupName,
(Key
"Type" 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 RuleGroupType
type'
]
)
instance Data.ToPath DescribeRuleGroup where
toPath :: DescribeRuleGroup -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DescribeRuleGroup where
toQuery :: DescribeRuleGroup -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DescribeRuleGroupResponse = DescribeRuleGroupResponse'
{
DescribeRuleGroupResponse -> Maybe RuleGroup
ruleGroup :: Prelude.Maybe RuleGroup,
DescribeRuleGroupResponse -> Int
httpStatus :: Prelude.Int,
DescribeRuleGroupResponse -> Text
updateToken :: Prelude.Text,
DescribeRuleGroupResponse -> RuleGroupResponse
ruleGroupResponse :: RuleGroupResponse
}
deriving (DescribeRuleGroupResponse -> DescribeRuleGroupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRuleGroupResponse -> DescribeRuleGroupResponse -> Bool
$c/= :: DescribeRuleGroupResponse -> DescribeRuleGroupResponse -> Bool
== :: DescribeRuleGroupResponse -> DescribeRuleGroupResponse -> Bool
$c== :: DescribeRuleGroupResponse -> DescribeRuleGroupResponse -> Bool
Prelude.Eq, ReadPrec [DescribeRuleGroupResponse]
ReadPrec DescribeRuleGroupResponse
Int -> ReadS DescribeRuleGroupResponse
ReadS [DescribeRuleGroupResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRuleGroupResponse]
$creadListPrec :: ReadPrec [DescribeRuleGroupResponse]
readPrec :: ReadPrec DescribeRuleGroupResponse
$creadPrec :: ReadPrec DescribeRuleGroupResponse
readList :: ReadS [DescribeRuleGroupResponse]
$creadList :: ReadS [DescribeRuleGroupResponse]
readsPrec :: Int -> ReadS DescribeRuleGroupResponse
$creadsPrec :: Int -> ReadS DescribeRuleGroupResponse
Prelude.Read, Int -> DescribeRuleGroupResponse -> ShowS
[DescribeRuleGroupResponse] -> ShowS
DescribeRuleGroupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRuleGroupResponse] -> ShowS
$cshowList :: [DescribeRuleGroupResponse] -> ShowS
show :: DescribeRuleGroupResponse -> String
$cshow :: DescribeRuleGroupResponse -> String
showsPrec :: Int -> DescribeRuleGroupResponse -> ShowS
$cshowsPrec :: Int -> DescribeRuleGroupResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeRuleGroupResponse x -> DescribeRuleGroupResponse
forall x.
DescribeRuleGroupResponse -> Rep DescribeRuleGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeRuleGroupResponse x -> DescribeRuleGroupResponse
$cfrom :: forall x.
DescribeRuleGroupResponse -> Rep DescribeRuleGroupResponse x
Prelude.Generic)
newDescribeRuleGroupResponse ::
Prelude.Int ->
Prelude.Text ->
RuleGroupResponse ->
DescribeRuleGroupResponse
newDescribeRuleGroupResponse :: Int -> Text -> RuleGroupResponse -> DescribeRuleGroupResponse
newDescribeRuleGroupResponse
Int
pHttpStatus_
Text
pUpdateToken_
RuleGroupResponse
pRuleGroupResponse_ =
DescribeRuleGroupResponse'
{ $sel:ruleGroup:DescribeRuleGroupResponse' :: Maybe RuleGroup
ruleGroup =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeRuleGroupResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:updateToken:DescribeRuleGroupResponse' :: Text
updateToken = Text
pUpdateToken_,
$sel:ruleGroupResponse:DescribeRuleGroupResponse' :: RuleGroupResponse
ruleGroupResponse = RuleGroupResponse
pRuleGroupResponse_
}
describeRuleGroupResponse_ruleGroup :: Lens.Lens' DescribeRuleGroupResponse (Prelude.Maybe RuleGroup)
describeRuleGroupResponse_ruleGroup :: Lens' DescribeRuleGroupResponse (Maybe RuleGroup)
describeRuleGroupResponse_ruleGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupResponse' {Maybe RuleGroup
ruleGroup :: Maybe RuleGroup
$sel:ruleGroup:DescribeRuleGroupResponse' :: DescribeRuleGroupResponse -> Maybe RuleGroup
ruleGroup} -> Maybe RuleGroup
ruleGroup) (\s :: DescribeRuleGroupResponse
s@DescribeRuleGroupResponse' {} Maybe RuleGroup
a -> DescribeRuleGroupResponse
s {$sel:ruleGroup:DescribeRuleGroupResponse' :: Maybe RuleGroup
ruleGroup = Maybe RuleGroup
a} :: DescribeRuleGroupResponse)
describeRuleGroupResponse_httpStatus :: Lens.Lens' DescribeRuleGroupResponse Prelude.Int
describeRuleGroupResponse_httpStatus :: Lens' DescribeRuleGroupResponse Int
describeRuleGroupResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeRuleGroupResponse' :: DescribeRuleGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeRuleGroupResponse
s@DescribeRuleGroupResponse' {} Int
a -> DescribeRuleGroupResponse
s {$sel:httpStatus:DescribeRuleGroupResponse' :: Int
httpStatus = Int
a} :: DescribeRuleGroupResponse)
describeRuleGroupResponse_updateToken :: Lens.Lens' DescribeRuleGroupResponse Prelude.Text
describeRuleGroupResponse_updateToken :: Lens' DescribeRuleGroupResponse Text
describeRuleGroupResponse_updateToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupResponse' {Text
updateToken :: Text
$sel:updateToken:DescribeRuleGroupResponse' :: DescribeRuleGroupResponse -> Text
updateToken} -> Text
updateToken) (\s :: DescribeRuleGroupResponse
s@DescribeRuleGroupResponse' {} Text
a -> DescribeRuleGroupResponse
s {$sel:updateToken:DescribeRuleGroupResponse' :: Text
updateToken = Text
a} :: DescribeRuleGroupResponse)
describeRuleGroupResponse_ruleGroupResponse :: Lens.Lens' DescribeRuleGroupResponse RuleGroupResponse
describeRuleGroupResponse_ruleGroupResponse :: Lens' DescribeRuleGroupResponse RuleGroupResponse
describeRuleGroupResponse_ruleGroupResponse = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupResponse' {RuleGroupResponse
ruleGroupResponse :: RuleGroupResponse
$sel:ruleGroupResponse:DescribeRuleGroupResponse' :: DescribeRuleGroupResponse -> RuleGroupResponse
ruleGroupResponse} -> RuleGroupResponse
ruleGroupResponse) (\s :: DescribeRuleGroupResponse
s@DescribeRuleGroupResponse' {} RuleGroupResponse
a -> DescribeRuleGroupResponse
s {$sel:ruleGroupResponse:DescribeRuleGroupResponse' :: RuleGroupResponse
ruleGroupResponse = RuleGroupResponse
a} :: DescribeRuleGroupResponse)
instance Prelude.NFData DescribeRuleGroupResponse where
rnf :: DescribeRuleGroupResponse -> ()
rnf DescribeRuleGroupResponse' {Int
Maybe RuleGroup
Text
RuleGroupResponse
ruleGroupResponse :: RuleGroupResponse
updateToken :: Text
httpStatus :: Int
ruleGroup :: Maybe RuleGroup
$sel:ruleGroupResponse:DescribeRuleGroupResponse' :: DescribeRuleGroupResponse -> RuleGroupResponse
$sel:updateToken:DescribeRuleGroupResponse' :: DescribeRuleGroupResponse -> Text
$sel:httpStatus:DescribeRuleGroupResponse' :: DescribeRuleGroupResponse -> Int
$sel:ruleGroup:DescribeRuleGroupResponse' :: DescribeRuleGroupResponse -> Maybe RuleGroup
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe RuleGroup
ruleGroup
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
updateToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RuleGroupResponse
ruleGroupResponse