{-# 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 #-}
module Amazonka.IoTEvents.DeleteInput
(
DeleteInput (..),
newDeleteInput,
deleteInput_inputName,
DeleteInputResponse (..),
newDeleteInputResponse,
deleteInputResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoTEvents.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
data DeleteInput = DeleteInput'
{
DeleteInput -> Text
inputName :: Prelude.Text
}
deriving (DeleteInput -> DeleteInput -> Bool
(DeleteInput -> DeleteInput -> Bool)
-> (DeleteInput -> DeleteInput -> Bool) -> Eq DeleteInput
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]
(Int -> ReadS DeleteInput)
-> ReadS [DeleteInput]
-> ReadPrec DeleteInput
-> ReadPrec [DeleteInput]
-> Read 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
(Int -> DeleteInput -> ShowS)
-> (DeleteInput -> String)
-> ([DeleteInput] -> ShowS)
-> Show DeleteInput
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. DeleteInput -> Rep DeleteInput x)
-> (forall x. Rep DeleteInput x -> DeleteInput)
-> Generic DeleteInput
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)
newDeleteInput ::
Prelude.Text ->
DeleteInput
newDeleteInput :: Text -> DeleteInput
newDeleteInput Text
pInputName_ =
DeleteInput' :: Text -> DeleteInput
DeleteInput' {$sel:inputName:DeleteInput' :: Text
inputName = Text
pInputName_}
deleteInput_inputName :: Lens.Lens' DeleteInput Prelude.Text
deleteInput_inputName :: (Text -> f Text) -> DeleteInput -> f DeleteInput
deleteInput_inputName = (DeleteInput -> Text)
-> (DeleteInput -> Text -> DeleteInput)
-> Lens DeleteInput DeleteInput Text Text
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 :: DeleteInput -> Request DeleteInput
request = Service -> DeleteInput -> Request DeleteInput
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteInput
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteInput)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteInput))
-> Logger
-> Service
-> Proxy DeleteInput
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteInput)))
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 -> DeleteInputResponse
DeleteInputResponse'
(Int -> DeleteInputResponse)
-> Either String Int -> Either String DeleteInputResponse
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 DeleteInput
instance Prelude.NFData DeleteInput
instance Core.ToHeaders DeleteInput where
toHeaders :: DeleteInput -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteInput -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteInput where
toPath :: DeleteInput -> ByteString
toPath DeleteInput' {Text
inputName :: Text
$sel:inputName:DeleteInput' :: DeleteInput -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/inputs/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
inputName]
instance Core.ToQuery DeleteInput where
toQuery :: DeleteInput -> QueryString
toQuery = QueryString -> DeleteInput -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteInputResponse = DeleteInputResponse'
{
DeleteInputResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteInputResponse -> DeleteInputResponse -> Bool
(DeleteInputResponse -> DeleteInputResponse -> Bool)
-> (DeleteInputResponse -> DeleteInputResponse -> Bool)
-> Eq DeleteInputResponse
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]
(Int -> ReadS DeleteInputResponse)
-> ReadS [DeleteInputResponse]
-> ReadPrec DeleteInputResponse
-> ReadPrec [DeleteInputResponse]
-> Read 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
(Int -> DeleteInputResponse -> ShowS)
-> (DeleteInputResponse -> String)
-> ([DeleteInputResponse] -> ShowS)
-> Show DeleteInputResponse
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. DeleteInputResponse -> Rep DeleteInputResponse x)
-> (forall x. Rep DeleteInputResponse x -> DeleteInputResponse)
-> Generic DeleteInputResponse
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)
newDeleteInputResponse ::
Prelude.Int ->
DeleteInputResponse
newDeleteInputResponse :: Int -> DeleteInputResponse
newDeleteInputResponse Int
pHttpStatus_ =
DeleteInputResponse' :: Int -> DeleteInputResponse
DeleteInputResponse' {$sel:httpStatus:DeleteInputResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteInputResponse_httpStatus :: Lens.Lens' DeleteInputResponse Prelude.Int
deleteInputResponse_httpStatus :: (Int -> f Int) -> DeleteInputResponse -> f DeleteInputResponse
deleteInputResponse_httpStatus = (DeleteInputResponse -> Int)
-> (DeleteInputResponse -> Int -> DeleteInputResponse)
-> Lens DeleteInputResponse DeleteInputResponse Int Int
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