{-# 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.ListFirewallRuleGroups
(
ListFirewallRuleGroups (..),
newListFirewallRuleGroups,
listFirewallRuleGroups_maxResults,
listFirewallRuleGroups_nextToken,
ListFirewallRuleGroupsResponse (..),
newListFirewallRuleGroupsResponse,
listFirewallRuleGroupsResponse_firewallRuleGroups,
listFirewallRuleGroupsResponse_nextToken,
listFirewallRuleGroupsResponse_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
data ListFirewallRuleGroups = ListFirewallRuleGroups'
{
ListFirewallRuleGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListFirewallRuleGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListFirewallRuleGroups -> ListFirewallRuleGroups -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFirewallRuleGroups -> ListFirewallRuleGroups -> Bool
$c/= :: ListFirewallRuleGroups -> ListFirewallRuleGroups -> Bool
== :: ListFirewallRuleGroups -> ListFirewallRuleGroups -> Bool
$c== :: ListFirewallRuleGroups -> ListFirewallRuleGroups -> Bool
Prelude.Eq, ReadPrec [ListFirewallRuleGroups]
ReadPrec ListFirewallRuleGroups
Int -> ReadS ListFirewallRuleGroups
ReadS [ListFirewallRuleGroups]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFirewallRuleGroups]
$creadListPrec :: ReadPrec [ListFirewallRuleGroups]
readPrec :: ReadPrec ListFirewallRuleGroups
$creadPrec :: ReadPrec ListFirewallRuleGroups
readList :: ReadS [ListFirewallRuleGroups]
$creadList :: ReadS [ListFirewallRuleGroups]
readsPrec :: Int -> ReadS ListFirewallRuleGroups
$creadsPrec :: Int -> ReadS ListFirewallRuleGroups
Prelude.Read, Int -> ListFirewallRuleGroups -> ShowS
[ListFirewallRuleGroups] -> ShowS
ListFirewallRuleGroups -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFirewallRuleGroups] -> ShowS
$cshowList :: [ListFirewallRuleGroups] -> ShowS
show :: ListFirewallRuleGroups -> String
$cshow :: ListFirewallRuleGroups -> String
showsPrec :: Int -> ListFirewallRuleGroups -> ShowS
$cshowsPrec :: Int -> ListFirewallRuleGroups -> ShowS
Prelude.Show, forall x. Rep ListFirewallRuleGroups x -> ListFirewallRuleGroups
forall x. ListFirewallRuleGroups -> Rep ListFirewallRuleGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFirewallRuleGroups x -> ListFirewallRuleGroups
$cfrom :: forall x. ListFirewallRuleGroups -> Rep ListFirewallRuleGroups x
Prelude.Generic)
newListFirewallRuleGroups ::
ListFirewallRuleGroups
newListFirewallRuleGroups :: ListFirewallRuleGroups
newListFirewallRuleGroups =
ListFirewallRuleGroups'
{ $sel:maxResults:ListFirewallRuleGroups' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListFirewallRuleGroups' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listFirewallRuleGroups_maxResults :: Lens.Lens' ListFirewallRuleGroups (Prelude.Maybe Prelude.Natural)
listFirewallRuleGroups_maxResults :: Lens' ListFirewallRuleGroups (Maybe Natural)
listFirewallRuleGroups_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallRuleGroups' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListFirewallRuleGroups' :: ListFirewallRuleGroups -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListFirewallRuleGroups
s@ListFirewallRuleGroups' {} Maybe Natural
a -> ListFirewallRuleGroups
s {$sel:maxResults:ListFirewallRuleGroups' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListFirewallRuleGroups)
listFirewallRuleGroups_nextToken :: Lens.Lens' ListFirewallRuleGroups (Prelude.Maybe Prelude.Text)
listFirewallRuleGroups_nextToken :: Lens' ListFirewallRuleGroups (Maybe Text)
listFirewallRuleGroups_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallRuleGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFirewallRuleGroups' :: ListFirewallRuleGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFirewallRuleGroups
s@ListFirewallRuleGroups' {} Maybe Text
a -> ListFirewallRuleGroups
s {$sel:nextToken:ListFirewallRuleGroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListFirewallRuleGroups)
instance Core.AWSPager ListFirewallRuleGroups where
page :: ListFirewallRuleGroups
-> AWSResponse ListFirewallRuleGroups
-> Maybe ListFirewallRuleGroups
page ListFirewallRuleGroups
rq AWSResponse ListFirewallRuleGroups
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListFirewallRuleGroups
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListFirewallRuleGroupsResponse (Maybe Text)
listFirewallRuleGroupsResponse_nextToken
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 ListFirewallRuleGroups
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
ListFirewallRuleGroupsResponse (Maybe [FirewallRuleGroupMetadata])
listFirewallRuleGroupsResponse_firewallRuleGroups
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.$ ListFirewallRuleGroups
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListFirewallRuleGroups (Maybe Text)
listFirewallRuleGroups_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListFirewallRuleGroups
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListFirewallRuleGroupsResponse (Maybe Text)
listFirewallRuleGroupsResponse_nextToken
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 ListFirewallRuleGroups where
type
AWSResponse ListFirewallRuleGroups =
ListFirewallRuleGroupsResponse
request :: (Service -> Service)
-> ListFirewallRuleGroups -> Request ListFirewallRuleGroups
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 ListFirewallRuleGroups
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListFirewallRuleGroups)))
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 [FirewallRuleGroupMetadata]
-> Maybe Text -> Int -> ListFirewallRuleGroupsResponse
ListFirewallRuleGroupsResponse'
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
"FirewallRuleGroups"
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.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
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 ListFirewallRuleGroups where
hashWithSalt :: Int -> ListFirewallRuleGroups -> Int
hashWithSalt Int
_salt ListFirewallRuleGroups' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListFirewallRuleGroups' :: ListFirewallRuleGroups -> Maybe Text
$sel:maxResults:ListFirewallRuleGroups' :: ListFirewallRuleGroups -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListFirewallRuleGroups where
rnf :: ListFirewallRuleGroups -> ()
rnf ListFirewallRuleGroups' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListFirewallRuleGroups' :: ListFirewallRuleGroups -> Maybe Text
$sel:maxResults:ListFirewallRuleGroups' :: ListFirewallRuleGroups -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
instance Data.ToHeaders ListFirewallRuleGroups where
toHeaders :: ListFirewallRuleGroups -> 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.ListFirewallRuleGroups" ::
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 ListFirewallRuleGroups where
toJSON :: ListFirewallRuleGroups -> Value
toJSON ListFirewallRuleGroups' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListFirewallRuleGroups' :: ListFirewallRuleGroups -> Maybe Text
$sel:maxResults:ListFirewallRuleGroups' :: ListFirewallRuleGroups -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MaxResults" 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
maxResults,
(Key
"NextToken" 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
nextToken
]
)
instance Data.ToPath ListFirewallRuleGroups where
toPath :: ListFirewallRuleGroups -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListFirewallRuleGroups where
toQuery :: ListFirewallRuleGroups -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListFirewallRuleGroupsResponse = ListFirewallRuleGroupsResponse'
{
ListFirewallRuleGroupsResponse -> Maybe [FirewallRuleGroupMetadata]
firewallRuleGroups :: Prelude.Maybe [FirewallRuleGroupMetadata],
ListFirewallRuleGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListFirewallRuleGroupsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListFirewallRuleGroupsResponse
-> ListFirewallRuleGroupsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFirewallRuleGroupsResponse
-> ListFirewallRuleGroupsResponse -> Bool
$c/= :: ListFirewallRuleGroupsResponse
-> ListFirewallRuleGroupsResponse -> Bool
== :: ListFirewallRuleGroupsResponse
-> ListFirewallRuleGroupsResponse -> Bool
$c== :: ListFirewallRuleGroupsResponse
-> ListFirewallRuleGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListFirewallRuleGroupsResponse]
ReadPrec ListFirewallRuleGroupsResponse
Int -> ReadS ListFirewallRuleGroupsResponse
ReadS [ListFirewallRuleGroupsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFirewallRuleGroupsResponse]
$creadListPrec :: ReadPrec [ListFirewallRuleGroupsResponse]
readPrec :: ReadPrec ListFirewallRuleGroupsResponse
$creadPrec :: ReadPrec ListFirewallRuleGroupsResponse
readList :: ReadS [ListFirewallRuleGroupsResponse]
$creadList :: ReadS [ListFirewallRuleGroupsResponse]
readsPrec :: Int -> ReadS ListFirewallRuleGroupsResponse
$creadsPrec :: Int -> ReadS ListFirewallRuleGroupsResponse
Prelude.Read, Int -> ListFirewallRuleGroupsResponse -> ShowS
[ListFirewallRuleGroupsResponse] -> ShowS
ListFirewallRuleGroupsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFirewallRuleGroupsResponse] -> ShowS
$cshowList :: [ListFirewallRuleGroupsResponse] -> ShowS
show :: ListFirewallRuleGroupsResponse -> String
$cshow :: ListFirewallRuleGroupsResponse -> String
showsPrec :: Int -> ListFirewallRuleGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListFirewallRuleGroupsResponse -> ShowS
Prelude.Show, forall x.
Rep ListFirewallRuleGroupsResponse x
-> ListFirewallRuleGroupsResponse
forall x.
ListFirewallRuleGroupsResponse
-> Rep ListFirewallRuleGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListFirewallRuleGroupsResponse x
-> ListFirewallRuleGroupsResponse
$cfrom :: forall x.
ListFirewallRuleGroupsResponse
-> Rep ListFirewallRuleGroupsResponse x
Prelude.Generic)
newListFirewallRuleGroupsResponse ::
Prelude.Int ->
ListFirewallRuleGroupsResponse
newListFirewallRuleGroupsResponse :: Int -> ListFirewallRuleGroupsResponse
newListFirewallRuleGroupsResponse Int
pHttpStatus_ =
ListFirewallRuleGroupsResponse'
{ $sel:firewallRuleGroups:ListFirewallRuleGroupsResponse' :: Maybe [FirewallRuleGroupMetadata]
firewallRuleGroups =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListFirewallRuleGroupsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListFirewallRuleGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listFirewallRuleGroupsResponse_firewallRuleGroups :: Lens.Lens' ListFirewallRuleGroupsResponse (Prelude.Maybe [FirewallRuleGroupMetadata])
listFirewallRuleGroupsResponse_firewallRuleGroups :: Lens'
ListFirewallRuleGroupsResponse (Maybe [FirewallRuleGroupMetadata])
listFirewallRuleGroupsResponse_firewallRuleGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallRuleGroupsResponse' {Maybe [FirewallRuleGroupMetadata]
firewallRuleGroups :: Maybe [FirewallRuleGroupMetadata]
$sel:firewallRuleGroups:ListFirewallRuleGroupsResponse' :: ListFirewallRuleGroupsResponse -> Maybe [FirewallRuleGroupMetadata]
firewallRuleGroups} -> Maybe [FirewallRuleGroupMetadata]
firewallRuleGroups) (\s :: ListFirewallRuleGroupsResponse
s@ListFirewallRuleGroupsResponse' {} Maybe [FirewallRuleGroupMetadata]
a -> ListFirewallRuleGroupsResponse
s {$sel:firewallRuleGroups:ListFirewallRuleGroupsResponse' :: Maybe [FirewallRuleGroupMetadata]
firewallRuleGroups = Maybe [FirewallRuleGroupMetadata]
a} :: ListFirewallRuleGroupsResponse) 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
listFirewallRuleGroupsResponse_nextToken :: Lens.Lens' ListFirewallRuleGroupsResponse (Prelude.Maybe Prelude.Text)
listFirewallRuleGroupsResponse_nextToken :: Lens' ListFirewallRuleGroupsResponse (Maybe Text)
listFirewallRuleGroupsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallRuleGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFirewallRuleGroupsResponse' :: ListFirewallRuleGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFirewallRuleGroupsResponse
s@ListFirewallRuleGroupsResponse' {} Maybe Text
a -> ListFirewallRuleGroupsResponse
s {$sel:nextToken:ListFirewallRuleGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFirewallRuleGroupsResponse)
listFirewallRuleGroupsResponse_httpStatus :: Lens.Lens' ListFirewallRuleGroupsResponse Prelude.Int
listFirewallRuleGroupsResponse_httpStatus :: Lens' ListFirewallRuleGroupsResponse Int
listFirewallRuleGroupsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallRuleGroupsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListFirewallRuleGroupsResponse' :: ListFirewallRuleGroupsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListFirewallRuleGroupsResponse
s@ListFirewallRuleGroupsResponse' {} Int
a -> ListFirewallRuleGroupsResponse
s {$sel:httpStatus:ListFirewallRuleGroupsResponse' :: Int
httpStatus = Int
a} :: ListFirewallRuleGroupsResponse)
instance
Prelude.NFData
ListFirewallRuleGroupsResponse
where
rnf :: ListFirewallRuleGroupsResponse -> ()
rnf ListFirewallRuleGroupsResponse' {Int
Maybe [FirewallRuleGroupMetadata]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
firewallRuleGroups :: Maybe [FirewallRuleGroupMetadata]
$sel:httpStatus:ListFirewallRuleGroupsResponse' :: ListFirewallRuleGroupsResponse -> Int
$sel:nextToken:ListFirewallRuleGroupsResponse' :: ListFirewallRuleGroupsResponse -> Maybe Text
$sel:firewallRuleGroups:ListFirewallRuleGroupsResponse' :: ListFirewallRuleGroupsResponse -> Maybe [FirewallRuleGroupMetadata]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [FirewallRuleGroupMetadata]
firewallRuleGroups
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus