{-# 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.Kinesis.AddTagsToStream
(
AddTagsToStream (..),
newAddTagsToStream,
addTagsToStream_streamName,
addTagsToStream_tags,
AddTagsToStreamResponse (..),
newAddTagsToStreamResponse,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Kinesis.Types
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 AddTagsToStream = AddTagsToStream'
{
AddTagsToStream -> Text
streamName :: Prelude.Text,
AddTagsToStream -> HashMap Text Text
tags :: Prelude.HashMap Prelude.Text Prelude.Text
}
deriving (AddTagsToStream -> AddTagsToStream -> Bool
(AddTagsToStream -> AddTagsToStream -> Bool)
-> (AddTagsToStream -> AddTagsToStream -> Bool)
-> Eq AddTagsToStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddTagsToStream -> AddTagsToStream -> Bool
$c/= :: AddTagsToStream -> AddTagsToStream -> Bool
== :: AddTagsToStream -> AddTagsToStream -> Bool
$c== :: AddTagsToStream -> AddTagsToStream -> Bool
Prelude.Eq, ReadPrec [AddTagsToStream]
ReadPrec AddTagsToStream
Int -> ReadS AddTagsToStream
ReadS [AddTagsToStream]
(Int -> ReadS AddTagsToStream)
-> ReadS [AddTagsToStream]
-> ReadPrec AddTagsToStream
-> ReadPrec [AddTagsToStream]
-> Read AddTagsToStream
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddTagsToStream]
$creadListPrec :: ReadPrec [AddTagsToStream]
readPrec :: ReadPrec AddTagsToStream
$creadPrec :: ReadPrec AddTagsToStream
readList :: ReadS [AddTagsToStream]
$creadList :: ReadS [AddTagsToStream]
readsPrec :: Int -> ReadS AddTagsToStream
$creadsPrec :: Int -> ReadS AddTagsToStream
Prelude.Read, Int -> AddTagsToStream -> ShowS
[AddTagsToStream] -> ShowS
AddTagsToStream -> String
(Int -> AddTagsToStream -> ShowS)
-> (AddTagsToStream -> String)
-> ([AddTagsToStream] -> ShowS)
-> Show AddTagsToStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddTagsToStream] -> ShowS
$cshowList :: [AddTagsToStream] -> ShowS
show :: AddTagsToStream -> String
$cshow :: AddTagsToStream -> String
showsPrec :: Int -> AddTagsToStream -> ShowS
$cshowsPrec :: Int -> AddTagsToStream -> ShowS
Prelude.Show, (forall x. AddTagsToStream -> Rep AddTagsToStream x)
-> (forall x. Rep AddTagsToStream x -> AddTagsToStream)
-> Generic AddTagsToStream
forall x. Rep AddTagsToStream x -> AddTagsToStream
forall x. AddTagsToStream -> Rep AddTagsToStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddTagsToStream x -> AddTagsToStream
$cfrom :: forall x. AddTagsToStream -> Rep AddTagsToStream x
Prelude.Generic)
newAddTagsToStream ::
Prelude.Text ->
AddTagsToStream
newAddTagsToStream :: Text -> AddTagsToStream
newAddTagsToStream Text
pStreamName_ =
AddTagsToStream' :: Text -> HashMap Text Text -> AddTagsToStream
AddTagsToStream'
{ $sel:streamName:AddTagsToStream' :: Text
streamName = Text
pStreamName_,
$sel:tags:AddTagsToStream' :: HashMap Text Text
tags = HashMap Text Text
forall a. Monoid a => a
Prelude.mempty
}
addTagsToStream_streamName :: Lens.Lens' AddTagsToStream Prelude.Text
addTagsToStream_streamName :: (Text -> f Text) -> AddTagsToStream -> f AddTagsToStream
addTagsToStream_streamName = (AddTagsToStream -> Text)
-> (AddTagsToStream -> Text -> AddTagsToStream)
-> Lens AddTagsToStream AddTagsToStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddTagsToStream' {Text
streamName :: Text
$sel:streamName:AddTagsToStream' :: AddTagsToStream -> Text
streamName} -> Text
streamName) (\s :: AddTagsToStream
s@AddTagsToStream' {} Text
a -> AddTagsToStream
s {$sel:streamName:AddTagsToStream' :: Text
streamName = Text
a} :: AddTagsToStream)
addTagsToStream_tags :: Lens.Lens' AddTagsToStream (Prelude.HashMap Prelude.Text Prelude.Text)
addTagsToStream_tags :: (HashMap Text Text -> f (HashMap Text Text))
-> AddTagsToStream -> f AddTagsToStream
addTagsToStream_tags = (AddTagsToStream -> HashMap Text Text)
-> (AddTagsToStream -> HashMap Text Text -> AddTagsToStream)
-> Lens
AddTagsToStream
AddTagsToStream
(HashMap Text Text)
(HashMap Text Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddTagsToStream' {HashMap Text Text
tags :: HashMap Text Text
$sel:tags:AddTagsToStream' :: AddTagsToStream -> HashMap Text Text
tags} -> HashMap Text Text
tags) (\s :: AddTagsToStream
s@AddTagsToStream' {} HashMap Text Text
a -> AddTagsToStream
s {$sel:tags:AddTagsToStream' :: HashMap Text Text
tags = HashMap Text Text
a} :: AddTagsToStream) ((HashMap Text Text -> f (HashMap Text Text))
-> AddTagsToStream -> f AddTagsToStream)
-> ((HashMap Text Text -> f (HashMap Text Text))
-> HashMap Text Text -> f (HashMap Text Text))
-> (HashMap Text Text -> f (HashMap Text Text))
-> AddTagsToStream
-> f AddTagsToStream
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 AddTagsToStream where
type
AWSResponse AddTagsToStream =
AddTagsToStreamResponse
request :: AddTagsToStream -> Request AddTagsToStream
request = Service -> AddTagsToStream -> Request AddTagsToStream
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AddTagsToStream
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AddTagsToStream)))
response =
AWSResponse AddTagsToStream
-> Logger
-> Service
-> Proxy AddTagsToStream
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AddTagsToStream)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse AddTagsToStream
AddTagsToStreamResponse
AddTagsToStreamResponse'
instance Prelude.Hashable AddTagsToStream
instance Prelude.NFData AddTagsToStream
instance Core.ToHeaders AddTagsToStream where
toHeaders :: AddTagsToStream -> [Header]
toHeaders =
[Header] -> AddTagsToStream -> [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
"Kinesis_20131202.AddTagsToStream" ::
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 AddTagsToStream where
toJSON :: AddTagsToStream -> Value
toJSON AddTagsToStream' {Text
HashMap Text Text
tags :: HashMap Text Text
streamName :: Text
$sel:tags:AddTagsToStream' :: AddTagsToStream -> HashMap Text Text
$sel:streamName:AddTagsToStream' :: AddTagsToStream -> 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
"StreamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
streamName),
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 AddTagsToStream where
toPath :: AddTagsToStream -> ByteString
toPath = ByteString -> AddTagsToStream -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AddTagsToStream where
toQuery :: AddTagsToStream -> QueryString
toQuery = QueryString -> AddTagsToStream -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AddTagsToStreamResponse = AddTagsToStreamResponse'
{
}
deriving (AddTagsToStreamResponse -> AddTagsToStreamResponse -> Bool
(AddTagsToStreamResponse -> AddTagsToStreamResponse -> Bool)
-> (AddTagsToStreamResponse -> AddTagsToStreamResponse -> Bool)
-> Eq AddTagsToStreamResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddTagsToStreamResponse -> AddTagsToStreamResponse -> Bool
$c/= :: AddTagsToStreamResponse -> AddTagsToStreamResponse -> Bool
== :: AddTagsToStreamResponse -> AddTagsToStreamResponse -> Bool
$c== :: AddTagsToStreamResponse -> AddTagsToStreamResponse -> Bool
Prelude.Eq, ReadPrec [AddTagsToStreamResponse]
ReadPrec AddTagsToStreamResponse
Int -> ReadS AddTagsToStreamResponse
ReadS [AddTagsToStreamResponse]
(Int -> ReadS AddTagsToStreamResponse)
-> ReadS [AddTagsToStreamResponse]
-> ReadPrec AddTagsToStreamResponse
-> ReadPrec [AddTagsToStreamResponse]
-> Read AddTagsToStreamResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddTagsToStreamResponse]
$creadListPrec :: ReadPrec [AddTagsToStreamResponse]
readPrec :: ReadPrec AddTagsToStreamResponse
$creadPrec :: ReadPrec AddTagsToStreamResponse
readList :: ReadS [AddTagsToStreamResponse]
$creadList :: ReadS [AddTagsToStreamResponse]
readsPrec :: Int -> ReadS AddTagsToStreamResponse
$creadsPrec :: Int -> ReadS AddTagsToStreamResponse
Prelude.Read, Int -> AddTagsToStreamResponse -> ShowS
[AddTagsToStreamResponse] -> ShowS
AddTagsToStreamResponse -> String
(Int -> AddTagsToStreamResponse -> ShowS)
-> (AddTagsToStreamResponse -> String)
-> ([AddTagsToStreamResponse] -> ShowS)
-> Show AddTagsToStreamResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddTagsToStreamResponse] -> ShowS
$cshowList :: [AddTagsToStreamResponse] -> ShowS
show :: AddTagsToStreamResponse -> String
$cshow :: AddTagsToStreamResponse -> String
showsPrec :: Int -> AddTagsToStreamResponse -> ShowS
$cshowsPrec :: Int -> AddTagsToStreamResponse -> ShowS
Prelude.Show, (forall x.
AddTagsToStreamResponse -> Rep AddTagsToStreamResponse x)
-> (forall x.
Rep AddTagsToStreamResponse x -> AddTagsToStreamResponse)
-> Generic AddTagsToStreamResponse
forall x. Rep AddTagsToStreamResponse x -> AddTagsToStreamResponse
forall x. AddTagsToStreamResponse -> Rep AddTagsToStreamResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddTagsToStreamResponse x -> AddTagsToStreamResponse
$cfrom :: forall x. AddTagsToStreamResponse -> Rep AddTagsToStreamResponse x
Prelude.Generic)
newAddTagsToStreamResponse ::
AddTagsToStreamResponse
newAddTagsToStreamResponse :: AddTagsToStreamResponse
newAddTagsToStreamResponse = AddTagsToStreamResponse
AddTagsToStreamResponse'
instance Prelude.NFData AddTagsToStreamResponse