{-# 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.MediaLive.CreateMultiplex
-- 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)
--
-- Create a new multiplex.
module Amazonka.MediaLive.CreateMultiplex
  ( -- * Creating a Request
    CreateMultiplex' (..),
    newCreateMultiplex',

    -- * Request Lenses
    createMultiplex'_tags,
    createMultiplex'_requestId,
    createMultiplex'_multiplexSettings,
    createMultiplex'_availabilityZones,
    createMultiplex'_name,

    -- * Destructuring the Response
    CreateMultiplexResponse (..),
    newCreateMultiplexResponse,

    -- * Response Lenses
    createMultiplexResponse_multiplex,
    createMultiplexResponse_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

-- | A request to create a multiplex.
--
-- /See:/ 'newCreateMultiplex'' smart constructor.
data CreateMultiplex' = CreateMultiplex''
  { -- | A collection of key-value pairs.
    CreateMultiplex' -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Unique request ID. This prevents retries from creating multiple
    -- resources.
    CreateMultiplex' -> Text
requestId :: Prelude.Text,
    -- | Configuration for a multiplex event.
    CreateMultiplex' -> MultiplexSettings
multiplexSettings :: MultiplexSettings,
    -- | A list of availability zones for the multiplex. You must specify exactly
    -- two.
    CreateMultiplex' -> [Text]
availabilityZones :: [Prelude.Text],
    -- | Name of multiplex.
    CreateMultiplex' -> Text
name :: Prelude.Text
  }
  deriving (CreateMultiplex' -> CreateMultiplex' -> Bool
(CreateMultiplex' -> CreateMultiplex' -> Bool)
-> (CreateMultiplex' -> CreateMultiplex' -> Bool)
-> Eq CreateMultiplex'
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']
(Int -> ReadS CreateMultiplex')
-> ReadS [CreateMultiplex']
-> ReadPrec CreateMultiplex'
-> ReadPrec [CreateMultiplex']
-> Read 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
(Int -> CreateMultiplex' -> ShowS)
-> (CreateMultiplex' -> String)
-> ([CreateMultiplex'] -> ShowS)
-> Show CreateMultiplex'
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. CreateMultiplex' -> Rep CreateMultiplex' x)
-> (forall x. Rep CreateMultiplex' x -> CreateMultiplex')
-> Generic CreateMultiplex'
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)

-- |
-- Create a value of 'CreateMultiplex'' 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:
--
-- 'tags', 'createMultiplex'_tags' - A collection of key-value pairs.
--
-- 'requestId', 'createMultiplex'_requestId' - Unique request ID. This prevents retries from creating multiple
-- resources.
--
-- 'multiplexSettings', 'createMultiplex'_multiplexSettings' - Configuration for a multiplex event.
--
-- 'availabilityZones', 'createMultiplex'_availabilityZones' - A list of availability zones for the multiplex. You must specify exactly
-- two.
--
-- 'name', 'createMultiplex'_name' - Name of multiplex.
newCreateMultiplex' ::
  -- | 'requestId'
  Prelude.Text ->
  -- | 'multiplexSettings'
  MultiplexSettings ->
  -- | 'name'
  Prelude.Text ->
  CreateMultiplex'
newCreateMultiplex' :: Text -> MultiplexSettings -> Text -> CreateMultiplex'
newCreateMultiplex'
  Text
pRequestId_
  MultiplexSettings
pMultiplexSettings_
  Text
pName_ =
    CreateMultiplex'' :: Maybe (HashMap Text Text)
-> Text -> MultiplexSettings -> [Text] -> Text -> CreateMultiplex'
CreateMultiplex''
      { $sel:tags:CreateMultiplex'' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
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 = [Text]
forall a. Monoid a => a
Prelude.mempty,
        $sel:name:CreateMultiplex'' :: Text
name = Text
pName_
      }

-- | A collection of key-value pairs.
createMultiplex'_tags :: Lens.Lens' CreateMultiplex' (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createMultiplex'_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateMultiplex' -> f CreateMultiplex'
createMultiplex'_tags = (CreateMultiplex' -> Maybe (HashMap Text Text))
-> (CreateMultiplex'
    -> Maybe (HashMap Text Text) -> CreateMultiplex')
-> Lens
     CreateMultiplex'
     CreateMultiplex'
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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') ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateMultiplex' -> f CreateMultiplex')
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateMultiplex'
-> f CreateMultiplex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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 AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Unique request ID. This prevents retries from creating multiple
-- resources.
createMultiplex'_requestId :: Lens.Lens' CreateMultiplex' Prelude.Text
createMultiplex'_requestId :: (Text -> f Text) -> CreateMultiplex' -> f CreateMultiplex'
createMultiplex'_requestId = (CreateMultiplex' -> Text)
-> (CreateMultiplex' -> Text -> CreateMultiplex')
-> Lens CreateMultiplex' CreateMultiplex' Text Text
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')

-- | Configuration for a multiplex event.
createMultiplex'_multiplexSettings :: Lens.Lens' CreateMultiplex' MultiplexSettings
createMultiplex'_multiplexSettings :: (MultiplexSettings -> f MultiplexSettings)
-> CreateMultiplex' -> f CreateMultiplex'
createMultiplex'_multiplexSettings = (CreateMultiplex' -> MultiplexSettings)
-> (CreateMultiplex' -> MultiplexSettings -> CreateMultiplex')
-> Lens
     CreateMultiplex'
     CreateMultiplex'
     MultiplexSettings
     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')

-- | A list of availability zones for the multiplex. You must specify exactly
-- two.
createMultiplex'_availabilityZones :: Lens.Lens' CreateMultiplex' [Prelude.Text]
createMultiplex'_availabilityZones :: ([Text] -> f [Text]) -> CreateMultiplex' -> f CreateMultiplex'
createMultiplex'_availabilityZones = (CreateMultiplex' -> [Text])
-> (CreateMultiplex' -> [Text] -> CreateMultiplex')
-> Lens CreateMultiplex' CreateMultiplex' [Text] [Text]
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') (([Text] -> f [Text]) -> CreateMultiplex' -> f CreateMultiplex')
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> CreateMultiplex'
-> f CreateMultiplex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Name of multiplex.
createMultiplex'_name :: Lens.Lens' CreateMultiplex' Prelude.Text
createMultiplex'_name :: (Text -> f Text) -> CreateMultiplex' -> f CreateMultiplex'
createMultiplex'_name = (CreateMultiplex' -> Text)
-> (CreateMultiplex' -> Text -> CreateMultiplex')
-> Lens CreateMultiplex' CreateMultiplex' Text Text
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 :: CreateMultiplex' -> Request CreateMultiplex'
request = Service -> CreateMultiplex' -> Request CreateMultiplex'
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateMultiplex'
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateMultiplex')))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateMultiplex'))
-> Logger
-> Service
-> Proxy CreateMultiplex'
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateMultiplex')))
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 Multiplex -> Int -> CreateMultiplexResponse
CreateMultiplexResponse'
            (Maybe Multiplex -> Int -> CreateMultiplexResponse)
-> Either String (Maybe Multiplex)
-> Either String (Int -> CreateMultiplexResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Multiplex)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"multiplex")
            Either String (Int -> CreateMultiplexResponse)
-> Either String Int -> Either String CreateMultiplexResponse
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 CreateMultiplex'

instance Prelude.NFData CreateMultiplex'

instance Core.ToHeaders CreateMultiplex' where
  toHeaders :: CreateMultiplex' -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateMultiplex' -> 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 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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"requestId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
requestId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"multiplexSettings" Text -> MultiplexSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= MultiplexSettings
multiplexSettings),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"availabilityZones" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
availabilityZones),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
          ]
      )

instance Core.ToPath CreateMultiplex' where
  toPath :: CreateMultiplex' -> ByteString
toPath = ByteString -> CreateMultiplex' -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/prod/multiplexes"

instance Core.ToQuery CreateMultiplex' where
  toQuery :: CreateMultiplex' -> QueryString
toQuery = QueryString -> CreateMultiplex' -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | Placeholder documentation for CreateMultiplexResponse
--
-- /See:/ 'newCreateMultiplexResponse' smart constructor.
data CreateMultiplexResponse = CreateMultiplexResponse'
  { -- | The newly created multiplex.
    CreateMultiplexResponse -> Maybe Multiplex
multiplex :: Prelude.Maybe Multiplex,
    -- | The response's http status code.
    CreateMultiplexResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateMultiplexResponse -> CreateMultiplexResponse -> Bool
(CreateMultiplexResponse -> CreateMultiplexResponse -> Bool)
-> (CreateMultiplexResponse -> CreateMultiplexResponse -> Bool)
-> Eq CreateMultiplexResponse
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]
(Int -> ReadS CreateMultiplexResponse)
-> ReadS [CreateMultiplexResponse]
-> ReadPrec CreateMultiplexResponse
-> ReadPrec [CreateMultiplexResponse]
-> Read 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
(Int -> CreateMultiplexResponse -> ShowS)
-> (CreateMultiplexResponse -> String)
-> ([CreateMultiplexResponse] -> ShowS)
-> Show CreateMultiplexResponse
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.
 CreateMultiplexResponse -> Rep CreateMultiplexResponse x)
-> (forall x.
    Rep CreateMultiplexResponse x -> CreateMultiplexResponse)
-> Generic CreateMultiplexResponse
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)

-- |
-- Create a value of 'CreateMultiplexResponse' 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:
--
-- 'multiplex', 'createMultiplexResponse_multiplex' - The newly created multiplex.
--
-- 'httpStatus', 'createMultiplexResponse_httpStatus' - The response's http status code.
newCreateMultiplexResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateMultiplexResponse
newCreateMultiplexResponse :: Int -> CreateMultiplexResponse
newCreateMultiplexResponse Int
pHttpStatus_ =
  CreateMultiplexResponse' :: Maybe Multiplex -> Int -> CreateMultiplexResponse
CreateMultiplexResponse'
    { $sel:multiplex:CreateMultiplexResponse' :: Maybe Multiplex
multiplex =
        Maybe Multiplex
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateMultiplexResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The newly created multiplex.
createMultiplexResponse_multiplex :: Lens.Lens' CreateMultiplexResponse (Prelude.Maybe Multiplex)
createMultiplexResponse_multiplex :: (Maybe Multiplex -> f (Maybe Multiplex))
-> CreateMultiplexResponse -> f CreateMultiplexResponse
createMultiplexResponse_multiplex = (CreateMultiplexResponse -> Maybe Multiplex)
-> (CreateMultiplexResponse
    -> Maybe Multiplex -> CreateMultiplexResponse)
-> Lens
     CreateMultiplexResponse
     CreateMultiplexResponse
     (Maybe Multiplex)
     (Maybe 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)

-- | The response's http status code.
createMultiplexResponse_httpStatus :: Lens.Lens' CreateMultiplexResponse Prelude.Int
createMultiplexResponse_httpStatus :: (Int -> f Int)
-> CreateMultiplexResponse -> f CreateMultiplexResponse
createMultiplexResponse_httpStatus = (CreateMultiplexResponse -> Int)
-> (CreateMultiplexResponse -> Int -> CreateMultiplexResponse)
-> Lens CreateMultiplexResponse CreateMultiplexResponse Int Int
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