{-# 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.ListLoggingConfigurations
(
ListLoggingConfigurations (..),
newListLoggingConfigurations,
listLoggingConfigurations_limit,
listLoggingConfigurations_nextMarker,
ListLoggingConfigurationsResponse (..),
newListLoggingConfigurationsResponse,
listLoggingConfigurationsResponse_loggingConfigurations,
listLoggingConfigurationsResponse_nextMarker,
listLoggingConfigurationsResponse_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 ListLoggingConfigurations = ListLoggingConfigurations'
{
ListLoggingConfigurations -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
ListLoggingConfigurations -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text
}
deriving (ListLoggingConfigurations -> ListLoggingConfigurations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLoggingConfigurations -> ListLoggingConfigurations -> Bool
$c/= :: ListLoggingConfigurations -> ListLoggingConfigurations -> Bool
== :: ListLoggingConfigurations -> ListLoggingConfigurations -> Bool
$c== :: ListLoggingConfigurations -> ListLoggingConfigurations -> Bool
Prelude.Eq, ReadPrec [ListLoggingConfigurations]
ReadPrec ListLoggingConfigurations
Int -> ReadS ListLoggingConfigurations
ReadS [ListLoggingConfigurations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLoggingConfigurations]
$creadListPrec :: ReadPrec [ListLoggingConfigurations]
readPrec :: ReadPrec ListLoggingConfigurations
$creadPrec :: ReadPrec ListLoggingConfigurations
readList :: ReadS [ListLoggingConfigurations]
$creadList :: ReadS [ListLoggingConfigurations]
readsPrec :: Int -> ReadS ListLoggingConfigurations
$creadsPrec :: Int -> ReadS ListLoggingConfigurations
Prelude.Read, Int -> ListLoggingConfigurations -> ShowS
[ListLoggingConfigurations] -> ShowS
ListLoggingConfigurations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLoggingConfigurations] -> ShowS
$cshowList :: [ListLoggingConfigurations] -> ShowS
show :: ListLoggingConfigurations -> String
$cshow :: ListLoggingConfigurations -> String
showsPrec :: Int -> ListLoggingConfigurations -> ShowS
$cshowsPrec :: Int -> ListLoggingConfigurations -> ShowS
Prelude.Show, forall x.
Rep ListLoggingConfigurations x -> ListLoggingConfigurations
forall x.
ListLoggingConfigurations -> Rep ListLoggingConfigurations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListLoggingConfigurations x -> ListLoggingConfigurations
$cfrom :: forall x.
ListLoggingConfigurations -> Rep ListLoggingConfigurations x
Prelude.Generic)
newListLoggingConfigurations ::
ListLoggingConfigurations
newListLoggingConfigurations :: ListLoggingConfigurations
newListLoggingConfigurations =
ListLoggingConfigurations'
{ $sel:limit:ListLoggingConfigurations' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:ListLoggingConfigurations' :: Maybe Text
nextMarker = forall a. Maybe a
Prelude.Nothing
}
listLoggingConfigurations_limit :: Lens.Lens' ListLoggingConfigurations (Prelude.Maybe Prelude.Natural)
listLoggingConfigurations_limit :: Lens' ListLoggingConfigurations (Maybe Natural)
listLoggingConfigurations_limit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLoggingConfigurations' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListLoggingConfigurations' :: ListLoggingConfigurations -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListLoggingConfigurations
s@ListLoggingConfigurations' {} Maybe Natural
a -> ListLoggingConfigurations
s {$sel:limit:ListLoggingConfigurations' :: Maybe Natural
limit = Maybe Natural
a} :: ListLoggingConfigurations)
listLoggingConfigurations_nextMarker :: Lens.Lens' ListLoggingConfigurations (Prelude.Maybe Prelude.Text)
listLoggingConfigurations_nextMarker :: Lens' ListLoggingConfigurations (Maybe Text)
listLoggingConfigurations_nextMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLoggingConfigurations' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListLoggingConfigurations' :: ListLoggingConfigurations -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListLoggingConfigurations
s@ListLoggingConfigurations' {} Maybe Text
a -> ListLoggingConfigurations
s {$sel:nextMarker:ListLoggingConfigurations' :: Maybe Text
nextMarker = Maybe Text
a} :: ListLoggingConfigurations)
instance Core.AWSPager ListLoggingConfigurations where
page :: ListLoggingConfigurations
-> AWSResponse ListLoggingConfigurations
-> Maybe ListLoggingConfigurations
page ListLoggingConfigurations
rq AWSResponse ListLoggingConfigurations
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListLoggingConfigurations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListLoggingConfigurationsResponse (Maybe Text)
listLoggingConfigurationsResponse_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 ListLoggingConfigurations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
ListLoggingConfigurationsResponse (Maybe [LoggingConfiguration])
listLoggingConfigurationsResponse_loggingConfigurations
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.$ ListLoggingConfigurations
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListLoggingConfigurations (Maybe Text)
listLoggingConfigurations_nextMarker
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListLoggingConfigurations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListLoggingConfigurationsResponse (Maybe Text)
listLoggingConfigurationsResponse_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 ListLoggingConfigurations where
type
AWSResponse ListLoggingConfigurations =
ListLoggingConfigurationsResponse
request :: (Service -> Service)
-> ListLoggingConfigurations -> Request ListLoggingConfigurations
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 ListLoggingConfigurations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListLoggingConfigurations)))
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 [LoggingConfiguration]
-> Maybe Text -> Int -> ListLoggingConfigurationsResponse
ListLoggingConfigurationsResponse'
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
"LoggingConfigurations"
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 ListLoggingConfigurations where
hashWithSalt :: Int -> ListLoggingConfigurations -> Int
hashWithSalt Int
_salt ListLoggingConfigurations' {Maybe Natural
Maybe Text
nextMarker :: Maybe Text
limit :: Maybe Natural
$sel:nextMarker:ListLoggingConfigurations' :: ListLoggingConfigurations -> Maybe Text
$sel:limit:ListLoggingConfigurations' :: ListLoggingConfigurations -> 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 ListLoggingConfigurations where
rnf :: ListLoggingConfigurations -> ()
rnf ListLoggingConfigurations' {Maybe Natural
Maybe Text
nextMarker :: Maybe Text
limit :: Maybe Natural
$sel:nextMarker:ListLoggingConfigurations' :: ListLoggingConfigurations -> Maybe Text
$sel:limit:ListLoggingConfigurations' :: ListLoggingConfigurations -> 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 ListLoggingConfigurations where
toHeaders :: ListLoggingConfigurations -> 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.ListLoggingConfigurations" ::
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 ListLoggingConfigurations where
toJSON :: ListLoggingConfigurations -> Value
toJSON ListLoggingConfigurations' {Maybe Natural
Maybe Text
nextMarker :: Maybe Text
limit :: Maybe Natural
$sel:nextMarker:ListLoggingConfigurations' :: ListLoggingConfigurations -> Maybe Text
$sel:limit:ListLoggingConfigurations' :: ListLoggingConfigurations -> 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 ListLoggingConfigurations where
toPath :: ListLoggingConfigurations -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListLoggingConfigurations where
toQuery :: ListLoggingConfigurations -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListLoggingConfigurationsResponse = ListLoggingConfigurationsResponse'
{
ListLoggingConfigurationsResponse -> Maybe [LoggingConfiguration]
loggingConfigurations :: Prelude.Maybe [LoggingConfiguration],
ListLoggingConfigurationsResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
ListLoggingConfigurationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListLoggingConfigurationsResponse
-> ListLoggingConfigurationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLoggingConfigurationsResponse
-> ListLoggingConfigurationsResponse -> Bool
$c/= :: ListLoggingConfigurationsResponse
-> ListLoggingConfigurationsResponse -> Bool
== :: ListLoggingConfigurationsResponse
-> ListLoggingConfigurationsResponse -> Bool
$c== :: ListLoggingConfigurationsResponse
-> ListLoggingConfigurationsResponse -> Bool
Prelude.Eq, ReadPrec [ListLoggingConfigurationsResponse]
ReadPrec ListLoggingConfigurationsResponse
Int -> ReadS ListLoggingConfigurationsResponse
ReadS [ListLoggingConfigurationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLoggingConfigurationsResponse]
$creadListPrec :: ReadPrec [ListLoggingConfigurationsResponse]
readPrec :: ReadPrec ListLoggingConfigurationsResponse
$creadPrec :: ReadPrec ListLoggingConfigurationsResponse
readList :: ReadS [ListLoggingConfigurationsResponse]
$creadList :: ReadS [ListLoggingConfigurationsResponse]
readsPrec :: Int -> ReadS ListLoggingConfigurationsResponse
$creadsPrec :: Int -> ReadS ListLoggingConfigurationsResponse
Prelude.Read, Int -> ListLoggingConfigurationsResponse -> ShowS
[ListLoggingConfigurationsResponse] -> ShowS
ListLoggingConfigurationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLoggingConfigurationsResponse] -> ShowS
$cshowList :: [ListLoggingConfigurationsResponse] -> ShowS
show :: ListLoggingConfigurationsResponse -> String
$cshow :: ListLoggingConfigurationsResponse -> String
showsPrec :: Int -> ListLoggingConfigurationsResponse -> ShowS
$cshowsPrec :: Int -> ListLoggingConfigurationsResponse -> ShowS
Prelude.Show, forall x.
Rep ListLoggingConfigurationsResponse x
-> ListLoggingConfigurationsResponse
forall x.
ListLoggingConfigurationsResponse
-> Rep ListLoggingConfigurationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListLoggingConfigurationsResponse x
-> ListLoggingConfigurationsResponse
$cfrom :: forall x.
ListLoggingConfigurationsResponse
-> Rep ListLoggingConfigurationsResponse x
Prelude.Generic)
newListLoggingConfigurationsResponse ::
Prelude.Int ->
ListLoggingConfigurationsResponse
newListLoggingConfigurationsResponse :: Int -> ListLoggingConfigurationsResponse
newListLoggingConfigurationsResponse Int
pHttpStatus_ =
ListLoggingConfigurationsResponse'
{ $sel:loggingConfigurations:ListLoggingConfigurationsResponse' :: Maybe [LoggingConfiguration]
loggingConfigurations =
forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:ListLoggingConfigurationsResponse' :: Maybe Text
nextMarker = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListLoggingConfigurationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listLoggingConfigurationsResponse_loggingConfigurations :: Lens.Lens' ListLoggingConfigurationsResponse (Prelude.Maybe [LoggingConfiguration])
listLoggingConfigurationsResponse_loggingConfigurations :: Lens'
ListLoggingConfigurationsResponse (Maybe [LoggingConfiguration])
listLoggingConfigurationsResponse_loggingConfigurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLoggingConfigurationsResponse' {Maybe [LoggingConfiguration]
loggingConfigurations :: Maybe [LoggingConfiguration]
$sel:loggingConfigurations:ListLoggingConfigurationsResponse' :: ListLoggingConfigurationsResponse -> Maybe [LoggingConfiguration]
loggingConfigurations} -> Maybe [LoggingConfiguration]
loggingConfigurations) (\s :: ListLoggingConfigurationsResponse
s@ListLoggingConfigurationsResponse' {} Maybe [LoggingConfiguration]
a -> ListLoggingConfigurationsResponse
s {$sel:loggingConfigurations:ListLoggingConfigurationsResponse' :: Maybe [LoggingConfiguration]
loggingConfigurations = Maybe [LoggingConfiguration]
a} :: ListLoggingConfigurationsResponse) 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
listLoggingConfigurationsResponse_nextMarker :: Lens.Lens' ListLoggingConfigurationsResponse (Prelude.Maybe Prelude.Text)
listLoggingConfigurationsResponse_nextMarker :: Lens' ListLoggingConfigurationsResponse (Maybe Text)
listLoggingConfigurationsResponse_nextMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLoggingConfigurationsResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListLoggingConfigurationsResponse' :: ListLoggingConfigurationsResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListLoggingConfigurationsResponse
s@ListLoggingConfigurationsResponse' {} Maybe Text
a -> ListLoggingConfigurationsResponse
s {$sel:nextMarker:ListLoggingConfigurationsResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListLoggingConfigurationsResponse)
listLoggingConfigurationsResponse_httpStatus :: Lens.Lens' ListLoggingConfigurationsResponse Prelude.Int
listLoggingConfigurationsResponse_httpStatus :: Lens' ListLoggingConfigurationsResponse Int
listLoggingConfigurationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLoggingConfigurationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListLoggingConfigurationsResponse' :: ListLoggingConfigurationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListLoggingConfigurationsResponse
s@ListLoggingConfigurationsResponse' {} Int
a -> ListLoggingConfigurationsResponse
s {$sel:httpStatus:ListLoggingConfigurationsResponse' :: Int
httpStatus = Int
a} :: ListLoggingConfigurationsResponse)
instance
Prelude.NFData
ListLoggingConfigurationsResponse
where
rnf :: ListLoggingConfigurationsResponse -> ()
rnf ListLoggingConfigurationsResponse' {Int
Maybe [LoggingConfiguration]
Maybe Text
httpStatus :: Int
nextMarker :: Maybe Text
loggingConfigurations :: Maybe [LoggingConfiguration]
$sel:httpStatus:ListLoggingConfigurationsResponse' :: ListLoggingConfigurationsResponse -> Int
$sel:nextMarker:ListLoggingConfigurationsResponse' :: ListLoggingConfigurationsResponse -> Maybe Text
$sel:loggingConfigurations:ListLoggingConfigurationsResponse' :: ListLoggingConfigurationsResponse -> Maybe [LoggingConfiguration]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [LoggingConfiguration]
loggingConfigurations
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