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