{-# 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.UpdateStream
(
UpdateStream (..),
newUpdateStream,
updateStream_mediaType,
updateStream_streamARN,
updateStream_deviceName,
updateStream_streamName,
updateStream_currentVersion,
UpdateStreamResponse (..),
newUpdateStreamResponse,
updateStreamResponse_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 UpdateStream = UpdateStream'
{
UpdateStream -> Maybe Text
mediaType :: Prelude.Maybe Prelude.Text,
UpdateStream -> Maybe Text
streamARN :: Prelude.Maybe Prelude.Text,
UpdateStream -> Maybe Text
deviceName :: Prelude.Maybe Prelude.Text,
UpdateStream -> Maybe Text
streamName :: Prelude.Maybe Prelude.Text,
UpdateStream -> Text
currentVersion :: Prelude.Text
}
deriving (UpdateStream -> UpdateStream -> Bool
(UpdateStream -> UpdateStream -> Bool)
-> (UpdateStream -> UpdateStream -> Bool) -> Eq UpdateStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateStream -> UpdateStream -> Bool
$c/= :: UpdateStream -> UpdateStream -> Bool
== :: UpdateStream -> UpdateStream -> Bool
$c== :: UpdateStream -> UpdateStream -> Bool
Prelude.Eq, ReadPrec [UpdateStream]
ReadPrec UpdateStream
Int -> ReadS UpdateStream
ReadS [UpdateStream]
(Int -> ReadS UpdateStream)
-> ReadS [UpdateStream]
-> ReadPrec UpdateStream
-> ReadPrec [UpdateStream]
-> Read UpdateStream
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateStream]
$creadListPrec :: ReadPrec [UpdateStream]
readPrec :: ReadPrec UpdateStream
$creadPrec :: ReadPrec UpdateStream
readList :: ReadS [UpdateStream]
$creadList :: ReadS [UpdateStream]
readsPrec :: Int -> ReadS UpdateStream
$creadsPrec :: Int -> ReadS UpdateStream
Prelude.Read, Int -> UpdateStream -> ShowS
[UpdateStream] -> ShowS
UpdateStream -> String
(Int -> UpdateStream -> ShowS)
-> (UpdateStream -> String)
-> ([UpdateStream] -> ShowS)
-> Show UpdateStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateStream] -> ShowS
$cshowList :: [UpdateStream] -> ShowS
show :: UpdateStream -> String
$cshow :: UpdateStream -> String
showsPrec :: Int -> UpdateStream -> ShowS
$cshowsPrec :: Int -> UpdateStream -> ShowS
Prelude.Show, (forall x. UpdateStream -> Rep UpdateStream x)
-> (forall x. Rep UpdateStream x -> UpdateStream)
-> Generic UpdateStream
forall x. Rep UpdateStream x -> UpdateStream
forall x. UpdateStream -> Rep UpdateStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateStream x -> UpdateStream
$cfrom :: forall x. UpdateStream -> Rep UpdateStream x
Prelude.Generic)
newUpdateStream ::
Prelude.Text ->
UpdateStream
newUpdateStream :: Text -> UpdateStream
newUpdateStream Text
pCurrentVersion_ =
UpdateStream' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Text -> UpdateStream
UpdateStream'
{ $sel:mediaType:UpdateStream' :: Maybe Text
mediaType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:streamARN:UpdateStream' :: Maybe Text
streamARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deviceName:UpdateStream' :: Maybe Text
deviceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:streamName:UpdateStream' :: Maybe Text
streamName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:currentVersion:UpdateStream' :: Text
currentVersion = Text
pCurrentVersion_
}
updateStream_mediaType :: Lens.Lens' UpdateStream (Prelude.Maybe Prelude.Text)
updateStream_mediaType :: (Maybe Text -> f (Maybe Text)) -> UpdateStream -> f UpdateStream
updateStream_mediaType = (UpdateStream -> Maybe Text)
-> (UpdateStream -> Maybe Text -> UpdateStream)
-> Lens UpdateStream UpdateStream (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStream' {Maybe Text
mediaType :: Maybe Text
$sel:mediaType:UpdateStream' :: UpdateStream -> Maybe Text
mediaType} -> Maybe Text
mediaType) (\s :: UpdateStream
s@UpdateStream' {} Maybe Text
a -> UpdateStream
s {$sel:mediaType:UpdateStream' :: Maybe Text
mediaType = Maybe Text
a} :: UpdateStream)
updateStream_streamARN :: Lens.Lens' UpdateStream (Prelude.Maybe Prelude.Text)
updateStream_streamARN :: (Maybe Text -> f (Maybe Text)) -> UpdateStream -> f UpdateStream
updateStream_streamARN = (UpdateStream -> Maybe Text)
-> (UpdateStream -> Maybe Text -> UpdateStream)
-> Lens UpdateStream UpdateStream (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStream' {Maybe Text
streamARN :: Maybe Text
$sel:streamARN:UpdateStream' :: UpdateStream -> Maybe Text
streamARN} -> Maybe Text
streamARN) (\s :: UpdateStream
s@UpdateStream' {} Maybe Text
a -> UpdateStream
s {$sel:streamARN:UpdateStream' :: Maybe Text
streamARN = Maybe Text
a} :: UpdateStream)
updateStream_deviceName :: Lens.Lens' UpdateStream (Prelude.Maybe Prelude.Text)
updateStream_deviceName :: (Maybe Text -> f (Maybe Text)) -> UpdateStream -> f UpdateStream
updateStream_deviceName = (UpdateStream -> Maybe Text)
-> (UpdateStream -> Maybe Text -> UpdateStream)
-> Lens UpdateStream UpdateStream (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStream' {Maybe Text
deviceName :: Maybe Text
$sel:deviceName:UpdateStream' :: UpdateStream -> Maybe Text
deviceName} -> Maybe Text
deviceName) (\s :: UpdateStream
s@UpdateStream' {} Maybe Text
a -> UpdateStream
s {$sel:deviceName:UpdateStream' :: Maybe Text
deviceName = Maybe Text
a} :: UpdateStream)
updateStream_streamName :: Lens.Lens' UpdateStream (Prelude.Maybe Prelude.Text)
updateStream_streamName :: (Maybe Text -> f (Maybe Text)) -> UpdateStream -> f UpdateStream
updateStream_streamName = (UpdateStream -> Maybe Text)
-> (UpdateStream -> Maybe Text -> UpdateStream)
-> Lens UpdateStream UpdateStream (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStream' {Maybe Text
streamName :: Maybe Text
$sel:streamName:UpdateStream' :: UpdateStream -> Maybe Text
streamName} -> Maybe Text
streamName) (\s :: UpdateStream
s@UpdateStream' {} Maybe Text
a -> UpdateStream
s {$sel:streamName:UpdateStream' :: Maybe Text
streamName = Maybe Text
a} :: UpdateStream)
updateStream_currentVersion :: Lens.Lens' UpdateStream Prelude.Text
updateStream_currentVersion :: (Text -> f Text) -> UpdateStream -> f UpdateStream
updateStream_currentVersion = (UpdateStream -> Text)
-> (UpdateStream -> Text -> UpdateStream)
-> Lens UpdateStream UpdateStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStream' {Text
currentVersion :: Text
$sel:currentVersion:UpdateStream' :: UpdateStream -> Text
currentVersion} -> Text
currentVersion) (\s :: UpdateStream
s@UpdateStream' {} Text
a -> UpdateStream
s {$sel:currentVersion:UpdateStream' :: Text
currentVersion = Text
a} :: UpdateStream)
instance Core.AWSRequest UpdateStream where
type AWSResponse UpdateStream = UpdateStreamResponse
request :: UpdateStream -> Request UpdateStream
request = Service -> UpdateStream -> Request UpdateStream
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateStream
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateStream)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateStream))
-> Logger
-> Service
-> Proxy UpdateStream
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateStream)))
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 -> UpdateStreamResponse
UpdateStreamResponse'
(Int -> UpdateStreamResponse)
-> Either String Int -> Either String UpdateStreamResponse
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 UpdateStream
instance Prelude.NFData UpdateStream
instance Core.ToHeaders UpdateStream where
toHeaders :: UpdateStream -> ResponseHeaders
toHeaders = ResponseHeaders -> UpdateStream -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON UpdateStream where
toJSON :: UpdateStream -> Value
toJSON UpdateStream' {Maybe Text
Text
currentVersion :: Text
streamName :: Maybe Text
deviceName :: Maybe Text
streamARN :: Maybe Text
mediaType :: Maybe Text
$sel:currentVersion:UpdateStream' :: UpdateStream -> Text
$sel:streamName:UpdateStream' :: UpdateStream -> Maybe Text
$sel:deviceName:UpdateStream' :: UpdateStream -> Maybe Text
$sel:streamARN:UpdateStream' :: UpdateStream -> Maybe Text
$sel:mediaType:UpdateStream' :: UpdateStream -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"MediaType" 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
mediaType,
(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
"DeviceName" 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
deviceName,
(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
"CurrentVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
currentVersion)
]
)
instance Core.ToPath UpdateStream where
toPath :: UpdateStream -> ByteString
toPath = ByteString -> UpdateStream -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/updateStream"
instance Core.ToQuery UpdateStream where
toQuery :: UpdateStream -> QueryString
toQuery = QueryString -> UpdateStream -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateStreamResponse = UpdateStreamResponse'
{
UpdateStreamResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateStreamResponse -> UpdateStreamResponse -> Bool
(UpdateStreamResponse -> UpdateStreamResponse -> Bool)
-> (UpdateStreamResponse -> UpdateStreamResponse -> Bool)
-> Eq UpdateStreamResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateStreamResponse -> UpdateStreamResponse -> Bool
$c/= :: UpdateStreamResponse -> UpdateStreamResponse -> Bool
== :: UpdateStreamResponse -> UpdateStreamResponse -> Bool
$c== :: UpdateStreamResponse -> UpdateStreamResponse -> Bool
Prelude.Eq, ReadPrec [UpdateStreamResponse]
ReadPrec UpdateStreamResponse
Int -> ReadS UpdateStreamResponse
ReadS [UpdateStreamResponse]
(Int -> ReadS UpdateStreamResponse)
-> ReadS [UpdateStreamResponse]
-> ReadPrec UpdateStreamResponse
-> ReadPrec [UpdateStreamResponse]
-> Read UpdateStreamResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateStreamResponse]
$creadListPrec :: ReadPrec [UpdateStreamResponse]
readPrec :: ReadPrec UpdateStreamResponse
$creadPrec :: ReadPrec UpdateStreamResponse
readList :: ReadS [UpdateStreamResponse]
$creadList :: ReadS [UpdateStreamResponse]
readsPrec :: Int -> ReadS UpdateStreamResponse
$creadsPrec :: Int -> ReadS UpdateStreamResponse
Prelude.Read, Int -> UpdateStreamResponse -> ShowS
[UpdateStreamResponse] -> ShowS
UpdateStreamResponse -> String
(Int -> UpdateStreamResponse -> ShowS)
-> (UpdateStreamResponse -> String)
-> ([UpdateStreamResponse] -> ShowS)
-> Show UpdateStreamResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateStreamResponse] -> ShowS
$cshowList :: [UpdateStreamResponse] -> ShowS
show :: UpdateStreamResponse -> String
$cshow :: UpdateStreamResponse -> String
showsPrec :: Int -> UpdateStreamResponse -> ShowS
$cshowsPrec :: Int -> UpdateStreamResponse -> ShowS
Prelude.Show, (forall x. UpdateStreamResponse -> Rep UpdateStreamResponse x)
-> (forall x. Rep UpdateStreamResponse x -> UpdateStreamResponse)
-> Generic UpdateStreamResponse
forall x. Rep UpdateStreamResponse x -> UpdateStreamResponse
forall x. UpdateStreamResponse -> Rep UpdateStreamResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateStreamResponse x -> UpdateStreamResponse
$cfrom :: forall x. UpdateStreamResponse -> Rep UpdateStreamResponse x
Prelude.Generic)
newUpdateStreamResponse ::
Prelude.Int ->
UpdateStreamResponse
newUpdateStreamResponse :: Int -> UpdateStreamResponse
newUpdateStreamResponse Int
pHttpStatus_ =
UpdateStreamResponse' :: Int -> UpdateStreamResponse
UpdateStreamResponse' {$sel:httpStatus:UpdateStreamResponse' :: Int
httpStatus = Int
pHttpStatus_}
updateStreamResponse_httpStatus :: Lens.Lens' UpdateStreamResponse Prelude.Int
updateStreamResponse_httpStatus :: (Int -> f Int) -> UpdateStreamResponse -> f UpdateStreamResponse
updateStreamResponse_httpStatus = (UpdateStreamResponse -> Int)
-> (UpdateStreamResponse -> Int -> UpdateStreamResponse)
-> Lens UpdateStreamResponse UpdateStreamResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStreamResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateStreamResponse' :: UpdateStreamResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateStreamResponse
s@UpdateStreamResponse' {} Int
a -> UpdateStreamResponse
s {$sel:httpStatus:UpdateStreamResponse' :: Int
httpStatus = Int
a} :: UpdateStreamResponse)
instance Prelude.NFData UpdateStreamResponse