{-# 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.Lens as Lens
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
(DeleteInsightRules -> DeleteInsightRules -> Bool)
-> (DeleteInsightRules -> DeleteInsightRules -> Bool)
-> Eq DeleteInsightRules
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]
(Int -> ReadS DeleteInsightRules)
-> ReadS [DeleteInsightRules]
-> ReadPrec DeleteInsightRules
-> ReadPrec [DeleteInsightRules]
-> Read 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
(Int -> DeleteInsightRules -> ShowS)
-> (DeleteInsightRules -> String)
-> ([DeleteInsightRules] -> ShowS)
-> Show DeleteInsightRules
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. DeleteInsightRules -> Rep DeleteInsightRules x)
-> (forall x. Rep DeleteInsightRules x -> DeleteInsightRules)
-> Generic DeleteInsightRules
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' :: [Text] -> DeleteInsightRules
DeleteInsightRules' {$sel:ruleNames:DeleteInsightRules' :: [Text]
ruleNames = [Text]
forall a. Monoid a => a
Prelude.mempty}
deleteInsightRules_ruleNames :: Lens.Lens' DeleteInsightRules [Prelude.Text]
deleteInsightRules_ruleNames :: ([Text] -> f [Text]) -> DeleteInsightRules -> f DeleteInsightRules
deleteInsightRules_ruleNames = (DeleteInsightRules -> [Text])
-> (DeleteInsightRules -> [Text] -> DeleteInsightRules)
-> Lens DeleteInsightRules DeleteInsightRules [Text] [Text]
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) (([Text] -> f [Text])
-> DeleteInsightRules -> f DeleteInsightRules)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> DeleteInsightRules
-> f DeleteInsightRules
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
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 :: DeleteInsightRules -> Request DeleteInsightRules
request = Service -> DeleteInsightRules -> Request DeleteInsightRules
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteInsightRules
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteInsightRules)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DeleteInsightRules))
-> Logger
-> Service
-> Proxy DeleteInsightRules
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteInsightRules)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> 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'
(Maybe [PartialFailure] -> Int -> DeleteInsightRulesResponse)
-> Either String (Maybe [PartialFailure])
-> Either String (Int -> DeleteInsightRulesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Failures" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [PartialFailure]))
-> Either String (Maybe [PartialFailure])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [PartialFailure])
-> [Node] -> Either String (Maybe [PartialFailure])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [PartialFailure]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
Either String (Int -> DeleteInsightRulesResponse)
-> Either String Int -> Either String DeleteInsightRulesResponse
forall (f :: * -> *) a b. Applicative f => 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 DeleteInsightRules
instance Prelude.NFData DeleteInsightRules
instance Core.ToHeaders DeleteInsightRules where
toHeaders :: DeleteInsightRules -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteInsightRules -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteInsightRules where
toPath :: DeleteInsightRules -> ByteString
toPath = ByteString -> DeleteInsightRules -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteInsightRules where
toQuery :: DeleteInsightRules -> QueryString
toQuery DeleteInsightRules' {[Text]
ruleNames :: [Text]
$sel:ruleNames:DeleteInsightRules' :: DeleteInsightRules -> [Text]
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DeleteInsightRules" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-08-01" :: Prelude.ByteString),
ByteString
"RuleNames"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" [Text]
ruleNames
]
data DeleteInsightRulesResponse = DeleteInsightRulesResponse'
{
DeleteInsightRulesResponse -> Maybe [PartialFailure]
failures :: Prelude.Maybe [PartialFailure],
DeleteInsightRulesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteInsightRulesResponse -> DeleteInsightRulesResponse -> Bool
(DeleteInsightRulesResponse -> DeleteInsightRulesResponse -> Bool)
-> (DeleteInsightRulesResponse
-> DeleteInsightRulesResponse -> Bool)
-> Eq DeleteInsightRulesResponse
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]
(Int -> ReadS DeleteInsightRulesResponse)
-> ReadS [DeleteInsightRulesResponse]
-> ReadPrec DeleteInsightRulesResponse
-> ReadPrec [DeleteInsightRulesResponse]
-> Read 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
(Int -> DeleteInsightRulesResponse -> ShowS)
-> (DeleteInsightRulesResponse -> String)
-> ([DeleteInsightRulesResponse] -> ShowS)
-> Show DeleteInsightRulesResponse
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.
DeleteInsightRulesResponse -> Rep DeleteInsightRulesResponse x)
-> (forall x.
Rep DeleteInsightRulesResponse x -> DeleteInsightRulesResponse)
-> Generic DeleteInsightRulesResponse
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' :: Maybe [PartialFailure] -> Int -> DeleteInsightRulesResponse
DeleteInsightRulesResponse'
{ $sel:failures:DeleteInsightRulesResponse' :: Maybe [PartialFailure]
failures =
Maybe [PartialFailure]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteInsightRulesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteInsightRulesResponse_failures :: Lens.Lens' DeleteInsightRulesResponse (Prelude.Maybe [PartialFailure])
deleteInsightRulesResponse_failures :: (Maybe [PartialFailure] -> f (Maybe [PartialFailure]))
-> DeleteInsightRulesResponse -> f DeleteInsightRulesResponse
deleteInsightRulesResponse_failures = (DeleteInsightRulesResponse -> Maybe [PartialFailure])
-> (DeleteInsightRulesResponse
-> Maybe [PartialFailure] -> DeleteInsightRulesResponse)
-> Lens
DeleteInsightRulesResponse
DeleteInsightRulesResponse
(Maybe [PartialFailure])
(Maybe [PartialFailure])
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) ((Maybe [PartialFailure] -> f (Maybe [PartialFailure]))
-> DeleteInsightRulesResponse -> f DeleteInsightRulesResponse)
-> ((Maybe [PartialFailure] -> f (Maybe [PartialFailure]))
-> Maybe [PartialFailure] -> f (Maybe [PartialFailure]))
-> (Maybe [PartialFailure] -> f (Maybe [PartialFailure]))
-> DeleteInsightRulesResponse
-> f DeleteInsightRulesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[PartialFailure] [PartialFailure] [PartialFailure] [PartialFailure]
-> Iso
(Maybe [PartialFailure])
(Maybe [PartialFailure])
(Maybe [PartialFailure])
(Maybe [PartialFailure])
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 AnIso
[PartialFailure] [PartialFailure] [PartialFailure] [PartialFailure]
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 :: (Int -> f Int)
-> DeleteInsightRulesResponse -> f DeleteInsightRulesResponse
deleteInsightRulesResponse_httpStatus = (DeleteInsightRulesResponse -> Int)
-> (DeleteInsightRulesResponse
-> Int -> DeleteInsightRulesResponse)
-> Lens
DeleteInsightRulesResponse DeleteInsightRulesResponse Int Int
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