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

    -- * Destructuring the Response
    ClearDefaultAuthorizerResponse (..),
    newClearDefaultAuthorizerResponse,

    -- * Response Lenses
    clearDefaultAuthorizerResponse_httpStatus,
  )
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:/ 'newClearDefaultAuthorizer' smart constructor.
data ClearDefaultAuthorizer = ClearDefaultAuthorizer'
  {
  }
  deriving (ClearDefaultAuthorizer -> ClearDefaultAuthorizer -> Bool
(ClearDefaultAuthorizer -> ClearDefaultAuthorizer -> Bool)
-> (ClearDefaultAuthorizer -> ClearDefaultAuthorizer -> Bool)
-> Eq ClearDefaultAuthorizer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClearDefaultAuthorizer -> ClearDefaultAuthorizer -> Bool
$c/= :: ClearDefaultAuthorizer -> ClearDefaultAuthorizer -> Bool
== :: ClearDefaultAuthorizer -> ClearDefaultAuthorizer -> Bool
$c== :: ClearDefaultAuthorizer -> ClearDefaultAuthorizer -> Bool
Prelude.Eq, ReadPrec [ClearDefaultAuthorizer]
ReadPrec ClearDefaultAuthorizer
Int -> ReadS ClearDefaultAuthorizer
ReadS [ClearDefaultAuthorizer]
(Int -> ReadS ClearDefaultAuthorizer)
-> ReadS [ClearDefaultAuthorizer]
-> ReadPrec ClearDefaultAuthorizer
-> ReadPrec [ClearDefaultAuthorizer]
-> Read ClearDefaultAuthorizer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClearDefaultAuthorizer]
$creadListPrec :: ReadPrec [ClearDefaultAuthorizer]
readPrec :: ReadPrec ClearDefaultAuthorizer
$creadPrec :: ReadPrec ClearDefaultAuthorizer
readList :: ReadS [ClearDefaultAuthorizer]
$creadList :: ReadS [ClearDefaultAuthorizer]
readsPrec :: Int -> ReadS ClearDefaultAuthorizer
$creadsPrec :: Int -> ReadS ClearDefaultAuthorizer
Prelude.Read, Int -> ClearDefaultAuthorizer -> ShowS
[ClearDefaultAuthorizer] -> ShowS
ClearDefaultAuthorizer -> String
(Int -> ClearDefaultAuthorizer -> ShowS)
-> (ClearDefaultAuthorizer -> String)
-> ([ClearDefaultAuthorizer] -> ShowS)
-> Show ClearDefaultAuthorizer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClearDefaultAuthorizer] -> ShowS
$cshowList :: [ClearDefaultAuthorizer] -> ShowS
show :: ClearDefaultAuthorizer -> String
$cshow :: ClearDefaultAuthorizer -> String
showsPrec :: Int -> ClearDefaultAuthorizer -> ShowS
$cshowsPrec :: Int -> ClearDefaultAuthorizer -> ShowS
Prelude.Show, (forall x. ClearDefaultAuthorizer -> Rep ClearDefaultAuthorizer x)
-> (forall x.
    Rep ClearDefaultAuthorizer x -> ClearDefaultAuthorizer)
-> Generic ClearDefaultAuthorizer
forall x. Rep ClearDefaultAuthorizer x -> ClearDefaultAuthorizer
forall x. ClearDefaultAuthorizer -> Rep ClearDefaultAuthorizer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClearDefaultAuthorizer x -> ClearDefaultAuthorizer
$cfrom :: forall x. ClearDefaultAuthorizer -> Rep ClearDefaultAuthorizer x
Prelude.Generic)

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

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

instance Prelude.NFData ClearDefaultAuthorizer

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

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

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

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

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

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

instance
  Prelude.NFData
    ClearDefaultAuthorizerResponse