{-# 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.AMP.DeleteLoggingConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Delete logging configuration.
module Amazonka.AMP.DeleteLoggingConfiguration
  ( -- * Creating a Request
    DeleteLoggingConfiguration (..),
    newDeleteLoggingConfiguration,

    -- * Request Lenses
    deleteLoggingConfiguration_clientToken,
    deleteLoggingConfiguration_workspaceId,

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

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

-- | Represents the input of a DeleteLoggingConfiguration operation.
--
-- /See:/ 'newDeleteLoggingConfiguration' smart constructor.
data DeleteLoggingConfiguration = DeleteLoggingConfiguration'
  { -- | Optional, unique, case-sensitive, user-provided identifier to ensure the
    -- idempotency of the request.
    DeleteLoggingConfiguration -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the workspace to vend logs to.
    DeleteLoggingConfiguration -> Text
workspaceId :: Prelude.Text
  }
  deriving (DeleteLoggingConfiguration -> DeleteLoggingConfiguration -> Bool
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]
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
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.
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:
--
-- 'clientToken', 'deleteLoggingConfiguration_clientToken' - Optional, unique, case-sensitive, user-provided identifier to ensure the
-- idempotency of the request.
--
-- 'workspaceId', 'deleteLoggingConfiguration_workspaceId' - The ID of the workspace to vend logs to.
newDeleteLoggingConfiguration ::
  -- | 'workspaceId'
  Prelude.Text ->
  DeleteLoggingConfiguration
newDeleteLoggingConfiguration :: Text -> DeleteLoggingConfiguration
newDeleteLoggingConfiguration Text
pWorkspaceId_ =
  DeleteLoggingConfiguration'
    { $sel:clientToken:DeleteLoggingConfiguration' :: Maybe Text
clientToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:workspaceId:DeleteLoggingConfiguration' :: Text
workspaceId = Text
pWorkspaceId_
    }

-- | Optional, unique, case-sensitive, user-provided identifier to ensure the
-- idempotency of the request.
deleteLoggingConfiguration_clientToken :: Lens.Lens' DeleteLoggingConfiguration (Prelude.Maybe Prelude.Text)
deleteLoggingConfiguration_clientToken :: Lens' DeleteLoggingConfiguration (Maybe Text)
deleteLoggingConfiguration_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLoggingConfiguration' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:DeleteLoggingConfiguration' :: DeleteLoggingConfiguration -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: DeleteLoggingConfiguration
s@DeleteLoggingConfiguration' {} Maybe Text
a -> DeleteLoggingConfiguration
s {$sel:clientToken:DeleteLoggingConfiguration' :: Maybe Text
clientToken = Maybe Text
a} :: DeleteLoggingConfiguration)

-- | The ID of the workspace to vend logs to.
deleteLoggingConfiguration_workspaceId :: Lens.Lens' DeleteLoggingConfiguration Prelude.Text
deleteLoggingConfiguration_workspaceId :: Lens' DeleteLoggingConfiguration Text
deleteLoggingConfiguration_workspaceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLoggingConfiguration' {Text
workspaceId :: Text
$sel:workspaceId:DeleteLoggingConfiguration' :: DeleteLoggingConfiguration -> Text
workspaceId} -> Text
workspaceId) (\s :: DeleteLoggingConfiguration
s@DeleteLoggingConfiguration' {} Text
a -> DeleteLoggingConfiguration
s {$sel:workspaceId:DeleteLoggingConfiguration' :: Text
workspaceId = Text
a} :: DeleteLoggingConfiguration)

instance Core.AWSRequest DeleteLoggingConfiguration where
  type
    AWSResponse DeleteLoggingConfiguration =
      DeleteLoggingConfigurationResponse
  request :: (Service -> Service)
-> DeleteLoggingConfiguration -> Request DeleteLoggingConfiguration
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 DeleteLoggingConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteLoggingConfiguration)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      DeleteLoggingConfigurationResponse
DeleteLoggingConfigurationResponse'

instance Prelude.Hashable DeleteLoggingConfiguration where
  hashWithSalt :: Int -> DeleteLoggingConfiguration -> Int
hashWithSalt Int
_salt DeleteLoggingConfiguration' {Maybe Text
Text
workspaceId :: Text
clientToken :: Maybe Text
$sel:workspaceId:DeleteLoggingConfiguration' :: DeleteLoggingConfiguration -> Text
$sel:clientToken:DeleteLoggingConfiguration' :: DeleteLoggingConfiguration -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workspaceId

instance Prelude.NFData DeleteLoggingConfiguration where
  rnf :: DeleteLoggingConfiguration -> ()
rnf DeleteLoggingConfiguration' {Maybe Text
Text
workspaceId :: Text
clientToken :: Maybe Text
$sel:workspaceId:DeleteLoggingConfiguration' :: DeleteLoggingConfiguration -> Text
$sel:clientToken:DeleteLoggingConfiguration' :: DeleteLoggingConfiguration -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
workspaceId

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

instance Data.ToPath DeleteLoggingConfiguration where
  toPath :: DeleteLoggingConfiguration -> ByteString
toPath DeleteLoggingConfiguration' {Maybe Text
Text
workspaceId :: Text
clientToken :: Maybe Text
$sel:workspaceId:DeleteLoggingConfiguration' :: DeleteLoggingConfiguration -> Text
$sel:clientToken:DeleteLoggingConfiguration' :: DeleteLoggingConfiguration -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/workspaces/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
workspaceId, ByteString
"/logging"]

instance Data.ToQuery DeleteLoggingConfiguration where
  toQuery :: DeleteLoggingConfiguration -> QueryString
toQuery DeleteLoggingConfiguration' {Maybe Text
Text
workspaceId :: Text
clientToken :: Maybe Text
$sel:workspaceId:DeleteLoggingConfiguration' :: DeleteLoggingConfiguration -> Text
$sel:clientToken:DeleteLoggingConfiguration' :: DeleteLoggingConfiguration -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"clientToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
clientToken]

-- | /See:/ 'newDeleteLoggingConfigurationResponse' smart constructor.
data DeleteLoggingConfigurationResponse = DeleteLoggingConfigurationResponse'
  {
  }
  deriving (DeleteLoggingConfigurationResponse
-> DeleteLoggingConfigurationResponse -> Bool
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]
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
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.
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.
newDeleteLoggingConfigurationResponse ::
  DeleteLoggingConfigurationResponse
newDeleteLoggingConfigurationResponse :: DeleteLoggingConfigurationResponse
newDeleteLoggingConfigurationResponse =
  DeleteLoggingConfigurationResponse
DeleteLoggingConfigurationResponse'

instance
  Prelude.NFData
    DeleteLoggingConfigurationResponse
  where
  rnf :: DeleteLoggingConfigurationResponse -> ()
rnf DeleteLoggingConfigurationResponse
_ = ()