{-# 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.CreateMultiplexProgram
(
CreateMultiplexProgram' (..),
newCreateMultiplexProgram',
createMultiplexProgram'_multiplexId,
createMultiplexProgram'_requestId,
createMultiplexProgram'_multiplexProgramSettings,
createMultiplexProgram'_programName,
CreateMultiplexProgramResponse (..),
newCreateMultiplexProgramResponse,
createMultiplexProgramResponse_multiplexProgram,
createMultiplexProgramResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateMultiplexProgram' = CreateMultiplexProgram''
{
CreateMultiplexProgram' -> Text
multiplexId :: Prelude.Text,
CreateMultiplexProgram' -> Text
requestId :: Prelude.Text,
CreateMultiplexProgram' -> MultiplexProgramSettings
multiplexProgramSettings :: MultiplexProgramSettings,
CreateMultiplexProgram' -> Text
programName :: Prelude.Text
}
deriving (CreateMultiplexProgram' -> CreateMultiplexProgram' -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateMultiplexProgram' -> CreateMultiplexProgram' -> Bool
$c/= :: CreateMultiplexProgram' -> CreateMultiplexProgram' -> Bool
== :: CreateMultiplexProgram' -> CreateMultiplexProgram' -> Bool
$c== :: CreateMultiplexProgram' -> CreateMultiplexProgram' -> Bool
Prelude.Eq, ReadPrec [CreateMultiplexProgram']
ReadPrec CreateMultiplexProgram'
Int -> ReadS CreateMultiplexProgram'
ReadS [CreateMultiplexProgram']
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateMultiplexProgram']
$creadListPrec :: ReadPrec [CreateMultiplexProgram']
readPrec :: ReadPrec CreateMultiplexProgram'
$creadPrec :: ReadPrec CreateMultiplexProgram'
readList :: ReadS [CreateMultiplexProgram']
$creadList :: ReadS [CreateMultiplexProgram']
readsPrec :: Int -> ReadS CreateMultiplexProgram'
$creadsPrec :: Int -> ReadS CreateMultiplexProgram'
Prelude.Read, Int -> CreateMultiplexProgram' -> ShowS
[CreateMultiplexProgram'] -> ShowS
CreateMultiplexProgram' -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMultiplexProgram'] -> ShowS
$cshowList :: [CreateMultiplexProgram'] -> ShowS
show :: CreateMultiplexProgram' -> String
$cshow :: CreateMultiplexProgram' -> String
showsPrec :: Int -> CreateMultiplexProgram' -> ShowS
$cshowsPrec :: Int -> CreateMultiplexProgram' -> ShowS
Prelude.Show, forall x. Rep CreateMultiplexProgram' x -> CreateMultiplexProgram'
forall x. CreateMultiplexProgram' -> Rep CreateMultiplexProgram' x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateMultiplexProgram' x -> CreateMultiplexProgram'
$cfrom :: forall x. CreateMultiplexProgram' -> Rep CreateMultiplexProgram' x
Prelude.Generic)
newCreateMultiplexProgram' ::
Prelude.Text ->
Prelude.Text ->
MultiplexProgramSettings ->
Prelude.Text ->
CreateMultiplexProgram'
newCreateMultiplexProgram' :: Text
-> Text
-> MultiplexProgramSettings
-> Text
-> CreateMultiplexProgram'
newCreateMultiplexProgram'
Text
pMultiplexId_
Text
pRequestId_
MultiplexProgramSettings
pMultiplexProgramSettings_
Text
pProgramName_ =
CreateMultiplexProgram''
{ $sel:multiplexId:CreateMultiplexProgram'' :: Text
multiplexId =
Text
pMultiplexId_,
$sel:requestId:CreateMultiplexProgram'' :: Text
requestId = Text
pRequestId_,
$sel:multiplexProgramSettings:CreateMultiplexProgram'' :: MultiplexProgramSettings
multiplexProgramSettings =
MultiplexProgramSettings
pMultiplexProgramSettings_,
$sel:programName:CreateMultiplexProgram'' :: Text
programName = Text
pProgramName_
}
createMultiplexProgram'_multiplexId :: Lens.Lens' CreateMultiplexProgram' Prelude.Text
createMultiplexProgram'_multiplexId :: Lens' CreateMultiplexProgram' Text
createMultiplexProgram'_multiplexId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMultiplexProgram'' {Text
multiplexId :: Text
$sel:multiplexId:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> Text
multiplexId} -> Text
multiplexId) (\s :: CreateMultiplexProgram'
s@CreateMultiplexProgram'' {} Text
a -> CreateMultiplexProgram'
s {$sel:multiplexId:CreateMultiplexProgram'' :: Text
multiplexId = Text
a} :: CreateMultiplexProgram')
createMultiplexProgram'_requestId :: Lens.Lens' CreateMultiplexProgram' Prelude.Text
createMultiplexProgram'_requestId :: Lens' CreateMultiplexProgram' Text
createMultiplexProgram'_requestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMultiplexProgram'' {Text
requestId :: Text
$sel:requestId:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> Text
requestId} -> Text
requestId) (\s :: CreateMultiplexProgram'
s@CreateMultiplexProgram'' {} Text
a -> CreateMultiplexProgram'
s {$sel:requestId:CreateMultiplexProgram'' :: Text
requestId = Text
a} :: CreateMultiplexProgram')
createMultiplexProgram'_multiplexProgramSettings :: Lens.Lens' CreateMultiplexProgram' MultiplexProgramSettings
createMultiplexProgram'_multiplexProgramSettings :: Lens' CreateMultiplexProgram' MultiplexProgramSettings
createMultiplexProgram'_multiplexProgramSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMultiplexProgram'' {MultiplexProgramSettings
multiplexProgramSettings :: MultiplexProgramSettings
$sel:multiplexProgramSettings:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> MultiplexProgramSettings
multiplexProgramSettings} -> MultiplexProgramSettings
multiplexProgramSettings) (\s :: CreateMultiplexProgram'
s@CreateMultiplexProgram'' {} MultiplexProgramSettings
a -> CreateMultiplexProgram'
s {$sel:multiplexProgramSettings:CreateMultiplexProgram'' :: MultiplexProgramSettings
multiplexProgramSettings = MultiplexProgramSettings
a} :: CreateMultiplexProgram')
createMultiplexProgram'_programName :: Lens.Lens' CreateMultiplexProgram' Prelude.Text
createMultiplexProgram'_programName :: Lens' CreateMultiplexProgram' Text
createMultiplexProgram'_programName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMultiplexProgram'' {Text
programName :: Text
$sel:programName:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> Text
programName} -> Text
programName) (\s :: CreateMultiplexProgram'
s@CreateMultiplexProgram'' {} Text
a -> CreateMultiplexProgram'
s {$sel:programName:CreateMultiplexProgram'' :: Text
programName = Text
a} :: CreateMultiplexProgram')
instance Core.AWSRequest CreateMultiplexProgram' where
type
AWSResponse CreateMultiplexProgram' =
CreateMultiplexProgramResponse
request :: (Service -> Service)
-> CreateMultiplexProgram' -> Request CreateMultiplexProgram'
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateMultiplexProgram'
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateMultiplexProgram')))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe MultiplexProgram -> Int -> CreateMultiplexProgramResponse
CreateMultiplexProgramResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"multiplexProgram")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateMultiplexProgram' where
hashWithSalt :: Int -> CreateMultiplexProgram' -> Int
hashWithSalt Int
_salt CreateMultiplexProgram'' {Text
MultiplexProgramSettings
programName :: Text
multiplexProgramSettings :: MultiplexProgramSettings
requestId :: Text
multiplexId :: Text
$sel:programName:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> Text
$sel:multiplexProgramSettings:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> MultiplexProgramSettings
$sel:requestId:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> Text
$sel:multiplexId:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
multiplexId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
requestId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` MultiplexProgramSettings
multiplexProgramSettings
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
programName
instance Prelude.NFData CreateMultiplexProgram' where
rnf :: CreateMultiplexProgram' -> ()
rnf CreateMultiplexProgram'' {Text
MultiplexProgramSettings
programName :: Text
multiplexProgramSettings :: MultiplexProgramSettings
requestId :: Text
multiplexId :: Text
$sel:programName:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> Text
$sel:multiplexProgramSettings:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> MultiplexProgramSettings
$sel:requestId:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> Text
$sel:multiplexId:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
multiplexId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
requestId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf MultiplexProgramSettings
multiplexProgramSettings
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
programName
instance Data.ToHeaders CreateMultiplexProgram' where
toHeaders :: CreateMultiplexProgram' -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON CreateMultiplexProgram' where
toJSON :: CreateMultiplexProgram' -> Value
toJSON CreateMultiplexProgram'' {Text
MultiplexProgramSettings
programName :: Text
multiplexProgramSettings :: MultiplexProgramSettings
requestId :: Text
multiplexId :: Text
$sel:programName:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> Text
$sel:multiplexProgramSettings:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> MultiplexProgramSettings
$sel:requestId:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> Text
$sel:multiplexId:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"requestId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
requestId),
forall a. a -> Maybe a
Prelude.Just
( Key
"multiplexProgramSettings"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= MultiplexProgramSettings
multiplexProgramSettings
),
forall a. a -> Maybe a
Prelude.Just (Key
"programName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
programName)
]
)
instance Data.ToPath CreateMultiplexProgram' where
toPath :: CreateMultiplexProgram' -> ByteString
toPath CreateMultiplexProgram'' {Text
MultiplexProgramSettings
programName :: Text
multiplexProgramSettings :: MultiplexProgramSettings
requestId :: Text
multiplexId :: Text
$sel:programName:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> Text
$sel:multiplexProgramSettings:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> MultiplexProgramSettings
$sel:requestId:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> Text
$sel:multiplexId:CreateMultiplexProgram'' :: CreateMultiplexProgram' -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/prod/multiplexes/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
multiplexId,
ByteString
"/programs"
]
instance Data.ToQuery CreateMultiplexProgram' where
toQuery :: CreateMultiplexProgram' -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateMultiplexProgramResponse = CreateMultiplexProgramResponse'
{
CreateMultiplexProgramResponse -> Maybe MultiplexProgram
multiplexProgram :: Prelude.Maybe MultiplexProgram,
CreateMultiplexProgramResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateMultiplexProgramResponse
-> CreateMultiplexProgramResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateMultiplexProgramResponse
-> CreateMultiplexProgramResponse -> Bool
$c/= :: CreateMultiplexProgramResponse
-> CreateMultiplexProgramResponse -> Bool
== :: CreateMultiplexProgramResponse
-> CreateMultiplexProgramResponse -> Bool
$c== :: CreateMultiplexProgramResponse
-> CreateMultiplexProgramResponse -> Bool
Prelude.Eq, ReadPrec [CreateMultiplexProgramResponse]
ReadPrec CreateMultiplexProgramResponse
Int -> ReadS CreateMultiplexProgramResponse
ReadS [CreateMultiplexProgramResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateMultiplexProgramResponse]
$creadListPrec :: ReadPrec [CreateMultiplexProgramResponse]
readPrec :: ReadPrec CreateMultiplexProgramResponse
$creadPrec :: ReadPrec CreateMultiplexProgramResponse
readList :: ReadS [CreateMultiplexProgramResponse]
$creadList :: ReadS [CreateMultiplexProgramResponse]
readsPrec :: Int -> ReadS CreateMultiplexProgramResponse
$creadsPrec :: Int -> ReadS CreateMultiplexProgramResponse
Prelude.Read, Int -> CreateMultiplexProgramResponse -> ShowS
[CreateMultiplexProgramResponse] -> ShowS
CreateMultiplexProgramResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMultiplexProgramResponse] -> ShowS
$cshowList :: [CreateMultiplexProgramResponse] -> ShowS
show :: CreateMultiplexProgramResponse -> String
$cshow :: CreateMultiplexProgramResponse -> String
showsPrec :: Int -> CreateMultiplexProgramResponse -> ShowS
$cshowsPrec :: Int -> CreateMultiplexProgramResponse -> ShowS
Prelude.Show, forall x.
Rep CreateMultiplexProgramResponse x
-> CreateMultiplexProgramResponse
forall x.
CreateMultiplexProgramResponse
-> Rep CreateMultiplexProgramResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateMultiplexProgramResponse x
-> CreateMultiplexProgramResponse
$cfrom :: forall x.
CreateMultiplexProgramResponse
-> Rep CreateMultiplexProgramResponse x
Prelude.Generic)
newCreateMultiplexProgramResponse ::
Prelude.Int ->
CreateMultiplexProgramResponse
newCreateMultiplexProgramResponse :: Int -> CreateMultiplexProgramResponse
newCreateMultiplexProgramResponse Int
pHttpStatus_ =
CreateMultiplexProgramResponse'
{ $sel:multiplexProgram:CreateMultiplexProgramResponse' :: Maybe MultiplexProgram
multiplexProgram =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateMultiplexProgramResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createMultiplexProgramResponse_multiplexProgram :: Lens.Lens' CreateMultiplexProgramResponse (Prelude.Maybe MultiplexProgram)
createMultiplexProgramResponse_multiplexProgram :: Lens' CreateMultiplexProgramResponse (Maybe MultiplexProgram)
createMultiplexProgramResponse_multiplexProgram = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMultiplexProgramResponse' {Maybe MultiplexProgram
multiplexProgram :: Maybe MultiplexProgram
$sel:multiplexProgram:CreateMultiplexProgramResponse' :: CreateMultiplexProgramResponse -> Maybe MultiplexProgram
multiplexProgram} -> Maybe MultiplexProgram
multiplexProgram) (\s :: CreateMultiplexProgramResponse
s@CreateMultiplexProgramResponse' {} Maybe MultiplexProgram
a -> CreateMultiplexProgramResponse
s {$sel:multiplexProgram:CreateMultiplexProgramResponse' :: Maybe MultiplexProgram
multiplexProgram = Maybe MultiplexProgram
a} :: CreateMultiplexProgramResponse)
createMultiplexProgramResponse_httpStatus :: Lens.Lens' CreateMultiplexProgramResponse Prelude.Int
createMultiplexProgramResponse_httpStatus :: Lens' CreateMultiplexProgramResponse Int
createMultiplexProgramResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMultiplexProgramResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateMultiplexProgramResponse' :: CreateMultiplexProgramResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateMultiplexProgramResponse
s@CreateMultiplexProgramResponse' {} Int
a -> CreateMultiplexProgramResponse
s {$sel:httpStatus:CreateMultiplexProgramResponse' :: Int
httpStatus = Int
a} :: CreateMultiplexProgramResponse)
instance
Prelude.NFData
CreateMultiplexProgramResponse
where
rnf :: CreateMultiplexProgramResponse -> ()
rnf CreateMultiplexProgramResponse' {Int
Maybe MultiplexProgram
httpStatus :: Int
multiplexProgram :: Maybe MultiplexProgram
$sel:httpStatus:CreateMultiplexProgramResponse' :: CreateMultiplexProgramResponse -> Int
$sel:multiplexProgram:CreateMultiplexProgramResponse' :: CreateMultiplexProgramResponse -> Maybe MultiplexProgram
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe MultiplexProgram
multiplexProgram
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus