{-# 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-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)
--
-- 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.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:/ '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
(DeleteQueryLoggingConfig -> DeleteQueryLoggingConfig -> Bool)
-> (DeleteQueryLoggingConfig -> DeleteQueryLoggingConfig -> Bool)
-> Eq DeleteQueryLoggingConfig
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]
(Int -> ReadS DeleteQueryLoggingConfig)
-> ReadS [DeleteQueryLoggingConfig]
-> ReadPrec DeleteQueryLoggingConfig
-> ReadPrec [DeleteQueryLoggingConfig]
-> Read 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
(Int -> DeleteQueryLoggingConfig -> ShowS)
-> (DeleteQueryLoggingConfig -> String)
-> ([DeleteQueryLoggingConfig] -> ShowS)
-> Show DeleteQueryLoggingConfig
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.
 DeleteQueryLoggingConfig -> Rep DeleteQueryLoggingConfig x)
-> (forall x.
    Rep DeleteQueryLoggingConfig x -> DeleteQueryLoggingConfig)
-> Generic DeleteQueryLoggingConfig
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' :: Text -> DeleteQueryLoggingConfig
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 :: (Text -> f Text)
-> DeleteQueryLoggingConfig -> f DeleteQueryLoggingConfig
deleteQueryLoggingConfig_id = (DeleteQueryLoggingConfig -> Text)
-> (DeleteQueryLoggingConfig -> Text -> DeleteQueryLoggingConfig)
-> Lens DeleteQueryLoggingConfig DeleteQueryLoggingConfig Text Text
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 :: DeleteQueryLoggingConfig -> Request DeleteQueryLoggingConfig
request = Service
-> DeleteQueryLoggingConfig -> Request DeleteQueryLoggingConfig
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteQueryLoggingConfig
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteQueryLoggingConfig)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteQueryLoggingConfig))
-> Logger
-> Service
-> Proxy DeleteQueryLoggingConfig
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteQueryLoggingConfig)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteQueryLoggingConfigResponse
DeleteQueryLoggingConfigResponse'
            (Int -> DeleteQueryLoggingConfigResponse)
-> Either String Int
-> Either String DeleteQueryLoggingConfigResponse
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))
      )

instance Prelude.Hashable DeleteQueryLoggingConfig

instance Prelude.NFData DeleteQueryLoggingConfig

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

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

instance Core.ToQuery DeleteQueryLoggingConfig where
  toQuery :: DeleteQueryLoggingConfig -> QueryString
toQuery = QueryString -> DeleteQueryLoggingConfig -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(DeleteQueryLoggingConfigResponse
 -> DeleteQueryLoggingConfigResponse -> Bool)
-> (DeleteQueryLoggingConfigResponse
    -> DeleteQueryLoggingConfigResponse -> Bool)
-> Eq DeleteQueryLoggingConfigResponse
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]
(Int -> ReadS DeleteQueryLoggingConfigResponse)
-> ReadS [DeleteQueryLoggingConfigResponse]
-> ReadPrec DeleteQueryLoggingConfigResponse
-> ReadPrec [DeleteQueryLoggingConfigResponse]
-> Read 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
(Int -> DeleteQueryLoggingConfigResponse -> ShowS)
-> (DeleteQueryLoggingConfigResponse -> String)
-> ([DeleteQueryLoggingConfigResponse] -> ShowS)
-> Show DeleteQueryLoggingConfigResponse
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.
 DeleteQueryLoggingConfigResponse
 -> Rep DeleteQueryLoggingConfigResponse x)
-> (forall x.
    Rep DeleteQueryLoggingConfigResponse x
    -> DeleteQueryLoggingConfigResponse)
-> Generic DeleteQueryLoggingConfigResponse
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' :: Int -> DeleteQueryLoggingConfigResponse
DeleteQueryLoggingConfigResponse'
    { $sel:httpStatus:DeleteQueryLoggingConfigResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
deleteQueryLoggingConfigResponse_httpStatus :: Lens.Lens' DeleteQueryLoggingConfigResponse Prelude.Int
deleteQueryLoggingConfigResponse_httpStatus :: (Int -> f Int)
-> DeleteQueryLoggingConfigResponse
-> f DeleteQueryLoggingConfigResponse
deleteQueryLoggingConfigResponse_httpStatus = (DeleteQueryLoggingConfigResponse -> Int)
-> (DeleteQueryLoggingConfigResponse
    -> Int -> DeleteQueryLoggingConfigResponse)
-> Lens
     DeleteQueryLoggingConfigResponse
     DeleteQueryLoggingConfigResponse
     Int
     Int
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