{-# 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.MediaConnect.RemoveFlowMediaStream
(
RemoveFlowMediaStream (..),
newRemoveFlowMediaStream,
removeFlowMediaStream_flowArn,
removeFlowMediaStream_mediaStreamName,
RemoveFlowMediaStreamResponse (..),
newRemoveFlowMediaStreamResponse,
removeFlowMediaStreamResponse_mediaStreamName,
removeFlowMediaStreamResponse_flowArn,
removeFlowMediaStreamResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data RemoveFlowMediaStream = RemoveFlowMediaStream'
{
RemoveFlowMediaStream -> Text
flowArn :: Prelude.Text,
RemoveFlowMediaStream -> Text
mediaStreamName :: Prelude.Text
}
deriving (RemoveFlowMediaStream -> RemoveFlowMediaStream -> Bool
(RemoveFlowMediaStream -> RemoveFlowMediaStream -> Bool)
-> (RemoveFlowMediaStream -> RemoveFlowMediaStream -> Bool)
-> Eq RemoveFlowMediaStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveFlowMediaStream -> RemoveFlowMediaStream -> Bool
$c/= :: RemoveFlowMediaStream -> RemoveFlowMediaStream -> Bool
== :: RemoveFlowMediaStream -> RemoveFlowMediaStream -> Bool
$c== :: RemoveFlowMediaStream -> RemoveFlowMediaStream -> Bool
Prelude.Eq, ReadPrec [RemoveFlowMediaStream]
ReadPrec RemoveFlowMediaStream
Int -> ReadS RemoveFlowMediaStream
ReadS [RemoveFlowMediaStream]
(Int -> ReadS RemoveFlowMediaStream)
-> ReadS [RemoveFlowMediaStream]
-> ReadPrec RemoveFlowMediaStream
-> ReadPrec [RemoveFlowMediaStream]
-> Read RemoveFlowMediaStream
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveFlowMediaStream]
$creadListPrec :: ReadPrec [RemoveFlowMediaStream]
readPrec :: ReadPrec RemoveFlowMediaStream
$creadPrec :: ReadPrec RemoveFlowMediaStream
readList :: ReadS [RemoveFlowMediaStream]
$creadList :: ReadS [RemoveFlowMediaStream]
readsPrec :: Int -> ReadS RemoveFlowMediaStream
$creadsPrec :: Int -> ReadS RemoveFlowMediaStream
Prelude.Read, Int -> RemoveFlowMediaStream -> ShowS
[RemoveFlowMediaStream] -> ShowS
RemoveFlowMediaStream -> String
(Int -> RemoveFlowMediaStream -> ShowS)
-> (RemoveFlowMediaStream -> String)
-> ([RemoveFlowMediaStream] -> ShowS)
-> Show RemoveFlowMediaStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveFlowMediaStream] -> ShowS
$cshowList :: [RemoveFlowMediaStream] -> ShowS
show :: RemoveFlowMediaStream -> String
$cshow :: RemoveFlowMediaStream -> String
showsPrec :: Int -> RemoveFlowMediaStream -> ShowS
$cshowsPrec :: Int -> RemoveFlowMediaStream -> ShowS
Prelude.Show, (forall x. RemoveFlowMediaStream -> Rep RemoveFlowMediaStream x)
-> (forall x. Rep RemoveFlowMediaStream x -> RemoveFlowMediaStream)
-> Generic RemoveFlowMediaStream
forall x. Rep RemoveFlowMediaStream x -> RemoveFlowMediaStream
forall x. RemoveFlowMediaStream -> Rep RemoveFlowMediaStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RemoveFlowMediaStream x -> RemoveFlowMediaStream
$cfrom :: forall x. RemoveFlowMediaStream -> Rep RemoveFlowMediaStream x
Prelude.Generic)
newRemoveFlowMediaStream ::
Prelude.Text ->
Prelude.Text ->
RemoveFlowMediaStream
newRemoveFlowMediaStream :: Text -> Text -> RemoveFlowMediaStream
newRemoveFlowMediaStream Text
pFlowArn_ Text
pMediaStreamName_ =
RemoveFlowMediaStream' :: Text -> Text -> RemoveFlowMediaStream
RemoveFlowMediaStream'
{ $sel:flowArn:RemoveFlowMediaStream' :: Text
flowArn = Text
pFlowArn_,
$sel:mediaStreamName:RemoveFlowMediaStream' :: Text
mediaStreamName = Text
pMediaStreamName_
}
removeFlowMediaStream_flowArn :: Lens.Lens' RemoveFlowMediaStream Prelude.Text
removeFlowMediaStream_flowArn :: (Text -> f Text)
-> RemoveFlowMediaStream -> f RemoveFlowMediaStream
removeFlowMediaStream_flowArn = (RemoveFlowMediaStream -> Text)
-> (RemoveFlowMediaStream -> Text -> RemoveFlowMediaStream)
-> Lens RemoveFlowMediaStream RemoveFlowMediaStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveFlowMediaStream' {Text
flowArn :: Text
$sel:flowArn:RemoveFlowMediaStream' :: RemoveFlowMediaStream -> Text
flowArn} -> Text
flowArn) (\s :: RemoveFlowMediaStream
s@RemoveFlowMediaStream' {} Text
a -> RemoveFlowMediaStream
s {$sel:flowArn:RemoveFlowMediaStream' :: Text
flowArn = Text
a} :: RemoveFlowMediaStream)
removeFlowMediaStream_mediaStreamName :: Lens.Lens' RemoveFlowMediaStream Prelude.Text
removeFlowMediaStream_mediaStreamName :: (Text -> f Text)
-> RemoveFlowMediaStream -> f RemoveFlowMediaStream
removeFlowMediaStream_mediaStreamName = (RemoveFlowMediaStream -> Text)
-> (RemoveFlowMediaStream -> Text -> RemoveFlowMediaStream)
-> Lens RemoveFlowMediaStream RemoveFlowMediaStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveFlowMediaStream' {Text
mediaStreamName :: Text
$sel:mediaStreamName:RemoveFlowMediaStream' :: RemoveFlowMediaStream -> Text
mediaStreamName} -> Text
mediaStreamName) (\s :: RemoveFlowMediaStream
s@RemoveFlowMediaStream' {} Text
a -> RemoveFlowMediaStream
s {$sel:mediaStreamName:RemoveFlowMediaStream' :: Text
mediaStreamName = Text
a} :: RemoveFlowMediaStream)
instance Core.AWSRequest RemoveFlowMediaStream where
type
AWSResponse RemoveFlowMediaStream =
RemoveFlowMediaStreamResponse
request :: RemoveFlowMediaStream -> Request RemoveFlowMediaStream
request = Service -> RemoveFlowMediaStream -> Request RemoveFlowMediaStream
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy RemoveFlowMediaStream
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RemoveFlowMediaStream)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse RemoveFlowMediaStream))
-> Logger
-> Service
-> Proxy RemoveFlowMediaStream
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RemoveFlowMediaStream)))
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 ->
Maybe Text -> Maybe Text -> Int -> RemoveFlowMediaStreamResponse
RemoveFlowMediaStreamResponse'
(Maybe Text -> Maybe Text -> Int -> RemoveFlowMediaStreamResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Int -> RemoveFlowMediaStreamResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"mediaStreamName")
Either String (Maybe Text -> Int -> RemoveFlowMediaStreamResponse)
-> Either String (Maybe Text)
-> Either String (Int -> RemoveFlowMediaStreamResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"flowArn")
Either String (Int -> RemoveFlowMediaStreamResponse)
-> Either String Int -> Either String RemoveFlowMediaStreamResponse
forall (f :: * -> *) a b. Applicative f => 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 RemoveFlowMediaStream
instance Prelude.NFData RemoveFlowMediaStream
instance Core.ToHeaders RemoveFlowMediaStream where
toHeaders :: RemoveFlowMediaStream -> ResponseHeaders
toHeaders =
ResponseHeaders -> RemoveFlowMediaStream -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath RemoveFlowMediaStream where
toPath :: RemoveFlowMediaStream -> ByteString
toPath RemoveFlowMediaStream' {Text
mediaStreamName :: Text
flowArn :: Text
$sel:mediaStreamName:RemoveFlowMediaStream' :: RemoveFlowMediaStream -> Text
$sel:flowArn:RemoveFlowMediaStream' :: RemoveFlowMediaStream -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v1/flows/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
flowArn,
ByteString
"/mediaStreams/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
mediaStreamName
]
instance Core.ToQuery RemoveFlowMediaStream where
toQuery :: RemoveFlowMediaStream -> QueryString
toQuery = QueryString -> RemoveFlowMediaStream -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RemoveFlowMediaStreamResponse = RemoveFlowMediaStreamResponse'
{
RemoveFlowMediaStreamResponse -> Maybe Text
mediaStreamName :: Prelude.Maybe Prelude.Text,
RemoveFlowMediaStreamResponse -> Maybe Text
flowArn :: Prelude.Maybe Prelude.Text,
RemoveFlowMediaStreamResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RemoveFlowMediaStreamResponse
-> RemoveFlowMediaStreamResponse -> Bool
(RemoveFlowMediaStreamResponse
-> RemoveFlowMediaStreamResponse -> Bool)
-> (RemoveFlowMediaStreamResponse
-> RemoveFlowMediaStreamResponse -> Bool)
-> Eq RemoveFlowMediaStreamResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveFlowMediaStreamResponse
-> RemoveFlowMediaStreamResponse -> Bool
$c/= :: RemoveFlowMediaStreamResponse
-> RemoveFlowMediaStreamResponse -> Bool
== :: RemoveFlowMediaStreamResponse
-> RemoveFlowMediaStreamResponse -> Bool
$c== :: RemoveFlowMediaStreamResponse
-> RemoveFlowMediaStreamResponse -> Bool
Prelude.Eq, ReadPrec [RemoveFlowMediaStreamResponse]
ReadPrec RemoveFlowMediaStreamResponse
Int -> ReadS RemoveFlowMediaStreamResponse
ReadS [RemoveFlowMediaStreamResponse]
(Int -> ReadS RemoveFlowMediaStreamResponse)
-> ReadS [RemoveFlowMediaStreamResponse]
-> ReadPrec RemoveFlowMediaStreamResponse
-> ReadPrec [RemoveFlowMediaStreamResponse]
-> Read RemoveFlowMediaStreamResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveFlowMediaStreamResponse]
$creadListPrec :: ReadPrec [RemoveFlowMediaStreamResponse]
readPrec :: ReadPrec RemoveFlowMediaStreamResponse
$creadPrec :: ReadPrec RemoveFlowMediaStreamResponse
readList :: ReadS [RemoveFlowMediaStreamResponse]
$creadList :: ReadS [RemoveFlowMediaStreamResponse]
readsPrec :: Int -> ReadS RemoveFlowMediaStreamResponse
$creadsPrec :: Int -> ReadS RemoveFlowMediaStreamResponse
Prelude.Read, Int -> RemoveFlowMediaStreamResponse -> ShowS
[RemoveFlowMediaStreamResponse] -> ShowS
RemoveFlowMediaStreamResponse -> String
(Int -> RemoveFlowMediaStreamResponse -> ShowS)
-> (RemoveFlowMediaStreamResponse -> String)
-> ([RemoveFlowMediaStreamResponse] -> ShowS)
-> Show RemoveFlowMediaStreamResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveFlowMediaStreamResponse] -> ShowS
$cshowList :: [RemoveFlowMediaStreamResponse] -> ShowS
show :: RemoveFlowMediaStreamResponse -> String
$cshow :: RemoveFlowMediaStreamResponse -> String
showsPrec :: Int -> RemoveFlowMediaStreamResponse -> ShowS
$cshowsPrec :: Int -> RemoveFlowMediaStreamResponse -> ShowS
Prelude.Show, (forall x.
RemoveFlowMediaStreamResponse
-> Rep RemoveFlowMediaStreamResponse x)
-> (forall x.
Rep RemoveFlowMediaStreamResponse x
-> RemoveFlowMediaStreamResponse)
-> Generic RemoveFlowMediaStreamResponse
forall x.
Rep RemoveFlowMediaStreamResponse x
-> RemoveFlowMediaStreamResponse
forall x.
RemoveFlowMediaStreamResponse
-> Rep RemoveFlowMediaStreamResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RemoveFlowMediaStreamResponse x
-> RemoveFlowMediaStreamResponse
$cfrom :: forall x.
RemoveFlowMediaStreamResponse
-> Rep RemoveFlowMediaStreamResponse x
Prelude.Generic)
newRemoveFlowMediaStreamResponse ::
Prelude.Int ->
RemoveFlowMediaStreamResponse
newRemoveFlowMediaStreamResponse :: Int -> RemoveFlowMediaStreamResponse
newRemoveFlowMediaStreamResponse Int
pHttpStatus_ =
RemoveFlowMediaStreamResponse' :: Maybe Text -> Maybe Text -> Int -> RemoveFlowMediaStreamResponse
RemoveFlowMediaStreamResponse'
{ $sel:mediaStreamName:RemoveFlowMediaStreamResponse' :: Maybe Text
mediaStreamName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:flowArn:RemoveFlowMediaStreamResponse' :: Maybe Text
flowArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RemoveFlowMediaStreamResponse' :: Int
httpStatus = Int
pHttpStatus_
}
removeFlowMediaStreamResponse_mediaStreamName :: Lens.Lens' RemoveFlowMediaStreamResponse (Prelude.Maybe Prelude.Text)
removeFlowMediaStreamResponse_mediaStreamName :: (Maybe Text -> f (Maybe Text))
-> RemoveFlowMediaStreamResponse -> f RemoveFlowMediaStreamResponse
removeFlowMediaStreamResponse_mediaStreamName = (RemoveFlowMediaStreamResponse -> Maybe Text)
-> (RemoveFlowMediaStreamResponse
-> Maybe Text -> RemoveFlowMediaStreamResponse)
-> Lens
RemoveFlowMediaStreamResponse
RemoveFlowMediaStreamResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveFlowMediaStreamResponse' {Maybe Text
mediaStreamName :: Maybe Text
$sel:mediaStreamName:RemoveFlowMediaStreamResponse' :: RemoveFlowMediaStreamResponse -> Maybe Text
mediaStreamName} -> Maybe Text
mediaStreamName) (\s :: RemoveFlowMediaStreamResponse
s@RemoveFlowMediaStreamResponse' {} Maybe Text
a -> RemoveFlowMediaStreamResponse
s {$sel:mediaStreamName:RemoveFlowMediaStreamResponse' :: Maybe Text
mediaStreamName = Maybe Text
a} :: RemoveFlowMediaStreamResponse)
removeFlowMediaStreamResponse_flowArn :: Lens.Lens' RemoveFlowMediaStreamResponse (Prelude.Maybe Prelude.Text)
removeFlowMediaStreamResponse_flowArn :: (Maybe Text -> f (Maybe Text))
-> RemoveFlowMediaStreamResponse -> f RemoveFlowMediaStreamResponse
removeFlowMediaStreamResponse_flowArn = (RemoveFlowMediaStreamResponse -> Maybe Text)
-> (RemoveFlowMediaStreamResponse
-> Maybe Text -> RemoveFlowMediaStreamResponse)
-> Lens
RemoveFlowMediaStreamResponse
RemoveFlowMediaStreamResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveFlowMediaStreamResponse' {Maybe Text
flowArn :: Maybe Text
$sel:flowArn:RemoveFlowMediaStreamResponse' :: RemoveFlowMediaStreamResponse -> Maybe Text
flowArn} -> Maybe Text
flowArn) (\s :: RemoveFlowMediaStreamResponse
s@RemoveFlowMediaStreamResponse' {} Maybe Text
a -> RemoveFlowMediaStreamResponse
s {$sel:flowArn:RemoveFlowMediaStreamResponse' :: Maybe Text
flowArn = Maybe Text
a} :: RemoveFlowMediaStreamResponse)
removeFlowMediaStreamResponse_httpStatus :: Lens.Lens' RemoveFlowMediaStreamResponse Prelude.Int
removeFlowMediaStreamResponse_httpStatus :: (Int -> f Int)
-> RemoveFlowMediaStreamResponse -> f RemoveFlowMediaStreamResponse
removeFlowMediaStreamResponse_httpStatus = (RemoveFlowMediaStreamResponse -> Int)
-> (RemoveFlowMediaStreamResponse
-> Int -> RemoveFlowMediaStreamResponse)
-> Lens
RemoveFlowMediaStreamResponse RemoveFlowMediaStreamResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveFlowMediaStreamResponse' {Int
httpStatus :: Int
$sel:httpStatus:RemoveFlowMediaStreamResponse' :: RemoveFlowMediaStreamResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RemoveFlowMediaStreamResponse
s@RemoveFlowMediaStreamResponse' {} Int
a -> RemoveFlowMediaStreamResponse
s {$sel:httpStatus:RemoveFlowMediaStreamResponse' :: Int
httpStatus = Int
a} :: RemoveFlowMediaStreamResponse)
instance Prelude.NFData RemoveFlowMediaStreamResponse