{-# 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.DeleteLogGroup
(
DeleteLogGroup (..),
newDeleteLogGroup,
deleteLogGroup_logGroupName,
DeleteLogGroupResponse (..),
newDeleteLogGroupResponse,
)
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 DeleteLogGroup = DeleteLogGroup'
{
DeleteLogGroup -> Text
logGroupName :: Prelude.Text
}
deriving (DeleteLogGroup -> DeleteLogGroup -> Bool
(DeleteLogGroup -> DeleteLogGroup -> Bool)
-> (DeleteLogGroup -> DeleteLogGroup -> Bool) -> Eq DeleteLogGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLogGroup -> DeleteLogGroup -> Bool
$c/= :: DeleteLogGroup -> DeleteLogGroup -> Bool
== :: DeleteLogGroup -> DeleteLogGroup -> Bool
$c== :: DeleteLogGroup -> DeleteLogGroup -> Bool
Prelude.Eq, ReadPrec [DeleteLogGroup]
ReadPrec DeleteLogGroup
Int -> ReadS DeleteLogGroup
ReadS [DeleteLogGroup]
(Int -> ReadS DeleteLogGroup)
-> ReadS [DeleteLogGroup]
-> ReadPrec DeleteLogGroup
-> ReadPrec [DeleteLogGroup]
-> Read DeleteLogGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLogGroup]
$creadListPrec :: ReadPrec [DeleteLogGroup]
readPrec :: ReadPrec DeleteLogGroup
$creadPrec :: ReadPrec DeleteLogGroup
readList :: ReadS [DeleteLogGroup]
$creadList :: ReadS [DeleteLogGroup]
readsPrec :: Int -> ReadS DeleteLogGroup
$creadsPrec :: Int -> ReadS DeleteLogGroup
Prelude.Read, Int -> DeleteLogGroup -> ShowS
[DeleteLogGroup] -> ShowS
DeleteLogGroup -> String
(Int -> DeleteLogGroup -> ShowS)
-> (DeleteLogGroup -> String)
-> ([DeleteLogGroup] -> ShowS)
-> Show DeleteLogGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLogGroup] -> ShowS
$cshowList :: [DeleteLogGroup] -> ShowS
show :: DeleteLogGroup -> String
$cshow :: DeleteLogGroup -> String
showsPrec :: Int -> DeleteLogGroup -> ShowS
$cshowsPrec :: Int -> DeleteLogGroup -> ShowS
Prelude.Show, (forall x. DeleteLogGroup -> Rep DeleteLogGroup x)
-> (forall x. Rep DeleteLogGroup x -> DeleteLogGroup)
-> Generic DeleteLogGroup
forall x. Rep DeleteLogGroup x -> DeleteLogGroup
forall x. DeleteLogGroup -> Rep DeleteLogGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteLogGroup x -> DeleteLogGroup
$cfrom :: forall x. DeleteLogGroup -> Rep DeleteLogGroup x
Prelude.Generic)
newDeleteLogGroup ::
Prelude.Text ->
DeleteLogGroup
newDeleteLogGroup :: Text -> DeleteLogGroup
newDeleteLogGroup Text
pLogGroupName_ =
DeleteLogGroup' :: Text -> DeleteLogGroup
DeleteLogGroup' {$sel:logGroupName:DeleteLogGroup' :: Text
logGroupName = Text
pLogGroupName_}
deleteLogGroup_logGroupName :: Lens.Lens' DeleteLogGroup Prelude.Text
deleteLogGroup_logGroupName :: (Text -> f Text) -> DeleteLogGroup -> f DeleteLogGroup
deleteLogGroup_logGroupName = (DeleteLogGroup -> Text)
-> (DeleteLogGroup -> Text -> DeleteLogGroup)
-> Lens DeleteLogGroup DeleteLogGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLogGroup' {Text
logGroupName :: Text
$sel:logGroupName:DeleteLogGroup' :: DeleteLogGroup -> Text
logGroupName} -> Text
logGroupName) (\s :: DeleteLogGroup
s@DeleteLogGroup' {} Text
a -> DeleteLogGroup
s {$sel:logGroupName:DeleteLogGroup' :: Text
logGroupName = Text
a} :: DeleteLogGroup)
instance Core.AWSRequest DeleteLogGroup where
type
AWSResponse DeleteLogGroup =
DeleteLogGroupResponse
request :: DeleteLogGroup -> Request DeleteLogGroup
request = Service -> DeleteLogGroup -> Request DeleteLogGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteLogGroup
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteLogGroup)))
response =
AWSResponse DeleteLogGroup
-> Logger
-> Service
-> Proxy DeleteLogGroup
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteLogGroup)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteLogGroup
DeleteLogGroupResponse
DeleteLogGroupResponse'
instance Prelude.Hashable DeleteLogGroup
instance Prelude.NFData DeleteLogGroup
instance Core.ToHeaders DeleteLogGroup where
toHeaders :: DeleteLogGroup -> [Header]
toHeaders =
[Header] -> DeleteLogGroup -> [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.DeleteLogGroup" ::
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 DeleteLogGroup where
toJSON :: DeleteLogGroup -> Value
toJSON DeleteLogGroup' {Text
logGroupName :: Text
$sel:logGroupName:DeleteLogGroup' :: DeleteLogGroup -> 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)]
)
instance Core.ToPath DeleteLogGroup where
toPath :: DeleteLogGroup -> ByteString
toPath = ByteString -> DeleteLogGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteLogGroup where
toQuery :: DeleteLogGroup -> QueryString
toQuery = QueryString -> DeleteLogGroup -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteLogGroupResponse = DeleteLogGroupResponse'
{
}
deriving (DeleteLogGroupResponse -> DeleteLogGroupResponse -> Bool
(DeleteLogGroupResponse -> DeleteLogGroupResponse -> Bool)
-> (DeleteLogGroupResponse -> DeleteLogGroupResponse -> Bool)
-> Eq DeleteLogGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLogGroupResponse -> DeleteLogGroupResponse -> Bool
$c/= :: DeleteLogGroupResponse -> DeleteLogGroupResponse -> Bool
== :: DeleteLogGroupResponse -> DeleteLogGroupResponse -> Bool
$c== :: DeleteLogGroupResponse -> DeleteLogGroupResponse -> Bool
Prelude.Eq, ReadPrec [DeleteLogGroupResponse]
ReadPrec DeleteLogGroupResponse
Int -> ReadS DeleteLogGroupResponse
ReadS [DeleteLogGroupResponse]
(Int -> ReadS DeleteLogGroupResponse)
-> ReadS [DeleteLogGroupResponse]
-> ReadPrec DeleteLogGroupResponse
-> ReadPrec [DeleteLogGroupResponse]
-> Read DeleteLogGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLogGroupResponse]
$creadListPrec :: ReadPrec [DeleteLogGroupResponse]
readPrec :: ReadPrec DeleteLogGroupResponse
$creadPrec :: ReadPrec DeleteLogGroupResponse
readList :: ReadS [DeleteLogGroupResponse]
$creadList :: ReadS [DeleteLogGroupResponse]
readsPrec :: Int -> ReadS DeleteLogGroupResponse
$creadsPrec :: Int -> ReadS DeleteLogGroupResponse
Prelude.Read, Int -> DeleteLogGroupResponse -> ShowS
[DeleteLogGroupResponse] -> ShowS
DeleteLogGroupResponse -> String
(Int -> DeleteLogGroupResponse -> ShowS)
-> (DeleteLogGroupResponse -> String)
-> ([DeleteLogGroupResponse] -> ShowS)
-> Show DeleteLogGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLogGroupResponse] -> ShowS
$cshowList :: [DeleteLogGroupResponse] -> ShowS
show :: DeleteLogGroupResponse -> String
$cshow :: DeleteLogGroupResponse -> String
showsPrec :: Int -> DeleteLogGroupResponse -> ShowS
$cshowsPrec :: Int -> DeleteLogGroupResponse -> ShowS
Prelude.Show, (forall x. DeleteLogGroupResponse -> Rep DeleteLogGroupResponse x)
-> (forall x.
Rep DeleteLogGroupResponse x -> DeleteLogGroupResponse)
-> Generic DeleteLogGroupResponse
forall x. Rep DeleteLogGroupResponse x -> DeleteLogGroupResponse
forall x. DeleteLogGroupResponse -> Rep DeleteLogGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteLogGroupResponse x -> DeleteLogGroupResponse
$cfrom :: forall x. DeleteLogGroupResponse -> Rep DeleteLogGroupResponse x
Prelude.Generic)
newDeleteLogGroupResponse ::
DeleteLogGroupResponse
newDeleteLogGroupResponse :: DeleteLogGroupResponse
newDeleteLogGroupResponse = DeleteLogGroupResponse
DeleteLogGroupResponse'
instance Prelude.NFData DeleteLogGroupResponse