{-# 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.CloudWatch.DeleteInsightRules
(
DeleteInsightRules (..),
newDeleteInsightRules,
deleteInsightRules_ruleNames,
DeleteInsightRulesResponse (..),
newDeleteInsightRulesResponse,
deleteInsightRulesResponse_failures,
deleteInsightRulesResponse_httpStatus,
)
where
import Amazonka.CloudWatch.Types
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
data DeleteInsightRules = DeleteInsightRules'
{
DeleteInsightRules -> [Text]
ruleNames :: [Prelude.Text]
}
deriving (DeleteInsightRules -> DeleteInsightRules -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteInsightRules -> DeleteInsightRules -> Bool
$c/= :: DeleteInsightRules -> DeleteInsightRules -> Bool
== :: DeleteInsightRules -> DeleteInsightRules -> Bool
$c== :: DeleteInsightRules -> DeleteInsightRules -> Bool
Prelude.Eq, ReadPrec [DeleteInsightRules]
ReadPrec DeleteInsightRules
Int -> ReadS DeleteInsightRules
ReadS [DeleteInsightRules]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteInsightRules]
$creadListPrec :: ReadPrec [DeleteInsightRules]
readPrec :: ReadPrec DeleteInsightRules
$creadPrec :: ReadPrec DeleteInsightRules
readList :: ReadS [DeleteInsightRules]
$creadList :: ReadS [DeleteInsightRules]
readsPrec :: Int -> ReadS DeleteInsightRules
$creadsPrec :: Int -> ReadS DeleteInsightRules
Prelude.Read, Int -> DeleteInsightRules -> ShowS
[DeleteInsightRules] -> ShowS
DeleteInsightRules -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteInsightRules] -> ShowS
$cshowList :: [DeleteInsightRules] -> ShowS
show :: DeleteInsightRules -> String
$cshow :: DeleteInsightRules -> String
showsPrec :: Int -> DeleteInsightRules -> ShowS
$cshowsPrec :: Int -> DeleteInsightRules -> ShowS
Prelude.Show, forall x. Rep DeleteInsightRules x -> DeleteInsightRules
forall x. DeleteInsightRules -> Rep DeleteInsightRules x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteInsightRules x -> DeleteInsightRules
$cfrom :: forall x. DeleteInsightRules -> Rep DeleteInsightRules x
Prelude.Generic)
newDeleteInsightRules ::
DeleteInsightRules
newDeleteInsightRules :: DeleteInsightRules
newDeleteInsightRules =
DeleteInsightRules' {$sel:ruleNames:DeleteInsightRules' :: [Text]
ruleNames = forall a. Monoid a => a
Prelude.mempty}
deleteInsightRules_ruleNames :: Lens.Lens' DeleteInsightRules [Prelude.Text]
deleteInsightRules_ruleNames :: Lens' DeleteInsightRules [Text]
deleteInsightRules_ruleNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteInsightRules' {[Text]
ruleNames :: [Text]
$sel:ruleNames:DeleteInsightRules' :: DeleteInsightRules -> [Text]
ruleNames} -> [Text]
ruleNames) (\s :: DeleteInsightRules
s@DeleteInsightRules' {} [Text]
a -> DeleteInsightRules
s {$sel:ruleNames:DeleteInsightRules' :: [Text]
ruleNames = [Text]
a} :: DeleteInsightRules) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest DeleteInsightRules where
type
AWSResponse DeleteInsightRules =
DeleteInsightRulesResponse
request :: (Service -> Service)
-> DeleteInsightRules -> Request DeleteInsightRules
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteInsightRules
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteInsightRules)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"DeleteInsightRulesResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe [PartialFailure] -> Int -> DeleteInsightRulesResponse
DeleteInsightRulesResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Failures"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
)
forall (f :: * -> *) a b. Applicative f => 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 DeleteInsightRules where
hashWithSalt :: Int -> DeleteInsightRules -> Int
hashWithSalt Int
_salt DeleteInsightRules' {[Text]
ruleNames :: [Text]
$sel:ruleNames:DeleteInsightRules' :: DeleteInsightRules -> [Text]
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
ruleNames
instance Prelude.NFData DeleteInsightRules where
rnf :: DeleteInsightRules -> ()
rnf DeleteInsightRules' {[Text]
ruleNames :: [Text]
$sel:ruleNames:DeleteInsightRules' :: DeleteInsightRules -> [Text]
..} = forall a. NFData a => a -> ()
Prelude.rnf [Text]
ruleNames
instance Data.ToHeaders DeleteInsightRules where
toHeaders :: DeleteInsightRules -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath DeleteInsightRules where
toPath :: DeleteInsightRules -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteInsightRules where
toQuery :: DeleteInsightRules -> QueryString
toQuery DeleteInsightRules' {[Text]
ruleNames :: [Text]
$sel:ruleNames:DeleteInsightRules' :: DeleteInsightRules -> [Text]
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DeleteInsightRules" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-08-01" :: Prelude.ByteString),
ByteString
"RuleNames"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" [Text]
ruleNames
]
data DeleteInsightRulesResponse = DeleteInsightRulesResponse'
{
DeleteInsightRulesResponse -> Maybe [PartialFailure]
failures :: Prelude.Maybe [PartialFailure],
DeleteInsightRulesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteInsightRulesResponse -> DeleteInsightRulesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteInsightRulesResponse -> DeleteInsightRulesResponse -> Bool
$c/= :: DeleteInsightRulesResponse -> DeleteInsightRulesResponse -> Bool
== :: DeleteInsightRulesResponse -> DeleteInsightRulesResponse -> Bool
$c== :: DeleteInsightRulesResponse -> DeleteInsightRulesResponse -> Bool
Prelude.Eq, ReadPrec [DeleteInsightRulesResponse]
ReadPrec DeleteInsightRulesResponse
Int -> ReadS DeleteInsightRulesResponse
ReadS [DeleteInsightRulesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteInsightRulesResponse]
$creadListPrec :: ReadPrec [DeleteInsightRulesResponse]
readPrec :: ReadPrec DeleteInsightRulesResponse
$creadPrec :: ReadPrec DeleteInsightRulesResponse
readList :: ReadS [DeleteInsightRulesResponse]
$creadList :: ReadS [DeleteInsightRulesResponse]
readsPrec :: Int -> ReadS DeleteInsightRulesResponse
$creadsPrec :: Int -> ReadS DeleteInsightRulesResponse
Prelude.Read, Int -> DeleteInsightRulesResponse -> ShowS
[DeleteInsightRulesResponse] -> ShowS
DeleteInsightRulesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteInsightRulesResponse] -> ShowS
$cshowList :: [DeleteInsightRulesResponse] -> ShowS
show :: DeleteInsightRulesResponse -> String
$cshow :: DeleteInsightRulesResponse -> String
showsPrec :: Int -> DeleteInsightRulesResponse -> ShowS
$cshowsPrec :: Int -> DeleteInsightRulesResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteInsightRulesResponse x -> DeleteInsightRulesResponse
forall x.
DeleteInsightRulesResponse -> Rep DeleteInsightRulesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteInsightRulesResponse x -> DeleteInsightRulesResponse
$cfrom :: forall x.
DeleteInsightRulesResponse -> Rep DeleteInsightRulesResponse x
Prelude.Generic)
newDeleteInsightRulesResponse ::
Prelude.Int ->
DeleteInsightRulesResponse
newDeleteInsightRulesResponse :: Int -> DeleteInsightRulesResponse
newDeleteInsightRulesResponse Int
pHttpStatus_ =
DeleteInsightRulesResponse'
{ $sel:failures:DeleteInsightRulesResponse' :: Maybe [PartialFailure]
failures =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteInsightRulesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteInsightRulesResponse_failures :: Lens.Lens' DeleteInsightRulesResponse (Prelude.Maybe [PartialFailure])
deleteInsightRulesResponse_failures :: Lens' DeleteInsightRulesResponse (Maybe [PartialFailure])
deleteInsightRulesResponse_failures = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteInsightRulesResponse' {Maybe [PartialFailure]
failures :: Maybe [PartialFailure]
$sel:failures:DeleteInsightRulesResponse' :: DeleteInsightRulesResponse -> Maybe [PartialFailure]
failures} -> Maybe [PartialFailure]
failures) (\s :: DeleteInsightRulesResponse
s@DeleteInsightRulesResponse' {} Maybe [PartialFailure]
a -> DeleteInsightRulesResponse
s {$sel:failures:DeleteInsightRulesResponse' :: Maybe [PartialFailure]
failures = Maybe [PartialFailure]
a} :: DeleteInsightRulesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
deleteInsightRulesResponse_httpStatus :: Lens.Lens' DeleteInsightRulesResponse Prelude.Int
deleteInsightRulesResponse_httpStatus :: Lens' DeleteInsightRulesResponse Int
deleteInsightRulesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteInsightRulesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteInsightRulesResponse' :: DeleteInsightRulesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteInsightRulesResponse
s@DeleteInsightRulesResponse' {} Int
a -> DeleteInsightRulesResponse
s {$sel:httpStatus:DeleteInsightRulesResponse' :: Int
httpStatus = Int
a} :: DeleteInsightRulesResponse)
instance Prelude.NFData DeleteInsightRulesResponse where
rnf :: DeleteInsightRulesResponse -> ()
rnf DeleteInsightRulesResponse' {Int
Maybe [PartialFailure]
httpStatus :: Int
failures :: Maybe [PartialFailure]
$sel:httpStatus:DeleteInsightRulesResponse' :: DeleteInsightRulesResponse -> Int
$sel:failures:DeleteInsightRulesResponse' :: DeleteInsightRulesResponse -> Maybe [PartialFailure]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [PartialFailure]
failures
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus