{-# 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.WAFRegional.DeleteLoggingConfiguration
-- 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)
--
-- This is __AWS WAF Classic__ documentation. For more information, see
-- <https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html AWS WAF Classic>
-- in the developer guide.
--
-- __For the latest version of AWS WAF__, use the AWS WAFV2 API and see the
-- <https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html AWS WAF Developer Guide>.
-- With the latest version, AWS WAF has a single set of endpoints for
-- regional and global use.
--
-- Permanently deletes the LoggingConfiguration from the specified web ACL.
module Amazonka.WAFRegional.DeleteLoggingConfiguration
  ( -- * Creating a Request
    DeleteLoggingConfiguration (..),
    newDeleteLoggingConfiguration,

    -- * Request Lenses
    deleteLoggingConfiguration_resourceArn,

    -- * Destructuring the Response
    DeleteLoggingConfigurationResponse (..),
    newDeleteLoggingConfigurationResponse,

    -- * Response Lenses
    deleteLoggingConfigurationResponse_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.WAFRegional.Types

-- | /See:/ 'newDeleteLoggingConfiguration' smart constructor.
data DeleteLoggingConfiguration = DeleteLoggingConfiguration'
  { -- | The Amazon Resource Name (ARN) of the web ACL from which you want to
    -- delete the LoggingConfiguration.
    DeleteLoggingConfiguration -> Text
resourceArn :: Prelude.Text
  }
  deriving (DeleteLoggingConfiguration -> DeleteLoggingConfiguration -> Bool
(DeleteLoggingConfiguration -> DeleteLoggingConfiguration -> Bool)
-> (DeleteLoggingConfiguration
    -> DeleteLoggingConfiguration -> Bool)
-> Eq DeleteLoggingConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLoggingConfiguration -> DeleteLoggingConfiguration -> Bool
$c/= :: DeleteLoggingConfiguration -> DeleteLoggingConfiguration -> Bool
== :: DeleteLoggingConfiguration -> DeleteLoggingConfiguration -> Bool
$c== :: DeleteLoggingConfiguration -> DeleteLoggingConfiguration -> Bool
Prelude.Eq, ReadPrec [DeleteLoggingConfiguration]
ReadPrec DeleteLoggingConfiguration
Int -> ReadS DeleteLoggingConfiguration
ReadS [DeleteLoggingConfiguration]
(Int -> ReadS DeleteLoggingConfiguration)
-> ReadS [DeleteLoggingConfiguration]
-> ReadPrec DeleteLoggingConfiguration
-> ReadPrec [DeleteLoggingConfiguration]
-> Read DeleteLoggingConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLoggingConfiguration]
$creadListPrec :: ReadPrec [DeleteLoggingConfiguration]
readPrec :: ReadPrec DeleteLoggingConfiguration
$creadPrec :: ReadPrec DeleteLoggingConfiguration
readList :: ReadS [DeleteLoggingConfiguration]
$creadList :: ReadS [DeleteLoggingConfiguration]
readsPrec :: Int -> ReadS DeleteLoggingConfiguration
$creadsPrec :: Int -> ReadS DeleteLoggingConfiguration
Prelude.Read, Int -> DeleteLoggingConfiguration -> ShowS
[DeleteLoggingConfiguration] -> ShowS
DeleteLoggingConfiguration -> String
(Int -> DeleteLoggingConfiguration -> ShowS)
-> (DeleteLoggingConfiguration -> String)
-> ([DeleteLoggingConfiguration] -> ShowS)
-> Show DeleteLoggingConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLoggingConfiguration] -> ShowS
$cshowList :: [DeleteLoggingConfiguration] -> ShowS
show :: DeleteLoggingConfiguration -> String
$cshow :: DeleteLoggingConfiguration -> String
showsPrec :: Int -> DeleteLoggingConfiguration -> ShowS
$cshowsPrec :: Int -> DeleteLoggingConfiguration -> ShowS
Prelude.Show, (forall x.
 DeleteLoggingConfiguration -> Rep DeleteLoggingConfiguration x)
-> (forall x.
    Rep DeleteLoggingConfiguration x -> DeleteLoggingConfiguration)
-> Generic DeleteLoggingConfiguration
forall x.
Rep DeleteLoggingConfiguration x -> DeleteLoggingConfiguration
forall x.
DeleteLoggingConfiguration -> Rep DeleteLoggingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteLoggingConfiguration x -> DeleteLoggingConfiguration
$cfrom :: forall x.
DeleteLoggingConfiguration -> Rep DeleteLoggingConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DeleteLoggingConfiguration' 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:
--
-- 'resourceArn', 'deleteLoggingConfiguration_resourceArn' - The Amazon Resource Name (ARN) of the web ACL from which you want to
-- delete the LoggingConfiguration.
newDeleteLoggingConfiguration ::
  -- | 'resourceArn'
  Prelude.Text ->
  DeleteLoggingConfiguration
newDeleteLoggingConfiguration :: Text -> DeleteLoggingConfiguration
newDeleteLoggingConfiguration Text
pResourceArn_ =
  DeleteLoggingConfiguration' :: Text -> DeleteLoggingConfiguration
DeleteLoggingConfiguration'
    { $sel:resourceArn:DeleteLoggingConfiguration' :: Text
resourceArn =
        Text
pResourceArn_
    }

-- | The Amazon Resource Name (ARN) of the web ACL from which you want to
-- delete the LoggingConfiguration.
deleteLoggingConfiguration_resourceArn :: Lens.Lens' DeleteLoggingConfiguration Prelude.Text
deleteLoggingConfiguration_resourceArn :: (Text -> f Text)
-> DeleteLoggingConfiguration -> f DeleteLoggingConfiguration
deleteLoggingConfiguration_resourceArn = (DeleteLoggingConfiguration -> Text)
-> (DeleteLoggingConfiguration
    -> Text -> DeleteLoggingConfiguration)
-> Lens
     DeleteLoggingConfiguration DeleteLoggingConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLoggingConfiguration' {Text
resourceArn :: Text
$sel:resourceArn:DeleteLoggingConfiguration' :: DeleteLoggingConfiguration -> Text
resourceArn} -> Text
resourceArn) (\s :: DeleteLoggingConfiguration
s@DeleteLoggingConfiguration' {} Text
a -> DeleteLoggingConfiguration
s {$sel:resourceArn:DeleteLoggingConfiguration' :: Text
resourceArn = Text
a} :: DeleteLoggingConfiguration)

instance Core.AWSRequest DeleteLoggingConfiguration where
  type
    AWSResponse DeleteLoggingConfiguration =
      DeleteLoggingConfigurationResponse
  request :: DeleteLoggingConfiguration -> Request DeleteLoggingConfiguration
request = Service
-> DeleteLoggingConfiguration -> Request DeleteLoggingConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteLoggingConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteLoggingConfiguration)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteLoggingConfiguration))
-> Logger
-> Service
-> Proxy DeleteLoggingConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteLoggingConfiguration)))
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 -> DeleteLoggingConfigurationResponse
DeleteLoggingConfigurationResponse'
            (Int -> DeleteLoggingConfigurationResponse)
-> Either String Int
-> Either String DeleteLoggingConfigurationResponse
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 DeleteLoggingConfiguration

instance Prelude.NFData DeleteLoggingConfiguration

instance Core.ToHeaders DeleteLoggingConfiguration where
  toHeaders :: DeleteLoggingConfiguration -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteLoggingConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSWAF_Regional_20161128.DeleteLoggingConfiguration" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DeleteLoggingConfiguration where
  toJSON :: DeleteLoggingConfiguration -> Value
toJSON DeleteLoggingConfiguration' {Text
resourceArn :: Text
$sel:resourceArn:DeleteLoggingConfiguration' :: DeleteLoggingConfiguration -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceArn)]
      )

instance Core.ToPath DeleteLoggingConfiguration where
  toPath :: DeleteLoggingConfiguration -> ByteString
toPath = ByteString -> DeleteLoggingConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

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

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

instance
  Prelude.NFData
    DeleteLoggingConfigurationResponse