{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types
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
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]
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
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. 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' {$sel:metricName:DeleteCustomMetric' :: Text
metricName = Text
pMetricName_}
deleteCustomMetric_metricName :: Lens.Lens' DeleteCustomMetric Prelude.Text
deleteCustomMetric_metricName :: Lens' DeleteCustomMetric Text
deleteCustomMetric_metricName = 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 :: (Service -> Service)
-> DeleteCustomMetric -> Request DeleteCustomMetric
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 DeleteCustomMetric
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteCustomMetric)))
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 -> DeleteCustomMetricResponse
DeleteCustomMetricResponse'
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 DeleteCustomMetric where
hashWithSalt :: Int -> DeleteCustomMetric -> Int
hashWithSalt Int
_salt DeleteCustomMetric' {Text
metricName :: Text
$sel:metricName:DeleteCustomMetric' :: DeleteCustomMetric -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
metricName
instance Prelude.NFData DeleteCustomMetric where
rnf :: DeleteCustomMetric -> ()
rnf DeleteCustomMetric' {Text
metricName :: Text
$sel:metricName:DeleteCustomMetric' :: DeleteCustomMetric -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
metricName
instance Data.ToHeaders DeleteCustomMetric where
toHeaders :: DeleteCustomMetric -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath DeleteCustomMetric where
toPath :: DeleteCustomMetric -> ByteString
toPath DeleteCustomMetric' {Text
metricName :: Text
$sel:metricName:DeleteCustomMetric' :: DeleteCustomMetric -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/custom-metric/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
metricName]
instance Data.ToQuery DeleteCustomMetric where
toQuery :: DeleteCustomMetric -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteCustomMetricResponse = DeleteCustomMetricResponse'
{
DeleteCustomMetricResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteCustomMetricResponse -> DeleteCustomMetricResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:DeleteCustomMetricResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteCustomMetricResponse_httpStatus :: Lens.Lens' DeleteCustomMetricResponse Prelude.Int
deleteCustomMetricResponse_httpStatus :: Lens' DeleteCustomMetricResponse Int
deleteCustomMetricResponse_httpStatus = 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 where
rnf :: DeleteCustomMetricResponse -> ()
rnf DeleteCustomMetricResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteCustomMetricResponse' :: DeleteCustomMetricResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus