{-# 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.Rum.DeleteRumMetricsDestination
(
DeleteRumMetricsDestination (..),
newDeleteRumMetricsDestination,
deleteRumMetricsDestination_destinationArn,
deleteRumMetricsDestination_appMonitorName,
deleteRumMetricsDestination_destination,
DeleteRumMetricsDestinationResponse (..),
newDeleteRumMetricsDestinationResponse,
deleteRumMetricsDestinationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Rum.Types
data DeleteRumMetricsDestination = DeleteRumMetricsDestination'
{
DeleteRumMetricsDestination -> Maybe Text
destinationArn :: Prelude.Maybe Prelude.Text,
DeleteRumMetricsDestination -> Text
appMonitorName :: Prelude.Text,
DeleteRumMetricsDestination -> MetricDestination
destination :: MetricDestination
}
deriving (DeleteRumMetricsDestination -> DeleteRumMetricsDestination -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRumMetricsDestination -> DeleteRumMetricsDestination -> Bool
$c/= :: DeleteRumMetricsDestination -> DeleteRumMetricsDestination -> Bool
== :: DeleteRumMetricsDestination -> DeleteRumMetricsDestination -> Bool
$c== :: DeleteRumMetricsDestination -> DeleteRumMetricsDestination -> Bool
Prelude.Eq, ReadPrec [DeleteRumMetricsDestination]
ReadPrec DeleteRumMetricsDestination
Int -> ReadS DeleteRumMetricsDestination
ReadS [DeleteRumMetricsDestination]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRumMetricsDestination]
$creadListPrec :: ReadPrec [DeleteRumMetricsDestination]
readPrec :: ReadPrec DeleteRumMetricsDestination
$creadPrec :: ReadPrec DeleteRumMetricsDestination
readList :: ReadS [DeleteRumMetricsDestination]
$creadList :: ReadS [DeleteRumMetricsDestination]
readsPrec :: Int -> ReadS DeleteRumMetricsDestination
$creadsPrec :: Int -> ReadS DeleteRumMetricsDestination
Prelude.Read, Int -> DeleteRumMetricsDestination -> ShowS
[DeleteRumMetricsDestination] -> ShowS
DeleteRumMetricsDestination -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRumMetricsDestination] -> ShowS
$cshowList :: [DeleteRumMetricsDestination] -> ShowS
show :: DeleteRumMetricsDestination -> String
$cshow :: DeleteRumMetricsDestination -> String
showsPrec :: Int -> DeleteRumMetricsDestination -> ShowS
$cshowsPrec :: Int -> DeleteRumMetricsDestination -> ShowS
Prelude.Show, forall x.
Rep DeleteRumMetricsDestination x -> DeleteRumMetricsDestination
forall x.
DeleteRumMetricsDestination -> Rep DeleteRumMetricsDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteRumMetricsDestination x -> DeleteRumMetricsDestination
$cfrom :: forall x.
DeleteRumMetricsDestination -> Rep DeleteRumMetricsDestination x
Prelude.Generic)
newDeleteRumMetricsDestination ::
Prelude.Text ->
MetricDestination ->
DeleteRumMetricsDestination
newDeleteRumMetricsDestination :: Text -> MetricDestination -> DeleteRumMetricsDestination
newDeleteRumMetricsDestination
Text
pAppMonitorName_
MetricDestination
pDestination_ =
DeleteRumMetricsDestination'
{ $sel:destinationArn:DeleteRumMetricsDestination' :: Maybe Text
destinationArn =
forall a. Maybe a
Prelude.Nothing,
$sel:appMonitorName:DeleteRumMetricsDestination' :: Text
appMonitorName = Text
pAppMonitorName_,
$sel:destination:DeleteRumMetricsDestination' :: MetricDestination
destination = MetricDestination
pDestination_
}
deleteRumMetricsDestination_destinationArn :: Lens.Lens' DeleteRumMetricsDestination (Prelude.Maybe Prelude.Text)
deleteRumMetricsDestination_destinationArn :: Lens' DeleteRumMetricsDestination (Maybe Text)
deleteRumMetricsDestination_destinationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRumMetricsDestination' {Maybe Text
destinationArn :: Maybe Text
$sel:destinationArn:DeleteRumMetricsDestination' :: DeleteRumMetricsDestination -> Maybe Text
destinationArn} -> Maybe Text
destinationArn) (\s :: DeleteRumMetricsDestination
s@DeleteRumMetricsDestination' {} Maybe Text
a -> DeleteRumMetricsDestination
s {$sel:destinationArn:DeleteRumMetricsDestination' :: Maybe Text
destinationArn = Maybe Text
a} :: DeleteRumMetricsDestination)
deleteRumMetricsDestination_appMonitorName :: Lens.Lens' DeleteRumMetricsDestination Prelude.Text
deleteRumMetricsDestination_appMonitorName :: Lens' DeleteRumMetricsDestination Text
deleteRumMetricsDestination_appMonitorName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRumMetricsDestination' {Text
appMonitorName :: Text
$sel:appMonitorName:DeleteRumMetricsDestination' :: DeleteRumMetricsDestination -> Text
appMonitorName} -> Text
appMonitorName) (\s :: DeleteRumMetricsDestination
s@DeleteRumMetricsDestination' {} Text
a -> DeleteRumMetricsDestination
s {$sel:appMonitorName:DeleteRumMetricsDestination' :: Text
appMonitorName = Text
a} :: DeleteRumMetricsDestination)
deleteRumMetricsDestination_destination :: Lens.Lens' DeleteRumMetricsDestination MetricDestination
deleteRumMetricsDestination_destination :: Lens' DeleteRumMetricsDestination MetricDestination
deleteRumMetricsDestination_destination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRumMetricsDestination' {MetricDestination
destination :: MetricDestination
$sel:destination:DeleteRumMetricsDestination' :: DeleteRumMetricsDestination -> MetricDestination
destination} -> MetricDestination
destination) (\s :: DeleteRumMetricsDestination
s@DeleteRumMetricsDestination' {} MetricDestination
a -> DeleteRumMetricsDestination
s {$sel:destination:DeleteRumMetricsDestination' :: MetricDestination
destination = MetricDestination
a} :: DeleteRumMetricsDestination)
instance Core.AWSRequest DeleteRumMetricsDestination where
type
AWSResponse DeleteRumMetricsDestination =
DeleteRumMetricsDestinationResponse
request :: (Service -> Service)
-> DeleteRumMetricsDestination
-> Request DeleteRumMetricsDestination
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 DeleteRumMetricsDestination
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteRumMetricsDestination)))
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 -> DeleteRumMetricsDestinationResponse
DeleteRumMetricsDestinationResponse'
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 DeleteRumMetricsDestination where
hashWithSalt :: Int -> DeleteRumMetricsDestination -> Int
hashWithSalt Int
_salt DeleteRumMetricsDestination' {Maybe Text
Text
MetricDestination
destination :: MetricDestination
appMonitorName :: Text
destinationArn :: Maybe Text
$sel:destination:DeleteRumMetricsDestination' :: DeleteRumMetricsDestination -> MetricDestination
$sel:appMonitorName:DeleteRumMetricsDestination' :: DeleteRumMetricsDestination -> Text
$sel:destinationArn:DeleteRumMetricsDestination' :: DeleteRumMetricsDestination -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
destinationArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
appMonitorName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` MetricDestination
destination
instance Prelude.NFData DeleteRumMetricsDestination where
rnf :: DeleteRumMetricsDestination -> ()
rnf DeleteRumMetricsDestination' {Maybe Text
Text
MetricDestination
destination :: MetricDestination
appMonitorName :: Text
destinationArn :: Maybe Text
$sel:destination:DeleteRumMetricsDestination' :: DeleteRumMetricsDestination -> MetricDestination
$sel:appMonitorName:DeleteRumMetricsDestination' :: DeleteRumMetricsDestination -> Text
$sel:destinationArn:DeleteRumMetricsDestination' :: DeleteRumMetricsDestination -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
destinationArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
appMonitorName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf MetricDestination
destination
instance Data.ToHeaders DeleteRumMetricsDestination where
toHeaders :: DeleteRumMetricsDestination -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath DeleteRumMetricsDestination where
toPath :: DeleteRumMetricsDestination -> ByteString
toPath DeleteRumMetricsDestination' {Maybe Text
Text
MetricDestination
destination :: MetricDestination
appMonitorName :: Text
destinationArn :: Maybe Text
$sel:destination:DeleteRumMetricsDestination' :: DeleteRumMetricsDestination -> MetricDestination
$sel:appMonitorName:DeleteRumMetricsDestination' :: DeleteRumMetricsDestination -> Text
$sel:destinationArn:DeleteRumMetricsDestination' :: DeleteRumMetricsDestination -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/rummetrics/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
appMonitorName,
ByteString
"/metricsdestination"
]
instance Data.ToQuery DeleteRumMetricsDestination where
toQuery :: DeleteRumMetricsDestination -> QueryString
toQuery DeleteRumMetricsDestination' {Maybe Text
Text
MetricDestination
destination :: MetricDestination
appMonitorName :: Text
destinationArn :: Maybe Text
$sel:destination:DeleteRumMetricsDestination' :: DeleteRumMetricsDestination -> MetricDestination
$sel:appMonitorName:DeleteRumMetricsDestination' :: DeleteRumMetricsDestination -> Text
$sel:destinationArn:DeleteRumMetricsDestination' :: DeleteRumMetricsDestination -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"destinationArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
destinationArn,
ByteString
"destination" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: MetricDestination
destination
]
data DeleteRumMetricsDestinationResponse = DeleteRumMetricsDestinationResponse'
{
DeleteRumMetricsDestinationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteRumMetricsDestinationResponse
-> DeleteRumMetricsDestinationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRumMetricsDestinationResponse
-> DeleteRumMetricsDestinationResponse -> Bool
$c/= :: DeleteRumMetricsDestinationResponse
-> DeleteRumMetricsDestinationResponse -> Bool
== :: DeleteRumMetricsDestinationResponse
-> DeleteRumMetricsDestinationResponse -> Bool
$c== :: DeleteRumMetricsDestinationResponse
-> DeleteRumMetricsDestinationResponse -> Bool
Prelude.Eq, ReadPrec [DeleteRumMetricsDestinationResponse]
ReadPrec DeleteRumMetricsDestinationResponse
Int -> ReadS DeleteRumMetricsDestinationResponse
ReadS [DeleteRumMetricsDestinationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRumMetricsDestinationResponse]
$creadListPrec :: ReadPrec [DeleteRumMetricsDestinationResponse]
readPrec :: ReadPrec DeleteRumMetricsDestinationResponse
$creadPrec :: ReadPrec DeleteRumMetricsDestinationResponse
readList :: ReadS [DeleteRumMetricsDestinationResponse]
$creadList :: ReadS [DeleteRumMetricsDestinationResponse]
readsPrec :: Int -> ReadS DeleteRumMetricsDestinationResponse
$creadsPrec :: Int -> ReadS DeleteRumMetricsDestinationResponse
Prelude.Read, Int -> DeleteRumMetricsDestinationResponse -> ShowS
[DeleteRumMetricsDestinationResponse] -> ShowS
DeleteRumMetricsDestinationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRumMetricsDestinationResponse] -> ShowS
$cshowList :: [DeleteRumMetricsDestinationResponse] -> ShowS
show :: DeleteRumMetricsDestinationResponse -> String
$cshow :: DeleteRumMetricsDestinationResponse -> String
showsPrec :: Int -> DeleteRumMetricsDestinationResponse -> ShowS
$cshowsPrec :: Int -> DeleteRumMetricsDestinationResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteRumMetricsDestinationResponse x
-> DeleteRumMetricsDestinationResponse
forall x.
DeleteRumMetricsDestinationResponse
-> Rep DeleteRumMetricsDestinationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteRumMetricsDestinationResponse x
-> DeleteRumMetricsDestinationResponse
$cfrom :: forall x.
DeleteRumMetricsDestinationResponse
-> Rep DeleteRumMetricsDestinationResponse x
Prelude.Generic)
newDeleteRumMetricsDestinationResponse ::
Prelude.Int ->
DeleteRumMetricsDestinationResponse
newDeleteRumMetricsDestinationResponse :: Int -> DeleteRumMetricsDestinationResponse
newDeleteRumMetricsDestinationResponse Int
pHttpStatus_ =
DeleteRumMetricsDestinationResponse'
{ $sel:httpStatus:DeleteRumMetricsDestinationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteRumMetricsDestinationResponse_httpStatus :: Lens.Lens' DeleteRumMetricsDestinationResponse Prelude.Int
deleteRumMetricsDestinationResponse_httpStatus :: Lens' DeleteRumMetricsDestinationResponse Int
deleteRumMetricsDestinationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRumMetricsDestinationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteRumMetricsDestinationResponse' :: DeleteRumMetricsDestinationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteRumMetricsDestinationResponse
s@DeleteRumMetricsDestinationResponse' {} Int
a -> DeleteRumMetricsDestinationResponse
s {$sel:httpStatus:DeleteRumMetricsDestinationResponse' :: Int
httpStatus = Int
a} :: DeleteRumMetricsDestinationResponse)
instance
Prelude.NFData
DeleteRumMetricsDestinationResponse
where
rnf :: DeleteRumMetricsDestinationResponse -> ()
rnf DeleteRumMetricsDestinationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteRumMetricsDestinationResponse' :: DeleteRumMetricsDestinationResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus