{-# 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.DeleteAlarmModel
(
DeleteAlarmModel (..),
newDeleteAlarmModel,
deleteAlarmModel_alarmModelName,
DeleteAlarmModelResponse (..),
newDeleteAlarmModelResponse,
deleteAlarmModelResponse_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 DeleteAlarmModel = DeleteAlarmModel'
{
DeleteAlarmModel -> Text
alarmModelName :: Prelude.Text
}
deriving (DeleteAlarmModel -> DeleteAlarmModel -> Bool
(DeleteAlarmModel -> DeleteAlarmModel -> Bool)
-> (DeleteAlarmModel -> DeleteAlarmModel -> Bool)
-> Eq DeleteAlarmModel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAlarmModel -> DeleteAlarmModel -> Bool
$c/= :: DeleteAlarmModel -> DeleteAlarmModel -> Bool
== :: DeleteAlarmModel -> DeleteAlarmModel -> Bool
$c== :: DeleteAlarmModel -> DeleteAlarmModel -> Bool
Prelude.Eq, ReadPrec [DeleteAlarmModel]
ReadPrec DeleteAlarmModel
Int -> ReadS DeleteAlarmModel
ReadS [DeleteAlarmModel]
(Int -> ReadS DeleteAlarmModel)
-> ReadS [DeleteAlarmModel]
-> ReadPrec DeleteAlarmModel
-> ReadPrec [DeleteAlarmModel]
-> Read DeleteAlarmModel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAlarmModel]
$creadListPrec :: ReadPrec [DeleteAlarmModel]
readPrec :: ReadPrec DeleteAlarmModel
$creadPrec :: ReadPrec DeleteAlarmModel
readList :: ReadS [DeleteAlarmModel]
$creadList :: ReadS [DeleteAlarmModel]
readsPrec :: Int -> ReadS DeleteAlarmModel
$creadsPrec :: Int -> ReadS DeleteAlarmModel
Prelude.Read, Int -> DeleteAlarmModel -> ShowS
[DeleteAlarmModel] -> ShowS
DeleteAlarmModel -> String
(Int -> DeleteAlarmModel -> ShowS)
-> (DeleteAlarmModel -> String)
-> ([DeleteAlarmModel] -> ShowS)
-> Show DeleteAlarmModel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAlarmModel] -> ShowS
$cshowList :: [DeleteAlarmModel] -> ShowS
show :: DeleteAlarmModel -> String
$cshow :: DeleteAlarmModel -> String
showsPrec :: Int -> DeleteAlarmModel -> ShowS
$cshowsPrec :: Int -> DeleteAlarmModel -> ShowS
Prelude.Show, (forall x. DeleteAlarmModel -> Rep DeleteAlarmModel x)
-> (forall x. Rep DeleteAlarmModel x -> DeleteAlarmModel)
-> Generic DeleteAlarmModel
forall x. Rep DeleteAlarmModel x -> DeleteAlarmModel
forall x. DeleteAlarmModel -> Rep DeleteAlarmModel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAlarmModel x -> DeleteAlarmModel
$cfrom :: forall x. DeleteAlarmModel -> Rep DeleteAlarmModel x
Prelude.Generic)
newDeleteAlarmModel ::
Prelude.Text ->
DeleteAlarmModel
newDeleteAlarmModel :: Text -> DeleteAlarmModel
newDeleteAlarmModel Text
pAlarmModelName_ =
DeleteAlarmModel' :: Text -> DeleteAlarmModel
DeleteAlarmModel'
{ $sel:alarmModelName:DeleteAlarmModel' :: Text
alarmModelName =
Text
pAlarmModelName_
}
deleteAlarmModel_alarmModelName :: Lens.Lens' DeleteAlarmModel Prelude.Text
deleteAlarmModel_alarmModelName :: (Text -> f Text) -> DeleteAlarmModel -> f DeleteAlarmModel
deleteAlarmModel_alarmModelName = (DeleteAlarmModel -> Text)
-> (DeleteAlarmModel -> Text -> DeleteAlarmModel)
-> Lens DeleteAlarmModel DeleteAlarmModel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAlarmModel' {Text
alarmModelName :: Text
$sel:alarmModelName:DeleteAlarmModel' :: DeleteAlarmModel -> Text
alarmModelName} -> Text
alarmModelName) (\s :: DeleteAlarmModel
s@DeleteAlarmModel' {} Text
a -> DeleteAlarmModel
s {$sel:alarmModelName:DeleteAlarmModel' :: Text
alarmModelName = Text
a} :: DeleteAlarmModel)
instance Core.AWSRequest DeleteAlarmModel where
type
AWSResponse DeleteAlarmModel =
DeleteAlarmModelResponse
request :: DeleteAlarmModel -> Request DeleteAlarmModel
request = Service -> DeleteAlarmModel -> Request DeleteAlarmModel
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteAlarmModel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteAlarmModel)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteAlarmModel))
-> Logger
-> Service
-> Proxy DeleteAlarmModel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteAlarmModel)))
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 -> DeleteAlarmModelResponse
DeleteAlarmModelResponse'
(Int -> DeleteAlarmModelResponse)
-> Either String Int -> Either String DeleteAlarmModelResponse
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 DeleteAlarmModel
instance Prelude.NFData DeleteAlarmModel
instance Core.ToHeaders DeleteAlarmModel where
toHeaders :: DeleteAlarmModel -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteAlarmModel -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteAlarmModel where
toPath :: DeleteAlarmModel -> ByteString
toPath DeleteAlarmModel' {Text
alarmModelName :: Text
$sel:alarmModelName:DeleteAlarmModel' :: DeleteAlarmModel -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/alarm-models/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
alarmModelName]
instance Core.ToQuery DeleteAlarmModel where
toQuery :: DeleteAlarmModel -> QueryString
toQuery = QueryString -> DeleteAlarmModel -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteAlarmModelResponse = DeleteAlarmModelResponse'
{
DeleteAlarmModelResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteAlarmModelResponse -> DeleteAlarmModelResponse -> Bool
(DeleteAlarmModelResponse -> DeleteAlarmModelResponse -> Bool)
-> (DeleteAlarmModelResponse -> DeleteAlarmModelResponse -> Bool)
-> Eq DeleteAlarmModelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAlarmModelResponse -> DeleteAlarmModelResponse -> Bool
$c/= :: DeleteAlarmModelResponse -> DeleteAlarmModelResponse -> Bool
== :: DeleteAlarmModelResponse -> DeleteAlarmModelResponse -> Bool
$c== :: DeleteAlarmModelResponse -> DeleteAlarmModelResponse -> Bool
Prelude.Eq, ReadPrec [DeleteAlarmModelResponse]
ReadPrec DeleteAlarmModelResponse
Int -> ReadS DeleteAlarmModelResponse
ReadS [DeleteAlarmModelResponse]
(Int -> ReadS DeleteAlarmModelResponse)
-> ReadS [DeleteAlarmModelResponse]
-> ReadPrec DeleteAlarmModelResponse
-> ReadPrec [DeleteAlarmModelResponse]
-> Read DeleteAlarmModelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAlarmModelResponse]
$creadListPrec :: ReadPrec [DeleteAlarmModelResponse]
readPrec :: ReadPrec DeleteAlarmModelResponse
$creadPrec :: ReadPrec DeleteAlarmModelResponse
readList :: ReadS [DeleteAlarmModelResponse]
$creadList :: ReadS [DeleteAlarmModelResponse]
readsPrec :: Int -> ReadS DeleteAlarmModelResponse
$creadsPrec :: Int -> ReadS DeleteAlarmModelResponse
Prelude.Read, Int -> DeleteAlarmModelResponse -> ShowS
[DeleteAlarmModelResponse] -> ShowS
DeleteAlarmModelResponse -> String
(Int -> DeleteAlarmModelResponse -> ShowS)
-> (DeleteAlarmModelResponse -> String)
-> ([DeleteAlarmModelResponse] -> ShowS)
-> Show DeleteAlarmModelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAlarmModelResponse] -> ShowS
$cshowList :: [DeleteAlarmModelResponse] -> ShowS
show :: DeleteAlarmModelResponse -> String
$cshow :: DeleteAlarmModelResponse -> String
showsPrec :: Int -> DeleteAlarmModelResponse -> ShowS
$cshowsPrec :: Int -> DeleteAlarmModelResponse -> ShowS
Prelude.Show, (forall x.
DeleteAlarmModelResponse -> Rep DeleteAlarmModelResponse x)
-> (forall x.
Rep DeleteAlarmModelResponse x -> DeleteAlarmModelResponse)
-> Generic DeleteAlarmModelResponse
forall x.
Rep DeleteAlarmModelResponse x -> DeleteAlarmModelResponse
forall x.
DeleteAlarmModelResponse -> Rep DeleteAlarmModelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteAlarmModelResponse x -> DeleteAlarmModelResponse
$cfrom :: forall x.
DeleteAlarmModelResponse -> Rep DeleteAlarmModelResponse x
Prelude.Generic)
newDeleteAlarmModelResponse ::
Prelude.Int ->
DeleteAlarmModelResponse
newDeleteAlarmModelResponse :: Int -> DeleteAlarmModelResponse
newDeleteAlarmModelResponse Int
pHttpStatus_ =
DeleteAlarmModelResponse' :: Int -> DeleteAlarmModelResponse
DeleteAlarmModelResponse'
{ $sel:httpStatus:DeleteAlarmModelResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteAlarmModelResponse_httpStatus :: Lens.Lens' DeleteAlarmModelResponse Prelude.Int
deleteAlarmModelResponse_httpStatus :: (Int -> f Int)
-> DeleteAlarmModelResponse -> f DeleteAlarmModelResponse
deleteAlarmModelResponse_httpStatus = (DeleteAlarmModelResponse -> Int)
-> (DeleteAlarmModelResponse -> Int -> DeleteAlarmModelResponse)
-> Lens DeleteAlarmModelResponse DeleteAlarmModelResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAlarmModelResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteAlarmModelResponse' :: DeleteAlarmModelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteAlarmModelResponse
s@DeleteAlarmModelResponse' {} Int
a -> DeleteAlarmModelResponse
s {$sel:httpStatus:DeleteAlarmModelResponse' :: Int
httpStatus = Int
a} :: DeleteAlarmModelResponse)
instance Prelude.NFData DeleteAlarmModelResponse