{-# 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.IoT.DeleteV2LoggingLevel
-- 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 logging level.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions DeleteV2LoggingLevel>
-- action.
module Amazonka.IoT.DeleteV2LoggingLevel
  ( -- * Creating a Request
    DeleteV2LoggingLevel (..),
    newDeleteV2LoggingLevel,

    -- * Request Lenses
    deleteV2LoggingLevel_targetType,
    deleteV2LoggingLevel_targetName,

    -- * Destructuring the Response
    DeleteV2LoggingLevelResponse (..),
    newDeleteV2LoggingLevelResponse,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types
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:/ 'newDeleteV2LoggingLevel' smart constructor.
data DeleteV2LoggingLevel = DeleteV2LoggingLevel'
  { -- | The type of resource for which you are configuring logging. Must be
    -- @THING_Group@.
    DeleteV2LoggingLevel -> LogTargetType
targetType :: LogTargetType,
    -- | The name of the resource for which you are configuring logging.
    DeleteV2LoggingLevel -> Text
targetName :: Prelude.Text
  }
  deriving (DeleteV2LoggingLevel -> DeleteV2LoggingLevel -> Bool
(DeleteV2LoggingLevel -> DeleteV2LoggingLevel -> Bool)
-> (DeleteV2LoggingLevel -> DeleteV2LoggingLevel -> Bool)
-> Eq DeleteV2LoggingLevel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteV2LoggingLevel -> DeleteV2LoggingLevel -> Bool
$c/= :: DeleteV2LoggingLevel -> DeleteV2LoggingLevel -> Bool
== :: DeleteV2LoggingLevel -> DeleteV2LoggingLevel -> Bool
$c== :: DeleteV2LoggingLevel -> DeleteV2LoggingLevel -> Bool
Prelude.Eq, ReadPrec [DeleteV2LoggingLevel]
ReadPrec DeleteV2LoggingLevel
Int -> ReadS DeleteV2LoggingLevel
ReadS [DeleteV2LoggingLevel]
(Int -> ReadS DeleteV2LoggingLevel)
-> ReadS [DeleteV2LoggingLevel]
-> ReadPrec DeleteV2LoggingLevel
-> ReadPrec [DeleteV2LoggingLevel]
-> Read DeleteV2LoggingLevel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteV2LoggingLevel]
$creadListPrec :: ReadPrec [DeleteV2LoggingLevel]
readPrec :: ReadPrec DeleteV2LoggingLevel
$creadPrec :: ReadPrec DeleteV2LoggingLevel
readList :: ReadS [DeleteV2LoggingLevel]
$creadList :: ReadS [DeleteV2LoggingLevel]
readsPrec :: Int -> ReadS DeleteV2LoggingLevel
$creadsPrec :: Int -> ReadS DeleteV2LoggingLevel
Prelude.Read, Int -> DeleteV2LoggingLevel -> ShowS
[DeleteV2LoggingLevel] -> ShowS
DeleteV2LoggingLevel -> String
(Int -> DeleteV2LoggingLevel -> ShowS)
-> (DeleteV2LoggingLevel -> String)
-> ([DeleteV2LoggingLevel] -> ShowS)
-> Show DeleteV2LoggingLevel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteV2LoggingLevel] -> ShowS
$cshowList :: [DeleteV2LoggingLevel] -> ShowS
show :: DeleteV2LoggingLevel -> String
$cshow :: DeleteV2LoggingLevel -> String
showsPrec :: Int -> DeleteV2LoggingLevel -> ShowS
$cshowsPrec :: Int -> DeleteV2LoggingLevel -> ShowS
Prelude.Show, (forall x. DeleteV2LoggingLevel -> Rep DeleteV2LoggingLevel x)
-> (forall x. Rep DeleteV2LoggingLevel x -> DeleteV2LoggingLevel)
-> Generic DeleteV2LoggingLevel
forall x. Rep DeleteV2LoggingLevel x -> DeleteV2LoggingLevel
forall x. DeleteV2LoggingLevel -> Rep DeleteV2LoggingLevel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteV2LoggingLevel x -> DeleteV2LoggingLevel
$cfrom :: forall x. DeleteV2LoggingLevel -> Rep DeleteV2LoggingLevel x
Prelude.Generic)

-- |
-- Create a value of 'DeleteV2LoggingLevel' 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:
--
-- 'targetType', 'deleteV2LoggingLevel_targetType' - The type of resource for which you are configuring logging. Must be
-- @THING_Group@.
--
-- 'targetName', 'deleteV2LoggingLevel_targetName' - The name of the resource for which you are configuring logging.
newDeleteV2LoggingLevel ::
  -- | 'targetType'
  LogTargetType ->
  -- | 'targetName'
  Prelude.Text ->
  DeleteV2LoggingLevel
newDeleteV2LoggingLevel :: LogTargetType -> Text -> DeleteV2LoggingLevel
newDeleteV2LoggingLevel LogTargetType
pTargetType_ Text
pTargetName_ =
  DeleteV2LoggingLevel' :: LogTargetType -> Text -> DeleteV2LoggingLevel
DeleteV2LoggingLevel'
    { $sel:targetType:DeleteV2LoggingLevel' :: LogTargetType
targetType = LogTargetType
pTargetType_,
      $sel:targetName:DeleteV2LoggingLevel' :: Text
targetName = Text
pTargetName_
    }

-- | The type of resource for which you are configuring logging. Must be
-- @THING_Group@.
deleteV2LoggingLevel_targetType :: Lens.Lens' DeleteV2LoggingLevel LogTargetType
deleteV2LoggingLevel_targetType :: (LogTargetType -> f LogTargetType)
-> DeleteV2LoggingLevel -> f DeleteV2LoggingLevel
deleteV2LoggingLevel_targetType = (DeleteV2LoggingLevel -> LogTargetType)
-> (DeleteV2LoggingLevel -> LogTargetType -> DeleteV2LoggingLevel)
-> Lens
     DeleteV2LoggingLevel
     DeleteV2LoggingLevel
     LogTargetType
     LogTargetType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteV2LoggingLevel' {LogTargetType
targetType :: LogTargetType
$sel:targetType:DeleteV2LoggingLevel' :: DeleteV2LoggingLevel -> LogTargetType
targetType} -> LogTargetType
targetType) (\s :: DeleteV2LoggingLevel
s@DeleteV2LoggingLevel' {} LogTargetType
a -> DeleteV2LoggingLevel
s {$sel:targetType:DeleteV2LoggingLevel' :: LogTargetType
targetType = LogTargetType
a} :: DeleteV2LoggingLevel)

-- | The name of the resource for which you are configuring logging.
deleteV2LoggingLevel_targetName :: Lens.Lens' DeleteV2LoggingLevel Prelude.Text
deleteV2LoggingLevel_targetName :: (Text -> f Text) -> DeleteV2LoggingLevel -> f DeleteV2LoggingLevel
deleteV2LoggingLevel_targetName = (DeleteV2LoggingLevel -> Text)
-> (DeleteV2LoggingLevel -> Text -> DeleteV2LoggingLevel)
-> Lens DeleteV2LoggingLevel DeleteV2LoggingLevel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteV2LoggingLevel' {Text
targetName :: Text
$sel:targetName:DeleteV2LoggingLevel' :: DeleteV2LoggingLevel -> Text
targetName} -> Text
targetName) (\s :: DeleteV2LoggingLevel
s@DeleteV2LoggingLevel' {} Text
a -> DeleteV2LoggingLevel
s {$sel:targetName:DeleteV2LoggingLevel' :: Text
targetName = Text
a} :: DeleteV2LoggingLevel)

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

instance Prelude.Hashable DeleteV2LoggingLevel

instance Prelude.NFData DeleteV2LoggingLevel

instance Core.ToHeaders DeleteV2LoggingLevel where
  toHeaders :: DeleteV2LoggingLevel -> [Header]
toHeaders = [Header] -> DeleteV2LoggingLevel -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery DeleteV2LoggingLevel where
  toQuery :: DeleteV2LoggingLevel -> QueryString
toQuery DeleteV2LoggingLevel' {Text
LogTargetType
targetName :: Text
targetType :: LogTargetType
$sel:targetName:DeleteV2LoggingLevel' :: DeleteV2LoggingLevel -> Text
$sel:targetType:DeleteV2LoggingLevel' :: DeleteV2LoggingLevel -> LogTargetType
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"targetType" ByteString -> LogTargetType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: LogTargetType
targetType,
        ByteString
"targetName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
targetName
      ]

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

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

instance Prelude.NFData DeleteV2LoggingLevelResponse