{-# 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.CreateMultiplex
(
CreateMultiplex' (..),
newCreateMultiplex',
createMultiplex'_tags,
createMultiplex'_requestId,
createMultiplex'_multiplexSettings,
createMultiplex'_availabilityZones,
createMultiplex'_name,
CreateMultiplexResponse (..),
newCreateMultiplexResponse,
createMultiplexResponse_multiplex,
createMultiplexResponse_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 CreateMultiplex' = CreateMultiplex''
{
CreateMultiplex' -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CreateMultiplex' -> Text
requestId :: Prelude.Text,
CreateMultiplex' -> MultiplexSettings
multiplexSettings :: MultiplexSettings,
CreateMultiplex' -> [Text]
availabilityZones :: [Prelude.Text],
CreateMultiplex' -> Text
name :: Prelude.Text
}
deriving (CreateMultiplex' -> CreateMultiplex' -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateMultiplex' -> CreateMultiplex' -> Bool
$c/= :: CreateMultiplex' -> CreateMultiplex' -> Bool
== :: CreateMultiplex' -> CreateMultiplex' -> Bool
$c== :: CreateMultiplex' -> CreateMultiplex' -> Bool
Prelude.Eq, ReadPrec [CreateMultiplex']
ReadPrec CreateMultiplex'
Int -> ReadS CreateMultiplex'
ReadS [CreateMultiplex']
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateMultiplex']
$creadListPrec :: ReadPrec [CreateMultiplex']
readPrec :: ReadPrec CreateMultiplex'
$creadPrec :: ReadPrec CreateMultiplex'
readList :: ReadS [CreateMultiplex']
$creadList :: ReadS [CreateMultiplex']
readsPrec :: Int -> ReadS CreateMultiplex'
$creadsPrec :: Int -> ReadS CreateMultiplex'
Prelude.Read, Int -> CreateMultiplex' -> ShowS
[CreateMultiplex'] -> ShowS
CreateMultiplex' -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMultiplex'] -> ShowS
$cshowList :: [CreateMultiplex'] -> ShowS
show :: CreateMultiplex' -> String
$cshow :: CreateMultiplex' -> String
showsPrec :: Int -> CreateMultiplex' -> ShowS
$cshowsPrec :: Int -> CreateMultiplex' -> ShowS
Prelude.Show, forall x. Rep CreateMultiplex' x -> CreateMultiplex'
forall x. CreateMultiplex' -> Rep CreateMultiplex' x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateMultiplex' x -> CreateMultiplex'
$cfrom :: forall x. CreateMultiplex' -> Rep CreateMultiplex' x
Prelude.Generic)
newCreateMultiplex' ::
Prelude.Text ->
MultiplexSettings ->
Prelude.Text ->
CreateMultiplex'
newCreateMultiplex' :: Text -> MultiplexSettings -> Text -> CreateMultiplex'
newCreateMultiplex'
Text
pRequestId_
MultiplexSettings
pMultiplexSettings_
Text
pName_ =
CreateMultiplex''
{ $sel:tags:CreateMultiplex'' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
$sel:requestId:CreateMultiplex'' :: Text
requestId = Text
pRequestId_,
$sel:multiplexSettings:CreateMultiplex'' :: MultiplexSettings
multiplexSettings = MultiplexSettings
pMultiplexSettings_,
$sel:availabilityZones:CreateMultiplex'' :: [Text]
availabilityZones = forall a. Monoid a => a
Prelude.mempty,
$sel:name:CreateMultiplex'' :: Text
name = Text
pName_
}
createMultiplex'_tags :: Lens.Lens' CreateMultiplex' (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createMultiplex'_tags :: Lens' CreateMultiplex' (Maybe (HashMap Text Text))
createMultiplex'_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMultiplex'' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateMultiplex'' :: CreateMultiplex' -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateMultiplex'
s@CreateMultiplex'' {} Maybe (HashMap Text Text)
a -> CreateMultiplex'
s {$sel:tags:CreateMultiplex'' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateMultiplex') forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createMultiplex'_requestId :: Lens.Lens' CreateMultiplex' Prelude.Text
createMultiplex'_requestId :: Lens' CreateMultiplex' Text
createMultiplex'_requestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMultiplex'' {Text
requestId :: Text
$sel:requestId:CreateMultiplex'' :: CreateMultiplex' -> Text
requestId} -> Text
requestId) (\s :: CreateMultiplex'
s@CreateMultiplex'' {} Text
a -> CreateMultiplex'
s {$sel:requestId:CreateMultiplex'' :: Text
requestId = Text
a} :: CreateMultiplex')
createMultiplex'_multiplexSettings :: Lens.Lens' CreateMultiplex' MultiplexSettings
createMultiplex'_multiplexSettings :: Lens' CreateMultiplex' MultiplexSettings
createMultiplex'_multiplexSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMultiplex'' {MultiplexSettings
multiplexSettings :: MultiplexSettings
$sel:multiplexSettings:CreateMultiplex'' :: CreateMultiplex' -> MultiplexSettings
multiplexSettings} -> MultiplexSettings
multiplexSettings) (\s :: CreateMultiplex'
s@CreateMultiplex'' {} MultiplexSettings
a -> CreateMultiplex'
s {$sel:multiplexSettings:CreateMultiplex'' :: MultiplexSettings
multiplexSettings = MultiplexSettings
a} :: CreateMultiplex')
createMultiplex'_availabilityZones :: Lens.Lens' CreateMultiplex' [Prelude.Text]
createMultiplex'_availabilityZones :: Lens' CreateMultiplex' [Text]
createMultiplex'_availabilityZones = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMultiplex'' {[Text]
availabilityZones :: [Text]
$sel:availabilityZones:CreateMultiplex'' :: CreateMultiplex' -> [Text]
availabilityZones} -> [Text]
availabilityZones) (\s :: CreateMultiplex'
s@CreateMultiplex'' {} [Text]
a -> CreateMultiplex'
s {$sel:availabilityZones:CreateMultiplex'' :: [Text]
availabilityZones = [Text]
a} :: CreateMultiplex') forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createMultiplex'_name :: Lens.Lens' CreateMultiplex' Prelude.Text
createMultiplex'_name :: Lens' CreateMultiplex' Text
createMultiplex'_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMultiplex'' {Text
name :: Text
$sel:name:CreateMultiplex'' :: CreateMultiplex' -> Text
name} -> Text
name) (\s :: CreateMultiplex'
s@CreateMultiplex'' {} Text
a -> CreateMultiplex'
s {$sel:name:CreateMultiplex'' :: Text
name = Text
a} :: CreateMultiplex')
instance Core.AWSRequest CreateMultiplex' where
type
AWSResponse CreateMultiplex' =
CreateMultiplexResponse
request :: (Service -> Service)
-> CreateMultiplex' -> Request CreateMultiplex'
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 CreateMultiplex'
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateMultiplex')))
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 -> CreateMultiplexResponse
CreateMultiplexResponse'
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 CreateMultiplex' where
hashWithSalt :: Int -> CreateMultiplex' -> Int
hashWithSalt Int
_salt CreateMultiplex'' {[Text]
Maybe (HashMap Text Text)
Text
MultiplexSettings
name :: Text
availabilityZones :: [Text]
multiplexSettings :: MultiplexSettings
requestId :: Text
tags :: Maybe (HashMap Text Text)
$sel:name:CreateMultiplex'' :: CreateMultiplex' -> Text
$sel:availabilityZones:CreateMultiplex'' :: CreateMultiplex' -> [Text]
$sel:multiplexSettings:CreateMultiplex'' :: CreateMultiplex' -> MultiplexSettings
$sel:requestId:CreateMultiplex'' :: CreateMultiplex' -> Text
$sel:tags:CreateMultiplex'' :: CreateMultiplex' -> Maybe (HashMap Text Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
requestId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` MultiplexSettings
multiplexSettings
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
availabilityZones
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData CreateMultiplex' where
rnf :: CreateMultiplex' -> ()
rnf CreateMultiplex'' {[Text]
Maybe (HashMap Text Text)
Text
MultiplexSettings
name :: Text
availabilityZones :: [Text]
multiplexSettings :: MultiplexSettings
requestId :: Text
tags :: Maybe (HashMap Text Text)
$sel:name:CreateMultiplex'' :: CreateMultiplex' -> Text
$sel:availabilityZones:CreateMultiplex'' :: CreateMultiplex' -> [Text]
$sel:multiplexSettings:CreateMultiplex'' :: CreateMultiplex' -> MultiplexSettings
$sel:requestId:CreateMultiplex'' :: CreateMultiplex' -> Text
$sel:tags:CreateMultiplex'' :: CreateMultiplex' -> Maybe (HashMap Text Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
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 MultiplexSettings
multiplexSettings
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
availabilityZones
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.ToHeaders CreateMultiplex' where
toHeaders :: CreateMultiplex' -> 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 CreateMultiplex' where
toJSON :: CreateMultiplex' -> Value
toJSON CreateMultiplex'' {[Text]
Maybe (HashMap Text Text)
Text
MultiplexSettings
name :: Text
availabilityZones :: [Text]
multiplexSettings :: MultiplexSettings
requestId :: Text
tags :: Maybe (HashMap Text Text)
$sel:name:CreateMultiplex'' :: CreateMultiplex' -> Text
$sel:availabilityZones:CreateMultiplex'' :: CreateMultiplex' -> [Text]
$sel:multiplexSettings:CreateMultiplex'' :: CreateMultiplex' -> MultiplexSettings
$sel:requestId:CreateMultiplex'' :: CreateMultiplex' -> Text
$sel:tags:CreateMultiplex'' :: CreateMultiplex' -> Maybe (HashMap Text Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"tags" 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 (HashMap Text Text)
tags,
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
"multiplexSettings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= MultiplexSettings
multiplexSettings),
forall a. a -> Maybe a
Prelude.Just
(Key
"availabilityZones" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
availabilityZones),
forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
]
)
instance Data.ToPath CreateMultiplex' where
toPath :: CreateMultiplex' -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/prod/multiplexes"
instance Data.ToQuery CreateMultiplex' where
toQuery :: CreateMultiplex' -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateMultiplexResponse = CreateMultiplexResponse'
{
CreateMultiplexResponse -> Maybe Multiplex
multiplex :: Prelude.Maybe Multiplex,
CreateMultiplexResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateMultiplexResponse -> CreateMultiplexResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateMultiplexResponse -> CreateMultiplexResponse -> Bool
$c/= :: CreateMultiplexResponse -> CreateMultiplexResponse -> Bool
== :: CreateMultiplexResponse -> CreateMultiplexResponse -> Bool
$c== :: CreateMultiplexResponse -> CreateMultiplexResponse -> Bool
Prelude.Eq, ReadPrec [CreateMultiplexResponse]
ReadPrec CreateMultiplexResponse
Int -> ReadS CreateMultiplexResponse
ReadS [CreateMultiplexResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateMultiplexResponse]
$creadListPrec :: ReadPrec [CreateMultiplexResponse]
readPrec :: ReadPrec CreateMultiplexResponse
$creadPrec :: ReadPrec CreateMultiplexResponse
readList :: ReadS [CreateMultiplexResponse]
$creadList :: ReadS [CreateMultiplexResponse]
readsPrec :: Int -> ReadS CreateMultiplexResponse
$creadsPrec :: Int -> ReadS CreateMultiplexResponse
Prelude.Read, Int -> CreateMultiplexResponse -> ShowS
[CreateMultiplexResponse] -> ShowS
CreateMultiplexResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMultiplexResponse] -> ShowS
$cshowList :: [CreateMultiplexResponse] -> ShowS
show :: CreateMultiplexResponse -> String
$cshow :: CreateMultiplexResponse -> String
showsPrec :: Int -> CreateMultiplexResponse -> ShowS
$cshowsPrec :: Int -> CreateMultiplexResponse -> ShowS
Prelude.Show, forall x. Rep CreateMultiplexResponse x -> CreateMultiplexResponse
forall x. CreateMultiplexResponse -> Rep CreateMultiplexResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateMultiplexResponse x -> CreateMultiplexResponse
$cfrom :: forall x. CreateMultiplexResponse -> Rep CreateMultiplexResponse x
Prelude.Generic)
newCreateMultiplexResponse ::
Prelude.Int ->
CreateMultiplexResponse
newCreateMultiplexResponse :: Int -> CreateMultiplexResponse
newCreateMultiplexResponse Int
pHttpStatus_ =
CreateMultiplexResponse'
{ $sel:multiplex:CreateMultiplexResponse' :: Maybe Multiplex
multiplex =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateMultiplexResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createMultiplexResponse_multiplex :: Lens.Lens' CreateMultiplexResponse (Prelude.Maybe Multiplex)
createMultiplexResponse_multiplex :: Lens' CreateMultiplexResponse (Maybe Multiplex)
createMultiplexResponse_multiplex = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMultiplexResponse' {Maybe Multiplex
multiplex :: Maybe Multiplex
$sel:multiplex:CreateMultiplexResponse' :: CreateMultiplexResponse -> Maybe Multiplex
multiplex} -> Maybe Multiplex
multiplex) (\s :: CreateMultiplexResponse
s@CreateMultiplexResponse' {} Maybe Multiplex
a -> CreateMultiplexResponse
s {$sel:multiplex:CreateMultiplexResponse' :: Maybe Multiplex
multiplex = Maybe Multiplex
a} :: CreateMultiplexResponse)
createMultiplexResponse_httpStatus :: Lens.Lens' CreateMultiplexResponse Prelude.Int
createMultiplexResponse_httpStatus :: Lens' CreateMultiplexResponse Int
createMultiplexResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMultiplexResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateMultiplexResponse' :: CreateMultiplexResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateMultiplexResponse
s@CreateMultiplexResponse' {} Int
a -> CreateMultiplexResponse
s {$sel:httpStatus:CreateMultiplexResponse' :: Int
httpStatus = Int
a} :: CreateMultiplexResponse)
instance Prelude.NFData CreateMultiplexResponse where
rnf :: CreateMultiplexResponse -> ()
rnf CreateMultiplexResponse' {Int
Maybe Multiplex
httpStatus :: Int
multiplex :: Maybe Multiplex
$sel:httpStatus:CreateMultiplexResponse' :: CreateMultiplexResponse -> Int
$sel:multiplex:CreateMultiplexResponse' :: CreateMultiplexResponse -> 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