{-# 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.KinesisVideo.TagStream
(
TagStream (..),
newTagStream,
tagStream_streamARN,
tagStream_streamName,
tagStream_tags,
TagStreamResponse (..),
newTagStreamResponse,
tagStreamResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.KinesisVideo.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 TagStream = TagStream'
{
TagStream -> Maybe Text
streamARN :: Prelude.Maybe Prelude.Text,
TagStream -> Maybe Text
streamName :: Prelude.Maybe Prelude.Text,
TagStream -> HashMap Text Text
tags :: Prelude.HashMap Prelude.Text Prelude.Text
}
deriving (TagStream -> TagStream -> Bool
(TagStream -> TagStream -> Bool)
-> (TagStream -> TagStream -> Bool) -> Eq TagStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TagStream -> TagStream -> Bool
$c/= :: TagStream -> TagStream -> Bool
== :: TagStream -> TagStream -> Bool
$c== :: TagStream -> TagStream -> Bool
Prelude.Eq, ReadPrec [TagStream]
ReadPrec TagStream
Int -> ReadS TagStream
ReadS [TagStream]
(Int -> ReadS TagStream)
-> ReadS [TagStream]
-> ReadPrec TagStream
-> ReadPrec [TagStream]
-> Read TagStream
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TagStream]
$creadListPrec :: ReadPrec [TagStream]
readPrec :: ReadPrec TagStream
$creadPrec :: ReadPrec TagStream
readList :: ReadS [TagStream]
$creadList :: ReadS [TagStream]
readsPrec :: Int -> ReadS TagStream
$creadsPrec :: Int -> ReadS TagStream
Prelude.Read, Int -> TagStream -> ShowS
[TagStream] -> ShowS
TagStream -> String
(Int -> TagStream -> ShowS)
-> (TagStream -> String)
-> ([TagStream] -> ShowS)
-> Show TagStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TagStream] -> ShowS
$cshowList :: [TagStream] -> ShowS
show :: TagStream -> String
$cshow :: TagStream -> String
showsPrec :: Int -> TagStream -> ShowS
$cshowsPrec :: Int -> TagStream -> ShowS
Prelude.Show, (forall x. TagStream -> Rep TagStream x)
-> (forall x. Rep TagStream x -> TagStream) -> Generic TagStream
forall x. Rep TagStream x -> TagStream
forall x. TagStream -> Rep TagStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TagStream x -> TagStream
$cfrom :: forall x. TagStream -> Rep TagStream x
Prelude.Generic)
newTagStream ::
TagStream
newTagStream :: TagStream
newTagStream =
TagStream' :: Maybe Text -> Maybe Text -> HashMap Text Text -> TagStream
TagStream'
{ $sel:streamARN:TagStream' :: Maybe Text
streamARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:streamName:TagStream' :: Maybe Text
streamName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:TagStream' :: HashMap Text Text
tags = HashMap Text Text
forall a. Monoid a => a
Prelude.mempty
}
tagStream_streamARN :: Lens.Lens' TagStream (Prelude.Maybe Prelude.Text)
tagStream_streamARN :: (Maybe Text -> f (Maybe Text)) -> TagStream -> f TagStream
tagStream_streamARN = (TagStream -> Maybe Text)
-> (TagStream -> Maybe Text -> TagStream)
-> Lens TagStream TagStream (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagStream' {Maybe Text
streamARN :: Maybe Text
$sel:streamARN:TagStream' :: TagStream -> Maybe Text
streamARN} -> Maybe Text
streamARN) (\s :: TagStream
s@TagStream' {} Maybe Text
a -> TagStream
s {$sel:streamARN:TagStream' :: Maybe Text
streamARN = Maybe Text
a} :: TagStream)
tagStream_streamName :: Lens.Lens' TagStream (Prelude.Maybe Prelude.Text)
tagStream_streamName :: (Maybe Text -> f (Maybe Text)) -> TagStream -> f TagStream
tagStream_streamName = (TagStream -> Maybe Text)
-> (TagStream -> Maybe Text -> TagStream)
-> Lens TagStream TagStream (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagStream' {Maybe Text
streamName :: Maybe Text
$sel:streamName:TagStream' :: TagStream -> Maybe Text
streamName} -> Maybe Text
streamName) (\s :: TagStream
s@TagStream' {} Maybe Text
a -> TagStream
s {$sel:streamName:TagStream' :: Maybe Text
streamName = Maybe Text
a} :: TagStream)
tagStream_tags :: Lens.Lens' TagStream (Prelude.HashMap Prelude.Text Prelude.Text)
tagStream_tags :: (HashMap Text Text -> f (HashMap Text Text))
-> TagStream -> f TagStream
tagStream_tags = (TagStream -> HashMap Text Text)
-> (TagStream -> HashMap Text Text -> TagStream)
-> Lens TagStream TagStream (HashMap Text Text) (HashMap Text Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagStream' {HashMap Text Text
tags :: HashMap Text Text
$sel:tags:TagStream' :: TagStream -> HashMap Text Text
tags} -> HashMap Text Text
tags) (\s :: TagStream
s@TagStream' {} HashMap Text Text
a -> TagStream
s {$sel:tags:TagStream' :: HashMap Text Text
tags = HashMap Text Text
a} :: TagStream) ((HashMap Text Text -> f (HashMap Text Text))
-> TagStream -> f TagStream)
-> ((HashMap Text Text -> f (HashMap Text Text))
-> HashMap Text Text -> f (HashMap Text Text))
-> (HashMap Text Text -> f (HashMap Text Text))
-> TagStream
-> f TagStream
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 TagStream where
type AWSResponse TagStream = TagStreamResponse
request :: TagStream -> Request TagStream
request = Service -> TagStream -> Request TagStream
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy TagStream
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse TagStream)))
response =
(Int
-> ResponseHeaders -> () -> Either String (AWSResponse TagStream))
-> Logger
-> Service
-> Proxy TagStream
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse TagStream)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> TagStreamResponse
TagStreamResponse'
(Int -> TagStreamResponse)
-> Either String Int -> Either String TagStreamResponse
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))
)
instance Prelude.Hashable TagStream
instance Prelude.NFData TagStream
instance Core.ToHeaders TagStream where
toHeaders :: TagStream -> ResponseHeaders
toHeaders = ResponseHeaders -> TagStream -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON TagStream where
toJSON :: TagStream -> Value
toJSON TagStream' {Maybe Text
HashMap Text Text
tags :: HashMap Text Text
streamName :: Maybe Text
streamARN :: Maybe Text
$sel:tags:TagStream' :: TagStream -> HashMap Text Text
$sel:streamName:TagStream' :: TagStream -> Maybe Text
$sel:streamARN:TagStream' :: TagStream -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"StreamARN" 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
streamARN,
(Text
"StreamName" 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
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 TagStream where
toPath :: TagStream -> ByteString
toPath = ByteString -> TagStream -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/tagStream"
instance Core.ToQuery TagStream where
toQuery :: TagStream -> QueryString
toQuery = QueryString -> TagStream -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data TagStreamResponse = TagStreamResponse'
{
TagStreamResponse -> Int
httpStatus :: Prelude.Int
}
deriving (TagStreamResponse -> TagStreamResponse -> Bool
(TagStreamResponse -> TagStreamResponse -> Bool)
-> (TagStreamResponse -> TagStreamResponse -> Bool)
-> Eq TagStreamResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TagStreamResponse -> TagStreamResponse -> Bool
$c/= :: TagStreamResponse -> TagStreamResponse -> Bool
== :: TagStreamResponse -> TagStreamResponse -> Bool
$c== :: TagStreamResponse -> TagStreamResponse -> Bool
Prelude.Eq, ReadPrec [TagStreamResponse]
ReadPrec TagStreamResponse
Int -> ReadS TagStreamResponse
ReadS [TagStreamResponse]
(Int -> ReadS TagStreamResponse)
-> ReadS [TagStreamResponse]
-> ReadPrec TagStreamResponse
-> ReadPrec [TagStreamResponse]
-> Read TagStreamResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TagStreamResponse]
$creadListPrec :: ReadPrec [TagStreamResponse]
readPrec :: ReadPrec TagStreamResponse
$creadPrec :: ReadPrec TagStreamResponse
readList :: ReadS [TagStreamResponse]
$creadList :: ReadS [TagStreamResponse]
readsPrec :: Int -> ReadS TagStreamResponse
$creadsPrec :: Int -> ReadS TagStreamResponse
Prelude.Read, Int -> TagStreamResponse -> ShowS
[TagStreamResponse] -> ShowS
TagStreamResponse -> String
(Int -> TagStreamResponse -> ShowS)
-> (TagStreamResponse -> String)
-> ([TagStreamResponse] -> ShowS)
-> Show TagStreamResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TagStreamResponse] -> ShowS
$cshowList :: [TagStreamResponse] -> ShowS
show :: TagStreamResponse -> String
$cshow :: TagStreamResponse -> String
showsPrec :: Int -> TagStreamResponse -> ShowS
$cshowsPrec :: Int -> TagStreamResponse -> ShowS
Prelude.Show, (forall x. TagStreamResponse -> Rep TagStreamResponse x)
-> (forall x. Rep TagStreamResponse x -> TagStreamResponse)
-> Generic TagStreamResponse
forall x. Rep TagStreamResponse x -> TagStreamResponse
forall x. TagStreamResponse -> Rep TagStreamResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TagStreamResponse x -> TagStreamResponse
$cfrom :: forall x. TagStreamResponse -> Rep TagStreamResponse x
Prelude.Generic)
newTagStreamResponse ::
Prelude.Int ->
TagStreamResponse
newTagStreamResponse :: Int -> TagStreamResponse
newTagStreamResponse Int
pHttpStatus_ =
TagStreamResponse' :: Int -> TagStreamResponse
TagStreamResponse' {$sel:httpStatus:TagStreamResponse' :: Int
httpStatus = Int
pHttpStatus_}
tagStreamResponse_httpStatus :: Lens.Lens' TagStreamResponse Prelude.Int
tagStreamResponse_httpStatus :: (Int -> f Int) -> TagStreamResponse -> f TagStreamResponse
tagStreamResponse_httpStatus = (TagStreamResponse -> Int)
-> (TagStreamResponse -> Int -> TagStreamResponse)
-> Lens TagStreamResponse TagStreamResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagStreamResponse' {Int
httpStatus :: Int
$sel:httpStatus:TagStreamResponse' :: TagStreamResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: TagStreamResponse
s@TagStreamResponse' {} Int
a -> TagStreamResponse
s {$sel:httpStatus:TagStreamResponse' :: Int
httpStatus = Int
a} :: TagStreamResponse)
instance Prelude.NFData TagStreamResponse