{-# 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.CreateQueryLoggingConfig
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a configuration for DNS query logging. After you create a query
-- logging configuration, Amazon Route 53 begins to publish log data to an
-- Amazon CloudWatch Logs log group.
--
-- DNS query logs contain information about the queries that Route 53
-- receives for a specified public hosted zone, such as the following:
--
-- -   Route 53 edge location that responded to the DNS query
--
-- -   Domain or subdomain that was requested
--
-- -   DNS record type, such as A or AAAA
--
-- -   DNS response code, such as @NoError@ or @ServFail@
--
-- [Log Group and Resource Policy]
--     Before you create a query logging configuration, perform the
--     following operations.
--
--     If you create a query logging configuration using the Route 53
--     console, Route 53 performs these operations automatically.
--
--     1.  Create a CloudWatch Logs log group, and make note of the ARN,
--         which you specify when you create a query logging configuration.
--         Note the following:
--
--         -   You must create the log group in the us-east-1 region.
--
--         -   You must use the same Amazon Web Services account to create
--             the log group and the hosted zone that you want to configure
--             query logging for.
--
--         -   When you create log groups for query logging, we recommend
--             that you use a consistent prefix, for example:
--
--             @\/aws\/route53\/hosted zone name @
--
--             In the next step, you\'ll create a resource policy, which
--             controls access to one or more log groups and the associated
--             Amazon Web Services resources, such as Route 53 hosted
--             zones. There\'s a limit on the number of resource policies
--             that you can create, so we recommend that you use a
--             consistent prefix so you can use the same resource policy
--             for all the log groups that you create for query logging.
--
--     2.  Create a CloudWatch Logs resource policy, and give it the
--         permissions that Route 53 needs to create log streams and to
--         send query logs to log streams. For the value of @Resource@,
--         specify the ARN for the log group that you created in the
--         previous step. To use the same resource policy for all the
--         CloudWatch Logs log groups that you created for query logging
--         configurations, replace the hosted zone name with @*@, for
--         example:
--
--         @arn:aws:logs:us-east-1:123412341234:log-group:\/aws\/route53\/*@
--
--         You can\'t use the CloudWatch console to create or edit a
--         resource policy. You must use the CloudWatch API, one of the
--         Amazon Web Services SDKs, or the CLI.
--
-- [Log Streams and Edge Locations]
--     When Route 53 finishes creating the configuration for DNS query
--     logging, it does the following:
--
--     -   Creates a log stream for an edge location the first time that
--         the edge location responds to DNS queries for the specified
--         hosted zone. That log stream is used to log all queries that
--         Route 53 responds to for that edge location.
--
--     -   Begins to send query logs to the applicable log stream.
--
--     The name of each log stream is in the following format:
--
--     @ hosted zone ID\/edge location code @
--
--     The edge location code is a three-letter code and an arbitrarily
--     assigned number, for example, DFW3. The three-letter code typically
--     corresponds with the International Air Transport Association airport
--     code for an airport near the edge location. (These abbreviations
--     might change in the future.) For a list of edge locations, see \"The
--     Route 53 Global Network\" on the
--     <http://aws.amazon.com/route53/details/ Route 53 Product Details>
--     page.
--
-- [Queries That Are Logged]
--     Query logs contain only the queries that DNS resolvers forward to
--     Route 53. If a DNS resolver has already cached the response to a
--     query (such as the IP address for a load balancer for example.com),
--     the resolver will continue to return the cached response. It
--     doesn\'t forward another query to Route 53 until the TTL for the
--     corresponding resource record set expires. Depending on how many DNS
--     queries are submitted for a resource record set, and depending on
--     the TTL for that resource record set, query logs might contain
--     information about only one query out of every several thousand
--     queries that are submitted to DNS. For more information about how
--     DNS works, see
--     <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/welcome-dns-service.html Routing Internet Traffic to Your Website or Web Application>
--     in the /Amazon Route 53 Developer Guide/.
--
-- [Log File Format]
--     For a list of the values in each query log and the format of each
--     value, see
--     <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/query-logs.html Logging DNS Queries>
--     in the /Amazon Route 53 Developer Guide/.
--
-- [Pricing]
--     For information about charges for query logs, see
--     <http://aws.amazon.com/cloudwatch/pricing/ Amazon CloudWatch Pricing>.
--
-- [How to Stop Logging]
--     If you want Route 53 to stop sending query logs to CloudWatch Logs,
--     delete the query logging configuration. For more information, see
--     <https://docs.aws.amazon.com/Route53/latest/APIReference/API_DeleteQueryLoggingConfig.html DeleteQueryLoggingConfig>.
module Amazonka.Route53.CreateQueryLoggingConfig
  ( -- * Creating a Request
    CreateQueryLoggingConfig (..),
    newCreateQueryLoggingConfig,

    -- * Request Lenses
    createQueryLoggingConfig_hostedZoneId,
    createQueryLoggingConfig_cloudWatchLogsLogGroupArn,

    -- * Destructuring the Response
    CreateQueryLoggingConfigResponse (..),
    newCreateQueryLoggingConfigResponse,

    -- * Response Lenses
    createQueryLoggingConfigResponse_httpStatus,
    createQueryLoggingConfigResponse_queryLoggingConfig,
    createQueryLoggingConfigResponse_location,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Route53.Types

-- | /See:/ 'newCreateQueryLoggingConfig' smart constructor.
data CreateQueryLoggingConfig = CreateQueryLoggingConfig'
  { -- | The ID of the hosted zone that you want to log queries for. You can log
    -- queries only for public hosted zones.
    CreateQueryLoggingConfig -> ResourceId
hostedZoneId :: ResourceId,
    -- | The Amazon Resource Name (ARN) for the log group that you want to Amazon
    -- Route 53 to send query logs to. This is the format of the ARN:
    --
    -- arn:aws:logs:/region/:/account-id/:log-group:/log_group_name/
    --
    -- To get the ARN for a log group, you can use the CloudWatch console, the
    -- <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeLogGroups.html DescribeLogGroups>
    -- API action, the
    -- <https://docs.aws.amazon.com/cli/latest/reference/logs/describe-log-groups.html describe-log-groups>
    -- command, or the applicable command in one of the Amazon Web Services
    -- SDKs.
    CreateQueryLoggingConfig -> Text
cloudWatchLogsLogGroupArn :: Prelude.Text
  }
  deriving (CreateQueryLoggingConfig -> CreateQueryLoggingConfig -> Bool
(CreateQueryLoggingConfig -> CreateQueryLoggingConfig -> Bool)
-> (CreateQueryLoggingConfig -> CreateQueryLoggingConfig -> Bool)
-> Eq CreateQueryLoggingConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateQueryLoggingConfig -> CreateQueryLoggingConfig -> Bool
$c/= :: CreateQueryLoggingConfig -> CreateQueryLoggingConfig -> Bool
== :: CreateQueryLoggingConfig -> CreateQueryLoggingConfig -> Bool
$c== :: CreateQueryLoggingConfig -> CreateQueryLoggingConfig -> Bool
Prelude.Eq, ReadPrec [CreateQueryLoggingConfig]
ReadPrec CreateQueryLoggingConfig
Int -> ReadS CreateQueryLoggingConfig
ReadS [CreateQueryLoggingConfig]
(Int -> ReadS CreateQueryLoggingConfig)
-> ReadS [CreateQueryLoggingConfig]
-> ReadPrec CreateQueryLoggingConfig
-> ReadPrec [CreateQueryLoggingConfig]
-> Read CreateQueryLoggingConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateQueryLoggingConfig]
$creadListPrec :: ReadPrec [CreateQueryLoggingConfig]
readPrec :: ReadPrec CreateQueryLoggingConfig
$creadPrec :: ReadPrec CreateQueryLoggingConfig
readList :: ReadS [CreateQueryLoggingConfig]
$creadList :: ReadS [CreateQueryLoggingConfig]
readsPrec :: Int -> ReadS CreateQueryLoggingConfig
$creadsPrec :: Int -> ReadS CreateQueryLoggingConfig
Prelude.Read, Int -> CreateQueryLoggingConfig -> ShowS
[CreateQueryLoggingConfig] -> ShowS
CreateQueryLoggingConfig -> String
(Int -> CreateQueryLoggingConfig -> ShowS)
-> (CreateQueryLoggingConfig -> String)
-> ([CreateQueryLoggingConfig] -> ShowS)
-> Show CreateQueryLoggingConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateQueryLoggingConfig] -> ShowS
$cshowList :: [CreateQueryLoggingConfig] -> ShowS
show :: CreateQueryLoggingConfig -> String
$cshow :: CreateQueryLoggingConfig -> String
showsPrec :: Int -> CreateQueryLoggingConfig -> ShowS
$cshowsPrec :: Int -> CreateQueryLoggingConfig -> ShowS
Prelude.Show, (forall x.
 CreateQueryLoggingConfig -> Rep CreateQueryLoggingConfig x)
-> (forall x.
    Rep CreateQueryLoggingConfig x -> CreateQueryLoggingConfig)
-> Generic CreateQueryLoggingConfig
forall x.
Rep CreateQueryLoggingConfig x -> CreateQueryLoggingConfig
forall x.
CreateQueryLoggingConfig -> Rep CreateQueryLoggingConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateQueryLoggingConfig x -> CreateQueryLoggingConfig
$cfrom :: forall x.
CreateQueryLoggingConfig -> Rep CreateQueryLoggingConfig x
Prelude.Generic)

-- |
-- Create a value of 'CreateQueryLoggingConfig' 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', 'createQueryLoggingConfig_hostedZoneId' - The ID of the hosted zone that you want to log queries for. You can log
-- queries only for public hosted zones.
--
-- 'cloudWatchLogsLogGroupArn', 'createQueryLoggingConfig_cloudWatchLogsLogGroupArn' - The Amazon Resource Name (ARN) for the log group that you want to Amazon
-- Route 53 to send query logs to. This is the format of the ARN:
--
-- arn:aws:logs:/region/:/account-id/:log-group:/log_group_name/
--
-- To get the ARN for a log group, you can use the CloudWatch console, the
-- <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeLogGroups.html DescribeLogGroups>
-- API action, the
-- <https://docs.aws.amazon.com/cli/latest/reference/logs/describe-log-groups.html describe-log-groups>
-- command, or the applicable command in one of the Amazon Web Services
-- SDKs.
newCreateQueryLoggingConfig ::
  -- | 'hostedZoneId'
  ResourceId ->
  -- | 'cloudWatchLogsLogGroupArn'
  Prelude.Text ->
  CreateQueryLoggingConfig
newCreateQueryLoggingConfig :: ResourceId -> Text -> CreateQueryLoggingConfig
newCreateQueryLoggingConfig
  ResourceId
pHostedZoneId_
  Text
pCloudWatchLogsLogGroupArn_ =
    CreateQueryLoggingConfig' :: ResourceId -> Text -> CreateQueryLoggingConfig
CreateQueryLoggingConfig'
      { $sel:hostedZoneId:CreateQueryLoggingConfig' :: ResourceId
hostedZoneId =
          ResourceId
pHostedZoneId_,
        $sel:cloudWatchLogsLogGroupArn:CreateQueryLoggingConfig' :: Text
cloudWatchLogsLogGroupArn =
          Text
pCloudWatchLogsLogGroupArn_
      }

-- | The ID of the hosted zone that you want to log queries for. You can log
-- queries only for public hosted zones.
createQueryLoggingConfig_hostedZoneId :: Lens.Lens' CreateQueryLoggingConfig ResourceId
createQueryLoggingConfig_hostedZoneId :: (ResourceId -> f ResourceId)
-> CreateQueryLoggingConfig -> f CreateQueryLoggingConfig
createQueryLoggingConfig_hostedZoneId = (CreateQueryLoggingConfig -> ResourceId)
-> (CreateQueryLoggingConfig
    -> ResourceId -> CreateQueryLoggingConfig)
-> Lens
     CreateQueryLoggingConfig
     CreateQueryLoggingConfig
     ResourceId
     ResourceId
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQueryLoggingConfig' {ResourceId
hostedZoneId :: ResourceId
$sel:hostedZoneId:CreateQueryLoggingConfig' :: CreateQueryLoggingConfig -> ResourceId
hostedZoneId} -> ResourceId
hostedZoneId) (\s :: CreateQueryLoggingConfig
s@CreateQueryLoggingConfig' {} ResourceId
a -> CreateQueryLoggingConfig
s {$sel:hostedZoneId:CreateQueryLoggingConfig' :: ResourceId
hostedZoneId = ResourceId
a} :: CreateQueryLoggingConfig)

-- | The Amazon Resource Name (ARN) for the log group that you want to Amazon
-- Route 53 to send query logs to. This is the format of the ARN:
--
-- arn:aws:logs:/region/:/account-id/:log-group:/log_group_name/
--
-- To get the ARN for a log group, you can use the CloudWatch console, the
-- <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeLogGroups.html DescribeLogGroups>
-- API action, the
-- <https://docs.aws.amazon.com/cli/latest/reference/logs/describe-log-groups.html describe-log-groups>
-- command, or the applicable command in one of the Amazon Web Services
-- SDKs.
createQueryLoggingConfig_cloudWatchLogsLogGroupArn :: Lens.Lens' CreateQueryLoggingConfig Prelude.Text
createQueryLoggingConfig_cloudWatchLogsLogGroupArn :: (Text -> f Text)
-> CreateQueryLoggingConfig -> f CreateQueryLoggingConfig
createQueryLoggingConfig_cloudWatchLogsLogGroupArn = (CreateQueryLoggingConfig -> Text)
-> (CreateQueryLoggingConfig -> Text -> CreateQueryLoggingConfig)
-> Lens CreateQueryLoggingConfig CreateQueryLoggingConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQueryLoggingConfig' {Text
cloudWatchLogsLogGroupArn :: Text
$sel:cloudWatchLogsLogGroupArn:CreateQueryLoggingConfig' :: CreateQueryLoggingConfig -> Text
cloudWatchLogsLogGroupArn} -> Text
cloudWatchLogsLogGroupArn) (\s :: CreateQueryLoggingConfig
s@CreateQueryLoggingConfig' {} Text
a -> CreateQueryLoggingConfig
s {$sel:cloudWatchLogsLogGroupArn:CreateQueryLoggingConfig' :: Text
cloudWatchLogsLogGroupArn = Text
a} :: CreateQueryLoggingConfig)

instance Core.AWSRequest CreateQueryLoggingConfig where
  type
    AWSResponse CreateQueryLoggingConfig =
      CreateQueryLoggingConfigResponse
  request :: CreateQueryLoggingConfig -> Request CreateQueryLoggingConfig
request = Service
-> CreateQueryLoggingConfig -> Request CreateQueryLoggingConfig
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.postXML Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateQueryLoggingConfig
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateQueryLoggingConfig)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse CreateQueryLoggingConfig))
-> Logger
-> Service
-> Proxy CreateQueryLoggingConfig
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateQueryLoggingConfig)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Int
-> QueryLoggingConfig -> Text -> CreateQueryLoggingConfigResponse
CreateQueryLoggingConfigResponse'
            (Int
 -> QueryLoggingConfig -> Text -> CreateQueryLoggingConfigResponse)
-> Either String Int
-> Either
     String
     (QueryLoggingConfig -> Text -> CreateQueryLoggingConfigResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String
  (QueryLoggingConfig -> Text -> CreateQueryLoggingConfigResponse)
-> Either String QueryLoggingConfig
-> Either String (Text -> CreateQueryLoggingConfigResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String QueryLoggingConfig
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"QueryLoggingConfig")
            Either String (Text -> CreateQueryLoggingConfigResponse)
-> Either String Text
-> Either String CreateQueryLoggingConfigResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String Text
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String a
Core..# HeaderName
"Location")
      )

instance Prelude.Hashable CreateQueryLoggingConfig

instance Prelude.NFData CreateQueryLoggingConfig

instance Core.ToElement CreateQueryLoggingConfig where
  toElement :: CreateQueryLoggingConfig -> Element
toElement =
    Name -> CreateQueryLoggingConfig -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
      Name
"{https://route53.amazonaws.com/doc/2013-04-01/}CreateQueryLoggingConfigRequest"

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

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

instance Core.ToQuery CreateQueryLoggingConfig where
  toQuery :: CreateQueryLoggingConfig -> QueryString
toQuery = QueryString -> CreateQueryLoggingConfig -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

instance Core.ToXML CreateQueryLoggingConfig where
  toXML :: CreateQueryLoggingConfig -> XML
toXML CreateQueryLoggingConfig' {Text
ResourceId
cloudWatchLogsLogGroupArn :: Text
hostedZoneId :: ResourceId
$sel:cloudWatchLogsLogGroupArn:CreateQueryLoggingConfig' :: CreateQueryLoggingConfig -> Text
$sel:hostedZoneId:CreateQueryLoggingConfig' :: CreateQueryLoggingConfig -> ResourceId
..} =
    [XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ Name
"HostedZoneId" Name -> ResourceId -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= ResourceId
hostedZoneId,
        Name
"CloudWatchLogsLogGroupArn"
          Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
cloudWatchLogsLogGroupArn
      ]

-- | /See:/ 'newCreateQueryLoggingConfigResponse' smart constructor.
data CreateQueryLoggingConfigResponse = CreateQueryLoggingConfigResponse'
  { -- | The response's http status code.
    CreateQueryLoggingConfigResponse -> Int
httpStatus :: Prelude.Int,
    -- | A complex type that contains the ID for a query logging configuration,
    -- the ID of the hosted zone that you want to log queries for, and the ARN
    -- for the log group that you want Amazon Route 53 to send query logs to.
    CreateQueryLoggingConfigResponse -> QueryLoggingConfig
queryLoggingConfig :: QueryLoggingConfig,
    -- | The unique URL representing the new query logging configuration.
    CreateQueryLoggingConfigResponse -> Text
location :: Prelude.Text
  }
  deriving (CreateQueryLoggingConfigResponse
-> CreateQueryLoggingConfigResponse -> Bool
(CreateQueryLoggingConfigResponse
 -> CreateQueryLoggingConfigResponse -> Bool)
-> (CreateQueryLoggingConfigResponse
    -> CreateQueryLoggingConfigResponse -> Bool)
-> Eq CreateQueryLoggingConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateQueryLoggingConfigResponse
-> CreateQueryLoggingConfigResponse -> Bool
$c/= :: CreateQueryLoggingConfigResponse
-> CreateQueryLoggingConfigResponse -> Bool
== :: CreateQueryLoggingConfigResponse
-> CreateQueryLoggingConfigResponse -> Bool
$c== :: CreateQueryLoggingConfigResponse
-> CreateQueryLoggingConfigResponse -> Bool
Prelude.Eq, ReadPrec [CreateQueryLoggingConfigResponse]
ReadPrec CreateQueryLoggingConfigResponse
Int -> ReadS CreateQueryLoggingConfigResponse
ReadS [CreateQueryLoggingConfigResponse]
(Int -> ReadS CreateQueryLoggingConfigResponse)
-> ReadS [CreateQueryLoggingConfigResponse]
-> ReadPrec CreateQueryLoggingConfigResponse
-> ReadPrec [CreateQueryLoggingConfigResponse]
-> Read CreateQueryLoggingConfigResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateQueryLoggingConfigResponse]
$creadListPrec :: ReadPrec [CreateQueryLoggingConfigResponse]
readPrec :: ReadPrec CreateQueryLoggingConfigResponse
$creadPrec :: ReadPrec CreateQueryLoggingConfigResponse
readList :: ReadS [CreateQueryLoggingConfigResponse]
$creadList :: ReadS [CreateQueryLoggingConfigResponse]
readsPrec :: Int -> ReadS CreateQueryLoggingConfigResponse
$creadsPrec :: Int -> ReadS CreateQueryLoggingConfigResponse
Prelude.Read, Int -> CreateQueryLoggingConfigResponse -> ShowS
[CreateQueryLoggingConfigResponse] -> ShowS
CreateQueryLoggingConfigResponse -> String
(Int -> CreateQueryLoggingConfigResponse -> ShowS)
-> (CreateQueryLoggingConfigResponse -> String)
-> ([CreateQueryLoggingConfigResponse] -> ShowS)
-> Show CreateQueryLoggingConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateQueryLoggingConfigResponse] -> ShowS
$cshowList :: [CreateQueryLoggingConfigResponse] -> ShowS
show :: CreateQueryLoggingConfigResponse -> String
$cshow :: CreateQueryLoggingConfigResponse -> String
showsPrec :: Int -> CreateQueryLoggingConfigResponse -> ShowS
$cshowsPrec :: Int -> CreateQueryLoggingConfigResponse -> ShowS
Prelude.Show, (forall x.
 CreateQueryLoggingConfigResponse
 -> Rep CreateQueryLoggingConfigResponse x)
-> (forall x.
    Rep CreateQueryLoggingConfigResponse x
    -> CreateQueryLoggingConfigResponse)
-> Generic CreateQueryLoggingConfigResponse
forall x.
Rep CreateQueryLoggingConfigResponse x
-> CreateQueryLoggingConfigResponse
forall x.
CreateQueryLoggingConfigResponse
-> Rep CreateQueryLoggingConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateQueryLoggingConfigResponse x
-> CreateQueryLoggingConfigResponse
$cfrom :: forall x.
CreateQueryLoggingConfigResponse
-> Rep CreateQueryLoggingConfigResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateQueryLoggingConfigResponse' 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:
--
-- 'httpStatus', 'createQueryLoggingConfigResponse_httpStatus' - The response's http status code.
--
-- 'queryLoggingConfig', 'createQueryLoggingConfigResponse_queryLoggingConfig' - A complex type that contains the ID for a query logging configuration,
-- the ID of the hosted zone that you want to log queries for, and the ARN
-- for the log group that you want Amazon Route 53 to send query logs to.
--
-- 'location', 'createQueryLoggingConfigResponse_location' - The unique URL representing the new query logging configuration.
newCreateQueryLoggingConfigResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'queryLoggingConfig'
  QueryLoggingConfig ->
  -- | 'location'
  Prelude.Text ->
  CreateQueryLoggingConfigResponse
newCreateQueryLoggingConfigResponse :: Int
-> QueryLoggingConfig -> Text -> CreateQueryLoggingConfigResponse
newCreateQueryLoggingConfigResponse
  Int
pHttpStatus_
  QueryLoggingConfig
pQueryLoggingConfig_
  Text
pLocation_ =
    CreateQueryLoggingConfigResponse' :: Int
-> QueryLoggingConfig -> Text -> CreateQueryLoggingConfigResponse
CreateQueryLoggingConfigResponse'
      { $sel:httpStatus:CreateQueryLoggingConfigResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:queryLoggingConfig:CreateQueryLoggingConfigResponse' :: QueryLoggingConfig
queryLoggingConfig = QueryLoggingConfig
pQueryLoggingConfig_,
        $sel:location:CreateQueryLoggingConfigResponse' :: Text
location = Text
pLocation_
      }

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

-- | A complex type that contains the ID for a query logging configuration,
-- the ID of the hosted zone that you want to log queries for, and the ARN
-- for the log group that you want Amazon Route 53 to send query logs to.
createQueryLoggingConfigResponse_queryLoggingConfig :: Lens.Lens' CreateQueryLoggingConfigResponse QueryLoggingConfig
createQueryLoggingConfigResponse_queryLoggingConfig :: (QueryLoggingConfig -> f QueryLoggingConfig)
-> CreateQueryLoggingConfigResponse
-> f CreateQueryLoggingConfigResponse
createQueryLoggingConfigResponse_queryLoggingConfig = (CreateQueryLoggingConfigResponse -> QueryLoggingConfig)
-> (CreateQueryLoggingConfigResponse
    -> QueryLoggingConfig -> CreateQueryLoggingConfigResponse)
-> Lens
     CreateQueryLoggingConfigResponse
     CreateQueryLoggingConfigResponse
     QueryLoggingConfig
     QueryLoggingConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQueryLoggingConfigResponse' {QueryLoggingConfig
queryLoggingConfig :: QueryLoggingConfig
$sel:queryLoggingConfig:CreateQueryLoggingConfigResponse' :: CreateQueryLoggingConfigResponse -> QueryLoggingConfig
queryLoggingConfig} -> QueryLoggingConfig
queryLoggingConfig) (\s :: CreateQueryLoggingConfigResponse
s@CreateQueryLoggingConfigResponse' {} QueryLoggingConfig
a -> CreateQueryLoggingConfigResponse
s {$sel:queryLoggingConfig:CreateQueryLoggingConfigResponse' :: QueryLoggingConfig
queryLoggingConfig = QueryLoggingConfig
a} :: CreateQueryLoggingConfigResponse)

-- | The unique URL representing the new query logging configuration.
createQueryLoggingConfigResponse_location :: Lens.Lens' CreateQueryLoggingConfigResponse Prelude.Text
createQueryLoggingConfigResponse_location :: (Text -> f Text)
-> CreateQueryLoggingConfigResponse
-> f CreateQueryLoggingConfigResponse
createQueryLoggingConfigResponse_location = (CreateQueryLoggingConfigResponse -> Text)
-> (CreateQueryLoggingConfigResponse
    -> Text -> CreateQueryLoggingConfigResponse)
-> Lens
     CreateQueryLoggingConfigResponse
     CreateQueryLoggingConfigResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQueryLoggingConfigResponse' {Text
location :: Text
$sel:location:CreateQueryLoggingConfigResponse' :: CreateQueryLoggingConfigResponse -> Text
location} -> Text
location) (\s :: CreateQueryLoggingConfigResponse
s@CreateQueryLoggingConfigResponse' {} Text
a -> CreateQueryLoggingConfigResponse
s {$sel:location:CreateQueryLoggingConfigResponse' :: Text
location = Text
a} :: CreateQueryLoggingConfigResponse)

instance
  Prelude.NFData
    CreateQueryLoggingConfigResponse