{-# 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.CloudWatchLogs.DeleteSubscriptionFilter
(
DeleteSubscriptionFilter (..),
newDeleteSubscriptionFilter,
deleteSubscriptionFilter_logGroupName,
deleteSubscriptionFilter_filterName,
DeleteSubscriptionFilterResponse (..),
newDeleteSubscriptionFilterResponse,
)
where
import Amazonka.CloudWatchLogs.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 DeleteSubscriptionFilter = DeleteSubscriptionFilter'
{
DeleteSubscriptionFilter -> Text
logGroupName :: Prelude.Text,
DeleteSubscriptionFilter -> Text
filterName :: Prelude.Text
}
deriving (DeleteSubscriptionFilter -> DeleteSubscriptionFilter -> Bool
(DeleteSubscriptionFilter -> DeleteSubscriptionFilter -> Bool)
-> (DeleteSubscriptionFilter -> DeleteSubscriptionFilter -> Bool)
-> Eq DeleteSubscriptionFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSubscriptionFilter -> DeleteSubscriptionFilter -> Bool
$c/= :: DeleteSubscriptionFilter -> DeleteSubscriptionFilter -> Bool
== :: DeleteSubscriptionFilter -> DeleteSubscriptionFilter -> Bool
$c== :: DeleteSubscriptionFilter -> DeleteSubscriptionFilter -> Bool
Prelude.Eq, ReadPrec [DeleteSubscriptionFilter]
ReadPrec DeleteSubscriptionFilter
Int -> ReadS DeleteSubscriptionFilter
ReadS [DeleteSubscriptionFilter]
(Int -> ReadS DeleteSubscriptionFilter)
-> ReadS [DeleteSubscriptionFilter]
-> ReadPrec DeleteSubscriptionFilter
-> ReadPrec [DeleteSubscriptionFilter]
-> Read DeleteSubscriptionFilter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSubscriptionFilter]
$creadListPrec :: ReadPrec [DeleteSubscriptionFilter]
readPrec :: ReadPrec DeleteSubscriptionFilter
$creadPrec :: ReadPrec DeleteSubscriptionFilter
readList :: ReadS [DeleteSubscriptionFilter]
$creadList :: ReadS [DeleteSubscriptionFilter]
readsPrec :: Int -> ReadS DeleteSubscriptionFilter
$creadsPrec :: Int -> ReadS DeleteSubscriptionFilter
Prelude.Read, Int -> DeleteSubscriptionFilter -> ShowS
[DeleteSubscriptionFilter] -> ShowS
DeleteSubscriptionFilter -> String
(Int -> DeleteSubscriptionFilter -> ShowS)
-> (DeleteSubscriptionFilter -> String)
-> ([DeleteSubscriptionFilter] -> ShowS)
-> Show DeleteSubscriptionFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSubscriptionFilter] -> ShowS
$cshowList :: [DeleteSubscriptionFilter] -> ShowS
show :: DeleteSubscriptionFilter -> String
$cshow :: DeleteSubscriptionFilter -> String
showsPrec :: Int -> DeleteSubscriptionFilter -> ShowS
$cshowsPrec :: Int -> DeleteSubscriptionFilter -> ShowS
Prelude.Show, (forall x.
DeleteSubscriptionFilter -> Rep DeleteSubscriptionFilter x)
-> (forall x.
Rep DeleteSubscriptionFilter x -> DeleteSubscriptionFilter)
-> Generic DeleteSubscriptionFilter
forall x.
Rep DeleteSubscriptionFilter x -> DeleteSubscriptionFilter
forall x.
DeleteSubscriptionFilter -> Rep DeleteSubscriptionFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteSubscriptionFilter x -> DeleteSubscriptionFilter
$cfrom :: forall x.
DeleteSubscriptionFilter -> Rep DeleteSubscriptionFilter x
Prelude.Generic)
newDeleteSubscriptionFilter ::
Prelude.Text ->
Prelude.Text ->
DeleteSubscriptionFilter
newDeleteSubscriptionFilter :: Text -> Text -> DeleteSubscriptionFilter
newDeleteSubscriptionFilter
Text
pLogGroupName_
Text
pFilterName_ =
DeleteSubscriptionFilter' :: Text -> Text -> DeleteSubscriptionFilter
DeleteSubscriptionFilter'
{ $sel:logGroupName:DeleteSubscriptionFilter' :: Text
logGroupName =
Text
pLogGroupName_,
$sel:filterName:DeleteSubscriptionFilter' :: Text
filterName = Text
pFilterName_
}
deleteSubscriptionFilter_logGroupName :: Lens.Lens' DeleteSubscriptionFilter Prelude.Text
deleteSubscriptionFilter_logGroupName :: (Text -> f Text)
-> DeleteSubscriptionFilter -> f DeleteSubscriptionFilter
deleteSubscriptionFilter_logGroupName = (DeleteSubscriptionFilter -> Text)
-> (DeleteSubscriptionFilter -> Text -> DeleteSubscriptionFilter)
-> Lens DeleteSubscriptionFilter DeleteSubscriptionFilter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSubscriptionFilter' {Text
logGroupName :: Text
$sel:logGroupName:DeleteSubscriptionFilter' :: DeleteSubscriptionFilter -> Text
logGroupName} -> Text
logGroupName) (\s :: DeleteSubscriptionFilter
s@DeleteSubscriptionFilter' {} Text
a -> DeleteSubscriptionFilter
s {$sel:logGroupName:DeleteSubscriptionFilter' :: Text
logGroupName = Text
a} :: DeleteSubscriptionFilter)
deleteSubscriptionFilter_filterName :: Lens.Lens' DeleteSubscriptionFilter Prelude.Text
deleteSubscriptionFilter_filterName :: (Text -> f Text)
-> DeleteSubscriptionFilter -> f DeleteSubscriptionFilter
deleteSubscriptionFilter_filterName = (DeleteSubscriptionFilter -> Text)
-> (DeleteSubscriptionFilter -> Text -> DeleteSubscriptionFilter)
-> Lens DeleteSubscriptionFilter DeleteSubscriptionFilter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSubscriptionFilter' {Text
filterName :: Text
$sel:filterName:DeleteSubscriptionFilter' :: DeleteSubscriptionFilter -> Text
filterName} -> Text
filterName) (\s :: DeleteSubscriptionFilter
s@DeleteSubscriptionFilter' {} Text
a -> DeleteSubscriptionFilter
s {$sel:filterName:DeleteSubscriptionFilter' :: Text
filterName = Text
a} :: DeleteSubscriptionFilter)
instance Core.AWSRequest DeleteSubscriptionFilter where
type
AWSResponse DeleteSubscriptionFilter =
DeleteSubscriptionFilterResponse
request :: DeleteSubscriptionFilter -> Request DeleteSubscriptionFilter
request = Service
-> DeleteSubscriptionFilter -> Request DeleteSubscriptionFilter
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteSubscriptionFilter
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteSubscriptionFilter)))
response =
AWSResponse DeleteSubscriptionFilter
-> Logger
-> Service
-> Proxy DeleteSubscriptionFilter
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteSubscriptionFilter)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse DeleteSubscriptionFilter
DeleteSubscriptionFilterResponse
DeleteSubscriptionFilterResponse'
instance Prelude.Hashable DeleteSubscriptionFilter
instance Prelude.NFData DeleteSubscriptionFilter
instance Core.ToHeaders DeleteSubscriptionFilter where
toHeaders :: DeleteSubscriptionFilter -> [Header]
toHeaders =
[Header] -> DeleteSubscriptionFilter -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"Logs_20140328.DeleteSubscriptionFilter" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DeleteSubscriptionFilter where
toJSON :: DeleteSubscriptionFilter -> Value
toJSON DeleteSubscriptionFilter' {Text
filterName :: Text
logGroupName :: Text
$sel:filterName:DeleteSubscriptionFilter' :: DeleteSubscriptionFilter -> Text
$sel:logGroupName:DeleteSubscriptionFilter' :: DeleteSubscriptionFilter -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"logGroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
logGroupName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"filterName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
filterName)
]
)
instance Core.ToPath DeleteSubscriptionFilter where
toPath :: DeleteSubscriptionFilter -> ByteString
toPath = ByteString -> DeleteSubscriptionFilter -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteSubscriptionFilter where
toQuery :: DeleteSubscriptionFilter -> QueryString
toQuery = QueryString -> DeleteSubscriptionFilter -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteSubscriptionFilterResponse = DeleteSubscriptionFilterResponse'
{
}
deriving (DeleteSubscriptionFilterResponse
-> DeleteSubscriptionFilterResponse -> Bool
(DeleteSubscriptionFilterResponse
-> DeleteSubscriptionFilterResponse -> Bool)
-> (DeleteSubscriptionFilterResponse
-> DeleteSubscriptionFilterResponse -> Bool)
-> Eq DeleteSubscriptionFilterResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSubscriptionFilterResponse
-> DeleteSubscriptionFilterResponse -> Bool
$c/= :: DeleteSubscriptionFilterResponse
-> DeleteSubscriptionFilterResponse -> Bool
== :: DeleteSubscriptionFilterResponse
-> DeleteSubscriptionFilterResponse -> Bool
$c== :: DeleteSubscriptionFilterResponse
-> DeleteSubscriptionFilterResponse -> Bool
Prelude.Eq, ReadPrec [DeleteSubscriptionFilterResponse]
ReadPrec DeleteSubscriptionFilterResponse
Int -> ReadS DeleteSubscriptionFilterResponse
ReadS [DeleteSubscriptionFilterResponse]
(Int -> ReadS DeleteSubscriptionFilterResponse)
-> ReadS [DeleteSubscriptionFilterResponse]
-> ReadPrec DeleteSubscriptionFilterResponse
-> ReadPrec [DeleteSubscriptionFilterResponse]
-> Read DeleteSubscriptionFilterResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSubscriptionFilterResponse]
$creadListPrec :: ReadPrec [DeleteSubscriptionFilterResponse]
readPrec :: ReadPrec DeleteSubscriptionFilterResponse
$creadPrec :: ReadPrec DeleteSubscriptionFilterResponse
readList :: ReadS [DeleteSubscriptionFilterResponse]
$creadList :: ReadS [DeleteSubscriptionFilterResponse]
readsPrec :: Int -> ReadS DeleteSubscriptionFilterResponse
$creadsPrec :: Int -> ReadS DeleteSubscriptionFilterResponse
Prelude.Read, Int -> DeleteSubscriptionFilterResponse -> ShowS
[DeleteSubscriptionFilterResponse] -> ShowS
DeleteSubscriptionFilterResponse -> String
(Int -> DeleteSubscriptionFilterResponse -> ShowS)
-> (DeleteSubscriptionFilterResponse -> String)
-> ([DeleteSubscriptionFilterResponse] -> ShowS)
-> Show DeleteSubscriptionFilterResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSubscriptionFilterResponse] -> ShowS
$cshowList :: [DeleteSubscriptionFilterResponse] -> ShowS
show :: DeleteSubscriptionFilterResponse -> String
$cshow :: DeleteSubscriptionFilterResponse -> String
showsPrec :: Int -> DeleteSubscriptionFilterResponse -> ShowS
$cshowsPrec :: Int -> DeleteSubscriptionFilterResponse -> ShowS
Prelude.Show, (forall x.
DeleteSubscriptionFilterResponse
-> Rep DeleteSubscriptionFilterResponse x)
-> (forall x.
Rep DeleteSubscriptionFilterResponse x
-> DeleteSubscriptionFilterResponse)
-> Generic DeleteSubscriptionFilterResponse
forall x.
Rep DeleteSubscriptionFilterResponse x
-> DeleteSubscriptionFilterResponse
forall x.
DeleteSubscriptionFilterResponse
-> Rep DeleteSubscriptionFilterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteSubscriptionFilterResponse x
-> DeleteSubscriptionFilterResponse
$cfrom :: forall x.
DeleteSubscriptionFilterResponse
-> Rep DeleteSubscriptionFilterResponse x
Prelude.Generic)
newDeleteSubscriptionFilterResponse ::
DeleteSubscriptionFilterResponse
newDeleteSubscriptionFilterResponse :: DeleteSubscriptionFilterResponse
newDeleteSubscriptionFilterResponse =
DeleteSubscriptionFilterResponse
DeleteSubscriptionFilterResponse'
instance
Prelude.NFData
DeleteSubscriptionFilterResponse