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