{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MediaConnect.UpdateFlowMediaStream
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates an existing media stream.
module Amazonka.MediaConnect.UpdateFlowMediaStream
  ( -- * Creating a Request
    UpdateFlowMediaStream (..),
    newUpdateFlowMediaStream,

    -- * Request Lenses
    updateFlowMediaStream_videoFormat,
    updateFlowMediaStream_mediaStreamType,
    updateFlowMediaStream_attributes,
    updateFlowMediaStream_clockRate,
    updateFlowMediaStream_description,
    updateFlowMediaStream_flowArn,
    updateFlowMediaStream_mediaStreamName,

    -- * Destructuring the Response
    UpdateFlowMediaStreamResponse (..),
    newUpdateFlowMediaStreamResponse,

    -- * Response Lenses
    updateFlowMediaStreamResponse_flowArn,
    updateFlowMediaStreamResponse_mediaStream,
    updateFlowMediaStreamResponse_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

-- | The fields that you want to update in the media stream.
--
-- /See:/ 'newUpdateFlowMediaStream' smart constructor.
data UpdateFlowMediaStream = UpdateFlowMediaStream'
  { -- | The resolution of the video.
    UpdateFlowMediaStream -> Maybe Text
videoFormat :: Prelude.Maybe Prelude.Text,
    -- | The type of media stream.
    UpdateFlowMediaStream -> Maybe MediaStreamType
mediaStreamType :: Prelude.Maybe MediaStreamType,
    -- | The attributes that you want to assign to the media stream.
    UpdateFlowMediaStream -> Maybe MediaStreamAttributesRequest
attributes :: Prelude.Maybe MediaStreamAttributesRequest,
    -- | The sample rate (in Hz) for the stream. If the media stream type is
    -- video or ancillary data, set this value to 90000. If the media stream
    -- type is audio, set this value to either 48000 or 96000.
    UpdateFlowMediaStream -> Maybe Int
clockRate :: Prelude.Maybe Prelude.Int,
    -- | Description
    UpdateFlowMediaStream -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the flow.
    UpdateFlowMediaStream -> Text
flowArn :: Prelude.Text,
    -- | The name of the media stream that you want to update.
    UpdateFlowMediaStream -> Text
mediaStreamName :: Prelude.Text
  }
  deriving (UpdateFlowMediaStream -> UpdateFlowMediaStream -> Bool
(UpdateFlowMediaStream -> UpdateFlowMediaStream -> Bool)
-> (UpdateFlowMediaStream -> UpdateFlowMediaStream -> Bool)
-> Eq UpdateFlowMediaStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFlowMediaStream -> UpdateFlowMediaStream -> Bool
$c/= :: UpdateFlowMediaStream -> UpdateFlowMediaStream -> Bool
== :: UpdateFlowMediaStream -> UpdateFlowMediaStream -> Bool
$c== :: UpdateFlowMediaStream -> UpdateFlowMediaStream -> Bool
Prelude.Eq, ReadPrec [UpdateFlowMediaStream]
ReadPrec UpdateFlowMediaStream
Int -> ReadS UpdateFlowMediaStream
ReadS [UpdateFlowMediaStream]
(Int -> ReadS UpdateFlowMediaStream)
-> ReadS [UpdateFlowMediaStream]
-> ReadPrec UpdateFlowMediaStream
-> ReadPrec [UpdateFlowMediaStream]
-> Read UpdateFlowMediaStream
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFlowMediaStream]
$creadListPrec :: ReadPrec [UpdateFlowMediaStream]
readPrec :: ReadPrec UpdateFlowMediaStream
$creadPrec :: ReadPrec UpdateFlowMediaStream
readList :: ReadS [UpdateFlowMediaStream]
$creadList :: ReadS [UpdateFlowMediaStream]
readsPrec :: Int -> ReadS UpdateFlowMediaStream
$creadsPrec :: Int -> ReadS UpdateFlowMediaStream
Prelude.Read, Int -> UpdateFlowMediaStream -> ShowS
[UpdateFlowMediaStream] -> ShowS
UpdateFlowMediaStream -> String
(Int -> UpdateFlowMediaStream -> ShowS)
-> (UpdateFlowMediaStream -> String)
-> ([UpdateFlowMediaStream] -> ShowS)
-> Show UpdateFlowMediaStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFlowMediaStream] -> ShowS
$cshowList :: [UpdateFlowMediaStream] -> ShowS
show :: UpdateFlowMediaStream -> String
$cshow :: UpdateFlowMediaStream -> String
showsPrec :: Int -> UpdateFlowMediaStream -> ShowS
$cshowsPrec :: Int -> UpdateFlowMediaStream -> ShowS
Prelude.Show, (forall x. UpdateFlowMediaStream -> Rep UpdateFlowMediaStream x)
-> (forall x. Rep UpdateFlowMediaStream x -> UpdateFlowMediaStream)
-> Generic UpdateFlowMediaStream
forall x. Rep UpdateFlowMediaStream x -> UpdateFlowMediaStream
forall x. UpdateFlowMediaStream -> Rep UpdateFlowMediaStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateFlowMediaStream x -> UpdateFlowMediaStream
$cfrom :: forall x. UpdateFlowMediaStream -> Rep UpdateFlowMediaStream x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFlowMediaStream' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'videoFormat', 'updateFlowMediaStream_videoFormat' - The resolution of the video.
--
-- 'mediaStreamType', 'updateFlowMediaStream_mediaStreamType' - The type of media stream.
--
-- 'attributes', 'updateFlowMediaStream_attributes' - The attributes that you want to assign to the media stream.
--
-- 'clockRate', 'updateFlowMediaStream_clockRate' - The sample rate (in Hz) for the stream. If the media stream type is
-- video or ancillary data, set this value to 90000. If the media stream
-- type is audio, set this value to either 48000 or 96000.
--
-- 'description', 'updateFlowMediaStream_description' - Description
--
-- 'flowArn', 'updateFlowMediaStream_flowArn' - The Amazon Resource Name (ARN) of the flow.
--
-- 'mediaStreamName', 'updateFlowMediaStream_mediaStreamName' - The name of the media stream that you want to update.
newUpdateFlowMediaStream ::
  -- | 'flowArn'
  Prelude.Text ->
  -- | 'mediaStreamName'
  Prelude.Text ->
  UpdateFlowMediaStream
newUpdateFlowMediaStream :: Text -> Text -> UpdateFlowMediaStream
newUpdateFlowMediaStream Text
pFlowArn_ Text
pMediaStreamName_ =
  UpdateFlowMediaStream' :: Maybe Text
-> Maybe MediaStreamType
-> Maybe MediaStreamAttributesRequest
-> Maybe Int
-> Maybe Text
-> Text
-> Text
-> UpdateFlowMediaStream
UpdateFlowMediaStream'
    { $sel:videoFormat:UpdateFlowMediaStream' :: Maybe Text
videoFormat =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:mediaStreamType:UpdateFlowMediaStream' :: Maybe MediaStreamType
mediaStreamType = Maybe MediaStreamType
forall a. Maybe a
Prelude.Nothing,
      $sel:attributes:UpdateFlowMediaStream' :: Maybe MediaStreamAttributesRequest
attributes = Maybe MediaStreamAttributesRequest
forall a. Maybe a
Prelude.Nothing,
      $sel:clockRate:UpdateFlowMediaStream' :: Maybe Int
clockRate = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateFlowMediaStream' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:flowArn:UpdateFlowMediaStream' :: Text
flowArn = Text
pFlowArn_,
      $sel:mediaStreamName:UpdateFlowMediaStream' :: Text
mediaStreamName = Text
pMediaStreamName_
    }

-- | The resolution of the video.
updateFlowMediaStream_videoFormat :: Lens.Lens' UpdateFlowMediaStream (Prelude.Maybe Prelude.Text)
updateFlowMediaStream_videoFormat :: (Maybe Text -> f (Maybe Text))
-> UpdateFlowMediaStream -> f UpdateFlowMediaStream
updateFlowMediaStream_videoFormat = (UpdateFlowMediaStream -> Maybe Text)
-> (UpdateFlowMediaStream -> Maybe Text -> UpdateFlowMediaStream)
-> Lens
     UpdateFlowMediaStream
     UpdateFlowMediaStream
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFlowMediaStream' {Maybe Text
videoFormat :: Maybe Text
$sel:videoFormat:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Maybe Text
videoFormat} -> Maybe Text
videoFormat) (\s :: UpdateFlowMediaStream
s@UpdateFlowMediaStream' {} Maybe Text
a -> UpdateFlowMediaStream
s {$sel:videoFormat:UpdateFlowMediaStream' :: Maybe Text
videoFormat = Maybe Text
a} :: UpdateFlowMediaStream)

-- | The type of media stream.
updateFlowMediaStream_mediaStreamType :: Lens.Lens' UpdateFlowMediaStream (Prelude.Maybe MediaStreamType)
updateFlowMediaStream_mediaStreamType :: (Maybe MediaStreamType -> f (Maybe MediaStreamType))
-> UpdateFlowMediaStream -> f UpdateFlowMediaStream
updateFlowMediaStream_mediaStreamType = (UpdateFlowMediaStream -> Maybe MediaStreamType)
-> (UpdateFlowMediaStream
    -> Maybe MediaStreamType -> UpdateFlowMediaStream)
-> Lens
     UpdateFlowMediaStream
     UpdateFlowMediaStream
     (Maybe MediaStreamType)
     (Maybe MediaStreamType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFlowMediaStream' {Maybe MediaStreamType
mediaStreamType :: Maybe MediaStreamType
$sel:mediaStreamType:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Maybe MediaStreamType
mediaStreamType} -> Maybe MediaStreamType
mediaStreamType) (\s :: UpdateFlowMediaStream
s@UpdateFlowMediaStream' {} Maybe MediaStreamType
a -> UpdateFlowMediaStream
s {$sel:mediaStreamType:UpdateFlowMediaStream' :: Maybe MediaStreamType
mediaStreamType = Maybe MediaStreamType
a} :: UpdateFlowMediaStream)

-- | The attributes that you want to assign to the media stream.
updateFlowMediaStream_attributes :: Lens.Lens' UpdateFlowMediaStream (Prelude.Maybe MediaStreamAttributesRequest)
updateFlowMediaStream_attributes :: (Maybe MediaStreamAttributesRequest
 -> f (Maybe MediaStreamAttributesRequest))
-> UpdateFlowMediaStream -> f UpdateFlowMediaStream
updateFlowMediaStream_attributes = (UpdateFlowMediaStream -> Maybe MediaStreamAttributesRequest)
-> (UpdateFlowMediaStream
    -> Maybe MediaStreamAttributesRequest -> UpdateFlowMediaStream)
-> Lens
     UpdateFlowMediaStream
     UpdateFlowMediaStream
     (Maybe MediaStreamAttributesRequest)
     (Maybe MediaStreamAttributesRequest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFlowMediaStream' {Maybe MediaStreamAttributesRequest
attributes :: Maybe MediaStreamAttributesRequest
$sel:attributes:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Maybe MediaStreamAttributesRequest
attributes} -> Maybe MediaStreamAttributesRequest
attributes) (\s :: UpdateFlowMediaStream
s@UpdateFlowMediaStream' {} Maybe MediaStreamAttributesRequest
a -> UpdateFlowMediaStream
s {$sel:attributes:UpdateFlowMediaStream' :: Maybe MediaStreamAttributesRequest
attributes = Maybe MediaStreamAttributesRequest
a} :: UpdateFlowMediaStream)

-- | The sample rate (in Hz) for the stream. If the media stream type is
-- video or ancillary data, set this value to 90000. If the media stream
-- type is audio, set this value to either 48000 or 96000.
updateFlowMediaStream_clockRate :: Lens.Lens' UpdateFlowMediaStream (Prelude.Maybe Prelude.Int)
updateFlowMediaStream_clockRate :: (Maybe Int -> f (Maybe Int))
-> UpdateFlowMediaStream -> f UpdateFlowMediaStream
updateFlowMediaStream_clockRate = (UpdateFlowMediaStream -> Maybe Int)
-> (UpdateFlowMediaStream -> Maybe Int -> UpdateFlowMediaStream)
-> Lens
     UpdateFlowMediaStream UpdateFlowMediaStream (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFlowMediaStream' {Maybe Int
clockRate :: Maybe Int
$sel:clockRate:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Maybe Int
clockRate} -> Maybe Int
clockRate) (\s :: UpdateFlowMediaStream
s@UpdateFlowMediaStream' {} Maybe Int
a -> UpdateFlowMediaStream
s {$sel:clockRate:UpdateFlowMediaStream' :: Maybe Int
clockRate = Maybe Int
a} :: UpdateFlowMediaStream)

-- | Description
updateFlowMediaStream_description :: Lens.Lens' UpdateFlowMediaStream (Prelude.Maybe Prelude.Text)
updateFlowMediaStream_description :: (Maybe Text -> f (Maybe Text))
-> UpdateFlowMediaStream -> f UpdateFlowMediaStream
updateFlowMediaStream_description = (UpdateFlowMediaStream -> Maybe Text)
-> (UpdateFlowMediaStream -> Maybe Text -> UpdateFlowMediaStream)
-> Lens
     UpdateFlowMediaStream
     UpdateFlowMediaStream
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFlowMediaStream' {Maybe Text
description :: Maybe Text
$sel:description:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateFlowMediaStream
s@UpdateFlowMediaStream' {} Maybe Text
a -> UpdateFlowMediaStream
s {$sel:description:UpdateFlowMediaStream' :: Maybe Text
description = Maybe Text
a} :: UpdateFlowMediaStream)

-- | The Amazon Resource Name (ARN) of the flow.
updateFlowMediaStream_flowArn :: Lens.Lens' UpdateFlowMediaStream Prelude.Text
updateFlowMediaStream_flowArn :: (Text -> f Text)
-> UpdateFlowMediaStream -> f UpdateFlowMediaStream
updateFlowMediaStream_flowArn = (UpdateFlowMediaStream -> Text)
-> (UpdateFlowMediaStream -> Text -> UpdateFlowMediaStream)
-> Lens UpdateFlowMediaStream UpdateFlowMediaStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFlowMediaStream' {Text
flowArn :: Text
$sel:flowArn:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Text
flowArn} -> Text
flowArn) (\s :: UpdateFlowMediaStream
s@UpdateFlowMediaStream' {} Text
a -> UpdateFlowMediaStream
s {$sel:flowArn:UpdateFlowMediaStream' :: Text
flowArn = Text
a} :: UpdateFlowMediaStream)

-- | The name of the media stream that you want to update.
updateFlowMediaStream_mediaStreamName :: Lens.Lens' UpdateFlowMediaStream Prelude.Text
updateFlowMediaStream_mediaStreamName :: (Text -> f Text)
-> UpdateFlowMediaStream -> f UpdateFlowMediaStream
updateFlowMediaStream_mediaStreamName = (UpdateFlowMediaStream -> Text)
-> (UpdateFlowMediaStream -> Text -> UpdateFlowMediaStream)
-> Lens UpdateFlowMediaStream UpdateFlowMediaStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFlowMediaStream' {Text
mediaStreamName :: Text
$sel:mediaStreamName:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Text
mediaStreamName} -> Text
mediaStreamName) (\s :: UpdateFlowMediaStream
s@UpdateFlowMediaStream' {} Text
a -> UpdateFlowMediaStream
s {$sel:mediaStreamName:UpdateFlowMediaStream' :: Text
mediaStreamName = Text
a} :: UpdateFlowMediaStream)

instance Core.AWSRequest UpdateFlowMediaStream where
  type
    AWSResponse UpdateFlowMediaStream =
      UpdateFlowMediaStreamResponse
  request :: UpdateFlowMediaStream -> Request UpdateFlowMediaStream
request = Service -> UpdateFlowMediaStream -> Request UpdateFlowMediaStream
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateFlowMediaStream
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateFlowMediaStream)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateFlowMediaStream))
-> Logger
-> Service
-> Proxy UpdateFlowMediaStream
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateFlowMediaStream)))
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 MediaStream -> Int -> UpdateFlowMediaStreamResponse
UpdateFlowMediaStreamResponse'
            (Maybe Text
 -> Maybe MediaStream -> Int -> UpdateFlowMediaStreamResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe MediaStream -> Int -> UpdateFlowMediaStreamResponse)
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
"flowArn")
            Either
  String (Maybe MediaStream -> Int -> UpdateFlowMediaStreamResponse)
-> Either String (Maybe MediaStream)
-> Either String (Int -> UpdateFlowMediaStreamResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe MediaStream)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"mediaStream")
            Either String (Int -> UpdateFlowMediaStreamResponse)
-> Either String Int -> Either String UpdateFlowMediaStreamResponse
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 UpdateFlowMediaStream

instance Prelude.NFData UpdateFlowMediaStream

instance Core.ToHeaders UpdateFlowMediaStream where
  toHeaders :: UpdateFlowMediaStream -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateFlowMediaStream -> 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.ToJSON UpdateFlowMediaStream where
  toJSON :: UpdateFlowMediaStream -> Value
toJSON UpdateFlowMediaStream' {Maybe Int
Maybe Text
Maybe MediaStreamType
Maybe MediaStreamAttributesRequest
Text
mediaStreamName :: Text
flowArn :: Text
description :: Maybe Text
clockRate :: Maybe Int
attributes :: Maybe MediaStreamAttributesRequest
mediaStreamType :: Maybe MediaStreamType
videoFormat :: Maybe Text
$sel:mediaStreamName:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Text
$sel:flowArn:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Text
$sel:description:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Maybe Text
$sel:clockRate:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Maybe Int
$sel:attributes:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Maybe MediaStreamAttributesRequest
$sel:mediaStreamType:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Maybe MediaStreamType
$sel:videoFormat:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"videoFormat" 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
videoFormat,
            (Text
"mediaStreamType" Text -> MediaStreamType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (MediaStreamType -> Pair) -> Maybe MediaStreamType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MediaStreamType
mediaStreamType,
            (Text
"attributes" Text -> MediaStreamAttributesRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MediaStreamAttributesRequest -> Pair)
-> Maybe MediaStreamAttributesRequest -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MediaStreamAttributesRequest
attributes,
            (Text
"clockRate" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
clockRate,
            (Text
"description" 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
description
          ]
      )

instance Core.ToPath UpdateFlowMediaStream where
  toPath :: UpdateFlowMediaStream -> ByteString
toPath UpdateFlowMediaStream' {Maybe Int
Maybe Text
Maybe MediaStreamType
Maybe MediaStreamAttributesRequest
Text
mediaStreamName :: Text
flowArn :: Text
description :: Maybe Text
clockRate :: Maybe Int
attributes :: Maybe MediaStreamAttributesRequest
mediaStreamType :: Maybe MediaStreamType
videoFormat :: Maybe Text
$sel:mediaStreamName:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Text
$sel:flowArn:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Text
$sel:description:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Maybe Text
$sel:clockRate:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Maybe Int
$sel:attributes:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Maybe MediaStreamAttributesRequest
$sel:mediaStreamType:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Maybe MediaStreamType
$sel:videoFormat:UpdateFlowMediaStream' :: UpdateFlowMediaStream -> Maybe 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 UpdateFlowMediaStream where
  toQuery :: UpdateFlowMediaStream -> QueryString
toQuery = QueryString -> UpdateFlowMediaStream -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateFlowMediaStreamResponse' smart constructor.
data UpdateFlowMediaStreamResponse = UpdateFlowMediaStreamResponse'
  { -- | The ARN of the flow that is associated with the media stream that you
    -- updated.
    UpdateFlowMediaStreamResponse -> Maybe Text
flowArn :: Prelude.Maybe Prelude.Text,
    -- | The media stream that you updated.
    UpdateFlowMediaStreamResponse -> Maybe MediaStream
mediaStream :: Prelude.Maybe MediaStream,
    -- | The response's http status code.
    UpdateFlowMediaStreamResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateFlowMediaStreamResponse
-> UpdateFlowMediaStreamResponse -> Bool
(UpdateFlowMediaStreamResponse
 -> UpdateFlowMediaStreamResponse -> Bool)
-> (UpdateFlowMediaStreamResponse
    -> UpdateFlowMediaStreamResponse -> Bool)
-> Eq UpdateFlowMediaStreamResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFlowMediaStreamResponse
-> UpdateFlowMediaStreamResponse -> Bool
$c/= :: UpdateFlowMediaStreamResponse
-> UpdateFlowMediaStreamResponse -> Bool
== :: UpdateFlowMediaStreamResponse
-> UpdateFlowMediaStreamResponse -> Bool
$c== :: UpdateFlowMediaStreamResponse
-> UpdateFlowMediaStreamResponse -> Bool
Prelude.Eq, ReadPrec [UpdateFlowMediaStreamResponse]
ReadPrec UpdateFlowMediaStreamResponse
Int -> ReadS UpdateFlowMediaStreamResponse
ReadS [UpdateFlowMediaStreamResponse]
(Int -> ReadS UpdateFlowMediaStreamResponse)
-> ReadS [UpdateFlowMediaStreamResponse]
-> ReadPrec UpdateFlowMediaStreamResponse
-> ReadPrec [UpdateFlowMediaStreamResponse]
-> Read UpdateFlowMediaStreamResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFlowMediaStreamResponse]
$creadListPrec :: ReadPrec [UpdateFlowMediaStreamResponse]
readPrec :: ReadPrec UpdateFlowMediaStreamResponse
$creadPrec :: ReadPrec UpdateFlowMediaStreamResponse
readList :: ReadS [UpdateFlowMediaStreamResponse]
$creadList :: ReadS [UpdateFlowMediaStreamResponse]
readsPrec :: Int -> ReadS UpdateFlowMediaStreamResponse
$creadsPrec :: Int -> ReadS UpdateFlowMediaStreamResponse
Prelude.Read, Int -> UpdateFlowMediaStreamResponse -> ShowS
[UpdateFlowMediaStreamResponse] -> ShowS
UpdateFlowMediaStreamResponse -> String
(Int -> UpdateFlowMediaStreamResponse -> ShowS)
-> (UpdateFlowMediaStreamResponse -> String)
-> ([UpdateFlowMediaStreamResponse] -> ShowS)
-> Show UpdateFlowMediaStreamResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFlowMediaStreamResponse] -> ShowS
$cshowList :: [UpdateFlowMediaStreamResponse] -> ShowS
show :: UpdateFlowMediaStreamResponse -> String
$cshow :: UpdateFlowMediaStreamResponse -> String
showsPrec :: Int -> UpdateFlowMediaStreamResponse -> ShowS
$cshowsPrec :: Int -> UpdateFlowMediaStreamResponse -> ShowS
Prelude.Show, (forall x.
 UpdateFlowMediaStreamResponse
 -> Rep UpdateFlowMediaStreamResponse x)
-> (forall x.
    Rep UpdateFlowMediaStreamResponse x
    -> UpdateFlowMediaStreamResponse)
-> Generic UpdateFlowMediaStreamResponse
forall x.
Rep UpdateFlowMediaStreamResponse x
-> UpdateFlowMediaStreamResponse
forall x.
UpdateFlowMediaStreamResponse
-> Rep UpdateFlowMediaStreamResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateFlowMediaStreamResponse x
-> UpdateFlowMediaStreamResponse
$cfrom :: forall x.
UpdateFlowMediaStreamResponse
-> Rep UpdateFlowMediaStreamResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFlowMediaStreamResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'flowArn', 'updateFlowMediaStreamResponse_flowArn' - The ARN of the flow that is associated with the media stream that you
-- updated.
--
-- 'mediaStream', 'updateFlowMediaStreamResponse_mediaStream' - The media stream that you updated.
--
-- 'httpStatus', 'updateFlowMediaStreamResponse_httpStatus' - The response's http status code.
newUpdateFlowMediaStreamResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateFlowMediaStreamResponse
newUpdateFlowMediaStreamResponse :: Int -> UpdateFlowMediaStreamResponse
newUpdateFlowMediaStreamResponse Int
pHttpStatus_ =
  UpdateFlowMediaStreamResponse' :: Maybe Text
-> Maybe MediaStream -> Int -> UpdateFlowMediaStreamResponse
UpdateFlowMediaStreamResponse'
    { $sel:flowArn:UpdateFlowMediaStreamResponse' :: Maybe Text
flowArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:mediaStream:UpdateFlowMediaStreamResponse' :: Maybe MediaStream
mediaStream = Maybe MediaStream
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateFlowMediaStreamResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the flow that is associated with the media stream that you
-- updated.
updateFlowMediaStreamResponse_flowArn :: Lens.Lens' UpdateFlowMediaStreamResponse (Prelude.Maybe Prelude.Text)
updateFlowMediaStreamResponse_flowArn :: (Maybe Text -> f (Maybe Text))
-> UpdateFlowMediaStreamResponse -> f UpdateFlowMediaStreamResponse
updateFlowMediaStreamResponse_flowArn = (UpdateFlowMediaStreamResponse -> Maybe Text)
-> (UpdateFlowMediaStreamResponse
    -> Maybe Text -> UpdateFlowMediaStreamResponse)
-> Lens
     UpdateFlowMediaStreamResponse
     UpdateFlowMediaStreamResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFlowMediaStreamResponse' {Maybe Text
flowArn :: Maybe Text
$sel:flowArn:UpdateFlowMediaStreamResponse' :: UpdateFlowMediaStreamResponse -> Maybe Text
flowArn} -> Maybe Text
flowArn) (\s :: UpdateFlowMediaStreamResponse
s@UpdateFlowMediaStreamResponse' {} Maybe Text
a -> UpdateFlowMediaStreamResponse
s {$sel:flowArn:UpdateFlowMediaStreamResponse' :: Maybe Text
flowArn = Maybe Text
a} :: UpdateFlowMediaStreamResponse)

-- | The media stream that you updated.
updateFlowMediaStreamResponse_mediaStream :: Lens.Lens' UpdateFlowMediaStreamResponse (Prelude.Maybe MediaStream)
updateFlowMediaStreamResponse_mediaStream :: (Maybe MediaStream -> f (Maybe MediaStream))
-> UpdateFlowMediaStreamResponse -> f UpdateFlowMediaStreamResponse
updateFlowMediaStreamResponse_mediaStream = (UpdateFlowMediaStreamResponse -> Maybe MediaStream)
-> (UpdateFlowMediaStreamResponse
    -> Maybe MediaStream -> UpdateFlowMediaStreamResponse)
-> Lens
     UpdateFlowMediaStreamResponse
     UpdateFlowMediaStreamResponse
     (Maybe MediaStream)
     (Maybe MediaStream)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFlowMediaStreamResponse' {Maybe MediaStream
mediaStream :: Maybe MediaStream
$sel:mediaStream:UpdateFlowMediaStreamResponse' :: UpdateFlowMediaStreamResponse -> Maybe MediaStream
mediaStream} -> Maybe MediaStream
mediaStream) (\s :: UpdateFlowMediaStreamResponse
s@UpdateFlowMediaStreamResponse' {} Maybe MediaStream
a -> UpdateFlowMediaStreamResponse
s {$sel:mediaStream:UpdateFlowMediaStreamResponse' :: Maybe MediaStream
mediaStream = Maybe MediaStream
a} :: UpdateFlowMediaStreamResponse)

-- | The response's http status code.
updateFlowMediaStreamResponse_httpStatus :: Lens.Lens' UpdateFlowMediaStreamResponse Prelude.Int
updateFlowMediaStreamResponse_httpStatus :: (Int -> f Int)
-> UpdateFlowMediaStreamResponse -> f UpdateFlowMediaStreamResponse
updateFlowMediaStreamResponse_httpStatus = (UpdateFlowMediaStreamResponse -> Int)
-> (UpdateFlowMediaStreamResponse
    -> Int -> UpdateFlowMediaStreamResponse)
-> Lens
     UpdateFlowMediaStreamResponse UpdateFlowMediaStreamResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFlowMediaStreamResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateFlowMediaStreamResponse' :: UpdateFlowMediaStreamResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateFlowMediaStreamResponse
s@UpdateFlowMediaStreamResponse' {} Int
a -> UpdateFlowMediaStreamResponse
s {$sel:httpStatus:UpdateFlowMediaStreamResponse' :: Int
httpStatus = Int
a} :: UpdateFlowMediaStreamResponse)

instance Prelude.NFData UpdateFlowMediaStreamResponse