{-# 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.MediaLive.UpdateMultiplexProgram
(
UpdateMultiplexProgram' (..),
newUpdateMultiplexProgram',
updateMultiplexProgram'_multiplexProgramSettings,
updateMultiplexProgram'_multiplexId,
updateMultiplexProgram'_programName,
UpdateMultiplexProgramResponse (..),
newUpdateMultiplexProgramResponse,
updateMultiplexProgramResponse_multiplexProgram,
updateMultiplexProgramResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateMultiplexProgram' = UpdateMultiplexProgram''
{
UpdateMultiplexProgram' -> Maybe MultiplexProgramSettings
multiplexProgramSettings :: Prelude.Maybe MultiplexProgramSettings,
UpdateMultiplexProgram' -> Text
multiplexId :: Prelude.Text,
UpdateMultiplexProgram' -> Text
programName :: Prelude.Text
}
deriving (UpdateMultiplexProgram' -> UpdateMultiplexProgram' -> Bool
(UpdateMultiplexProgram' -> UpdateMultiplexProgram' -> Bool)
-> (UpdateMultiplexProgram' -> UpdateMultiplexProgram' -> Bool)
-> Eq UpdateMultiplexProgram'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateMultiplexProgram' -> UpdateMultiplexProgram' -> Bool
$c/= :: UpdateMultiplexProgram' -> UpdateMultiplexProgram' -> Bool
== :: UpdateMultiplexProgram' -> UpdateMultiplexProgram' -> Bool
$c== :: UpdateMultiplexProgram' -> UpdateMultiplexProgram' -> Bool
Prelude.Eq, ReadPrec [UpdateMultiplexProgram']
ReadPrec UpdateMultiplexProgram'
Int -> ReadS UpdateMultiplexProgram'
ReadS [UpdateMultiplexProgram']
(Int -> ReadS UpdateMultiplexProgram')
-> ReadS [UpdateMultiplexProgram']
-> ReadPrec UpdateMultiplexProgram'
-> ReadPrec [UpdateMultiplexProgram']
-> Read UpdateMultiplexProgram'
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateMultiplexProgram']
$creadListPrec :: ReadPrec [UpdateMultiplexProgram']
readPrec :: ReadPrec UpdateMultiplexProgram'
$creadPrec :: ReadPrec UpdateMultiplexProgram'
readList :: ReadS [UpdateMultiplexProgram']
$creadList :: ReadS [UpdateMultiplexProgram']
readsPrec :: Int -> ReadS UpdateMultiplexProgram'
$creadsPrec :: Int -> ReadS UpdateMultiplexProgram'
Prelude.Read, Int -> UpdateMultiplexProgram' -> ShowS
[UpdateMultiplexProgram'] -> ShowS
UpdateMultiplexProgram' -> String
(Int -> UpdateMultiplexProgram' -> ShowS)
-> (UpdateMultiplexProgram' -> String)
-> ([UpdateMultiplexProgram'] -> ShowS)
-> Show UpdateMultiplexProgram'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateMultiplexProgram'] -> ShowS
$cshowList :: [UpdateMultiplexProgram'] -> ShowS
show :: UpdateMultiplexProgram' -> String
$cshow :: UpdateMultiplexProgram' -> String
showsPrec :: Int -> UpdateMultiplexProgram' -> ShowS
$cshowsPrec :: Int -> UpdateMultiplexProgram' -> ShowS
Prelude.Show, (forall x.
UpdateMultiplexProgram' -> Rep UpdateMultiplexProgram' x)
-> (forall x.
Rep UpdateMultiplexProgram' x -> UpdateMultiplexProgram')
-> Generic UpdateMultiplexProgram'
forall x. Rep UpdateMultiplexProgram' x -> UpdateMultiplexProgram'
forall x. UpdateMultiplexProgram' -> Rep UpdateMultiplexProgram' x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateMultiplexProgram' x -> UpdateMultiplexProgram'
$cfrom :: forall x. UpdateMultiplexProgram' -> Rep UpdateMultiplexProgram' x
Prelude.Generic)
newUpdateMultiplexProgram' ::
Prelude.Text ->
Prelude.Text ->
UpdateMultiplexProgram'
newUpdateMultiplexProgram' :: Text -> Text -> UpdateMultiplexProgram'
newUpdateMultiplexProgram'
Text
pMultiplexId_
Text
pProgramName_ =
UpdateMultiplexProgram'' :: Maybe MultiplexProgramSettings
-> Text -> Text -> UpdateMultiplexProgram'
UpdateMultiplexProgram''
{ $sel:multiplexProgramSettings:UpdateMultiplexProgram'' :: Maybe MultiplexProgramSettings
multiplexProgramSettings =
Maybe MultiplexProgramSettings
forall a. Maybe a
Prelude.Nothing,
$sel:multiplexId:UpdateMultiplexProgram'' :: Text
multiplexId = Text
pMultiplexId_,
$sel:programName:UpdateMultiplexProgram'' :: Text
programName = Text
pProgramName_
}
updateMultiplexProgram'_multiplexProgramSettings :: Lens.Lens' UpdateMultiplexProgram' (Prelude.Maybe MultiplexProgramSettings)
updateMultiplexProgram'_multiplexProgramSettings :: (Maybe MultiplexProgramSettings
-> f (Maybe MultiplexProgramSettings))
-> UpdateMultiplexProgram' -> f UpdateMultiplexProgram'
updateMultiplexProgram'_multiplexProgramSettings = (UpdateMultiplexProgram' -> Maybe MultiplexProgramSettings)
-> (UpdateMultiplexProgram'
-> Maybe MultiplexProgramSettings -> UpdateMultiplexProgram')
-> Lens
UpdateMultiplexProgram'
UpdateMultiplexProgram'
(Maybe MultiplexProgramSettings)
(Maybe MultiplexProgramSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMultiplexProgram'' {Maybe MultiplexProgramSettings
multiplexProgramSettings :: Maybe MultiplexProgramSettings
$sel:multiplexProgramSettings:UpdateMultiplexProgram'' :: UpdateMultiplexProgram' -> Maybe MultiplexProgramSettings
multiplexProgramSettings} -> Maybe MultiplexProgramSettings
multiplexProgramSettings) (\s :: UpdateMultiplexProgram'
s@UpdateMultiplexProgram'' {} Maybe MultiplexProgramSettings
a -> UpdateMultiplexProgram'
s {$sel:multiplexProgramSettings:UpdateMultiplexProgram'' :: Maybe MultiplexProgramSettings
multiplexProgramSettings = Maybe MultiplexProgramSettings
a} :: UpdateMultiplexProgram')
updateMultiplexProgram'_multiplexId :: Lens.Lens' UpdateMultiplexProgram' Prelude.Text
updateMultiplexProgram'_multiplexId :: (Text -> f Text)
-> UpdateMultiplexProgram' -> f UpdateMultiplexProgram'
updateMultiplexProgram'_multiplexId = (UpdateMultiplexProgram' -> Text)
-> (UpdateMultiplexProgram' -> Text -> UpdateMultiplexProgram')
-> Lens UpdateMultiplexProgram' UpdateMultiplexProgram' Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMultiplexProgram'' {Text
multiplexId :: Text
$sel:multiplexId:UpdateMultiplexProgram'' :: UpdateMultiplexProgram' -> Text
multiplexId} -> Text
multiplexId) (\s :: UpdateMultiplexProgram'
s@UpdateMultiplexProgram'' {} Text
a -> UpdateMultiplexProgram'
s {$sel:multiplexId:UpdateMultiplexProgram'' :: Text
multiplexId = Text
a} :: UpdateMultiplexProgram')
updateMultiplexProgram'_programName :: Lens.Lens' UpdateMultiplexProgram' Prelude.Text
updateMultiplexProgram'_programName :: (Text -> f Text)
-> UpdateMultiplexProgram' -> f UpdateMultiplexProgram'
updateMultiplexProgram'_programName = (UpdateMultiplexProgram' -> Text)
-> (UpdateMultiplexProgram' -> Text -> UpdateMultiplexProgram')
-> Lens UpdateMultiplexProgram' UpdateMultiplexProgram' Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMultiplexProgram'' {Text
programName :: Text
$sel:programName:UpdateMultiplexProgram'' :: UpdateMultiplexProgram' -> Text
programName} -> Text
programName) (\s :: UpdateMultiplexProgram'
s@UpdateMultiplexProgram'' {} Text
a -> UpdateMultiplexProgram'
s {$sel:programName:UpdateMultiplexProgram'' :: Text
programName = Text
a} :: UpdateMultiplexProgram')
instance Core.AWSRequest UpdateMultiplexProgram' where
type
AWSResponse UpdateMultiplexProgram' =
UpdateMultiplexProgramResponse
request :: UpdateMultiplexProgram' -> Request UpdateMultiplexProgram'
request = Service
-> UpdateMultiplexProgram' -> Request UpdateMultiplexProgram'
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateMultiplexProgram'
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateMultiplexProgram')))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateMultiplexProgram'))
-> Logger
-> Service
-> Proxy UpdateMultiplexProgram'
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateMultiplexProgram')))
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 MultiplexProgram -> Int -> UpdateMultiplexProgramResponse
UpdateMultiplexProgramResponse'
(Maybe MultiplexProgram -> Int -> UpdateMultiplexProgramResponse)
-> Either String (Maybe MultiplexProgram)
-> Either String (Int -> UpdateMultiplexProgramResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe MultiplexProgram)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"multiplexProgram")
Either String (Int -> UpdateMultiplexProgramResponse)
-> Either String Int
-> Either String UpdateMultiplexProgramResponse
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 UpdateMultiplexProgram'
instance Prelude.NFData UpdateMultiplexProgram'
instance Core.ToHeaders UpdateMultiplexProgram' where
toHeaders :: UpdateMultiplexProgram' -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateMultiplexProgram' -> 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 UpdateMultiplexProgram' where
toJSON :: UpdateMultiplexProgram' -> Value
toJSON UpdateMultiplexProgram'' {Maybe MultiplexProgramSettings
Text
programName :: Text
multiplexId :: Text
multiplexProgramSettings :: Maybe MultiplexProgramSettings
$sel:programName:UpdateMultiplexProgram'' :: UpdateMultiplexProgram' -> Text
$sel:multiplexId:UpdateMultiplexProgram'' :: UpdateMultiplexProgram' -> Text
$sel:multiplexProgramSettings:UpdateMultiplexProgram'' :: UpdateMultiplexProgram' -> Maybe MultiplexProgramSettings
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"multiplexProgramSettings" Text -> MultiplexProgramSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(MultiplexProgramSettings -> Pair)
-> Maybe MultiplexProgramSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MultiplexProgramSettings
multiplexProgramSettings
]
)
instance Core.ToPath UpdateMultiplexProgram' where
toPath :: UpdateMultiplexProgram' -> ByteString
toPath UpdateMultiplexProgram'' {Maybe MultiplexProgramSettings
Text
programName :: Text
multiplexId :: Text
multiplexProgramSettings :: Maybe MultiplexProgramSettings
$sel:programName:UpdateMultiplexProgram'' :: UpdateMultiplexProgram' -> Text
$sel:multiplexId:UpdateMultiplexProgram'' :: UpdateMultiplexProgram' -> Text
$sel:multiplexProgramSettings:UpdateMultiplexProgram'' :: UpdateMultiplexProgram' -> Maybe MultiplexProgramSettings
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/prod/multiplexes/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
multiplexId,
ByteString
"/programs/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
programName
]
instance Core.ToQuery UpdateMultiplexProgram' where
toQuery :: UpdateMultiplexProgram' -> QueryString
toQuery = QueryString -> UpdateMultiplexProgram' -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateMultiplexProgramResponse = UpdateMultiplexProgramResponse'
{
UpdateMultiplexProgramResponse -> Maybe MultiplexProgram
multiplexProgram :: Prelude.Maybe MultiplexProgram,
UpdateMultiplexProgramResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateMultiplexProgramResponse
-> UpdateMultiplexProgramResponse -> Bool
(UpdateMultiplexProgramResponse
-> UpdateMultiplexProgramResponse -> Bool)
-> (UpdateMultiplexProgramResponse
-> UpdateMultiplexProgramResponse -> Bool)
-> Eq UpdateMultiplexProgramResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateMultiplexProgramResponse
-> UpdateMultiplexProgramResponse -> Bool
$c/= :: UpdateMultiplexProgramResponse
-> UpdateMultiplexProgramResponse -> Bool
== :: UpdateMultiplexProgramResponse
-> UpdateMultiplexProgramResponse -> Bool
$c== :: UpdateMultiplexProgramResponse
-> UpdateMultiplexProgramResponse -> Bool
Prelude.Eq, ReadPrec [UpdateMultiplexProgramResponse]
ReadPrec UpdateMultiplexProgramResponse
Int -> ReadS UpdateMultiplexProgramResponse
ReadS [UpdateMultiplexProgramResponse]
(Int -> ReadS UpdateMultiplexProgramResponse)
-> ReadS [UpdateMultiplexProgramResponse]
-> ReadPrec UpdateMultiplexProgramResponse
-> ReadPrec [UpdateMultiplexProgramResponse]
-> Read UpdateMultiplexProgramResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateMultiplexProgramResponse]
$creadListPrec :: ReadPrec [UpdateMultiplexProgramResponse]
readPrec :: ReadPrec UpdateMultiplexProgramResponse
$creadPrec :: ReadPrec UpdateMultiplexProgramResponse
readList :: ReadS [UpdateMultiplexProgramResponse]
$creadList :: ReadS [UpdateMultiplexProgramResponse]
readsPrec :: Int -> ReadS UpdateMultiplexProgramResponse
$creadsPrec :: Int -> ReadS UpdateMultiplexProgramResponse
Prelude.Read, Int -> UpdateMultiplexProgramResponse -> ShowS
[UpdateMultiplexProgramResponse] -> ShowS
UpdateMultiplexProgramResponse -> String
(Int -> UpdateMultiplexProgramResponse -> ShowS)
-> (UpdateMultiplexProgramResponse -> String)
-> ([UpdateMultiplexProgramResponse] -> ShowS)
-> Show UpdateMultiplexProgramResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateMultiplexProgramResponse] -> ShowS
$cshowList :: [UpdateMultiplexProgramResponse] -> ShowS
show :: UpdateMultiplexProgramResponse -> String
$cshow :: UpdateMultiplexProgramResponse -> String
showsPrec :: Int -> UpdateMultiplexProgramResponse -> ShowS
$cshowsPrec :: Int -> UpdateMultiplexProgramResponse -> ShowS
Prelude.Show, (forall x.
UpdateMultiplexProgramResponse
-> Rep UpdateMultiplexProgramResponse x)
-> (forall x.
Rep UpdateMultiplexProgramResponse x
-> UpdateMultiplexProgramResponse)
-> Generic UpdateMultiplexProgramResponse
forall x.
Rep UpdateMultiplexProgramResponse x
-> UpdateMultiplexProgramResponse
forall x.
UpdateMultiplexProgramResponse
-> Rep UpdateMultiplexProgramResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateMultiplexProgramResponse x
-> UpdateMultiplexProgramResponse
$cfrom :: forall x.
UpdateMultiplexProgramResponse
-> Rep UpdateMultiplexProgramResponse x
Prelude.Generic)
newUpdateMultiplexProgramResponse ::
Prelude.Int ->
UpdateMultiplexProgramResponse
newUpdateMultiplexProgramResponse :: Int -> UpdateMultiplexProgramResponse
newUpdateMultiplexProgramResponse Int
pHttpStatus_ =
UpdateMultiplexProgramResponse' :: Maybe MultiplexProgram -> Int -> UpdateMultiplexProgramResponse
UpdateMultiplexProgramResponse'
{ $sel:multiplexProgram:UpdateMultiplexProgramResponse' :: Maybe MultiplexProgram
multiplexProgram =
Maybe MultiplexProgram
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateMultiplexProgramResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateMultiplexProgramResponse_multiplexProgram :: Lens.Lens' UpdateMultiplexProgramResponse (Prelude.Maybe MultiplexProgram)
updateMultiplexProgramResponse_multiplexProgram :: (Maybe MultiplexProgram -> f (Maybe MultiplexProgram))
-> UpdateMultiplexProgramResponse
-> f UpdateMultiplexProgramResponse
updateMultiplexProgramResponse_multiplexProgram = (UpdateMultiplexProgramResponse -> Maybe MultiplexProgram)
-> (UpdateMultiplexProgramResponse
-> Maybe MultiplexProgram -> UpdateMultiplexProgramResponse)
-> Lens
UpdateMultiplexProgramResponse
UpdateMultiplexProgramResponse
(Maybe MultiplexProgram)
(Maybe MultiplexProgram)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMultiplexProgramResponse' {Maybe MultiplexProgram
multiplexProgram :: Maybe MultiplexProgram
$sel:multiplexProgram:UpdateMultiplexProgramResponse' :: UpdateMultiplexProgramResponse -> Maybe MultiplexProgram
multiplexProgram} -> Maybe MultiplexProgram
multiplexProgram) (\s :: UpdateMultiplexProgramResponse
s@UpdateMultiplexProgramResponse' {} Maybe MultiplexProgram
a -> UpdateMultiplexProgramResponse
s {$sel:multiplexProgram:UpdateMultiplexProgramResponse' :: Maybe MultiplexProgram
multiplexProgram = Maybe MultiplexProgram
a} :: UpdateMultiplexProgramResponse)
updateMultiplexProgramResponse_httpStatus :: Lens.Lens' UpdateMultiplexProgramResponse Prelude.Int
updateMultiplexProgramResponse_httpStatus :: (Int -> f Int)
-> UpdateMultiplexProgramResponse
-> f UpdateMultiplexProgramResponse
updateMultiplexProgramResponse_httpStatus = (UpdateMultiplexProgramResponse -> Int)
-> (UpdateMultiplexProgramResponse
-> Int -> UpdateMultiplexProgramResponse)
-> Lens
UpdateMultiplexProgramResponse
UpdateMultiplexProgramResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMultiplexProgramResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateMultiplexProgramResponse' :: UpdateMultiplexProgramResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateMultiplexProgramResponse
s@UpdateMultiplexProgramResponse' {} Int
a -> UpdateMultiplexProgramResponse
s {$sel:httpStatus:UpdateMultiplexProgramResponse' :: Int
httpStatus = Int
a} :: UpdateMultiplexProgramResponse)
instance
Prelude.NFData
UpdateMultiplexProgramResponse