{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Route53.ListQueryLoggingConfigs
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the configurations for DNS query logging that are associated with
-- the current Amazon Web Services account or the configuration that is
-- associated with a specified hosted zone.
--
-- For more information about DNS query logs, see
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateQueryLoggingConfig.html CreateQueryLoggingConfig>.
-- Additional information, including the format of DNS query logs, appears
-- in
-- <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/query-logs.html Logging DNS Queries>
-- in the /Amazon Route 53 Developer Guide/.
--
-- This operation returns paginated results.
module Amazonka.Route53.ListQueryLoggingConfigs
  ( -- * Creating a Request
    ListQueryLoggingConfigs (..),
    newListQueryLoggingConfigs,

    -- * Request Lenses
    listQueryLoggingConfigs_hostedZoneId,
    listQueryLoggingConfigs_maxResults,
    listQueryLoggingConfigs_nextToken,

    -- * Destructuring the Response
    ListQueryLoggingConfigsResponse (..),
    newListQueryLoggingConfigsResponse,

    -- * Response Lenses
    listQueryLoggingConfigsResponse_nextToken,
    listQueryLoggingConfigsResponse_httpStatus,
    listQueryLoggingConfigsResponse_queryLoggingConfigs,
  )
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.Route53.Types

-- | /See:/ 'newListQueryLoggingConfigs' smart constructor.
data ListQueryLoggingConfigs = ListQueryLoggingConfigs'
  { -- | (Optional) If you want to list the query logging configuration that is
    -- associated with a hosted zone, specify the ID in @HostedZoneId@.
    --
    -- If you don\'t specify a hosted zone ID, @ListQueryLoggingConfigs@
    -- returns all of the configurations that are associated with the current
    -- Amazon Web Services account.
    ListQueryLoggingConfigs -> Maybe ResourceId
hostedZoneId :: Prelude.Maybe ResourceId,
    -- | (Optional) The maximum number of query logging configurations that you
    -- want Amazon Route 53 to return in response to the current request. If
    -- the current Amazon Web Services account has more than @MaxResults@
    -- configurations, use the value of
    -- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_ListQueryLoggingConfigs.html#API_ListQueryLoggingConfigs_RequestSyntax NextToken>
    -- in the response to get the next page of results.
    --
    -- If you don\'t specify a value for @MaxResults@, Route 53 returns up to
    -- 100 configurations.
    ListQueryLoggingConfigs -> Maybe Text
maxResults :: Prelude.Maybe Prelude.Text,
    -- | (Optional) If the current Amazon Web Services account has more than
    -- @MaxResults@ query logging configurations, use @NextToken@ to get the
    -- second and subsequent pages of results.
    --
    -- For the first @ListQueryLoggingConfigs@ request, omit this value.
    --
    -- For the second and subsequent requests, get the value of @NextToken@
    -- from the previous response and specify that value for @NextToken@ in the
    -- request.
    ListQueryLoggingConfigs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListQueryLoggingConfigs -> ListQueryLoggingConfigs -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListQueryLoggingConfigs -> ListQueryLoggingConfigs -> Bool
$c/= :: ListQueryLoggingConfigs -> ListQueryLoggingConfigs -> Bool
== :: ListQueryLoggingConfigs -> ListQueryLoggingConfigs -> Bool
$c== :: ListQueryLoggingConfigs -> ListQueryLoggingConfigs -> Bool
Prelude.Eq, ReadPrec [ListQueryLoggingConfigs]
ReadPrec ListQueryLoggingConfigs
Int -> ReadS ListQueryLoggingConfigs
ReadS [ListQueryLoggingConfigs]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListQueryLoggingConfigs]
$creadListPrec :: ReadPrec [ListQueryLoggingConfigs]
readPrec :: ReadPrec ListQueryLoggingConfigs
$creadPrec :: ReadPrec ListQueryLoggingConfigs
readList :: ReadS [ListQueryLoggingConfigs]
$creadList :: ReadS [ListQueryLoggingConfigs]
readsPrec :: Int -> ReadS ListQueryLoggingConfigs
$creadsPrec :: Int -> ReadS ListQueryLoggingConfigs
Prelude.Read, Int -> ListQueryLoggingConfigs -> ShowS
[ListQueryLoggingConfigs] -> ShowS
ListQueryLoggingConfigs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListQueryLoggingConfigs] -> ShowS
$cshowList :: [ListQueryLoggingConfigs] -> ShowS
show :: ListQueryLoggingConfigs -> String
$cshow :: ListQueryLoggingConfigs -> String
showsPrec :: Int -> ListQueryLoggingConfigs -> ShowS
$cshowsPrec :: Int -> ListQueryLoggingConfigs -> ShowS
Prelude.Show, forall x. Rep ListQueryLoggingConfigs x -> ListQueryLoggingConfigs
forall x. ListQueryLoggingConfigs -> Rep ListQueryLoggingConfigs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListQueryLoggingConfigs x -> ListQueryLoggingConfigs
$cfrom :: forall x. ListQueryLoggingConfigs -> Rep ListQueryLoggingConfigs x
Prelude.Generic)

-- |
-- Create a value of 'ListQueryLoggingConfigs' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'hostedZoneId', 'listQueryLoggingConfigs_hostedZoneId' - (Optional) If you want to list the query logging configuration that is
-- associated with a hosted zone, specify the ID in @HostedZoneId@.
--
-- If you don\'t specify a hosted zone ID, @ListQueryLoggingConfigs@
-- returns all of the configurations that are associated with the current
-- Amazon Web Services account.
--
-- 'maxResults', 'listQueryLoggingConfigs_maxResults' - (Optional) The maximum number of query logging configurations that you
-- want Amazon Route 53 to return in response to the current request. If
-- the current Amazon Web Services account has more than @MaxResults@
-- configurations, use the value of
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_ListQueryLoggingConfigs.html#API_ListQueryLoggingConfigs_RequestSyntax NextToken>
-- in the response to get the next page of results.
--
-- If you don\'t specify a value for @MaxResults@, Route 53 returns up to
-- 100 configurations.
--
-- 'nextToken', 'listQueryLoggingConfigs_nextToken' - (Optional) If the current Amazon Web Services account has more than
-- @MaxResults@ query logging configurations, use @NextToken@ to get the
-- second and subsequent pages of results.
--
-- For the first @ListQueryLoggingConfigs@ request, omit this value.
--
-- For the second and subsequent requests, get the value of @NextToken@
-- from the previous response and specify that value for @NextToken@ in the
-- request.
newListQueryLoggingConfigs ::
  ListQueryLoggingConfigs
newListQueryLoggingConfigs :: ListQueryLoggingConfigs
newListQueryLoggingConfigs =
  ListQueryLoggingConfigs'
    { $sel:hostedZoneId:ListQueryLoggingConfigs' :: Maybe ResourceId
hostedZoneId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListQueryLoggingConfigs' :: Maybe Text
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListQueryLoggingConfigs' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | (Optional) If you want to list the query logging configuration that is
-- associated with a hosted zone, specify the ID in @HostedZoneId@.
--
-- If you don\'t specify a hosted zone ID, @ListQueryLoggingConfigs@
-- returns all of the configurations that are associated with the current
-- Amazon Web Services account.
listQueryLoggingConfigs_hostedZoneId :: Lens.Lens' ListQueryLoggingConfigs (Prelude.Maybe ResourceId)
listQueryLoggingConfigs_hostedZoneId :: Lens' ListQueryLoggingConfigs (Maybe ResourceId)
listQueryLoggingConfigs_hostedZoneId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueryLoggingConfigs' {Maybe ResourceId
hostedZoneId :: Maybe ResourceId
$sel:hostedZoneId:ListQueryLoggingConfigs' :: ListQueryLoggingConfigs -> Maybe ResourceId
hostedZoneId} -> Maybe ResourceId
hostedZoneId) (\s :: ListQueryLoggingConfigs
s@ListQueryLoggingConfigs' {} Maybe ResourceId
a -> ListQueryLoggingConfigs
s {$sel:hostedZoneId:ListQueryLoggingConfigs' :: Maybe ResourceId
hostedZoneId = Maybe ResourceId
a} :: ListQueryLoggingConfigs)

-- | (Optional) The maximum number of query logging configurations that you
-- want Amazon Route 53 to return in response to the current request. If
-- the current Amazon Web Services account has more than @MaxResults@
-- configurations, use the value of
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_ListQueryLoggingConfigs.html#API_ListQueryLoggingConfigs_RequestSyntax NextToken>
-- in the response to get the next page of results.
--
-- If you don\'t specify a value for @MaxResults@, Route 53 returns up to
-- 100 configurations.
listQueryLoggingConfigs_maxResults :: Lens.Lens' ListQueryLoggingConfigs (Prelude.Maybe Prelude.Text)
listQueryLoggingConfigs_maxResults :: Lens' ListQueryLoggingConfigs (Maybe Text)
listQueryLoggingConfigs_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueryLoggingConfigs' {Maybe Text
maxResults :: Maybe Text
$sel:maxResults:ListQueryLoggingConfigs' :: ListQueryLoggingConfigs -> Maybe Text
maxResults} -> Maybe Text
maxResults) (\s :: ListQueryLoggingConfigs
s@ListQueryLoggingConfigs' {} Maybe Text
a -> ListQueryLoggingConfigs
s {$sel:maxResults:ListQueryLoggingConfigs' :: Maybe Text
maxResults = Maybe Text
a} :: ListQueryLoggingConfigs)

-- | (Optional) If the current Amazon Web Services account has more than
-- @MaxResults@ query logging configurations, use @NextToken@ to get the
-- second and subsequent pages of results.
--
-- For the first @ListQueryLoggingConfigs@ request, omit this value.
--
-- For the second and subsequent requests, get the value of @NextToken@
-- from the previous response and specify that value for @NextToken@ in the
-- request.
listQueryLoggingConfigs_nextToken :: Lens.Lens' ListQueryLoggingConfigs (Prelude.Maybe Prelude.Text)
listQueryLoggingConfigs_nextToken :: Lens' ListQueryLoggingConfigs (Maybe Text)
listQueryLoggingConfigs_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueryLoggingConfigs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListQueryLoggingConfigs' :: ListQueryLoggingConfigs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListQueryLoggingConfigs
s@ListQueryLoggingConfigs' {} Maybe Text
a -> ListQueryLoggingConfigs
s {$sel:nextToken:ListQueryLoggingConfigs' :: Maybe Text
nextToken = Maybe Text
a} :: ListQueryLoggingConfigs)

instance Core.AWSPager ListQueryLoggingConfigs where
  page :: ListQueryLoggingConfigs
-> AWSResponse ListQueryLoggingConfigs
-> Maybe ListQueryLoggingConfigs
page ListQueryLoggingConfigs
rq AWSResponse ListQueryLoggingConfigs
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListQueryLoggingConfigs
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListQueryLoggingConfigsResponse (Maybe Text)
listQueryLoggingConfigsResponse_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 ListQueryLoggingConfigs
rs
            forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListQueryLoggingConfigsResponse [QueryLoggingConfig]
listQueryLoggingConfigsResponse_queryLoggingConfigs
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListQueryLoggingConfigs
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListQueryLoggingConfigs (Maybe Text)
listQueryLoggingConfigs_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListQueryLoggingConfigs
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListQueryLoggingConfigsResponse (Maybe Text)
listQueryLoggingConfigsResponse_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 ListQueryLoggingConfigs where
  type
    AWSResponse ListQueryLoggingConfigs =
      ListQueryLoggingConfigsResponse
  request :: (Service -> Service)
-> ListQueryLoggingConfigs -> Request ListQueryLoggingConfigs
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListQueryLoggingConfigs
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListQueryLoggingConfigs)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Int -> [QueryLoggingConfig] -> ListQueryLoggingConfigsResponse
ListQueryLoggingConfigsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"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))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"QueryLoggingConfigs"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"QueryLoggingConfig"
                        )
      )

instance Prelude.Hashable ListQueryLoggingConfigs where
  hashWithSalt :: Int -> ListQueryLoggingConfigs -> Int
hashWithSalt Int
_salt ListQueryLoggingConfigs' {Maybe Text
Maybe ResourceId
nextToken :: Maybe Text
maxResults :: Maybe Text
hostedZoneId :: Maybe ResourceId
$sel:nextToken:ListQueryLoggingConfigs' :: ListQueryLoggingConfigs -> Maybe Text
$sel:maxResults:ListQueryLoggingConfigs' :: ListQueryLoggingConfigs -> Maybe Text
$sel:hostedZoneId:ListQueryLoggingConfigs' :: ListQueryLoggingConfigs -> Maybe ResourceId
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceId
hostedZoneId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData ListQueryLoggingConfigs where
  rnf :: ListQueryLoggingConfigs -> ()
rnf ListQueryLoggingConfigs' {Maybe Text
Maybe ResourceId
nextToken :: Maybe Text
maxResults :: Maybe Text
hostedZoneId :: Maybe ResourceId
$sel:nextToken:ListQueryLoggingConfigs' :: ListQueryLoggingConfigs -> Maybe Text
$sel:maxResults:ListQueryLoggingConfigs' :: ListQueryLoggingConfigs -> Maybe Text
$sel:hostedZoneId:ListQueryLoggingConfigs' :: ListQueryLoggingConfigs -> Maybe ResourceId
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceId
hostedZoneId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

instance Data.ToHeaders ListQueryLoggingConfigs where
  toHeaders :: ListQueryLoggingConfigs -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath ListQueryLoggingConfigs where
  toPath :: ListQueryLoggingConfigs -> ByteString
toPath =
    forall a b. a -> b -> a
Prelude.const ByteString
"/2013-04-01/queryloggingconfig"

instance Data.ToQuery ListQueryLoggingConfigs where
  toQuery :: ListQueryLoggingConfigs -> QueryString
toQuery ListQueryLoggingConfigs' {Maybe Text
Maybe ResourceId
nextToken :: Maybe Text
maxResults :: Maybe Text
hostedZoneId :: Maybe ResourceId
$sel:nextToken:ListQueryLoggingConfigs' :: ListQueryLoggingConfigs -> Maybe Text
$sel:maxResults:ListQueryLoggingConfigs' :: ListQueryLoggingConfigs -> Maybe Text
$sel:hostedZoneId:ListQueryLoggingConfigs' :: ListQueryLoggingConfigs -> Maybe ResourceId
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"hostedzoneid" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe ResourceId
hostedZoneId,
        ByteString
"maxresults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
maxResults,
        ByteString
"nexttoken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
      ]

-- | /See:/ 'newListQueryLoggingConfigsResponse' smart constructor.
data ListQueryLoggingConfigsResponse = ListQueryLoggingConfigsResponse'
  { -- | If a response includes the last of the query logging configurations that
    -- are associated with the current Amazon Web Services account, @NextToken@
    -- doesn\'t appear in the response.
    --
    -- If a response doesn\'t include the last of the configurations, you can
    -- get more configurations by submitting another
    -- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_ListQueryLoggingConfigs.html ListQueryLoggingConfigs>
    -- request. Get the value of @NextToken@ that Amazon Route 53 returned in
    -- the previous response and include it in @NextToken@ in the next request.
    ListQueryLoggingConfigsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListQueryLoggingConfigsResponse -> Int
httpStatus :: Prelude.Int,
    -- | An array that contains one
    -- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_QueryLoggingConfig.html QueryLoggingConfig>
    -- element for each configuration for DNS query logging that is associated
    -- with the current Amazon Web Services account.
    ListQueryLoggingConfigsResponse -> [QueryLoggingConfig]
queryLoggingConfigs :: [QueryLoggingConfig]
  }
  deriving (ListQueryLoggingConfigsResponse
-> ListQueryLoggingConfigsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListQueryLoggingConfigsResponse
-> ListQueryLoggingConfigsResponse -> Bool
$c/= :: ListQueryLoggingConfigsResponse
-> ListQueryLoggingConfigsResponse -> Bool
== :: ListQueryLoggingConfigsResponse
-> ListQueryLoggingConfigsResponse -> Bool
$c== :: ListQueryLoggingConfigsResponse
-> ListQueryLoggingConfigsResponse -> Bool
Prelude.Eq, ReadPrec [ListQueryLoggingConfigsResponse]
ReadPrec ListQueryLoggingConfigsResponse
Int -> ReadS ListQueryLoggingConfigsResponse
ReadS [ListQueryLoggingConfigsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListQueryLoggingConfigsResponse]
$creadListPrec :: ReadPrec [ListQueryLoggingConfigsResponse]
readPrec :: ReadPrec ListQueryLoggingConfigsResponse
$creadPrec :: ReadPrec ListQueryLoggingConfigsResponse
readList :: ReadS [ListQueryLoggingConfigsResponse]
$creadList :: ReadS [ListQueryLoggingConfigsResponse]
readsPrec :: Int -> ReadS ListQueryLoggingConfigsResponse
$creadsPrec :: Int -> ReadS ListQueryLoggingConfigsResponse
Prelude.Read, Int -> ListQueryLoggingConfigsResponse -> ShowS
[ListQueryLoggingConfigsResponse] -> ShowS
ListQueryLoggingConfigsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListQueryLoggingConfigsResponse] -> ShowS
$cshowList :: [ListQueryLoggingConfigsResponse] -> ShowS
show :: ListQueryLoggingConfigsResponse -> String
$cshow :: ListQueryLoggingConfigsResponse -> String
showsPrec :: Int -> ListQueryLoggingConfigsResponse -> ShowS
$cshowsPrec :: Int -> ListQueryLoggingConfigsResponse -> ShowS
Prelude.Show, forall x.
Rep ListQueryLoggingConfigsResponse x
-> ListQueryLoggingConfigsResponse
forall x.
ListQueryLoggingConfigsResponse
-> Rep ListQueryLoggingConfigsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListQueryLoggingConfigsResponse x
-> ListQueryLoggingConfigsResponse
$cfrom :: forall x.
ListQueryLoggingConfigsResponse
-> Rep ListQueryLoggingConfigsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListQueryLoggingConfigsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listQueryLoggingConfigsResponse_nextToken' - If a response includes the last of the query logging configurations that
-- are associated with the current Amazon Web Services account, @NextToken@
-- doesn\'t appear in the response.
--
-- If a response doesn\'t include the last of the configurations, you can
-- get more configurations by submitting another
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_ListQueryLoggingConfigs.html ListQueryLoggingConfigs>
-- request. Get the value of @NextToken@ that Amazon Route 53 returned in
-- the previous response and include it in @NextToken@ in the next request.
--
-- 'httpStatus', 'listQueryLoggingConfigsResponse_httpStatus' - The response's http status code.
--
-- 'queryLoggingConfigs', 'listQueryLoggingConfigsResponse_queryLoggingConfigs' - An array that contains one
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_QueryLoggingConfig.html QueryLoggingConfig>
-- element for each configuration for DNS query logging that is associated
-- with the current Amazon Web Services account.
newListQueryLoggingConfigsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListQueryLoggingConfigsResponse
newListQueryLoggingConfigsResponse :: Int -> ListQueryLoggingConfigsResponse
newListQueryLoggingConfigsResponse Int
pHttpStatus_ =
  ListQueryLoggingConfigsResponse'
    { $sel:nextToken:ListQueryLoggingConfigsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListQueryLoggingConfigsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:queryLoggingConfigs:ListQueryLoggingConfigsResponse' :: [QueryLoggingConfig]
queryLoggingConfigs = forall a. Monoid a => a
Prelude.mempty
    }

-- | If a response includes the last of the query logging configurations that
-- are associated with the current Amazon Web Services account, @NextToken@
-- doesn\'t appear in the response.
--
-- If a response doesn\'t include the last of the configurations, you can
-- get more configurations by submitting another
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_ListQueryLoggingConfigs.html ListQueryLoggingConfigs>
-- request. Get the value of @NextToken@ that Amazon Route 53 returned in
-- the previous response and include it in @NextToken@ in the next request.
listQueryLoggingConfigsResponse_nextToken :: Lens.Lens' ListQueryLoggingConfigsResponse (Prelude.Maybe Prelude.Text)
listQueryLoggingConfigsResponse_nextToken :: Lens' ListQueryLoggingConfigsResponse (Maybe Text)
listQueryLoggingConfigsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueryLoggingConfigsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListQueryLoggingConfigsResponse' :: ListQueryLoggingConfigsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListQueryLoggingConfigsResponse
s@ListQueryLoggingConfigsResponse' {} Maybe Text
a -> ListQueryLoggingConfigsResponse
s {$sel:nextToken:ListQueryLoggingConfigsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListQueryLoggingConfigsResponse)

-- | The response's http status code.
listQueryLoggingConfigsResponse_httpStatus :: Lens.Lens' ListQueryLoggingConfigsResponse Prelude.Int
listQueryLoggingConfigsResponse_httpStatus :: Lens' ListQueryLoggingConfigsResponse Int
listQueryLoggingConfigsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueryLoggingConfigsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListQueryLoggingConfigsResponse' :: ListQueryLoggingConfigsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListQueryLoggingConfigsResponse
s@ListQueryLoggingConfigsResponse' {} Int
a -> ListQueryLoggingConfigsResponse
s {$sel:httpStatus:ListQueryLoggingConfigsResponse' :: Int
httpStatus = Int
a} :: ListQueryLoggingConfigsResponse)

-- | An array that contains one
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_QueryLoggingConfig.html QueryLoggingConfig>
-- element for each configuration for DNS query logging that is associated
-- with the current Amazon Web Services account.
listQueryLoggingConfigsResponse_queryLoggingConfigs :: Lens.Lens' ListQueryLoggingConfigsResponse [QueryLoggingConfig]
listQueryLoggingConfigsResponse_queryLoggingConfigs :: Lens' ListQueryLoggingConfigsResponse [QueryLoggingConfig]
listQueryLoggingConfigsResponse_queryLoggingConfigs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListQueryLoggingConfigsResponse' {[QueryLoggingConfig]
queryLoggingConfigs :: [QueryLoggingConfig]
$sel:queryLoggingConfigs:ListQueryLoggingConfigsResponse' :: ListQueryLoggingConfigsResponse -> [QueryLoggingConfig]
queryLoggingConfigs} -> [QueryLoggingConfig]
queryLoggingConfigs) (\s :: ListQueryLoggingConfigsResponse
s@ListQueryLoggingConfigsResponse' {} [QueryLoggingConfig]
a -> ListQueryLoggingConfigsResponse
s {$sel:queryLoggingConfigs:ListQueryLoggingConfigsResponse' :: [QueryLoggingConfig]
queryLoggingConfigs = [QueryLoggingConfig]
a} :: ListQueryLoggingConfigsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    ListQueryLoggingConfigsResponse
  where
  rnf :: ListQueryLoggingConfigsResponse -> ()
rnf ListQueryLoggingConfigsResponse' {Int
[QueryLoggingConfig]
Maybe Text
queryLoggingConfigs :: [QueryLoggingConfig]
httpStatus :: Int
nextToken :: Maybe Text
$sel:queryLoggingConfigs:ListQueryLoggingConfigsResponse' :: ListQueryLoggingConfigsResponse -> [QueryLoggingConfig]
$sel:httpStatus:ListQueryLoggingConfigsResponse' :: ListQueryLoggingConfigsResponse -> Int
$sel:nextToken:ListQueryLoggingConfigsResponse' :: ListQueryLoggingConfigsResponse -> Maybe Text
..} =
    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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [QueryLoggingConfig]
queryLoggingConfigs