{-# 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.ApiGatewayV2.DeleteAccessLogSettings
-- 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 the AccessLogSettings for a Stage. To disable access logging for
-- a Stage, delete its AccessLogSettings.
module Amazonka.ApiGatewayV2.DeleteAccessLogSettings
  ( -- * Creating a Request
    DeleteAccessLogSettings (..),
    newDeleteAccessLogSettings,

    -- * Request Lenses
    deleteAccessLogSettings_stageName,
    deleteAccessLogSettings_apiId,

    -- * Destructuring the Response
    DeleteAccessLogSettingsResponse (..),
    newDeleteAccessLogSettingsResponse,
  )
where

import Amazonka.ApiGatewayV2.Types
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

-- | /See:/ 'newDeleteAccessLogSettings' smart constructor.
data DeleteAccessLogSettings = DeleteAccessLogSettings'
  { -- | The stage name. Stage names can only contain alphanumeric characters,
    -- hyphens, and underscores. Maximum length is 128 characters.
    DeleteAccessLogSettings -> Text
stageName :: Prelude.Text,
    -- | The API identifier.
    DeleteAccessLogSettings -> Text
apiId :: Prelude.Text
  }
  deriving (DeleteAccessLogSettings -> DeleteAccessLogSettings -> Bool
(DeleteAccessLogSettings -> DeleteAccessLogSettings -> Bool)
-> (DeleteAccessLogSettings -> DeleteAccessLogSettings -> Bool)
-> Eq DeleteAccessLogSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAccessLogSettings -> DeleteAccessLogSettings -> Bool
$c/= :: DeleteAccessLogSettings -> DeleteAccessLogSettings -> Bool
== :: DeleteAccessLogSettings -> DeleteAccessLogSettings -> Bool
$c== :: DeleteAccessLogSettings -> DeleteAccessLogSettings -> Bool
Prelude.Eq, ReadPrec [DeleteAccessLogSettings]
ReadPrec DeleteAccessLogSettings
Int -> ReadS DeleteAccessLogSettings
ReadS [DeleteAccessLogSettings]
(Int -> ReadS DeleteAccessLogSettings)
-> ReadS [DeleteAccessLogSettings]
-> ReadPrec DeleteAccessLogSettings
-> ReadPrec [DeleteAccessLogSettings]
-> Read DeleteAccessLogSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAccessLogSettings]
$creadListPrec :: ReadPrec [DeleteAccessLogSettings]
readPrec :: ReadPrec DeleteAccessLogSettings
$creadPrec :: ReadPrec DeleteAccessLogSettings
readList :: ReadS [DeleteAccessLogSettings]
$creadList :: ReadS [DeleteAccessLogSettings]
readsPrec :: Int -> ReadS DeleteAccessLogSettings
$creadsPrec :: Int -> ReadS DeleteAccessLogSettings
Prelude.Read, Int -> DeleteAccessLogSettings -> ShowS
[DeleteAccessLogSettings] -> ShowS
DeleteAccessLogSettings -> String
(Int -> DeleteAccessLogSettings -> ShowS)
-> (DeleteAccessLogSettings -> String)
-> ([DeleteAccessLogSettings] -> ShowS)
-> Show DeleteAccessLogSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAccessLogSettings] -> ShowS
$cshowList :: [DeleteAccessLogSettings] -> ShowS
show :: DeleteAccessLogSettings -> String
$cshow :: DeleteAccessLogSettings -> String
showsPrec :: Int -> DeleteAccessLogSettings -> ShowS
$cshowsPrec :: Int -> DeleteAccessLogSettings -> ShowS
Prelude.Show, (forall x.
 DeleteAccessLogSettings -> Rep DeleteAccessLogSettings x)
-> (forall x.
    Rep DeleteAccessLogSettings x -> DeleteAccessLogSettings)
-> Generic DeleteAccessLogSettings
forall x. Rep DeleteAccessLogSettings x -> DeleteAccessLogSettings
forall x. DeleteAccessLogSettings -> Rep DeleteAccessLogSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAccessLogSettings x -> DeleteAccessLogSettings
$cfrom :: forall x. DeleteAccessLogSettings -> Rep DeleteAccessLogSettings x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAccessLogSettings' 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:
--
-- 'stageName', 'deleteAccessLogSettings_stageName' - The stage name. Stage names can only contain alphanumeric characters,
-- hyphens, and underscores. Maximum length is 128 characters.
--
-- 'apiId', 'deleteAccessLogSettings_apiId' - The API identifier.
newDeleteAccessLogSettings ::
  -- | 'stageName'
  Prelude.Text ->
  -- | 'apiId'
  Prelude.Text ->
  DeleteAccessLogSettings
newDeleteAccessLogSettings :: Text -> Text -> DeleteAccessLogSettings
newDeleteAccessLogSettings Text
pStageName_ Text
pApiId_ =
  DeleteAccessLogSettings' :: Text -> Text -> DeleteAccessLogSettings
DeleteAccessLogSettings'
    { $sel:stageName:DeleteAccessLogSettings' :: Text
stageName = Text
pStageName_,
      $sel:apiId:DeleteAccessLogSettings' :: Text
apiId = Text
pApiId_
    }

-- | The stage name. Stage names can only contain alphanumeric characters,
-- hyphens, and underscores. Maximum length is 128 characters.
deleteAccessLogSettings_stageName :: Lens.Lens' DeleteAccessLogSettings Prelude.Text
deleteAccessLogSettings_stageName :: (Text -> f Text)
-> DeleteAccessLogSettings -> f DeleteAccessLogSettings
deleteAccessLogSettings_stageName = (DeleteAccessLogSettings -> Text)
-> (DeleteAccessLogSettings -> Text -> DeleteAccessLogSettings)
-> Lens DeleteAccessLogSettings DeleteAccessLogSettings Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAccessLogSettings' {Text
stageName :: Text
$sel:stageName:DeleteAccessLogSettings' :: DeleteAccessLogSettings -> Text
stageName} -> Text
stageName) (\s :: DeleteAccessLogSettings
s@DeleteAccessLogSettings' {} Text
a -> DeleteAccessLogSettings
s {$sel:stageName:DeleteAccessLogSettings' :: Text
stageName = Text
a} :: DeleteAccessLogSettings)

-- | The API identifier.
deleteAccessLogSettings_apiId :: Lens.Lens' DeleteAccessLogSettings Prelude.Text
deleteAccessLogSettings_apiId :: (Text -> f Text)
-> DeleteAccessLogSettings -> f DeleteAccessLogSettings
deleteAccessLogSettings_apiId = (DeleteAccessLogSettings -> Text)
-> (DeleteAccessLogSettings -> Text -> DeleteAccessLogSettings)
-> Lens DeleteAccessLogSettings DeleteAccessLogSettings Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAccessLogSettings' {Text
apiId :: Text
$sel:apiId:DeleteAccessLogSettings' :: DeleteAccessLogSettings -> Text
apiId} -> Text
apiId) (\s :: DeleteAccessLogSettings
s@DeleteAccessLogSettings' {} Text
a -> DeleteAccessLogSettings
s {$sel:apiId:DeleteAccessLogSettings' :: Text
apiId = Text
a} :: DeleteAccessLogSettings)

instance Core.AWSRequest DeleteAccessLogSettings where
  type
    AWSResponse DeleteAccessLogSettings =
      DeleteAccessLogSettingsResponse
  request :: DeleteAccessLogSettings -> Request DeleteAccessLogSettings
request = Service
-> DeleteAccessLogSettings -> Request DeleteAccessLogSettings
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteAccessLogSettings
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteAccessLogSettings)))
response =
    AWSResponse DeleteAccessLogSettings
-> Logger
-> Service
-> Proxy DeleteAccessLogSettings
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteAccessLogSettings)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DeleteAccessLogSettings
DeleteAccessLogSettingsResponse
DeleteAccessLogSettingsResponse'

instance Prelude.Hashable DeleteAccessLogSettings

instance Prelude.NFData DeleteAccessLogSettings

instance Core.ToHeaders DeleteAccessLogSettings where
  toHeaders :: DeleteAccessLogSettings -> [Header]
toHeaders =
    [Header] -> DeleteAccessLogSettings -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath DeleteAccessLogSettings where
  toPath :: DeleteAccessLogSettings -> ByteString
toPath DeleteAccessLogSettings' {Text
apiId :: Text
stageName :: Text
$sel:apiId:DeleteAccessLogSettings' :: DeleteAccessLogSettings -> Text
$sel:stageName:DeleteAccessLogSettings' :: DeleteAccessLogSettings -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v2/apis/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
apiId,
        ByteString
"/stages/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
stageName,
        ByteString
"/accesslogsettings"
      ]

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

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

-- |
-- Create a value of 'DeleteAccessLogSettingsResponse' 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.
newDeleteAccessLogSettingsResponse ::
  DeleteAccessLogSettingsResponse
newDeleteAccessLogSettingsResponse :: DeleteAccessLogSettingsResponse
newDeleteAccessLogSettingsResponse =
  DeleteAccessLogSettingsResponse
DeleteAccessLogSettingsResponse'

instance
  Prelude.NFData
    DeleteAccessLogSettingsResponse