{-# 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.UpdateMultiplex
(
UpdateMultiplex' (..),
newUpdateMultiplex',
updateMultiplex'_multiplexSettings,
updateMultiplex'_name,
updateMultiplex'_multiplexId,
UpdateMultiplexResponse (..),
newUpdateMultiplexResponse,
updateMultiplexResponse_multiplex,
updateMultiplexResponse_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 UpdateMultiplex' = UpdateMultiplex''
{
UpdateMultiplex' -> Maybe MultiplexSettings
multiplexSettings :: Prelude.Maybe MultiplexSettings,
UpdateMultiplex' -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
UpdateMultiplex' -> Text
multiplexId :: Prelude.Text
}
deriving (UpdateMultiplex' -> UpdateMultiplex' -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateMultiplex' -> UpdateMultiplex' -> Bool
$c/= :: UpdateMultiplex' -> UpdateMultiplex' -> Bool
== :: UpdateMultiplex' -> UpdateMultiplex' -> Bool
$c== :: UpdateMultiplex' -> UpdateMultiplex' -> Bool
Prelude.Eq, ReadPrec [UpdateMultiplex']
ReadPrec UpdateMultiplex'
Int -> ReadS UpdateMultiplex'
ReadS [UpdateMultiplex']
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateMultiplex']
$creadListPrec :: ReadPrec [UpdateMultiplex']
readPrec :: ReadPrec UpdateMultiplex'
$creadPrec :: ReadPrec UpdateMultiplex'
readList :: ReadS [UpdateMultiplex']
$creadList :: ReadS [UpdateMultiplex']
readsPrec :: Int -> ReadS UpdateMultiplex'
$creadsPrec :: Int -> ReadS UpdateMultiplex'
Prelude.Read, Int -> UpdateMultiplex' -> ShowS
[UpdateMultiplex'] -> ShowS
UpdateMultiplex' -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateMultiplex'] -> ShowS
$cshowList :: [UpdateMultiplex'] -> ShowS
show :: UpdateMultiplex' -> String
$cshow :: UpdateMultiplex' -> String
showsPrec :: Int -> UpdateMultiplex' -> ShowS
$cshowsPrec :: Int -> UpdateMultiplex' -> ShowS
Prelude.Show, forall x. Rep UpdateMultiplex' x -> UpdateMultiplex'
forall x. UpdateMultiplex' -> Rep UpdateMultiplex' x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateMultiplex' x -> UpdateMultiplex'
$cfrom :: forall x. UpdateMultiplex' -> Rep UpdateMultiplex' x
Prelude.Generic)
newUpdateMultiplex' ::
Prelude.Text ->
UpdateMultiplex'
newUpdateMultiplex' :: Text -> UpdateMultiplex'
newUpdateMultiplex' Text
pMultiplexId_ =
UpdateMultiplex''
{ $sel:multiplexSettings:UpdateMultiplex'' :: Maybe MultiplexSettings
multiplexSettings =
forall a. Maybe a
Prelude.Nothing,
$sel:name:UpdateMultiplex'' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:multiplexId:UpdateMultiplex'' :: Text
multiplexId = Text
pMultiplexId_
}
updateMultiplex'_multiplexSettings :: Lens.Lens' UpdateMultiplex' (Prelude.Maybe MultiplexSettings)
updateMultiplex'_multiplexSettings :: Lens' UpdateMultiplex' (Maybe MultiplexSettings)
updateMultiplex'_multiplexSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMultiplex'' {Maybe MultiplexSettings
multiplexSettings :: Maybe MultiplexSettings
$sel:multiplexSettings:UpdateMultiplex'' :: UpdateMultiplex' -> Maybe MultiplexSettings
multiplexSettings} -> Maybe MultiplexSettings
multiplexSettings) (\s :: UpdateMultiplex'
s@UpdateMultiplex'' {} Maybe MultiplexSettings
a -> UpdateMultiplex'
s {$sel:multiplexSettings:UpdateMultiplex'' :: Maybe MultiplexSettings
multiplexSettings = Maybe MultiplexSettings
a} :: UpdateMultiplex')
updateMultiplex'_name :: Lens.Lens' UpdateMultiplex' (Prelude.Maybe Prelude.Text)
updateMultiplex'_name :: Lens' UpdateMultiplex' (Maybe Text)
updateMultiplex'_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMultiplex'' {Maybe Text
name :: Maybe Text
$sel:name:UpdateMultiplex'' :: UpdateMultiplex' -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateMultiplex'
s@UpdateMultiplex'' {} Maybe Text
a -> UpdateMultiplex'
s {$sel:name:UpdateMultiplex'' :: Maybe Text
name = Maybe Text
a} :: UpdateMultiplex')
updateMultiplex'_multiplexId :: Lens.Lens' UpdateMultiplex' Prelude.Text
updateMultiplex'_multiplexId :: Lens' UpdateMultiplex' Text
updateMultiplex'_multiplexId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMultiplex'' {Text
multiplexId :: Text
$sel:multiplexId:UpdateMultiplex'' :: UpdateMultiplex' -> Text
multiplexId} -> Text
multiplexId) (\s :: UpdateMultiplex'
s@UpdateMultiplex'' {} Text
a -> UpdateMultiplex'
s {$sel:multiplexId:UpdateMultiplex'' :: Text
multiplexId = Text
a} :: UpdateMultiplex')
instance Core.AWSRequest UpdateMultiplex' where
type
AWSResponse UpdateMultiplex' =
UpdateMultiplexResponse
request :: (Service -> Service)
-> UpdateMultiplex' -> Request UpdateMultiplex'
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateMultiplex'
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateMultiplex')))
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 Multiplex -> Int -> UpdateMultiplexResponse
UpdateMultiplexResponse'
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
"multiplex")
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 UpdateMultiplex' where
hashWithSalt :: Int -> UpdateMultiplex' -> Int
hashWithSalt Int
_salt UpdateMultiplex'' {Maybe Text
Maybe MultiplexSettings
Text
multiplexId :: Text
name :: Maybe Text
multiplexSettings :: Maybe MultiplexSettings
$sel:multiplexId:UpdateMultiplex'' :: UpdateMultiplex' -> Text
$sel:name:UpdateMultiplex'' :: UpdateMultiplex' -> Maybe Text
$sel:multiplexSettings:UpdateMultiplex'' :: UpdateMultiplex' -> Maybe MultiplexSettings
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MultiplexSettings
multiplexSettings
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
multiplexId
instance Prelude.NFData UpdateMultiplex' where
rnf :: UpdateMultiplex' -> ()
rnf UpdateMultiplex'' {Maybe Text
Maybe MultiplexSettings
Text
multiplexId :: Text
name :: Maybe Text
multiplexSettings :: Maybe MultiplexSettings
$sel:multiplexId:UpdateMultiplex'' :: UpdateMultiplex' -> Text
$sel:name:UpdateMultiplex'' :: UpdateMultiplex' -> Maybe Text
$sel:multiplexSettings:UpdateMultiplex'' :: UpdateMultiplex' -> Maybe MultiplexSettings
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe MultiplexSettings
multiplexSettings
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
multiplexId
instance Data.ToHeaders UpdateMultiplex' where
toHeaders :: UpdateMultiplex' -> 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 UpdateMultiplex' where
toJSON :: UpdateMultiplex' -> Value
toJSON UpdateMultiplex'' {Maybe Text
Maybe MultiplexSettings
Text
multiplexId :: Text
name :: Maybe Text
multiplexSettings :: Maybe MultiplexSettings
$sel:multiplexId:UpdateMultiplex'' :: UpdateMultiplex' -> Text
$sel:name:UpdateMultiplex'' :: UpdateMultiplex' -> Maybe Text
$sel:multiplexSettings:UpdateMultiplex'' :: UpdateMultiplex' -> Maybe MultiplexSettings
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"multiplexSettings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MultiplexSettings
multiplexSettings,
(Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name
]
)
instance Data.ToPath UpdateMultiplex' where
toPath :: UpdateMultiplex' -> ByteString
toPath UpdateMultiplex'' {Maybe Text
Maybe MultiplexSettings
Text
multiplexId :: Text
name :: Maybe Text
multiplexSettings :: Maybe MultiplexSettings
$sel:multiplexId:UpdateMultiplex'' :: UpdateMultiplex' -> Text
$sel:name:UpdateMultiplex'' :: UpdateMultiplex' -> Maybe Text
$sel:multiplexSettings:UpdateMultiplex'' :: UpdateMultiplex' -> Maybe MultiplexSettings
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/prod/multiplexes/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
multiplexId]
instance Data.ToQuery UpdateMultiplex' where
toQuery :: UpdateMultiplex' -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateMultiplexResponse = UpdateMultiplexResponse'
{
UpdateMultiplexResponse -> Maybe Multiplex
multiplex :: Prelude.Maybe Multiplex,
UpdateMultiplexResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateMultiplexResponse -> UpdateMultiplexResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateMultiplexResponse -> UpdateMultiplexResponse -> Bool
$c/= :: UpdateMultiplexResponse -> UpdateMultiplexResponse -> Bool
== :: UpdateMultiplexResponse -> UpdateMultiplexResponse -> Bool
$c== :: UpdateMultiplexResponse -> UpdateMultiplexResponse -> Bool
Prelude.Eq, ReadPrec [UpdateMultiplexResponse]
ReadPrec UpdateMultiplexResponse
Int -> ReadS UpdateMultiplexResponse
ReadS [UpdateMultiplexResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateMultiplexResponse]
$creadListPrec :: ReadPrec [UpdateMultiplexResponse]
readPrec :: ReadPrec UpdateMultiplexResponse
$creadPrec :: ReadPrec UpdateMultiplexResponse
readList :: ReadS [UpdateMultiplexResponse]
$creadList :: ReadS [UpdateMultiplexResponse]
readsPrec :: Int -> ReadS UpdateMultiplexResponse
$creadsPrec :: Int -> ReadS UpdateMultiplexResponse
Prelude.Read, Int -> UpdateMultiplexResponse -> ShowS
[UpdateMultiplexResponse] -> ShowS
UpdateMultiplexResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateMultiplexResponse] -> ShowS
$cshowList :: [UpdateMultiplexResponse] -> ShowS
show :: UpdateMultiplexResponse -> String
$cshow :: UpdateMultiplexResponse -> String
showsPrec :: Int -> UpdateMultiplexResponse -> ShowS
$cshowsPrec :: Int -> UpdateMultiplexResponse -> ShowS
Prelude.Show, forall x. Rep UpdateMultiplexResponse x -> UpdateMultiplexResponse
forall x. UpdateMultiplexResponse -> Rep UpdateMultiplexResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateMultiplexResponse x -> UpdateMultiplexResponse
$cfrom :: forall x. UpdateMultiplexResponse -> Rep UpdateMultiplexResponse x
Prelude.Generic)
newUpdateMultiplexResponse ::
Prelude.Int ->
UpdateMultiplexResponse
newUpdateMultiplexResponse :: Int -> UpdateMultiplexResponse
newUpdateMultiplexResponse Int
pHttpStatus_ =
UpdateMultiplexResponse'
{ $sel:multiplex:UpdateMultiplexResponse' :: Maybe Multiplex
multiplex =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateMultiplexResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateMultiplexResponse_multiplex :: Lens.Lens' UpdateMultiplexResponse (Prelude.Maybe Multiplex)
updateMultiplexResponse_multiplex :: Lens' UpdateMultiplexResponse (Maybe Multiplex)
updateMultiplexResponse_multiplex = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMultiplexResponse' {Maybe Multiplex
multiplex :: Maybe Multiplex
$sel:multiplex:UpdateMultiplexResponse' :: UpdateMultiplexResponse -> Maybe Multiplex
multiplex} -> Maybe Multiplex
multiplex) (\s :: UpdateMultiplexResponse
s@UpdateMultiplexResponse' {} Maybe Multiplex
a -> UpdateMultiplexResponse
s {$sel:multiplex:UpdateMultiplexResponse' :: Maybe Multiplex
multiplex = Maybe Multiplex
a} :: UpdateMultiplexResponse)
updateMultiplexResponse_httpStatus :: Lens.Lens' UpdateMultiplexResponse Prelude.Int
updateMultiplexResponse_httpStatus :: Lens' UpdateMultiplexResponse Int
updateMultiplexResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMultiplexResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateMultiplexResponse' :: UpdateMultiplexResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateMultiplexResponse
s@UpdateMultiplexResponse' {} Int
a -> UpdateMultiplexResponse
s {$sel:httpStatus:UpdateMultiplexResponse' :: Int
httpStatus = Int
a} :: UpdateMultiplexResponse)
instance Prelude.NFData UpdateMultiplexResponse where
rnf :: UpdateMultiplexResponse -> ()
rnf UpdateMultiplexResponse' {Int
Maybe Multiplex
httpStatus :: Int
multiplex :: Maybe Multiplex
$sel:httpStatus:UpdateMultiplexResponse' :: UpdateMultiplexResponse -> Int
$sel:multiplex:UpdateMultiplexResponse' :: UpdateMultiplexResponse -> Maybe Multiplex
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Multiplex
multiplex
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus