{-# 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.DeleteQueryLoggingConfig
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a configuration for DNS query logging. If you delete a
-- configuration, Amazon Route 53 stops sending query logs to CloudWatch
-- Logs. Route 53 doesn\'t delete any logs that are already in CloudWatch
-- Logs.
--
-- For more information about DNS query logs, see
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateQueryLoggingConfig.html CreateQueryLoggingConfig>.
module Amazonka.Route53.DeleteQueryLoggingConfig
  ( -- * Creating a Request
    DeleteQueryLoggingConfig (..),
    newDeleteQueryLoggingConfig,

    -- * Request Lenses
    deleteQueryLoggingConfig_id,

    -- * Destructuring the Response
    DeleteQueryLoggingConfigResponse (..),
    newDeleteQueryLoggingConfigResponse,

    -- * Response Lenses
    deleteQueryLoggingConfigResponse_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.Route53.Types

-- | /See:/ 'newDeleteQueryLoggingConfig' smart constructor.
data DeleteQueryLoggingConfig = DeleteQueryLoggingConfig'
  { -- | The ID of the configuration that you want to delete.
    DeleteQueryLoggingConfig -> Text
id :: Prelude.Text
  }
  deriving (DeleteQueryLoggingConfig -> DeleteQueryLoggingConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteQueryLoggingConfig -> DeleteQueryLoggingConfig -> Bool
$c/= :: DeleteQueryLoggingConfig -> DeleteQueryLoggingConfig -> Bool
== :: DeleteQueryLoggingConfig -> DeleteQueryLoggingConfig -> Bool
$c== :: DeleteQueryLoggingConfig -> DeleteQueryLoggingConfig -> Bool
Prelude.Eq, ReadPrec [DeleteQueryLoggingConfig]
ReadPrec DeleteQueryLoggingConfig
Int -> ReadS DeleteQueryLoggingConfig
ReadS [DeleteQueryLoggingConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteQueryLoggingConfig]
$creadListPrec :: ReadPrec [DeleteQueryLoggingConfig]
readPrec :: ReadPrec DeleteQueryLoggingConfig
$creadPrec :: ReadPrec DeleteQueryLoggingConfig
readList :: ReadS [DeleteQueryLoggingConfig]
$creadList :: ReadS [DeleteQueryLoggingConfig]
readsPrec :: Int -> ReadS DeleteQueryLoggingConfig
$creadsPrec :: Int -> ReadS DeleteQueryLoggingConfig
Prelude.Read, Int -> DeleteQueryLoggingConfig -> ShowS
[DeleteQueryLoggingConfig] -> ShowS
DeleteQueryLoggingConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteQueryLoggingConfig] -> ShowS
$cshowList :: [DeleteQueryLoggingConfig] -> ShowS
show :: DeleteQueryLoggingConfig -> String
$cshow :: DeleteQueryLoggingConfig -> String
showsPrec :: Int -> DeleteQueryLoggingConfig -> ShowS
$cshowsPrec :: Int -> DeleteQueryLoggingConfig -> ShowS
Prelude.Show, forall x.
Rep DeleteQueryLoggingConfig x -> DeleteQueryLoggingConfig
forall x.
DeleteQueryLoggingConfig -> Rep DeleteQueryLoggingConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteQueryLoggingConfig x -> DeleteQueryLoggingConfig
$cfrom :: forall x.
DeleteQueryLoggingConfig -> Rep DeleteQueryLoggingConfig x
Prelude.Generic)

-- |
-- Create a value of 'DeleteQueryLoggingConfig' 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:
--
-- 'id', 'deleteQueryLoggingConfig_id' - The ID of the configuration that you want to delete.
newDeleteQueryLoggingConfig ::
  -- | 'id'
  Prelude.Text ->
  DeleteQueryLoggingConfig
newDeleteQueryLoggingConfig :: Text -> DeleteQueryLoggingConfig
newDeleteQueryLoggingConfig Text
pId_ =
  DeleteQueryLoggingConfig' {$sel:id:DeleteQueryLoggingConfig' :: Text
id = Text
pId_}

-- | The ID of the configuration that you want to delete.
deleteQueryLoggingConfig_id :: Lens.Lens' DeleteQueryLoggingConfig Prelude.Text
deleteQueryLoggingConfig_id :: Lens' DeleteQueryLoggingConfig Text
deleteQueryLoggingConfig_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteQueryLoggingConfig' {Text
id :: Text
$sel:id:DeleteQueryLoggingConfig' :: DeleteQueryLoggingConfig -> Text
id} -> Text
id) (\s :: DeleteQueryLoggingConfig
s@DeleteQueryLoggingConfig' {} Text
a -> DeleteQueryLoggingConfig
s {$sel:id:DeleteQueryLoggingConfig' :: Text
id = Text
a} :: DeleteQueryLoggingConfig)

instance Core.AWSRequest DeleteQueryLoggingConfig where
  type
    AWSResponse DeleteQueryLoggingConfig =
      DeleteQueryLoggingConfigResponse
  request :: (Service -> Service)
-> DeleteQueryLoggingConfig -> Request DeleteQueryLoggingConfig
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteQueryLoggingConfig
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteQueryLoggingConfig)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteQueryLoggingConfigResponse
DeleteQueryLoggingConfigResponse'
            forall (f :: * -> *) a b. Functor 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 DeleteQueryLoggingConfig where
  hashWithSalt :: Int -> DeleteQueryLoggingConfig -> Int
hashWithSalt Int
_salt DeleteQueryLoggingConfig' {Text
id :: Text
$sel:id:DeleteQueryLoggingConfig' :: DeleteQueryLoggingConfig -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id

instance Prelude.NFData DeleteQueryLoggingConfig where
  rnf :: DeleteQueryLoggingConfig -> ()
rnf DeleteQueryLoggingConfig' {Text
id :: Text
$sel:id:DeleteQueryLoggingConfig' :: DeleteQueryLoggingConfig -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
id

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

instance Data.ToPath DeleteQueryLoggingConfig where
  toPath :: DeleteQueryLoggingConfig -> ByteString
toPath DeleteQueryLoggingConfig' {Text
id :: Text
$sel:id:DeleteQueryLoggingConfig' :: DeleteQueryLoggingConfig -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/2013-04-01/queryloggingconfig/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
id]

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

-- | /See:/ 'newDeleteQueryLoggingConfigResponse' smart constructor.
data DeleteQueryLoggingConfigResponse = DeleteQueryLoggingConfigResponse'
  { -- | The response's http status code.
    DeleteQueryLoggingConfigResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeleteQueryLoggingConfigResponse
-> DeleteQueryLoggingConfigResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteQueryLoggingConfigResponse
-> DeleteQueryLoggingConfigResponse -> Bool
$c/= :: DeleteQueryLoggingConfigResponse
-> DeleteQueryLoggingConfigResponse -> Bool
== :: DeleteQueryLoggingConfigResponse
-> DeleteQueryLoggingConfigResponse -> Bool
$c== :: DeleteQueryLoggingConfigResponse
-> DeleteQueryLoggingConfigResponse -> Bool
Prelude.Eq, ReadPrec [DeleteQueryLoggingConfigResponse]
ReadPrec DeleteQueryLoggingConfigResponse
Int -> ReadS DeleteQueryLoggingConfigResponse
ReadS [DeleteQueryLoggingConfigResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteQueryLoggingConfigResponse]
$creadListPrec :: ReadPrec [DeleteQueryLoggingConfigResponse]
readPrec :: ReadPrec DeleteQueryLoggingConfigResponse
$creadPrec :: ReadPrec DeleteQueryLoggingConfigResponse
readList :: ReadS [DeleteQueryLoggingConfigResponse]
$creadList :: ReadS [DeleteQueryLoggingConfigResponse]
readsPrec :: Int -> ReadS DeleteQueryLoggingConfigResponse
$creadsPrec :: Int -> ReadS DeleteQueryLoggingConfigResponse
Prelude.Read, Int -> DeleteQueryLoggingConfigResponse -> ShowS
[DeleteQueryLoggingConfigResponse] -> ShowS
DeleteQueryLoggingConfigResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteQueryLoggingConfigResponse] -> ShowS
$cshowList :: [DeleteQueryLoggingConfigResponse] -> ShowS
show :: DeleteQueryLoggingConfigResponse -> String
$cshow :: DeleteQueryLoggingConfigResponse -> String
showsPrec :: Int -> DeleteQueryLoggingConfigResponse -> ShowS
$cshowsPrec :: Int -> DeleteQueryLoggingConfigResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteQueryLoggingConfigResponse x
-> DeleteQueryLoggingConfigResponse
forall x.
DeleteQueryLoggingConfigResponse
-> Rep DeleteQueryLoggingConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteQueryLoggingConfigResponse x
-> DeleteQueryLoggingConfigResponse
$cfrom :: forall x.
DeleteQueryLoggingConfigResponse
-> Rep DeleteQueryLoggingConfigResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteQueryLoggingConfigResponse' 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', 'deleteQueryLoggingConfigResponse_httpStatus' - The response's http status code.
newDeleteQueryLoggingConfigResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteQueryLoggingConfigResponse
newDeleteQueryLoggingConfigResponse :: Int -> DeleteQueryLoggingConfigResponse
newDeleteQueryLoggingConfigResponse Int
pHttpStatus_ =
  DeleteQueryLoggingConfigResponse'
    { $sel:httpStatus:DeleteQueryLoggingConfigResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance
  Prelude.NFData
    DeleteQueryLoggingConfigResponse
  where
  rnf :: DeleteQueryLoggingConfigResponse -> ()
rnf DeleteQueryLoggingConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteQueryLoggingConfigResponse' :: DeleteQueryLoggingConfigResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus