{-# 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.ListByteMatchSets
(
ListByteMatchSets (..),
newListByteMatchSets,
listByteMatchSets_limit,
listByteMatchSets_nextMarker,
ListByteMatchSetsResponse (..),
newListByteMatchSetsResponse,
listByteMatchSetsResponse_byteMatchSets,
listByteMatchSetsResponse_nextMarker,
listByteMatchSetsResponse_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 ListByteMatchSets = ListByteMatchSets'
{
ListByteMatchSets -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
ListByteMatchSets -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text
}
deriving (ListByteMatchSets -> ListByteMatchSets -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListByteMatchSets -> ListByteMatchSets -> Bool
$c/= :: ListByteMatchSets -> ListByteMatchSets -> Bool
== :: ListByteMatchSets -> ListByteMatchSets -> Bool
$c== :: ListByteMatchSets -> ListByteMatchSets -> Bool
Prelude.Eq, ReadPrec [ListByteMatchSets]
ReadPrec ListByteMatchSets
Int -> ReadS ListByteMatchSets
ReadS [ListByteMatchSets]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListByteMatchSets]
$creadListPrec :: ReadPrec [ListByteMatchSets]
readPrec :: ReadPrec ListByteMatchSets
$creadPrec :: ReadPrec ListByteMatchSets
readList :: ReadS [ListByteMatchSets]
$creadList :: ReadS [ListByteMatchSets]
readsPrec :: Int -> ReadS ListByteMatchSets
$creadsPrec :: Int -> ReadS ListByteMatchSets
Prelude.Read, Int -> ListByteMatchSets -> ShowS
[ListByteMatchSets] -> ShowS
ListByteMatchSets -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListByteMatchSets] -> ShowS
$cshowList :: [ListByteMatchSets] -> ShowS
show :: ListByteMatchSets -> String
$cshow :: ListByteMatchSets -> String
showsPrec :: Int -> ListByteMatchSets -> ShowS
$cshowsPrec :: Int -> ListByteMatchSets -> ShowS
Prelude.Show, forall x. Rep ListByteMatchSets x -> ListByteMatchSets
forall x. ListByteMatchSets -> Rep ListByteMatchSets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListByteMatchSets x -> ListByteMatchSets
$cfrom :: forall x. ListByteMatchSets -> Rep ListByteMatchSets x
Prelude.Generic)
newListByteMatchSets ::
ListByteMatchSets
newListByteMatchSets :: ListByteMatchSets
newListByteMatchSets =
ListByteMatchSets'
{ $sel:limit:ListByteMatchSets' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:ListByteMatchSets' :: Maybe Text
nextMarker = forall a. Maybe a
Prelude.Nothing
}
listByteMatchSets_limit :: Lens.Lens' ListByteMatchSets (Prelude.Maybe Prelude.Natural)
listByteMatchSets_limit :: Lens' ListByteMatchSets (Maybe Natural)
listByteMatchSets_limit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListByteMatchSets' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListByteMatchSets' :: ListByteMatchSets -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListByteMatchSets
s@ListByteMatchSets' {} Maybe Natural
a -> ListByteMatchSets
s {$sel:limit:ListByteMatchSets' :: Maybe Natural
limit = Maybe Natural
a} :: ListByteMatchSets)
listByteMatchSets_nextMarker :: Lens.Lens' ListByteMatchSets (Prelude.Maybe Prelude.Text)
listByteMatchSets_nextMarker :: Lens' ListByteMatchSets (Maybe Text)
listByteMatchSets_nextMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListByteMatchSets' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListByteMatchSets' :: ListByteMatchSets -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListByteMatchSets
s@ListByteMatchSets' {} Maybe Text
a -> ListByteMatchSets
s {$sel:nextMarker:ListByteMatchSets' :: Maybe Text
nextMarker = Maybe Text
a} :: ListByteMatchSets)
instance Core.AWSPager ListByteMatchSets where
page :: ListByteMatchSets
-> AWSResponse ListByteMatchSets -> Maybe ListByteMatchSets
page ListByteMatchSets
rq AWSResponse ListByteMatchSets
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListByteMatchSets
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListByteMatchSetsResponse (Maybe Text)
listByteMatchSetsResponse_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 ListByteMatchSets
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListByteMatchSetsResponse (Maybe [ByteMatchSetSummary])
listByteMatchSetsResponse_byteMatchSets
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.$ ListByteMatchSets
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListByteMatchSets (Maybe Text)
listByteMatchSets_nextMarker
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListByteMatchSets
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListByteMatchSetsResponse (Maybe Text)
listByteMatchSetsResponse_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 ListByteMatchSets where
type
AWSResponse ListByteMatchSets =
ListByteMatchSetsResponse
request :: (Service -> Service)
-> ListByteMatchSets -> Request ListByteMatchSets
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 ListByteMatchSets
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListByteMatchSets)))
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 [ByteMatchSetSummary]
-> Maybe Text -> Int -> ListByteMatchSetsResponse
ListByteMatchSetsResponse'
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
"ByteMatchSets" 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
"NextMarker")
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 ListByteMatchSets where
hashWithSalt :: Int -> ListByteMatchSets -> Int
hashWithSalt Int
_salt ListByteMatchSets' {Maybe Natural
Maybe Text
nextMarker :: Maybe Text
limit :: Maybe Natural
$sel:nextMarker:ListByteMatchSets' :: ListByteMatchSets -> Maybe Text
$sel:limit:ListByteMatchSets' :: ListByteMatchSets -> 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 ListByteMatchSets where
rnf :: ListByteMatchSets -> ()
rnf ListByteMatchSets' {Maybe Natural
Maybe Text
nextMarker :: Maybe Text
limit :: Maybe Natural
$sel:nextMarker:ListByteMatchSets' :: ListByteMatchSets -> Maybe Text
$sel:limit:ListByteMatchSets' :: ListByteMatchSets -> 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 ListByteMatchSets where
toHeaders :: ListByteMatchSets -> 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.ListByteMatchSets" ::
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 ListByteMatchSets where
toJSON :: ListByteMatchSets -> Value
toJSON ListByteMatchSets' {Maybe Natural
Maybe Text
nextMarker :: Maybe Text
limit :: Maybe Natural
$sel:nextMarker:ListByteMatchSets' :: ListByteMatchSets -> Maybe Text
$sel:limit:ListByteMatchSets' :: ListByteMatchSets -> 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 ListByteMatchSets where
toPath :: ListByteMatchSets -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListByteMatchSets where
toQuery :: ListByteMatchSets -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListByteMatchSetsResponse = ListByteMatchSetsResponse'
{
ListByteMatchSetsResponse -> Maybe [ByteMatchSetSummary]
byteMatchSets :: Prelude.Maybe [ByteMatchSetSummary],
ListByteMatchSetsResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
ListByteMatchSetsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListByteMatchSetsResponse -> ListByteMatchSetsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListByteMatchSetsResponse -> ListByteMatchSetsResponse -> Bool
$c/= :: ListByteMatchSetsResponse -> ListByteMatchSetsResponse -> Bool
== :: ListByteMatchSetsResponse -> ListByteMatchSetsResponse -> Bool
$c== :: ListByteMatchSetsResponse -> ListByteMatchSetsResponse -> Bool
Prelude.Eq, ReadPrec [ListByteMatchSetsResponse]
ReadPrec ListByteMatchSetsResponse
Int -> ReadS ListByteMatchSetsResponse
ReadS [ListByteMatchSetsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListByteMatchSetsResponse]
$creadListPrec :: ReadPrec [ListByteMatchSetsResponse]
readPrec :: ReadPrec ListByteMatchSetsResponse
$creadPrec :: ReadPrec ListByteMatchSetsResponse
readList :: ReadS [ListByteMatchSetsResponse]
$creadList :: ReadS [ListByteMatchSetsResponse]
readsPrec :: Int -> ReadS ListByteMatchSetsResponse
$creadsPrec :: Int -> ReadS ListByteMatchSetsResponse
Prelude.Read, Int -> ListByteMatchSetsResponse -> ShowS
[ListByteMatchSetsResponse] -> ShowS
ListByteMatchSetsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListByteMatchSetsResponse] -> ShowS
$cshowList :: [ListByteMatchSetsResponse] -> ShowS
show :: ListByteMatchSetsResponse -> String
$cshow :: ListByteMatchSetsResponse -> String
showsPrec :: Int -> ListByteMatchSetsResponse -> ShowS
$cshowsPrec :: Int -> ListByteMatchSetsResponse -> ShowS
Prelude.Show, forall x.
Rep ListByteMatchSetsResponse x -> ListByteMatchSetsResponse
forall x.
ListByteMatchSetsResponse -> Rep ListByteMatchSetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListByteMatchSetsResponse x -> ListByteMatchSetsResponse
$cfrom :: forall x.
ListByteMatchSetsResponse -> Rep ListByteMatchSetsResponse x
Prelude.Generic)
newListByteMatchSetsResponse ::
Prelude.Int ->
ListByteMatchSetsResponse
newListByteMatchSetsResponse :: Int -> ListByteMatchSetsResponse
newListByteMatchSetsResponse Int
pHttpStatus_ =
ListByteMatchSetsResponse'
{ $sel:byteMatchSets:ListByteMatchSetsResponse' :: Maybe [ByteMatchSetSummary]
byteMatchSets =
forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:ListByteMatchSetsResponse' :: Maybe Text
nextMarker = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListByteMatchSetsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listByteMatchSetsResponse_byteMatchSets :: Lens.Lens' ListByteMatchSetsResponse (Prelude.Maybe [ByteMatchSetSummary])
listByteMatchSetsResponse_byteMatchSets :: Lens' ListByteMatchSetsResponse (Maybe [ByteMatchSetSummary])
listByteMatchSetsResponse_byteMatchSets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListByteMatchSetsResponse' {Maybe [ByteMatchSetSummary]
byteMatchSets :: Maybe [ByteMatchSetSummary]
$sel:byteMatchSets:ListByteMatchSetsResponse' :: ListByteMatchSetsResponse -> Maybe [ByteMatchSetSummary]
byteMatchSets} -> Maybe [ByteMatchSetSummary]
byteMatchSets) (\s :: ListByteMatchSetsResponse
s@ListByteMatchSetsResponse' {} Maybe [ByteMatchSetSummary]
a -> ListByteMatchSetsResponse
s {$sel:byteMatchSets:ListByteMatchSetsResponse' :: Maybe [ByteMatchSetSummary]
byteMatchSets = Maybe [ByteMatchSetSummary]
a} :: ListByteMatchSetsResponse) 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
listByteMatchSetsResponse_nextMarker :: Lens.Lens' ListByteMatchSetsResponse (Prelude.Maybe Prelude.Text)
listByteMatchSetsResponse_nextMarker :: Lens' ListByteMatchSetsResponse (Maybe Text)
listByteMatchSetsResponse_nextMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListByteMatchSetsResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListByteMatchSetsResponse' :: ListByteMatchSetsResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListByteMatchSetsResponse
s@ListByteMatchSetsResponse' {} Maybe Text
a -> ListByteMatchSetsResponse
s {$sel:nextMarker:ListByteMatchSetsResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListByteMatchSetsResponse)
listByteMatchSetsResponse_httpStatus :: Lens.Lens' ListByteMatchSetsResponse Prelude.Int
listByteMatchSetsResponse_httpStatus :: Lens' ListByteMatchSetsResponse Int
listByteMatchSetsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListByteMatchSetsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListByteMatchSetsResponse' :: ListByteMatchSetsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListByteMatchSetsResponse
s@ListByteMatchSetsResponse' {} Int
a -> ListByteMatchSetsResponse
s {$sel:httpStatus:ListByteMatchSetsResponse' :: Int
httpStatus = Int
a} :: ListByteMatchSetsResponse)
instance Prelude.NFData ListByteMatchSetsResponse where
rnf :: ListByteMatchSetsResponse -> ()
rnf ListByteMatchSetsResponse' {Int
Maybe [ByteMatchSetSummary]
Maybe Text
httpStatus :: Int
nextMarker :: Maybe Text
byteMatchSets :: Maybe [ByteMatchSetSummary]
$sel:httpStatus:ListByteMatchSetsResponse' :: ListByteMatchSetsResponse -> Int
$sel:nextMarker:ListByteMatchSetsResponse' :: ListByteMatchSetsResponse -> Maybe Text
$sel:byteMatchSets:ListByteMatchSetsResponse' :: ListByteMatchSetsResponse -> Maybe [ByteMatchSetSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [ByteMatchSetSummary]
byteMatchSets
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Int
httpStatus