{-# 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.ListFirewallConfigs
(
ListFirewallConfigs (..),
newListFirewallConfigs,
listFirewallConfigs_maxResults,
listFirewallConfigs_nextToken,
ListFirewallConfigsResponse (..),
newListFirewallConfigsResponse,
listFirewallConfigsResponse_firewallConfigs,
listFirewallConfigsResponse_nextToken,
listFirewallConfigsResponse_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 ListFirewallConfigs = ListFirewallConfigs'
{
ListFirewallConfigs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListFirewallConfigs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListFirewallConfigs -> ListFirewallConfigs -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFirewallConfigs -> ListFirewallConfigs -> Bool
$c/= :: ListFirewallConfigs -> ListFirewallConfigs -> Bool
== :: ListFirewallConfigs -> ListFirewallConfigs -> Bool
$c== :: ListFirewallConfigs -> ListFirewallConfigs -> Bool
Prelude.Eq, ReadPrec [ListFirewallConfigs]
ReadPrec ListFirewallConfigs
Int -> ReadS ListFirewallConfigs
ReadS [ListFirewallConfigs]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFirewallConfigs]
$creadListPrec :: ReadPrec [ListFirewallConfigs]
readPrec :: ReadPrec ListFirewallConfigs
$creadPrec :: ReadPrec ListFirewallConfigs
readList :: ReadS [ListFirewallConfigs]
$creadList :: ReadS [ListFirewallConfigs]
readsPrec :: Int -> ReadS ListFirewallConfigs
$creadsPrec :: Int -> ReadS ListFirewallConfigs
Prelude.Read, Int -> ListFirewallConfigs -> ShowS
[ListFirewallConfigs] -> ShowS
ListFirewallConfigs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFirewallConfigs] -> ShowS
$cshowList :: [ListFirewallConfigs] -> ShowS
show :: ListFirewallConfigs -> String
$cshow :: ListFirewallConfigs -> String
showsPrec :: Int -> ListFirewallConfigs -> ShowS
$cshowsPrec :: Int -> ListFirewallConfigs -> ShowS
Prelude.Show, forall x. Rep ListFirewallConfigs x -> ListFirewallConfigs
forall x. ListFirewallConfigs -> Rep ListFirewallConfigs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFirewallConfigs x -> ListFirewallConfigs
$cfrom :: forall x. ListFirewallConfigs -> Rep ListFirewallConfigs x
Prelude.Generic)
newListFirewallConfigs ::
ListFirewallConfigs
newListFirewallConfigs :: ListFirewallConfigs
newListFirewallConfigs =
ListFirewallConfigs'
{ $sel:maxResults:ListFirewallConfigs' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListFirewallConfigs' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listFirewallConfigs_maxResults :: Lens.Lens' ListFirewallConfigs (Prelude.Maybe Prelude.Natural)
listFirewallConfigs_maxResults :: Lens' ListFirewallConfigs (Maybe Natural)
listFirewallConfigs_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallConfigs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListFirewallConfigs' :: ListFirewallConfigs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListFirewallConfigs
s@ListFirewallConfigs' {} Maybe Natural
a -> ListFirewallConfigs
s {$sel:maxResults:ListFirewallConfigs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListFirewallConfigs)
listFirewallConfigs_nextToken :: Lens.Lens' ListFirewallConfigs (Prelude.Maybe Prelude.Text)
listFirewallConfigs_nextToken :: Lens' ListFirewallConfigs (Maybe Text)
listFirewallConfigs_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallConfigs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFirewallConfigs' :: ListFirewallConfigs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFirewallConfigs
s@ListFirewallConfigs' {} Maybe Text
a -> ListFirewallConfigs
s {$sel:nextToken:ListFirewallConfigs' :: Maybe Text
nextToken = Maybe Text
a} :: ListFirewallConfigs)
instance Core.AWSPager ListFirewallConfigs where
page :: ListFirewallConfigs
-> AWSResponse ListFirewallConfigs -> Maybe ListFirewallConfigs
page ListFirewallConfigs
rq AWSResponse ListFirewallConfigs
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListFirewallConfigs
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListFirewallConfigsResponse (Maybe Text)
listFirewallConfigsResponse_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 ListFirewallConfigs
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListFirewallConfigsResponse (Maybe [FirewallConfig])
listFirewallConfigsResponse_firewallConfigs
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.$ ListFirewallConfigs
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListFirewallConfigs (Maybe Text)
listFirewallConfigs_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListFirewallConfigs
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListFirewallConfigsResponse (Maybe Text)
listFirewallConfigsResponse_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 ListFirewallConfigs where
type
AWSResponse ListFirewallConfigs =
ListFirewallConfigsResponse
request :: (Service -> Service)
-> ListFirewallConfigs -> Request ListFirewallConfigs
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 ListFirewallConfigs
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListFirewallConfigs)))
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 [FirewallConfig]
-> Maybe Text -> Int -> ListFirewallConfigsResponse
ListFirewallConfigsResponse'
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
"FirewallConfigs"
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 ListFirewallConfigs where
hashWithSalt :: Int -> ListFirewallConfigs -> Int
hashWithSalt Int
_salt ListFirewallConfigs' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListFirewallConfigs' :: ListFirewallConfigs -> Maybe Text
$sel:maxResults:ListFirewallConfigs' :: ListFirewallConfigs -> 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 ListFirewallConfigs where
rnf :: ListFirewallConfigs -> ()
rnf ListFirewallConfigs' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListFirewallConfigs' :: ListFirewallConfigs -> Maybe Text
$sel:maxResults:ListFirewallConfigs' :: ListFirewallConfigs -> 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 ListFirewallConfigs where
toHeaders :: ListFirewallConfigs -> 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.ListFirewallConfigs" ::
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 ListFirewallConfigs where
toJSON :: ListFirewallConfigs -> Value
toJSON ListFirewallConfigs' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListFirewallConfigs' :: ListFirewallConfigs -> Maybe Text
$sel:maxResults:ListFirewallConfigs' :: ListFirewallConfigs -> 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 ListFirewallConfigs where
toPath :: ListFirewallConfigs -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListFirewallConfigs where
toQuery :: ListFirewallConfigs -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListFirewallConfigsResponse = ListFirewallConfigsResponse'
{
ListFirewallConfigsResponse -> Maybe [FirewallConfig]
firewallConfigs :: Prelude.Maybe [FirewallConfig],
ListFirewallConfigsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListFirewallConfigsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListFirewallConfigsResponse -> ListFirewallConfigsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFirewallConfigsResponse -> ListFirewallConfigsResponse -> Bool
$c/= :: ListFirewallConfigsResponse -> ListFirewallConfigsResponse -> Bool
== :: ListFirewallConfigsResponse -> ListFirewallConfigsResponse -> Bool
$c== :: ListFirewallConfigsResponse -> ListFirewallConfigsResponse -> Bool
Prelude.Eq, ReadPrec [ListFirewallConfigsResponse]
ReadPrec ListFirewallConfigsResponse
Int -> ReadS ListFirewallConfigsResponse
ReadS [ListFirewallConfigsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFirewallConfigsResponse]
$creadListPrec :: ReadPrec [ListFirewallConfigsResponse]
readPrec :: ReadPrec ListFirewallConfigsResponse
$creadPrec :: ReadPrec ListFirewallConfigsResponse
readList :: ReadS [ListFirewallConfigsResponse]
$creadList :: ReadS [ListFirewallConfigsResponse]
readsPrec :: Int -> ReadS ListFirewallConfigsResponse
$creadsPrec :: Int -> ReadS ListFirewallConfigsResponse
Prelude.Read, Int -> ListFirewallConfigsResponse -> ShowS
[ListFirewallConfigsResponse] -> ShowS
ListFirewallConfigsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFirewallConfigsResponse] -> ShowS
$cshowList :: [ListFirewallConfigsResponse] -> ShowS
show :: ListFirewallConfigsResponse -> String
$cshow :: ListFirewallConfigsResponse -> String
showsPrec :: Int -> ListFirewallConfigsResponse -> ShowS
$cshowsPrec :: Int -> ListFirewallConfigsResponse -> ShowS
Prelude.Show, forall x.
Rep ListFirewallConfigsResponse x -> ListFirewallConfigsResponse
forall x.
ListFirewallConfigsResponse -> Rep ListFirewallConfigsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListFirewallConfigsResponse x -> ListFirewallConfigsResponse
$cfrom :: forall x.
ListFirewallConfigsResponse -> Rep ListFirewallConfigsResponse x
Prelude.Generic)
newListFirewallConfigsResponse ::
Prelude.Int ->
ListFirewallConfigsResponse
newListFirewallConfigsResponse :: Int -> ListFirewallConfigsResponse
newListFirewallConfigsResponse Int
pHttpStatus_ =
ListFirewallConfigsResponse'
{ $sel:firewallConfigs:ListFirewallConfigsResponse' :: Maybe [FirewallConfig]
firewallConfigs =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListFirewallConfigsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListFirewallConfigsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listFirewallConfigsResponse_firewallConfigs :: Lens.Lens' ListFirewallConfigsResponse (Prelude.Maybe [FirewallConfig])
listFirewallConfigsResponse_firewallConfigs :: Lens' ListFirewallConfigsResponse (Maybe [FirewallConfig])
listFirewallConfigsResponse_firewallConfigs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallConfigsResponse' {Maybe [FirewallConfig]
firewallConfigs :: Maybe [FirewallConfig]
$sel:firewallConfigs:ListFirewallConfigsResponse' :: ListFirewallConfigsResponse -> Maybe [FirewallConfig]
firewallConfigs} -> Maybe [FirewallConfig]
firewallConfigs) (\s :: ListFirewallConfigsResponse
s@ListFirewallConfigsResponse' {} Maybe [FirewallConfig]
a -> ListFirewallConfigsResponse
s {$sel:firewallConfigs:ListFirewallConfigsResponse' :: Maybe [FirewallConfig]
firewallConfigs = Maybe [FirewallConfig]
a} :: ListFirewallConfigsResponse) 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
listFirewallConfigsResponse_nextToken :: Lens.Lens' ListFirewallConfigsResponse (Prelude.Maybe Prelude.Text)
listFirewallConfigsResponse_nextToken :: Lens' ListFirewallConfigsResponse (Maybe Text)
listFirewallConfigsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallConfigsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFirewallConfigsResponse' :: ListFirewallConfigsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFirewallConfigsResponse
s@ListFirewallConfigsResponse' {} Maybe Text
a -> ListFirewallConfigsResponse
s {$sel:nextToken:ListFirewallConfigsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFirewallConfigsResponse)
listFirewallConfigsResponse_httpStatus :: Lens.Lens' ListFirewallConfigsResponse Prelude.Int
listFirewallConfigsResponse_httpStatus :: Lens' ListFirewallConfigsResponse Int
listFirewallConfigsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallConfigsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListFirewallConfigsResponse' :: ListFirewallConfigsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListFirewallConfigsResponse
s@ListFirewallConfigsResponse' {} Int
a -> ListFirewallConfigsResponse
s {$sel:httpStatus:ListFirewallConfigsResponse' :: Int
httpStatus = Int
a} :: ListFirewallConfigsResponse)
instance Prelude.NFData ListFirewallConfigsResponse where
rnf :: ListFirewallConfigsResponse -> ()
rnf ListFirewallConfigsResponse' {Int
Maybe [FirewallConfig]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
firewallConfigs :: Maybe [FirewallConfig]
$sel:httpStatus:ListFirewallConfigsResponse' :: ListFirewallConfigsResponse -> Int
$sel:nextToken:ListFirewallConfigsResponse' :: ListFirewallConfigsResponse -> Maybe Text
$sel:firewallConfigs:ListFirewallConfigsResponse' :: ListFirewallConfigsResponse -> Maybe [FirewallConfig]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [FirewallConfig]
firewallConfigs
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