{-# 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.IoTEvents.DeleteInput
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes an input.
module Amazonka.IoTEvents.DeleteInput
  ( -- * Creating a Request
    DeleteInput (..),
    newDeleteInput,

    -- * Request Lenses
    deleteInput_inputName,

    -- * Destructuring the Response
    DeleteInputResponse (..),
    newDeleteInputResponse,

    -- * Response Lenses
    deleteInputResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTEvents.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

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

-- |
-- Create a value of 'DeleteInput' 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:
--
-- 'inputName', 'deleteInput_inputName' - The name of the input to delete.
newDeleteInput ::
  -- | 'inputName'
  Prelude.Text ->
  DeleteInput
newDeleteInput :: Text -> DeleteInput
newDeleteInput Text
pInputName_ =
  DeleteInput' {$sel:inputName:DeleteInput' :: Text
inputName = Text
pInputName_}

-- | The name of the input to delete.
deleteInput_inputName :: Lens.Lens' DeleteInput Prelude.Text
deleteInput_inputName :: Lens' DeleteInput Text
deleteInput_inputName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteInput' {Text
inputName :: Text
$sel:inputName:DeleteInput' :: DeleteInput -> Text
inputName} -> Text
inputName) (\s :: DeleteInput
s@DeleteInput' {} Text
a -> DeleteInput
s {$sel:inputName:DeleteInput' :: Text
inputName = Text
a} :: DeleteInput)

instance Core.AWSRequest DeleteInput where
  type AWSResponse DeleteInput = DeleteInputResponse
  request :: (Service -> Service) -> DeleteInput -> Request DeleteInput
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 DeleteInput
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteInput)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteInputResponse
DeleteInputResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DeleteInput where
  hashWithSalt :: Int -> DeleteInput -> Int
hashWithSalt Int
_salt DeleteInput' {Text
inputName :: Text
$sel:inputName:DeleteInput' :: DeleteInput -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
inputName

instance Prelude.NFData DeleteInput where
  rnf :: DeleteInput -> ()
rnf DeleteInput' {Text
inputName :: Text
$sel:inputName:DeleteInput' :: DeleteInput -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
inputName

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

instance Data.ToPath DeleteInput where
  toPath :: DeleteInput -> ByteString
toPath DeleteInput' {Text
inputName :: Text
$sel:inputName:DeleteInput' :: DeleteInput -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/inputs/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
inputName]

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

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

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

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

instance Prelude.NFData DeleteInputResponse where
  rnf :: DeleteInputResponse -> ()
rnf DeleteInputResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteInputResponse' :: DeleteInputResponse -> Int
..} = forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus