{-# 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.WAF.ListSubscribedRuleGroups
(
ListSubscribedRuleGroups (..),
newListSubscribedRuleGroups,
listSubscribedRuleGroups_limit,
listSubscribedRuleGroups_nextMarker,
ListSubscribedRuleGroupsResponse (..),
newListSubscribedRuleGroupsResponse,
listSubscribedRuleGroupsResponse_nextMarker,
listSubscribedRuleGroupsResponse_ruleGroups,
listSubscribedRuleGroupsResponse_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.WAF.Types
data ListSubscribedRuleGroups = ListSubscribedRuleGroups'
{
ListSubscribedRuleGroups -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
ListSubscribedRuleGroups -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text
}
deriving (ListSubscribedRuleGroups -> ListSubscribedRuleGroups -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSubscribedRuleGroups -> ListSubscribedRuleGroups -> Bool
$c/= :: ListSubscribedRuleGroups -> ListSubscribedRuleGroups -> Bool
== :: ListSubscribedRuleGroups -> ListSubscribedRuleGroups -> Bool
$c== :: ListSubscribedRuleGroups -> ListSubscribedRuleGroups -> Bool
Prelude.Eq, ReadPrec [ListSubscribedRuleGroups]
ReadPrec ListSubscribedRuleGroups
Int -> ReadS ListSubscribedRuleGroups
ReadS [ListSubscribedRuleGroups]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSubscribedRuleGroups]
$creadListPrec :: ReadPrec [ListSubscribedRuleGroups]
readPrec :: ReadPrec ListSubscribedRuleGroups
$creadPrec :: ReadPrec ListSubscribedRuleGroups
readList :: ReadS [ListSubscribedRuleGroups]
$creadList :: ReadS [ListSubscribedRuleGroups]
readsPrec :: Int -> ReadS ListSubscribedRuleGroups
$creadsPrec :: Int -> ReadS ListSubscribedRuleGroups
Prelude.Read, Int -> ListSubscribedRuleGroups -> ShowS
[ListSubscribedRuleGroups] -> ShowS
ListSubscribedRuleGroups -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSubscribedRuleGroups] -> ShowS
$cshowList :: [ListSubscribedRuleGroups] -> ShowS
show :: ListSubscribedRuleGroups -> String
$cshow :: ListSubscribedRuleGroups -> String
showsPrec :: Int -> ListSubscribedRuleGroups -> ShowS
$cshowsPrec :: Int -> ListSubscribedRuleGroups -> ShowS
Prelude.Show, forall x.
Rep ListSubscribedRuleGroups x -> ListSubscribedRuleGroups
forall x.
ListSubscribedRuleGroups -> Rep ListSubscribedRuleGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSubscribedRuleGroups x -> ListSubscribedRuleGroups
$cfrom :: forall x.
ListSubscribedRuleGroups -> Rep ListSubscribedRuleGroups x
Prelude.Generic)
newListSubscribedRuleGroups ::
ListSubscribedRuleGroups
newListSubscribedRuleGroups :: ListSubscribedRuleGroups
newListSubscribedRuleGroups =
ListSubscribedRuleGroups'
{ $sel:limit:ListSubscribedRuleGroups' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:ListSubscribedRuleGroups' :: Maybe Text
nextMarker = forall a. Maybe a
Prelude.Nothing
}
listSubscribedRuleGroups_limit :: Lens.Lens' ListSubscribedRuleGroups (Prelude.Maybe Prelude.Natural)
listSubscribedRuleGroups_limit :: Lens' ListSubscribedRuleGroups (Maybe Natural)
listSubscribedRuleGroups_limit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSubscribedRuleGroups' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListSubscribedRuleGroups' :: ListSubscribedRuleGroups -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListSubscribedRuleGroups
s@ListSubscribedRuleGroups' {} Maybe Natural
a -> ListSubscribedRuleGroups
s {$sel:limit:ListSubscribedRuleGroups' :: Maybe Natural
limit = Maybe Natural
a} :: ListSubscribedRuleGroups)
listSubscribedRuleGroups_nextMarker :: Lens.Lens' ListSubscribedRuleGroups (Prelude.Maybe Prelude.Text)
listSubscribedRuleGroups_nextMarker :: Lens' ListSubscribedRuleGroups (Maybe Text)
listSubscribedRuleGroups_nextMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSubscribedRuleGroups' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListSubscribedRuleGroups' :: ListSubscribedRuleGroups -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListSubscribedRuleGroups
s@ListSubscribedRuleGroups' {} Maybe Text
a -> ListSubscribedRuleGroups
s {$sel:nextMarker:ListSubscribedRuleGroups' :: Maybe Text
nextMarker = Maybe Text
a} :: ListSubscribedRuleGroups)
instance Core.AWSPager ListSubscribedRuleGroups where
page :: ListSubscribedRuleGroups
-> AWSResponse ListSubscribedRuleGroups
-> Maybe ListSubscribedRuleGroups
page ListSubscribedRuleGroups
rq AWSResponse ListSubscribedRuleGroups
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListSubscribedRuleGroups
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSubscribedRuleGroupsResponse (Maybe Text)
listSubscribedRuleGroupsResponse_nextMarker
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 ListSubscribedRuleGroups
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
ListSubscribedRuleGroupsResponse
(Maybe [SubscribedRuleGroupSummary])
listSubscribedRuleGroupsResponse_ruleGroups
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.$ ListSubscribedRuleGroups
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListSubscribedRuleGroups (Maybe Text)
listSubscribedRuleGroups_nextMarker
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListSubscribedRuleGroups
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSubscribedRuleGroupsResponse (Maybe Text)
listSubscribedRuleGroupsResponse_nextMarker
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 ListSubscribedRuleGroups where
type
AWSResponse ListSubscribedRuleGroups =
ListSubscribedRuleGroupsResponse
request :: (Service -> Service)
-> ListSubscribedRuleGroups -> Request ListSubscribedRuleGroups
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 ListSubscribedRuleGroups
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListSubscribedRuleGroups)))
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 Text
-> Maybe [SubscribedRuleGroupSummary]
-> Int
-> ListSubscribedRuleGroupsResponse
ListSubscribedRuleGroupsResponse'
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
"NextMarker")
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
"RuleGroups" 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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListSubscribedRuleGroups where
hashWithSalt :: Int -> ListSubscribedRuleGroups -> Int
hashWithSalt Int
_salt ListSubscribedRuleGroups' {Maybe Natural
Maybe Text
nextMarker :: Maybe Text
limit :: Maybe Natural
$sel:nextMarker:ListSubscribedRuleGroups' :: ListSubscribedRuleGroups -> Maybe Text
$sel:limit:ListSubscribedRuleGroups' :: ListSubscribedRuleGroups -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
limit
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextMarker
instance Prelude.NFData ListSubscribedRuleGroups where
rnf :: ListSubscribedRuleGroups -> ()
rnf ListSubscribedRuleGroups' {Maybe Natural
Maybe Text
nextMarker :: Maybe Text
limit :: Maybe Natural
$sel:nextMarker:ListSubscribedRuleGroups' :: ListSubscribedRuleGroups -> Maybe Text
$sel:limit:ListSubscribedRuleGroups' :: ListSubscribedRuleGroups -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
limit
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextMarker
instance Data.ToHeaders ListSubscribedRuleGroups where
toHeaders :: ListSubscribedRuleGroups -> 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
"AWSWAF_20150824.ListSubscribedRuleGroups" ::
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 ListSubscribedRuleGroups where
toJSON :: ListSubscribedRuleGroups -> Value
toJSON ListSubscribedRuleGroups' {Maybe Natural
Maybe Text
nextMarker :: Maybe Text
limit :: Maybe Natural
$sel:nextMarker:ListSubscribedRuleGroups' :: ListSubscribedRuleGroups -> Maybe Text
$sel:limit:ListSubscribedRuleGroups' :: ListSubscribedRuleGroups -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Limit" 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
limit,
(Key
"NextMarker" 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
nextMarker
]
)
instance Data.ToPath ListSubscribedRuleGroups where
toPath :: ListSubscribedRuleGroups -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListSubscribedRuleGroups where
toQuery :: ListSubscribedRuleGroups -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListSubscribedRuleGroupsResponse = ListSubscribedRuleGroupsResponse'
{
ListSubscribedRuleGroupsResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
ListSubscribedRuleGroupsResponse
-> Maybe [SubscribedRuleGroupSummary]
ruleGroups :: Prelude.Maybe [SubscribedRuleGroupSummary],
ListSubscribedRuleGroupsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListSubscribedRuleGroupsResponse
-> ListSubscribedRuleGroupsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSubscribedRuleGroupsResponse
-> ListSubscribedRuleGroupsResponse -> Bool
$c/= :: ListSubscribedRuleGroupsResponse
-> ListSubscribedRuleGroupsResponse -> Bool
== :: ListSubscribedRuleGroupsResponse
-> ListSubscribedRuleGroupsResponse -> Bool
$c== :: ListSubscribedRuleGroupsResponse
-> ListSubscribedRuleGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListSubscribedRuleGroupsResponse]
ReadPrec ListSubscribedRuleGroupsResponse
Int -> ReadS ListSubscribedRuleGroupsResponse
ReadS [ListSubscribedRuleGroupsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSubscribedRuleGroupsResponse]
$creadListPrec :: ReadPrec [ListSubscribedRuleGroupsResponse]
readPrec :: ReadPrec ListSubscribedRuleGroupsResponse
$creadPrec :: ReadPrec ListSubscribedRuleGroupsResponse
readList :: ReadS [ListSubscribedRuleGroupsResponse]
$creadList :: ReadS [ListSubscribedRuleGroupsResponse]
readsPrec :: Int -> ReadS ListSubscribedRuleGroupsResponse
$creadsPrec :: Int -> ReadS ListSubscribedRuleGroupsResponse
Prelude.Read, Int -> ListSubscribedRuleGroupsResponse -> ShowS
[ListSubscribedRuleGroupsResponse] -> ShowS
ListSubscribedRuleGroupsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSubscribedRuleGroupsResponse] -> ShowS
$cshowList :: [ListSubscribedRuleGroupsResponse] -> ShowS
show :: ListSubscribedRuleGroupsResponse -> String
$cshow :: ListSubscribedRuleGroupsResponse -> String
showsPrec :: Int -> ListSubscribedRuleGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListSubscribedRuleGroupsResponse -> ShowS
Prelude.Show, forall x.
Rep ListSubscribedRuleGroupsResponse x
-> ListSubscribedRuleGroupsResponse
forall x.
ListSubscribedRuleGroupsResponse
-> Rep ListSubscribedRuleGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSubscribedRuleGroupsResponse x
-> ListSubscribedRuleGroupsResponse
$cfrom :: forall x.
ListSubscribedRuleGroupsResponse
-> Rep ListSubscribedRuleGroupsResponse x
Prelude.Generic)
newListSubscribedRuleGroupsResponse ::
Prelude.Int ->
ListSubscribedRuleGroupsResponse
newListSubscribedRuleGroupsResponse :: Int -> ListSubscribedRuleGroupsResponse
newListSubscribedRuleGroupsResponse Int
pHttpStatus_ =
ListSubscribedRuleGroupsResponse'
{ $sel:nextMarker:ListSubscribedRuleGroupsResponse' :: Maybe Text
nextMarker =
forall a. Maybe a
Prelude.Nothing,
$sel:ruleGroups:ListSubscribedRuleGroupsResponse' :: Maybe [SubscribedRuleGroupSummary]
ruleGroups = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListSubscribedRuleGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listSubscribedRuleGroupsResponse_nextMarker :: Lens.Lens' ListSubscribedRuleGroupsResponse (Prelude.Maybe Prelude.Text)
listSubscribedRuleGroupsResponse_nextMarker :: Lens' ListSubscribedRuleGroupsResponse (Maybe Text)
listSubscribedRuleGroupsResponse_nextMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSubscribedRuleGroupsResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListSubscribedRuleGroupsResponse' :: ListSubscribedRuleGroupsResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListSubscribedRuleGroupsResponse
s@ListSubscribedRuleGroupsResponse' {} Maybe Text
a -> ListSubscribedRuleGroupsResponse
s {$sel:nextMarker:ListSubscribedRuleGroupsResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListSubscribedRuleGroupsResponse)
listSubscribedRuleGroupsResponse_ruleGroups :: Lens.Lens' ListSubscribedRuleGroupsResponse (Prelude.Maybe [SubscribedRuleGroupSummary])
listSubscribedRuleGroupsResponse_ruleGroups :: Lens'
ListSubscribedRuleGroupsResponse
(Maybe [SubscribedRuleGroupSummary])
listSubscribedRuleGroupsResponse_ruleGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSubscribedRuleGroupsResponse' {Maybe [SubscribedRuleGroupSummary]
ruleGroups :: Maybe [SubscribedRuleGroupSummary]
$sel:ruleGroups:ListSubscribedRuleGroupsResponse' :: ListSubscribedRuleGroupsResponse
-> Maybe [SubscribedRuleGroupSummary]
ruleGroups} -> Maybe [SubscribedRuleGroupSummary]
ruleGroups) (\s :: ListSubscribedRuleGroupsResponse
s@ListSubscribedRuleGroupsResponse' {} Maybe [SubscribedRuleGroupSummary]
a -> ListSubscribedRuleGroupsResponse
s {$sel:ruleGroups:ListSubscribedRuleGroupsResponse' :: Maybe [SubscribedRuleGroupSummary]
ruleGroups = Maybe [SubscribedRuleGroupSummary]
a} :: ListSubscribedRuleGroupsResponse) 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
listSubscribedRuleGroupsResponse_httpStatus :: Lens.Lens' ListSubscribedRuleGroupsResponse Prelude.Int
listSubscribedRuleGroupsResponse_httpStatus :: Lens' ListSubscribedRuleGroupsResponse Int
listSubscribedRuleGroupsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSubscribedRuleGroupsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListSubscribedRuleGroupsResponse' :: ListSubscribedRuleGroupsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListSubscribedRuleGroupsResponse
s@ListSubscribedRuleGroupsResponse' {} Int
a -> ListSubscribedRuleGroupsResponse
s {$sel:httpStatus:ListSubscribedRuleGroupsResponse' :: Int
httpStatus = Int
a} :: ListSubscribedRuleGroupsResponse)
instance
Prelude.NFData
ListSubscribedRuleGroupsResponse
where
rnf :: ListSubscribedRuleGroupsResponse -> ()
rnf ListSubscribedRuleGroupsResponse' {Int
Maybe [SubscribedRuleGroupSummary]
Maybe Text
httpStatus :: Int
ruleGroups :: Maybe [SubscribedRuleGroupSummary]
nextMarker :: Maybe Text
$sel:httpStatus:ListSubscribedRuleGroupsResponse' :: ListSubscribedRuleGroupsResponse -> Int
$sel:ruleGroups:ListSubscribedRuleGroupsResponse' :: ListSubscribedRuleGroupsResponse
-> Maybe [SubscribedRuleGroupSummary]
$sel:nextMarker:ListSubscribedRuleGroupsResponse' :: ListSubscribedRuleGroupsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextMarker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SubscribedRuleGroupSummary]
ruleGroups
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus