{-# 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.ListTagsForStream
(
ListTagsForStream (..),
newListTagsForStream,
listTagsForStream_limit,
listTagsForStream_exclusiveStartTagKey,
listTagsForStream_streamName,
ListTagsForStreamResponse (..),
newListTagsForStreamResponse,
listTagsForStreamResponse_httpStatus,
listTagsForStreamResponse_tags,
listTagsForStreamResponse_hasMoreTags,
)
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 ListTagsForStream = ListTagsForStream'
{
ListTagsForStream -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
ListTagsForStream -> Maybe Text
exclusiveStartTagKey :: Prelude.Maybe Prelude.Text,
ListTagsForStream -> Text
streamName :: Prelude.Text
}
deriving (ListTagsForStream -> ListTagsForStream -> Bool
(ListTagsForStream -> ListTagsForStream -> Bool)
-> (ListTagsForStream -> ListTagsForStream -> Bool)
-> Eq ListTagsForStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTagsForStream -> ListTagsForStream -> Bool
$c/= :: ListTagsForStream -> ListTagsForStream -> Bool
== :: ListTagsForStream -> ListTagsForStream -> Bool
$c== :: ListTagsForStream -> ListTagsForStream -> Bool
Prelude.Eq, ReadPrec [ListTagsForStream]
ReadPrec ListTagsForStream
Int -> ReadS ListTagsForStream
ReadS [ListTagsForStream]
(Int -> ReadS ListTagsForStream)
-> ReadS [ListTagsForStream]
-> ReadPrec ListTagsForStream
-> ReadPrec [ListTagsForStream]
-> Read ListTagsForStream
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTagsForStream]
$creadListPrec :: ReadPrec [ListTagsForStream]
readPrec :: ReadPrec ListTagsForStream
$creadPrec :: ReadPrec ListTagsForStream
readList :: ReadS [ListTagsForStream]
$creadList :: ReadS [ListTagsForStream]
readsPrec :: Int -> ReadS ListTagsForStream
$creadsPrec :: Int -> ReadS ListTagsForStream
Prelude.Read, Int -> ListTagsForStream -> ShowS
[ListTagsForStream] -> ShowS
ListTagsForStream -> String
(Int -> ListTagsForStream -> ShowS)
-> (ListTagsForStream -> String)
-> ([ListTagsForStream] -> ShowS)
-> Show ListTagsForStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTagsForStream] -> ShowS
$cshowList :: [ListTagsForStream] -> ShowS
show :: ListTagsForStream -> String
$cshow :: ListTagsForStream -> String
showsPrec :: Int -> ListTagsForStream -> ShowS
$cshowsPrec :: Int -> ListTagsForStream -> ShowS
Prelude.Show, (forall x. ListTagsForStream -> Rep ListTagsForStream x)
-> (forall x. Rep ListTagsForStream x -> ListTagsForStream)
-> Generic ListTagsForStream
forall x. Rep ListTagsForStream x -> ListTagsForStream
forall x. ListTagsForStream -> Rep ListTagsForStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTagsForStream x -> ListTagsForStream
$cfrom :: forall x. ListTagsForStream -> Rep ListTagsForStream x
Prelude.Generic)
newListTagsForStream ::
Prelude.Text ->
ListTagsForStream
newListTagsForStream :: Text -> ListTagsForStream
newListTagsForStream Text
pStreamName_ =
ListTagsForStream' :: Maybe Natural -> Maybe Text -> Text -> ListTagsForStream
ListTagsForStream'
{ $sel:limit:ListTagsForStream' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:exclusiveStartTagKey:ListTagsForStream' :: Maybe Text
exclusiveStartTagKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:streamName:ListTagsForStream' :: Text
streamName = Text
pStreamName_
}
listTagsForStream_limit :: Lens.Lens' ListTagsForStream (Prelude.Maybe Prelude.Natural)
listTagsForStream_limit :: (Maybe Natural -> f (Maybe Natural))
-> ListTagsForStream -> f ListTagsForStream
listTagsForStream_limit = (ListTagsForStream -> Maybe Natural)
-> (ListTagsForStream -> Maybe Natural -> ListTagsForStream)
-> Lens
ListTagsForStream ListTagsForStream (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForStream' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListTagsForStream' :: ListTagsForStream -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListTagsForStream
s@ListTagsForStream' {} Maybe Natural
a -> ListTagsForStream
s {$sel:limit:ListTagsForStream' :: Maybe Natural
limit = Maybe Natural
a} :: ListTagsForStream)
listTagsForStream_exclusiveStartTagKey :: Lens.Lens' ListTagsForStream (Prelude.Maybe Prelude.Text)
listTagsForStream_exclusiveStartTagKey :: (Maybe Text -> f (Maybe Text))
-> ListTagsForStream -> f ListTagsForStream
listTagsForStream_exclusiveStartTagKey = (ListTagsForStream -> Maybe Text)
-> (ListTagsForStream -> Maybe Text -> ListTagsForStream)
-> Lens
ListTagsForStream ListTagsForStream (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForStream' {Maybe Text
exclusiveStartTagKey :: Maybe Text
$sel:exclusiveStartTagKey:ListTagsForStream' :: ListTagsForStream -> Maybe Text
exclusiveStartTagKey} -> Maybe Text
exclusiveStartTagKey) (\s :: ListTagsForStream
s@ListTagsForStream' {} Maybe Text
a -> ListTagsForStream
s {$sel:exclusiveStartTagKey:ListTagsForStream' :: Maybe Text
exclusiveStartTagKey = Maybe Text
a} :: ListTagsForStream)
listTagsForStream_streamName :: Lens.Lens' ListTagsForStream Prelude.Text
listTagsForStream_streamName :: (Text -> f Text) -> ListTagsForStream -> f ListTagsForStream
listTagsForStream_streamName = (ListTagsForStream -> Text)
-> (ListTagsForStream -> Text -> ListTagsForStream)
-> Lens ListTagsForStream ListTagsForStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForStream' {Text
streamName :: Text
$sel:streamName:ListTagsForStream' :: ListTagsForStream -> Text
streamName} -> Text
streamName) (\s :: ListTagsForStream
s@ListTagsForStream' {} Text
a -> ListTagsForStream
s {$sel:streamName:ListTagsForStream' :: Text
streamName = Text
a} :: ListTagsForStream)
instance Core.AWSRequest ListTagsForStream where
type
AWSResponse ListTagsForStream =
ListTagsForStreamResponse
request :: ListTagsForStream -> Request ListTagsForStream
request = Service -> ListTagsForStream -> Request ListTagsForStream
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ListTagsForStream
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListTagsForStream)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListTagsForStream))
-> Logger
-> Service
-> Proxy ListTagsForStream
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListTagsForStream)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> [Tag] -> Bool -> ListTagsForStreamResponse
ListTagsForStreamResponse'
(Int -> [Tag] -> Bool -> ListTagsForStreamResponse)
-> Either String Int
-> Either String ([Tag] -> Bool -> ListTagsForStreamResponse)
forall (f :: * -> *) a b. Functor 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))
Either String ([Tag] -> Bool -> ListTagsForStreamResponse)
-> Either String [Tag]
-> Either String (Bool -> ListTagsForStreamResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [Tag])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Tags" Either String (Maybe [Tag]) -> [Tag] -> Either String [Tag]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Tag]
forall a. Monoid a => a
Prelude.mempty)
Either String (Bool -> ListTagsForStreamResponse)
-> Either String Bool -> Either String ListTagsForStreamResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Bool
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"HasMoreTags")
)
instance Prelude.Hashable ListTagsForStream
instance Prelude.NFData ListTagsForStream
instance Core.ToHeaders ListTagsForStream where
toHeaders :: ListTagsForStream -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListTagsForStream -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Kinesis_20131202.ListTagsForStream" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON ListTagsForStream where
toJSON :: ListTagsForStream -> Value
toJSON ListTagsForStream' {Maybe Natural
Maybe Text
Text
streamName :: Text
exclusiveStartTagKey :: Maybe Text
limit :: Maybe Natural
$sel:streamName:ListTagsForStream' :: ListTagsForStream -> Text
$sel:exclusiveStartTagKey:ListTagsForStream' :: ListTagsForStream -> Maybe Text
$sel:limit:ListTagsForStream' :: ListTagsForStream -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Limit" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit,
(Text
"ExclusiveStartTagKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
exclusiveStartTagKey,
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)
]
)
instance Core.ToPath ListTagsForStream where
toPath :: ListTagsForStream -> ByteString
toPath = ByteString -> ListTagsForStream -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ListTagsForStream where
toQuery :: ListTagsForStream -> QueryString
toQuery = QueryString -> ListTagsForStream -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ListTagsForStreamResponse = ListTagsForStreamResponse'
{
ListTagsForStreamResponse -> Int
httpStatus :: Prelude.Int,
ListTagsForStreamResponse -> [Tag]
tags :: [Tag],
ListTagsForStreamResponse -> Bool
hasMoreTags :: Prelude.Bool
}
deriving (ListTagsForStreamResponse -> ListTagsForStreamResponse -> Bool
(ListTagsForStreamResponse -> ListTagsForStreamResponse -> Bool)
-> (ListTagsForStreamResponse -> ListTagsForStreamResponse -> Bool)
-> Eq ListTagsForStreamResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTagsForStreamResponse -> ListTagsForStreamResponse -> Bool
$c/= :: ListTagsForStreamResponse -> ListTagsForStreamResponse -> Bool
== :: ListTagsForStreamResponse -> ListTagsForStreamResponse -> Bool
$c== :: ListTagsForStreamResponse -> ListTagsForStreamResponse -> Bool
Prelude.Eq, ReadPrec [ListTagsForStreamResponse]
ReadPrec ListTagsForStreamResponse
Int -> ReadS ListTagsForStreamResponse
ReadS [ListTagsForStreamResponse]
(Int -> ReadS ListTagsForStreamResponse)
-> ReadS [ListTagsForStreamResponse]
-> ReadPrec ListTagsForStreamResponse
-> ReadPrec [ListTagsForStreamResponse]
-> Read ListTagsForStreamResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTagsForStreamResponse]
$creadListPrec :: ReadPrec [ListTagsForStreamResponse]
readPrec :: ReadPrec ListTagsForStreamResponse
$creadPrec :: ReadPrec ListTagsForStreamResponse
readList :: ReadS [ListTagsForStreamResponse]
$creadList :: ReadS [ListTagsForStreamResponse]
readsPrec :: Int -> ReadS ListTagsForStreamResponse
$creadsPrec :: Int -> ReadS ListTagsForStreamResponse
Prelude.Read, Int -> ListTagsForStreamResponse -> ShowS
[ListTagsForStreamResponse] -> ShowS
ListTagsForStreamResponse -> String
(Int -> ListTagsForStreamResponse -> ShowS)
-> (ListTagsForStreamResponse -> String)
-> ([ListTagsForStreamResponse] -> ShowS)
-> Show ListTagsForStreamResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTagsForStreamResponse] -> ShowS
$cshowList :: [ListTagsForStreamResponse] -> ShowS
show :: ListTagsForStreamResponse -> String
$cshow :: ListTagsForStreamResponse -> String
showsPrec :: Int -> ListTagsForStreamResponse -> ShowS
$cshowsPrec :: Int -> ListTagsForStreamResponse -> ShowS
Prelude.Show, (forall x.
ListTagsForStreamResponse -> Rep ListTagsForStreamResponse x)
-> (forall x.
Rep ListTagsForStreamResponse x -> ListTagsForStreamResponse)
-> Generic ListTagsForStreamResponse
forall x.
Rep ListTagsForStreamResponse x -> ListTagsForStreamResponse
forall x.
ListTagsForStreamResponse -> Rep ListTagsForStreamResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTagsForStreamResponse x -> ListTagsForStreamResponse
$cfrom :: forall x.
ListTagsForStreamResponse -> Rep ListTagsForStreamResponse x
Prelude.Generic)
newListTagsForStreamResponse ::
Prelude.Int ->
Prelude.Bool ->
ListTagsForStreamResponse
newListTagsForStreamResponse :: Int -> Bool -> ListTagsForStreamResponse
newListTagsForStreamResponse
Int
pHttpStatus_
Bool
pHasMoreTags_ =
ListTagsForStreamResponse' :: Int -> [Tag] -> Bool -> ListTagsForStreamResponse
ListTagsForStreamResponse'
{ $sel:httpStatus:ListTagsForStreamResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:tags:ListTagsForStreamResponse' :: [Tag]
tags = [Tag]
forall a. Monoid a => a
Prelude.mempty,
$sel:hasMoreTags:ListTagsForStreamResponse' :: Bool
hasMoreTags = Bool
pHasMoreTags_
}
listTagsForStreamResponse_httpStatus :: Lens.Lens' ListTagsForStreamResponse Prelude.Int
listTagsForStreamResponse_httpStatus :: (Int -> f Int)
-> ListTagsForStreamResponse -> f ListTagsForStreamResponse
listTagsForStreamResponse_httpStatus = (ListTagsForStreamResponse -> Int)
-> (ListTagsForStreamResponse -> Int -> ListTagsForStreamResponse)
-> Lens ListTagsForStreamResponse ListTagsForStreamResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForStreamResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListTagsForStreamResponse' :: ListTagsForStreamResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListTagsForStreamResponse
s@ListTagsForStreamResponse' {} Int
a -> ListTagsForStreamResponse
s {$sel:httpStatus:ListTagsForStreamResponse' :: Int
httpStatus = Int
a} :: ListTagsForStreamResponse)
listTagsForStreamResponse_tags :: Lens.Lens' ListTagsForStreamResponse [Tag]
listTagsForStreamResponse_tags :: ([Tag] -> f [Tag])
-> ListTagsForStreamResponse -> f ListTagsForStreamResponse
listTagsForStreamResponse_tags = (ListTagsForStreamResponse -> [Tag])
-> (ListTagsForStreamResponse
-> [Tag] -> ListTagsForStreamResponse)
-> Lens
ListTagsForStreamResponse ListTagsForStreamResponse [Tag] [Tag]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForStreamResponse' {[Tag]
tags :: [Tag]
$sel:tags:ListTagsForStreamResponse' :: ListTagsForStreamResponse -> [Tag]
tags} -> [Tag]
tags) (\s :: ListTagsForStreamResponse
s@ListTagsForStreamResponse' {} [Tag]
a -> ListTagsForStreamResponse
s {$sel:tags:ListTagsForStreamResponse' :: [Tag]
tags = [Tag]
a} :: ListTagsForStreamResponse) (([Tag] -> f [Tag])
-> ListTagsForStreamResponse -> f ListTagsForStreamResponse)
-> (([Tag] -> f [Tag]) -> [Tag] -> f [Tag])
-> ([Tag] -> f [Tag])
-> ListTagsForStreamResponse
-> f ListTagsForStreamResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Tag] -> f [Tag]) -> [Tag] -> f [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listTagsForStreamResponse_hasMoreTags :: Lens.Lens' ListTagsForStreamResponse Prelude.Bool
listTagsForStreamResponse_hasMoreTags :: (Bool -> f Bool)
-> ListTagsForStreamResponse -> f ListTagsForStreamResponse
listTagsForStreamResponse_hasMoreTags = (ListTagsForStreamResponse -> Bool)
-> (ListTagsForStreamResponse -> Bool -> ListTagsForStreamResponse)
-> Lens
ListTagsForStreamResponse ListTagsForStreamResponse Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsForStreamResponse' {Bool
hasMoreTags :: Bool
$sel:hasMoreTags:ListTagsForStreamResponse' :: ListTagsForStreamResponse -> Bool
hasMoreTags} -> Bool
hasMoreTags) (\s :: ListTagsForStreamResponse
s@ListTagsForStreamResponse' {} Bool
a -> ListTagsForStreamResponse
s {$sel:hasMoreTags:ListTagsForStreamResponse' :: Bool
hasMoreTags = Bool
a} :: ListTagsForStreamResponse)
instance Prelude.NFData ListTagsForStreamResponse