{-# 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.DeleteStream
(
DeleteStream (..),
newDeleteStream,
deleteStream_currentVersion,
deleteStream_streamARN,
DeleteStreamResponse (..),
newDeleteStreamResponse,
deleteStreamResponse_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 DeleteStream = DeleteStream'
{
DeleteStream -> Maybe Text
currentVersion :: Prelude.Maybe Prelude.Text,
DeleteStream -> Text
streamARN :: Prelude.Text
}
deriving (DeleteStream -> DeleteStream -> Bool
(DeleteStream -> DeleteStream -> Bool)
-> (DeleteStream -> DeleteStream -> Bool) -> Eq DeleteStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteStream -> DeleteStream -> Bool
$c/= :: DeleteStream -> DeleteStream -> Bool
== :: DeleteStream -> DeleteStream -> Bool
$c== :: DeleteStream -> DeleteStream -> Bool
Prelude.Eq, ReadPrec [DeleteStream]
ReadPrec DeleteStream
Int -> ReadS DeleteStream
ReadS [DeleteStream]
(Int -> ReadS DeleteStream)
-> ReadS [DeleteStream]
-> ReadPrec DeleteStream
-> ReadPrec [DeleteStream]
-> Read DeleteStream
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteStream]
$creadListPrec :: ReadPrec [DeleteStream]
readPrec :: ReadPrec DeleteStream
$creadPrec :: ReadPrec DeleteStream
readList :: ReadS [DeleteStream]
$creadList :: ReadS [DeleteStream]
readsPrec :: Int -> ReadS DeleteStream
$creadsPrec :: Int -> ReadS DeleteStream
Prelude.Read, Int -> DeleteStream -> ShowS
[DeleteStream] -> ShowS
DeleteStream -> String
(Int -> DeleteStream -> ShowS)
-> (DeleteStream -> String)
-> ([DeleteStream] -> ShowS)
-> Show DeleteStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteStream] -> ShowS
$cshowList :: [DeleteStream] -> ShowS
show :: DeleteStream -> String
$cshow :: DeleteStream -> String
showsPrec :: Int -> DeleteStream -> ShowS
$cshowsPrec :: Int -> DeleteStream -> ShowS
Prelude.Show, (forall x. DeleteStream -> Rep DeleteStream x)
-> (forall x. Rep DeleteStream x -> DeleteStream)
-> Generic DeleteStream
forall x. Rep DeleteStream x -> DeleteStream
forall x. DeleteStream -> Rep DeleteStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteStream x -> DeleteStream
$cfrom :: forall x. DeleteStream -> Rep DeleteStream x
Prelude.Generic)
newDeleteStream ::
Prelude.Text ->
DeleteStream
newDeleteStream :: Text -> DeleteStream
newDeleteStream Text
pStreamARN_ =
DeleteStream' :: Maybe Text -> Text -> DeleteStream
DeleteStream'
{ $sel:currentVersion:DeleteStream' :: Maybe Text
currentVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:streamARN:DeleteStream' :: Text
streamARN = Text
pStreamARN_
}
deleteStream_currentVersion :: Lens.Lens' DeleteStream (Prelude.Maybe Prelude.Text)
deleteStream_currentVersion :: (Maybe Text -> f (Maybe Text)) -> DeleteStream -> f DeleteStream
deleteStream_currentVersion = (DeleteStream -> Maybe Text)
-> (DeleteStream -> Maybe Text -> DeleteStream)
-> Lens DeleteStream DeleteStream (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteStream' {Maybe Text
currentVersion :: Maybe Text
$sel:currentVersion:DeleteStream' :: DeleteStream -> Maybe Text
currentVersion} -> Maybe Text
currentVersion) (\s :: DeleteStream
s@DeleteStream' {} Maybe Text
a -> DeleteStream
s {$sel:currentVersion:DeleteStream' :: Maybe Text
currentVersion = Maybe Text
a} :: DeleteStream)
deleteStream_streamARN :: Lens.Lens' DeleteStream Prelude.Text
deleteStream_streamARN :: (Text -> f Text) -> DeleteStream -> f DeleteStream
deleteStream_streamARN = (DeleteStream -> Text)
-> (DeleteStream -> Text -> DeleteStream)
-> Lens DeleteStream DeleteStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteStream' {Text
streamARN :: Text
$sel:streamARN:DeleteStream' :: DeleteStream -> Text
streamARN} -> Text
streamARN) (\s :: DeleteStream
s@DeleteStream' {} Text
a -> DeleteStream
s {$sel:streamARN:DeleteStream' :: Text
streamARN = Text
a} :: DeleteStream)
instance Core.AWSRequest DeleteStream where
type AWSResponse DeleteStream = DeleteStreamResponse
request :: DeleteStream -> Request DeleteStream
request = Service -> DeleteStream -> Request DeleteStream
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteStream
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteStream)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteStream))
-> Logger
-> Service
-> Proxy DeleteStream
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteStream)))
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 -> DeleteStreamResponse
DeleteStreamResponse'
(Int -> DeleteStreamResponse)
-> Either String Int -> Either String DeleteStreamResponse
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 DeleteStream
instance Prelude.NFData DeleteStream
instance Core.ToHeaders DeleteStream where
toHeaders :: DeleteStream -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteStream -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON DeleteStream where
toJSON :: DeleteStream -> Value
toJSON DeleteStream' {Maybe Text
Text
streamARN :: Text
currentVersion :: Maybe Text
$sel:streamARN:DeleteStream' :: DeleteStream -> Text
$sel:currentVersion:DeleteStream' :: DeleteStream -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"CurrentVersion" 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
currentVersion,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StreamARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
streamARN)
]
)
instance Core.ToPath DeleteStream where
toPath :: DeleteStream -> ByteString
toPath = ByteString -> DeleteStream -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/deleteStream"
instance Core.ToQuery DeleteStream where
toQuery :: DeleteStream -> QueryString
toQuery = QueryString -> DeleteStream -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteStreamResponse = DeleteStreamResponse'
{
DeleteStreamResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteStreamResponse -> DeleteStreamResponse -> Bool
(DeleteStreamResponse -> DeleteStreamResponse -> Bool)
-> (DeleteStreamResponse -> DeleteStreamResponse -> Bool)
-> Eq DeleteStreamResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteStreamResponse -> DeleteStreamResponse -> Bool
$c/= :: DeleteStreamResponse -> DeleteStreamResponse -> Bool
== :: DeleteStreamResponse -> DeleteStreamResponse -> Bool
$c== :: DeleteStreamResponse -> DeleteStreamResponse -> Bool
Prelude.Eq, ReadPrec [DeleteStreamResponse]
ReadPrec DeleteStreamResponse
Int -> ReadS DeleteStreamResponse
ReadS [DeleteStreamResponse]
(Int -> ReadS DeleteStreamResponse)
-> ReadS [DeleteStreamResponse]
-> ReadPrec DeleteStreamResponse
-> ReadPrec [DeleteStreamResponse]
-> Read DeleteStreamResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteStreamResponse]
$creadListPrec :: ReadPrec [DeleteStreamResponse]
readPrec :: ReadPrec DeleteStreamResponse
$creadPrec :: ReadPrec DeleteStreamResponse
readList :: ReadS [DeleteStreamResponse]
$creadList :: ReadS [DeleteStreamResponse]
readsPrec :: Int -> ReadS DeleteStreamResponse
$creadsPrec :: Int -> ReadS DeleteStreamResponse
Prelude.Read, Int -> DeleteStreamResponse -> ShowS
[DeleteStreamResponse] -> ShowS
DeleteStreamResponse -> String
(Int -> DeleteStreamResponse -> ShowS)
-> (DeleteStreamResponse -> String)
-> ([DeleteStreamResponse] -> ShowS)
-> Show DeleteStreamResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteStreamResponse] -> ShowS
$cshowList :: [DeleteStreamResponse] -> ShowS
show :: DeleteStreamResponse -> String
$cshow :: DeleteStreamResponse -> String
showsPrec :: Int -> DeleteStreamResponse -> ShowS
$cshowsPrec :: Int -> DeleteStreamResponse -> ShowS
Prelude.Show, (forall x. DeleteStreamResponse -> Rep DeleteStreamResponse x)
-> (forall x. Rep DeleteStreamResponse x -> DeleteStreamResponse)
-> Generic DeleteStreamResponse
forall x. Rep DeleteStreamResponse x -> DeleteStreamResponse
forall x. DeleteStreamResponse -> Rep DeleteStreamResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteStreamResponse x -> DeleteStreamResponse
$cfrom :: forall x. DeleteStreamResponse -> Rep DeleteStreamResponse x
Prelude.Generic)
newDeleteStreamResponse ::
Prelude.Int ->
DeleteStreamResponse
newDeleteStreamResponse :: Int -> DeleteStreamResponse
newDeleteStreamResponse Int
pHttpStatus_ =
DeleteStreamResponse' :: Int -> DeleteStreamResponse
DeleteStreamResponse' {$sel:httpStatus:DeleteStreamResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteStreamResponse_httpStatus :: Lens.Lens' DeleteStreamResponse Prelude.Int
deleteStreamResponse_httpStatus :: (Int -> f Int) -> DeleteStreamResponse -> f DeleteStreamResponse
deleteStreamResponse_httpStatus = (DeleteStreamResponse -> Int)
-> (DeleteStreamResponse -> Int -> DeleteStreamResponse)
-> Lens DeleteStreamResponse DeleteStreamResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteStreamResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteStreamResponse' :: DeleteStreamResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteStreamResponse
s@DeleteStreamResponse' {} Int
a -> DeleteStreamResponse
s {$sel:httpStatus:DeleteStreamResponse' :: Int
httpStatus = Int
a} :: DeleteStreamResponse)
instance Prelude.NFData DeleteStreamResponse