{-# 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.ListFirewallDomains
(
ListFirewallDomains (..),
newListFirewallDomains,
listFirewallDomains_maxResults,
listFirewallDomains_nextToken,
listFirewallDomains_firewallDomainListId,
ListFirewallDomainsResponse (..),
newListFirewallDomainsResponse,
listFirewallDomainsResponse_domains,
listFirewallDomainsResponse_nextToken,
listFirewallDomainsResponse_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 ListFirewallDomains = ListFirewallDomains'
{
ListFirewallDomains -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListFirewallDomains -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListFirewallDomains -> Text
firewallDomainListId :: Prelude.Text
}
deriving (ListFirewallDomains -> ListFirewallDomains -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFirewallDomains -> ListFirewallDomains -> Bool
$c/= :: ListFirewallDomains -> ListFirewallDomains -> Bool
== :: ListFirewallDomains -> ListFirewallDomains -> Bool
$c== :: ListFirewallDomains -> ListFirewallDomains -> Bool
Prelude.Eq, ReadPrec [ListFirewallDomains]
ReadPrec ListFirewallDomains
Int -> ReadS ListFirewallDomains
ReadS [ListFirewallDomains]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFirewallDomains]
$creadListPrec :: ReadPrec [ListFirewallDomains]
readPrec :: ReadPrec ListFirewallDomains
$creadPrec :: ReadPrec ListFirewallDomains
readList :: ReadS [ListFirewallDomains]
$creadList :: ReadS [ListFirewallDomains]
readsPrec :: Int -> ReadS ListFirewallDomains
$creadsPrec :: Int -> ReadS ListFirewallDomains
Prelude.Read, Int -> ListFirewallDomains -> ShowS
[ListFirewallDomains] -> ShowS
ListFirewallDomains -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFirewallDomains] -> ShowS
$cshowList :: [ListFirewallDomains] -> ShowS
show :: ListFirewallDomains -> String
$cshow :: ListFirewallDomains -> String
showsPrec :: Int -> ListFirewallDomains -> ShowS
$cshowsPrec :: Int -> ListFirewallDomains -> ShowS
Prelude.Show, forall x. Rep ListFirewallDomains x -> ListFirewallDomains
forall x. ListFirewallDomains -> Rep ListFirewallDomains x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFirewallDomains x -> ListFirewallDomains
$cfrom :: forall x. ListFirewallDomains -> Rep ListFirewallDomains x
Prelude.Generic)
newListFirewallDomains ::
Prelude.Text ->
ListFirewallDomains
newListFirewallDomains :: Text -> ListFirewallDomains
newListFirewallDomains Text
pFirewallDomainListId_ =
ListFirewallDomains'
{ $sel:maxResults:ListFirewallDomains' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListFirewallDomains' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:firewallDomainListId:ListFirewallDomains' :: Text
firewallDomainListId = Text
pFirewallDomainListId_
}
listFirewallDomains_maxResults :: Lens.Lens' ListFirewallDomains (Prelude.Maybe Prelude.Natural)
listFirewallDomains_maxResults :: Lens' ListFirewallDomains (Maybe Natural)
listFirewallDomains_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallDomains' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListFirewallDomains' :: ListFirewallDomains -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListFirewallDomains
s@ListFirewallDomains' {} Maybe Natural
a -> ListFirewallDomains
s {$sel:maxResults:ListFirewallDomains' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListFirewallDomains)
listFirewallDomains_nextToken :: Lens.Lens' ListFirewallDomains (Prelude.Maybe Prelude.Text)
listFirewallDomains_nextToken :: Lens' ListFirewallDomains (Maybe Text)
listFirewallDomains_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallDomains' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFirewallDomains' :: ListFirewallDomains -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFirewallDomains
s@ListFirewallDomains' {} Maybe Text
a -> ListFirewallDomains
s {$sel:nextToken:ListFirewallDomains' :: Maybe Text
nextToken = Maybe Text
a} :: ListFirewallDomains)
listFirewallDomains_firewallDomainListId :: Lens.Lens' ListFirewallDomains Prelude.Text
listFirewallDomains_firewallDomainListId :: Lens' ListFirewallDomains Text
listFirewallDomains_firewallDomainListId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallDomains' {Text
firewallDomainListId :: Text
$sel:firewallDomainListId:ListFirewallDomains' :: ListFirewallDomains -> Text
firewallDomainListId} -> Text
firewallDomainListId) (\s :: ListFirewallDomains
s@ListFirewallDomains' {} Text
a -> ListFirewallDomains
s {$sel:firewallDomainListId:ListFirewallDomains' :: Text
firewallDomainListId = Text
a} :: ListFirewallDomains)
instance Core.AWSPager ListFirewallDomains where
page :: ListFirewallDomains
-> AWSResponse ListFirewallDomains -> Maybe ListFirewallDomains
page ListFirewallDomains
rq AWSResponse ListFirewallDomains
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListFirewallDomains
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListFirewallDomainsResponse (Maybe Text)
listFirewallDomainsResponse_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 ListFirewallDomains
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListFirewallDomainsResponse (Maybe [Text])
listFirewallDomainsResponse_domains
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.$ ListFirewallDomains
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListFirewallDomains (Maybe Text)
listFirewallDomains_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListFirewallDomains
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListFirewallDomainsResponse (Maybe Text)
listFirewallDomainsResponse_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 ListFirewallDomains where
type
AWSResponse ListFirewallDomains =
ListFirewallDomainsResponse
request :: (Service -> Service)
-> ListFirewallDomains -> Request ListFirewallDomains
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 ListFirewallDomains
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListFirewallDomains)))
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 Text -> Int -> ListFirewallDomainsResponse
ListFirewallDomainsResponse'
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
"Domains" 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 ListFirewallDomains where
hashWithSalt :: Int -> ListFirewallDomains -> Int
hashWithSalt Int
_salt ListFirewallDomains' {Maybe Natural
Maybe Text
Text
firewallDomainListId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:firewallDomainListId:ListFirewallDomains' :: ListFirewallDomains -> Text
$sel:nextToken:ListFirewallDomains' :: ListFirewallDomains -> Maybe Text
$sel:maxResults:ListFirewallDomains' :: ListFirewallDomains -> 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
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
firewallDomainListId
instance Prelude.NFData ListFirewallDomains where
rnf :: ListFirewallDomains -> ()
rnf ListFirewallDomains' {Maybe Natural
Maybe Text
Text
firewallDomainListId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:firewallDomainListId:ListFirewallDomains' :: ListFirewallDomains -> Text
$sel:nextToken:ListFirewallDomains' :: ListFirewallDomains -> Maybe Text
$sel:maxResults:ListFirewallDomains' :: ListFirewallDomains -> 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
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
firewallDomainListId
instance Data.ToHeaders ListFirewallDomains where
toHeaders :: ListFirewallDomains -> 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.ListFirewallDomains" ::
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 ListFirewallDomains where
toJSON :: ListFirewallDomains -> Value
toJSON ListFirewallDomains' {Maybe Natural
Maybe Text
Text
firewallDomainListId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:firewallDomainListId:ListFirewallDomains' :: ListFirewallDomains -> Text
$sel:nextToken:ListFirewallDomains' :: ListFirewallDomains -> Maybe Text
$sel:maxResults:ListFirewallDomains' :: ListFirewallDomains -> 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,
forall a. a -> Maybe a
Prelude.Just
( Key
"FirewallDomainListId"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
firewallDomainListId
)
]
)
instance Data.ToPath ListFirewallDomains where
toPath :: ListFirewallDomains -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListFirewallDomains where
toQuery :: ListFirewallDomains -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListFirewallDomainsResponse = ListFirewallDomainsResponse'
{
ListFirewallDomainsResponse -> Maybe [Text]
domains :: Prelude.Maybe [Prelude.Text],
ListFirewallDomainsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListFirewallDomainsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListFirewallDomainsResponse -> ListFirewallDomainsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFirewallDomainsResponse -> ListFirewallDomainsResponse -> Bool
$c/= :: ListFirewallDomainsResponse -> ListFirewallDomainsResponse -> Bool
== :: ListFirewallDomainsResponse -> ListFirewallDomainsResponse -> Bool
$c== :: ListFirewallDomainsResponse -> ListFirewallDomainsResponse -> Bool
Prelude.Eq, ReadPrec [ListFirewallDomainsResponse]
ReadPrec ListFirewallDomainsResponse
Int -> ReadS ListFirewallDomainsResponse
ReadS [ListFirewallDomainsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFirewallDomainsResponse]
$creadListPrec :: ReadPrec [ListFirewallDomainsResponse]
readPrec :: ReadPrec ListFirewallDomainsResponse
$creadPrec :: ReadPrec ListFirewallDomainsResponse
readList :: ReadS [ListFirewallDomainsResponse]
$creadList :: ReadS [ListFirewallDomainsResponse]
readsPrec :: Int -> ReadS ListFirewallDomainsResponse
$creadsPrec :: Int -> ReadS ListFirewallDomainsResponse
Prelude.Read, Int -> ListFirewallDomainsResponse -> ShowS
[ListFirewallDomainsResponse] -> ShowS
ListFirewallDomainsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFirewallDomainsResponse] -> ShowS
$cshowList :: [ListFirewallDomainsResponse] -> ShowS
show :: ListFirewallDomainsResponse -> String
$cshow :: ListFirewallDomainsResponse -> String
showsPrec :: Int -> ListFirewallDomainsResponse -> ShowS
$cshowsPrec :: Int -> ListFirewallDomainsResponse -> ShowS
Prelude.Show, forall x.
Rep ListFirewallDomainsResponse x -> ListFirewallDomainsResponse
forall x.
ListFirewallDomainsResponse -> Rep ListFirewallDomainsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListFirewallDomainsResponse x -> ListFirewallDomainsResponse
$cfrom :: forall x.
ListFirewallDomainsResponse -> Rep ListFirewallDomainsResponse x
Prelude.Generic)
newListFirewallDomainsResponse ::
Prelude.Int ->
ListFirewallDomainsResponse
newListFirewallDomainsResponse :: Int -> ListFirewallDomainsResponse
newListFirewallDomainsResponse Int
pHttpStatus_ =
ListFirewallDomainsResponse'
{ $sel:domains:ListFirewallDomainsResponse' :: Maybe [Text]
domains =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListFirewallDomainsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListFirewallDomainsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listFirewallDomainsResponse_domains :: Lens.Lens' ListFirewallDomainsResponse (Prelude.Maybe [Prelude.Text])
listFirewallDomainsResponse_domains :: Lens' ListFirewallDomainsResponse (Maybe [Text])
listFirewallDomainsResponse_domains = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallDomainsResponse' {Maybe [Text]
domains :: Maybe [Text]
$sel:domains:ListFirewallDomainsResponse' :: ListFirewallDomainsResponse -> Maybe [Text]
domains} -> Maybe [Text]
domains) (\s :: ListFirewallDomainsResponse
s@ListFirewallDomainsResponse' {} Maybe [Text]
a -> ListFirewallDomainsResponse
s {$sel:domains:ListFirewallDomainsResponse' :: Maybe [Text]
domains = Maybe [Text]
a} :: ListFirewallDomainsResponse) 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
listFirewallDomainsResponse_nextToken :: Lens.Lens' ListFirewallDomainsResponse (Prelude.Maybe Prelude.Text)
listFirewallDomainsResponse_nextToken :: Lens' ListFirewallDomainsResponse (Maybe Text)
listFirewallDomainsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallDomainsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFirewallDomainsResponse' :: ListFirewallDomainsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFirewallDomainsResponse
s@ListFirewallDomainsResponse' {} Maybe Text
a -> ListFirewallDomainsResponse
s {$sel:nextToken:ListFirewallDomainsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFirewallDomainsResponse)
listFirewallDomainsResponse_httpStatus :: Lens.Lens' ListFirewallDomainsResponse Prelude.Int
listFirewallDomainsResponse_httpStatus :: Lens' ListFirewallDomainsResponse Int
listFirewallDomainsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallDomainsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListFirewallDomainsResponse' :: ListFirewallDomainsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListFirewallDomainsResponse
s@ListFirewallDomainsResponse' {} Int
a -> ListFirewallDomainsResponse
s {$sel:httpStatus:ListFirewallDomainsResponse' :: Int
httpStatus = Int
a} :: ListFirewallDomainsResponse)
instance Prelude.NFData ListFirewallDomainsResponse where
rnf :: ListFirewallDomainsResponse -> ()
rnf ListFirewallDomainsResponse' {Int
Maybe [Text]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
domains :: Maybe [Text]
$sel:httpStatus:ListFirewallDomainsResponse' :: ListFirewallDomainsResponse -> Int
$sel:nextToken:ListFirewallDomainsResponse' :: ListFirewallDomainsResponse -> Maybe Text
$sel:domains:ListFirewallDomainsResponse' :: ListFirewallDomainsResponse -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
domains
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