{-# 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.IoTWireless.ResetResourceLogLevel
-- 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)
--
-- Removes the log-level override, if any, for a specific resource-ID and
-- resource-type. It can be used for a wireless device or a wireless
-- gateway.
module Amazonka.IoTWireless.ResetResourceLogLevel
  ( -- * Creating a Request
    ResetResourceLogLevel (..),
    newResetResourceLogLevel,

    -- * Request Lenses
    resetResourceLogLevel_resourceIdentifier,
    resetResourceLogLevel_resourceType,

    -- * Destructuring the Response
    ResetResourceLogLevelResponse (..),
    newResetResourceLogLevelResponse,

    -- * Response Lenses
    resetResourceLogLevelResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoTWireless.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:/ 'newResetResourceLogLevel' smart constructor.
data ResetResourceLogLevel = ResetResourceLogLevel'
  { ResetResourceLogLevel -> Text
resourceIdentifier :: Prelude.Text,
    -- | The type of the resource, which can be @WirelessDevice@ or
    -- @WirelessGateway@.
    ResetResourceLogLevel -> Text
resourceType :: Prelude.Text
  }
  deriving (ResetResourceLogLevel -> ResetResourceLogLevel -> Bool
(ResetResourceLogLevel -> ResetResourceLogLevel -> Bool)
-> (ResetResourceLogLevel -> ResetResourceLogLevel -> Bool)
-> Eq ResetResourceLogLevel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResetResourceLogLevel -> ResetResourceLogLevel -> Bool
$c/= :: ResetResourceLogLevel -> ResetResourceLogLevel -> Bool
== :: ResetResourceLogLevel -> ResetResourceLogLevel -> Bool
$c== :: ResetResourceLogLevel -> ResetResourceLogLevel -> Bool
Prelude.Eq, ReadPrec [ResetResourceLogLevel]
ReadPrec ResetResourceLogLevel
Int -> ReadS ResetResourceLogLevel
ReadS [ResetResourceLogLevel]
(Int -> ReadS ResetResourceLogLevel)
-> ReadS [ResetResourceLogLevel]
-> ReadPrec ResetResourceLogLevel
-> ReadPrec [ResetResourceLogLevel]
-> Read ResetResourceLogLevel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResetResourceLogLevel]
$creadListPrec :: ReadPrec [ResetResourceLogLevel]
readPrec :: ReadPrec ResetResourceLogLevel
$creadPrec :: ReadPrec ResetResourceLogLevel
readList :: ReadS [ResetResourceLogLevel]
$creadList :: ReadS [ResetResourceLogLevel]
readsPrec :: Int -> ReadS ResetResourceLogLevel
$creadsPrec :: Int -> ReadS ResetResourceLogLevel
Prelude.Read, Int -> ResetResourceLogLevel -> ShowS
[ResetResourceLogLevel] -> ShowS
ResetResourceLogLevel -> String
(Int -> ResetResourceLogLevel -> ShowS)
-> (ResetResourceLogLevel -> String)
-> ([ResetResourceLogLevel] -> ShowS)
-> Show ResetResourceLogLevel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResetResourceLogLevel] -> ShowS
$cshowList :: [ResetResourceLogLevel] -> ShowS
show :: ResetResourceLogLevel -> String
$cshow :: ResetResourceLogLevel -> String
showsPrec :: Int -> ResetResourceLogLevel -> ShowS
$cshowsPrec :: Int -> ResetResourceLogLevel -> ShowS
Prelude.Show, (forall x. ResetResourceLogLevel -> Rep ResetResourceLogLevel x)
-> (forall x. Rep ResetResourceLogLevel x -> ResetResourceLogLevel)
-> Generic ResetResourceLogLevel
forall x. Rep ResetResourceLogLevel x -> ResetResourceLogLevel
forall x. ResetResourceLogLevel -> Rep ResetResourceLogLevel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResetResourceLogLevel x -> ResetResourceLogLevel
$cfrom :: forall x. ResetResourceLogLevel -> Rep ResetResourceLogLevel x
Prelude.Generic)

-- |
-- Create a value of 'ResetResourceLogLevel' 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:
--
-- 'resourceIdentifier', 'resetResourceLogLevel_resourceIdentifier' - Undocumented member.
--
-- 'resourceType', 'resetResourceLogLevel_resourceType' - The type of the resource, which can be @WirelessDevice@ or
-- @WirelessGateway@.
newResetResourceLogLevel ::
  -- | 'resourceIdentifier'
  Prelude.Text ->
  -- | 'resourceType'
  Prelude.Text ->
  ResetResourceLogLevel
newResetResourceLogLevel :: Text -> Text -> ResetResourceLogLevel
newResetResourceLogLevel
  Text
pResourceIdentifier_
  Text
pResourceType_ =
    ResetResourceLogLevel' :: Text -> Text -> ResetResourceLogLevel
ResetResourceLogLevel'
      { $sel:resourceIdentifier:ResetResourceLogLevel' :: Text
resourceIdentifier =
          Text
pResourceIdentifier_,
        $sel:resourceType:ResetResourceLogLevel' :: Text
resourceType = Text
pResourceType_
      }

-- | Undocumented member.
resetResourceLogLevel_resourceIdentifier :: Lens.Lens' ResetResourceLogLevel Prelude.Text
resetResourceLogLevel_resourceIdentifier :: (Text -> f Text)
-> ResetResourceLogLevel -> f ResetResourceLogLevel
resetResourceLogLevel_resourceIdentifier = (ResetResourceLogLevel -> Text)
-> (ResetResourceLogLevel -> Text -> ResetResourceLogLevel)
-> Lens ResetResourceLogLevel ResetResourceLogLevel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResetResourceLogLevel' {Text
resourceIdentifier :: Text
$sel:resourceIdentifier:ResetResourceLogLevel' :: ResetResourceLogLevel -> Text
resourceIdentifier} -> Text
resourceIdentifier) (\s :: ResetResourceLogLevel
s@ResetResourceLogLevel' {} Text
a -> ResetResourceLogLevel
s {$sel:resourceIdentifier:ResetResourceLogLevel' :: Text
resourceIdentifier = Text
a} :: ResetResourceLogLevel)

-- | The type of the resource, which can be @WirelessDevice@ or
-- @WirelessGateway@.
resetResourceLogLevel_resourceType :: Lens.Lens' ResetResourceLogLevel Prelude.Text
resetResourceLogLevel_resourceType :: (Text -> f Text)
-> ResetResourceLogLevel -> f ResetResourceLogLevel
resetResourceLogLevel_resourceType = (ResetResourceLogLevel -> Text)
-> (ResetResourceLogLevel -> Text -> ResetResourceLogLevel)
-> Lens ResetResourceLogLevel ResetResourceLogLevel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResetResourceLogLevel' {Text
resourceType :: Text
$sel:resourceType:ResetResourceLogLevel' :: ResetResourceLogLevel -> Text
resourceType} -> Text
resourceType) (\s :: ResetResourceLogLevel
s@ResetResourceLogLevel' {} Text
a -> ResetResourceLogLevel
s {$sel:resourceType:ResetResourceLogLevel' :: Text
resourceType = Text
a} :: ResetResourceLogLevel)

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

instance Prelude.NFData ResetResourceLogLevel

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

instance Core.ToPath ResetResourceLogLevel where
  toPath :: ResetResourceLogLevel -> ByteString
toPath ResetResourceLogLevel' {Text
resourceType :: Text
resourceIdentifier :: Text
$sel:resourceType:ResetResourceLogLevel' :: ResetResourceLogLevel -> Text
$sel:resourceIdentifier:ResetResourceLogLevel' :: ResetResourceLogLevel -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/log-levels/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
resourceIdentifier]

instance Core.ToQuery ResetResourceLogLevel where
  toQuery :: ResetResourceLogLevel -> QueryString
toQuery ResetResourceLogLevel' {Text
resourceType :: Text
resourceIdentifier :: Text
$sel:resourceType:ResetResourceLogLevel' :: ResetResourceLogLevel -> Text
$sel:resourceIdentifier:ResetResourceLogLevel' :: ResetResourceLogLevel -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"resourceType" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
resourceType]

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

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

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

instance Prelude.NFData ResetResourceLogLevelResponse