{-# 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.StartMultiplex
-- 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)
--
-- Start (run) the multiplex. Starting the multiplex does not start the
-- channels. You must explicitly start each channel.
module Amazonka.MediaLive.StartMultiplex
  ( -- * Creating a Request
    StartMultiplex (..),
    newStartMultiplex,

    -- * Request Lenses
    startMultiplex_multiplexId,

    -- * Destructuring the Response
    StartMultiplexResponse (..),
    newStartMultiplexResponse,

    -- * Response Lenses
    startMultiplexResponse_state,
    startMultiplexResponse_arn,
    startMultiplexResponse_pipelinesRunningCount,
    startMultiplexResponse_availabilityZones,
    startMultiplexResponse_programCount,
    startMultiplexResponse_destinations,
    startMultiplexResponse_name,
    startMultiplexResponse_id,
    startMultiplexResponse_multiplexSettings,
    startMultiplexResponse_tags,
    startMultiplexResponse_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

-- | Placeholder documentation for StartMultiplexRequest
--
-- /See:/ 'newStartMultiplex' smart constructor.
data StartMultiplex = StartMultiplex'
  { -- | The ID of the multiplex.
    StartMultiplex -> Text
multiplexId :: Prelude.Text
  }
  deriving (StartMultiplex -> StartMultiplex -> Bool
(StartMultiplex -> StartMultiplex -> Bool)
-> (StartMultiplex -> StartMultiplex -> Bool) -> Eq StartMultiplex
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartMultiplex -> StartMultiplex -> Bool
$c/= :: StartMultiplex -> StartMultiplex -> Bool
== :: StartMultiplex -> StartMultiplex -> Bool
$c== :: StartMultiplex -> StartMultiplex -> Bool
Prelude.Eq, ReadPrec [StartMultiplex]
ReadPrec StartMultiplex
Int -> ReadS StartMultiplex
ReadS [StartMultiplex]
(Int -> ReadS StartMultiplex)
-> ReadS [StartMultiplex]
-> ReadPrec StartMultiplex
-> ReadPrec [StartMultiplex]
-> Read StartMultiplex
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartMultiplex]
$creadListPrec :: ReadPrec [StartMultiplex]
readPrec :: ReadPrec StartMultiplex
$creadPrec :: ReadPrec StartMultiplex
readList :: ReadS [StartMultiplex]
$creadList :: ReadS [StartMultiplex]
readsPrec :: Int -> ReadS StartMultiplex
$creadsPrec :: Int -> ReadS StartMultiplex
Prelude.Read, Int -> StartMultiplex -> ShowS
[StartMultiplex] -> ShowS
StartMultiplex -> String
(Int -> StartMultiplex -> ShowS)
-> (StartMultiplex -> String)
-> ([StartMultiplex] -> ShowS)
-> Show StartMultiplex
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartMultiplex] -> ShowS
$cshowList :: [StartMultiplex] -> ShowS
show :: StartMultiplex -> String
$cshow :: StartMultiplex -> String
showsPrec :: Int -> StartMultiplex -> ShowS
$cshowsPrec :: Int -> StartMultiplex -> ShowS
Prelude.Show, (forall x. StartMultiplex -> Rep StartMultiplex x)
-> (forall x. Rep StartMultiplex x -> StartMultiplex)
-> Generic StartMultiplex
forall x. Rep StartMultiplex x -> StartMultiplex
forall x. StartMultiplex -> Rep StartMultiplex x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartMultiplex x -> StartMultiplex
$cfrom :: forall x. StartMultiplex -> Rep StartMultiplex x
Prelude.Generic)

-- |
-- Create a value of 'StartMultiplex' 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:
--
-- 'multiplexId', 'startMultiplex_multiplexId' - The ID of the multiplex.
newStartMultiplex ::
  -- | 'multiplexId'
  Prelude.Text ->
  StartMultiplex
newStartMultiplex :: Text -> StartMultiplex
newStartMultiplex Text
pMultiplexId_ =
  StartMultiplex' :: Text -> StartMultiplex
StartMultiplex' {$sel:multiplexId:StartMultiplex' :: Text
multiplexId = Text
pMultiplexId_}

-- | The ID of the multiplex.
startMultiplex_multiplexId :: Lens.Lens' StartMultiplex Prelude.Text
startMultiplex_multiplexId :: (Text -> f Text) -> StartMultiplex -> f StartMultiplex
startMultiplex_multiplexId = (StartMultiplex -> Text)
-> (StartMultiplex -> Text -> StartMultiplex)
-> Lens StartMultiplex StartMultiplex Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMultiplex' {Text
multiplexId :: Text
$sel:multiplexId:StartMultiplex' :: StartMultiplex -> Text
multiplexId} -> Text
multiplexId) (\s :: StartMultiplex
s@StartMultiplex' {} Text
a -> StartMultiplex
s {$sel:multiplexId:StartMultiplex' :: Text
multiplexId = Text
a} :: StartMultiplex)

instance Core.AWSRequest StartMultiplex where
  type
    AWSResponse StartMultiplex =
      StartMultiplexResponse
  request :: StartMultiplex -> Request StartMultiplex
request = Service -> StartMultiplex -> Request StartMultiplex
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy StartMultiplex
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartMultiplex)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse StartMultiplex))
-> Logger
-> Service
-> Proxy StartMultiplex
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartMultiplex)))
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 MultiplexState
-> Maybe Text
-> Maybe Int
-> Maybe [Text]
-> Maybe Int
-> Maybe [MultiplexOutputDestination]
-> Maybe Text
-> Maybe Text
-> Maybe MultiplexSettings
-> Maybe (HashMap Text Text)
-> Int
-> StartMultiplexResponse
StartMultiplexResponse'
            (Maybe MultiplexState
 -> Maybe Text
 -> Maybe Int
 -> Maybe [Text]
 -> Maybe Int
 -> Maybe [MultiplexOutputDestination]
 -> Maybe Text
 -> Maybe Text
 -> Maybe MultiplexSettings
 -> Maybe (HashMap Text Text)
 -> Int
 -> StartMultiplexResponse)
-> Either String (Maybe MultiplexState)
-> Either
     String
     (Maybe Text
      -> Maybe Int
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe [MultiplexOutputDestination]
      -> Maybe Text
      -> Maybe Text
      -> Maybe MultiplexSettings
      -> Maybe (HashMap Text Text)
      -> Int
      -> StartMultiplexResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe MultiplexState)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"state")
            Either
  String
  (Maybe Text
   -> Maybe Int
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe [MultiplexOutputDestination]
   -> Maybe Text
   -> Maybe Text
   -> Maybe MultiplexSettings
   -> Maybe (HashMap Text Text)
   -> Int
   -> StartMultiplexResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Int
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe [MultiplexOutputDestination]
      -> Maybe Text
      -> Maybe Text
      -> Maybe MultiplexSettings
      -> Maybe (HashMap Text Text)
      -> Int
      -> StartMultiplexResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"arn")
            Either
  String
  (Maybe Int
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe [MultiplexOutputDestination]
   -> Maybe Text
   -> Maybe Text
   -> Maybe MultiplexSettings
   -> Maybe (HashMap Text Text)
   -> Int
   -> StartMultiplexResponse)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe [Text]
      -> Maybe Int
      -> Maybe [MultiplexOutputDestination]
      -> Maybe Text
      -> Maybe Text
      -> Maybe MultiplexSettings
      -> Maybe (HashMap Text Text)
      -> Int
      -> StartMultiplexResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Int)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"pipelinesRunningCount")
            Either
  String
  (Maybe [Text]
   -> Maybe Int
   -> Maybe [MultiplexOutputDestination]
   -> Maybe Text
   -> Maybe Text
   -> Maybe MultiplexSettings
   -> Maybe (HashMap Text Text)
   -> Int
   -> StartMultiplexResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Int
      -> Maybe [MultiplexOutputDestination]
      -> Maybe Text
      -> Maybe Text
      -> Maybe MultiplexSettings
      -> Maybe (HashMap Text Text)
      -> Int
      -> StartMultiplexResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"availabilityZones"
                            Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Int
   -> Maybe [MultiplexOutputDestination]
   -> Maybe Text
   -> Maybe Text
   -> Maybe MultiplexSettings
   -> Maybe (HashMap Text Text)
   -> Int
   -> StartMultiplexResponse)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe [MultiplexOutputDestination]
      -> Maybe Text
      -> Maybe Text
      -> Maybe MultiplexSettings
      -> Maybe (HashMap Text Text)
      -> Int
      -> StartMultiplexResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Int)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"programCount")
            Either
  String
  (Maybe [MultiplexOutputDestination]
   -> Maybe Text
   -> Maybe Text
   -> Maybe MultiplexSettings
   -> Maybe (HashMap Text Text)
   -> Int
   -> StartMultiplexResponse)
-> Either String (Maybe [MultiplexOutputDestination])
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe MultiplexSettings
      -> Maybe (HashMap Text Text)
      -> Int
      -> StartMultiplexResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Either String (Maybe (Maybe [MultiplexOutputDestination]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"destinations" Either String (Maybe (Maybe [MultiplexOutputDestination]))
-> Maybe [MultiplexOutputDestination]
-> Either String (Maybe [MultiplexOutputDestination])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [MultiplexOutputDestination]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe MultiplexSettings
   -> Maybe (HashMap Text Text)
   -> Int
   -> StartMultiplexResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe MultiplexSettings
      -> Maybe (HashMap Text Text)
      -> Int
      -> StartMultiplexResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"name")
            Either
  String
  (Maybe Text
   -> Maybe MultiplexSettings
   -> Maybe (HashMap Text Text)
   -> Int
   -> StartMultiplexResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe MultiplexSettings
      -> Maybe (HashMap Text Text) -> Int -> StartMultiplexResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"id")
            Either
  String
  (Maybe MultiplexSettings
   -> Maybe (HashMap Text Text) -> Int -> StartMultiplexResponse)
-> Either String (Maybe MultiplexSettings)
-> Either
     String (Maybe (HashMap Text Text) -> Int -> StartMultiplexResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe MultiplexSettings)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"multiplexSettings")
            Either
  String (Maybe (HashMap Text Text) -> Int -> StartMultiplexResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> StartMultiplexResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> StartMultiplexResponse)
-> Either String Int -> Either String StartMultiplexResponse
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 StartMultiplex

instance Prelude.NFData StartMultiplex

instance Core.ToHeaders StartMultiplex where
  toHeaders :: StartMultiplex -> ResponseHeaders
toHeaders =
    ResponseHeaders -> StartMultiplex -> 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 StartMultiplex where
  toJSON :: StartMultiplex -> Value
toJSON = Value -> StartMultiplex -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)

instance Core.ToPath StartMultiplex where
  toPath :: StartMultiplex -> ByteString
toPath StartMultiplex' {Text
multiplexId :: Text
$sel:multiplexId:StartMultiplex' :: StartMultiplex -> Text
..} =
    [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
"/start"
      ]

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

-- | Placeholder documentation for StartMultiplexResponse
--
-- /See:/ 'newStartMultiplexResponse' smart constructor.
data StartMultiplexResponse = StartMultiplexResponse'
  { -- | The current state of the multiplex.
    StartMultiplexResponse -> Maybe MultiplexState
state :: Prelude.Maybe MultiplexState,
    -- | The unique arn of the multiplex.
    StartMultiplexResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The number of currently healthy pipelines.
    StartMultiplexResponse -> Maybe Int
pipelinesRunningCount :: Prelude.Maybe Prelude.Int,
    -- | A list of availability zones for the multiplex.
    StartMultiplexResponse -> Maybe [Text]
availabilityZones :: Prelude.Maybe [Prelude.Text],
    -- | The number of programs in the multiplex.
    StartMultiplexResponse -> Maybe Int
programCount :: Prelude.Maybe Prelude.Int,
    -- | A list of the multiplex output destinations.
    StartMultiplexResponse -> Maybe [MultiplexOutputDestination]
destinations :: Prelude.Maybe [MultiplexOutputDestination],
    -- | The name of the multiplex.
    StartMultiplexResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The unique id of the multiplex.
    StartMultiplexResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | Configuration for a multiplex event.
    StartMultiplexResponse -> Maybe MultiplexSettings
multiplexSettings :: Prelude.Maybe MultiplexSettings,
    -- | A collection of key-value pairs.
    StartMultiplexResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    StartMultiplexResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (StartMultiplexResponse -> StartMultiplexResponse -> Bool
(StartMultiplexResponse -> StartMultiplexResponse -> Bool)
-> (StartMultiplexResponse -> StartMultiplexResponse -> Bool)
-> Eq StartMultiplexResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartMultiplexResponse -> StartMultiplexResponse -> Bool
$c/= :: StartMultiplexResponse -> StartMultiplexResponse -> Bool
== :: StartMultiplexResponse -> StartMultiplexResponse -> Bool
$c== :: StartMultiplexResponse -> StartMultiplexResponse -> Bool
Prelude.Eq, ReadPrec [StartMultiplexResponse]
ReadPrec StartMultiplexResponse
Int -> ReadS StartMultiplexResponse
ReadS [StartMultiplexResponse]
(Int -> ReadS StartMultiplexResponse)
-> ReadS [StartMultiplexResponse]
-> ReadPrec StartMultiplexResponse
-> ReadPrec [StartMultiplexResponse]
-> Read StartMultiplexResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartMultiplexResponse]
$creadListPrec :: ReadPrec [StartMultiplexResponse]
readPrec :: ReadPrec StartMultiplexResponse
$creadPrec :: ReadPrec StartMultiplexResponse
readList :: ReadS [StartMultiplexResponse]
$creadList :: ReadS [StartMultiplexResponse]
readsPrec :: Int -> ReadS StartMultiplexResponse
$creadsPrec :: Int -> ReadS StartMultiplexResponse
Prelude.Read, Int -> StartMultiplexResponse -> ShowS
[StartMultiplexResponse] -> ShowS
StartMultiplexResponse -> String
(Int -> StartMultiplexResponse -> ShowS)
-> (StartMultiplexResponse -> String)
-> ([StartMultiplexResponse] -> ShowS)
-> Show StartMultiplexResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartMultiplexResponse] -> ShowS
$cshowList :: [StartMultiplexResponse] -> ShowS
show :: StartMultiplexResponse -> String
$cshow :: StartMultiplexResponse -> String
showsPrec :: Int -> StartMultiplexResponse -> ShowS
$cshowsPrec :: Int -> StartMultiplexResponse -> ShowS
Prelude.Show, (forall x. StartMultiplexResponse -> Rep StartMultiplexResponse x)
-> (forall x.
    Rep StartMultiplexResponse x -> StartMultiplexResponse)
-> Generic StartMultiplexResponse
forall x. Rep StartMultiplexResponse x -> StartMultiplexResponse
forall x. StartMultiplexResponse -> Rep StartMultiplexResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartMultiplexResponse x -> StartMultiplexResponse
$cfrom :: forall x. StartMultiplexResponse -> Rep StartMultiplexResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartMultiplexResponse' 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:
--
-- 'state', 'startMultiplexResponse_state' - The current state of the multiplex.
--
-- 'arn', 'startMultiplexResponse_arn' - The unique arn of the multiplex.
--
-- 'pipelinesRunningCount', 'startMultiplexResponse_pipelinesRunningCount' - The number of currently healthy pipelines.
--
-- 'availabilityZones', 'startMultiplexResponse_availabilityZones' - A list of availability zones for the multiplex.
--
-- 'programCount', 'startMultiplexResponse_programCount' - The number of programs in the multiplex.
--
-- 'destinations', 'startMultiplexResponse_destinations' - A list of the multiplex output destinations.
--
-- 'name', 'startMultiplexResponse_name' - The name of the multiplex.
--
-- 'id', 'startMultiplexResponse_id' - The unique id of the multiplex.
--
-- 'multiplexSettings', 'startMultiplexResponse_multiplexSettings' - Configuration for a multiplex event.
--
-- 'tags', 'startMultiplexResponse_tags' - A collection of key-value pairs.
--
-- 'httpStatus', 'startMultiplexResponse_httpStatus' - The response's http status code.
newStartMultiplexResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartMultiplexResponse
newStartMultiplexResponse :: Int -> StartMultiplexResponse
newStartMultiplexResponse Int
pHttpStatus_ =
  StartMultiplexResponse' :: Maybe MultiplexState
-> Maybe Text
-> Maybe Int
-> Maybe [Text]
-> Maybe Int
-> Maybe [MultiplexOutputDestination]
-> Maybe Text
-> Maybe Text
-> Maybe MultiplexSettings
-> Maybe (HashMap Text Text)
-> Int
-> StartMultiplexResponse
StartMultiplexResponse'
    { $sel:state:StartMultiplexResponse' :: Maybe MultiplexState
state = Maybe MultiplexState
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:StartMultiplexResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pipelinesRunningCount:StartMultiplexResponse' :: Maybe Int
pipelinesRunningCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:availabilityZones:StartMultiplexResponse' :: Maybe [Text]
availabilityZones = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:programCount:StartMultiplexResponse' :: Maybe Int
programCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:destinations:StartMultiplexResponse' :: Maybe [MultiplexOutputDestination]
destinations = Maybe [MultiplexOutputDestination]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:StartMultiplexResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:StartMultiplexResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:multiplexSettings:StartMultiplexResponse' :: Maybe MultiplexSettings
multiplexSettings = Maybe MultiplexSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:StartMultiplexResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartMultiplexResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The current state of the multiplex.
startMultiplexResponse_state :: Lens.Lens' StartMultiplexResponse (Prelude.Maybe MultiplexState)
startMultiplexResponse_state :: (Maybe MultiplexState -> f (Maybe MultiplexState))
-> StartMultiplexResponse -> f StartMultiplexResponse
startMultiplexResponse_state = (StartMultiplexResponse -> Maybe MultiplexState)
-> (StartMultiplexResponse
    -> Maybe MultiplexState -> StartMultiplexResponse)
-> Lens
     StartMultiplexResponse
     StartMultiplexResponse
     (Maybe MultiplexState)
     (Maybe MultiplexState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMultiplexResponse' {Maybe MultiplexState
state :: Maybe MultiplexState
$sel:state:StartMultiplexResponse' :: StartMultiplexResponse -> Maybe MultiplexState
state} -> Maybe MultiplexState
state) (\s :: StartMultiplexResponse
s@StartMultiplexResponse' {} Maybe MultiplexState
a -> StartMultiplexResponse
s {$sel:state:StartMultiplexResponse' :: Maybe MultiplexState
state = Maybe MultiplexState
a} :: StartMultiplexResponse)

-- | The unique arn of the multiplex.
startMultiplexResponse_arn :: Lens.Lens' StartMultiplexResponse (Prelude.Maybe Prelude.Text)
startMultiplexResponse_arn :: (Maybe Text -> f (Maybe Text))
-> StartMultiplexResponse -> f StartMultiplexResponse
startMultiplexResponse_arn = (StartMultiplexResponse -> Maybe Text)
-> (StartMultiplexResponse -> Maybe Text -> StartMultiplexResponse)
-> Lens
     StartMultiplexResponse
     StartMultiplexResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMultiplexResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:StartMultiplexResponse' :: StartMultiplexResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: StartMultiplexResponse
s@StartMultiplexResponse' {} Maybe Text
a -> StartMultiplexResponse
s {$sel:arn:StartMultiplexResponse' :: Maybe Text
arn = Maybe Text
a} :: StartMultiplexResponse)

-- | The number of currently healthy pipelines.
startMultiplexResponse_pipelinesRunningCount :: Lens.Lens' StartMultiplexResponse (Prelude.Maybe Prelude.Int)
startMultiplexResponse_pipelinesRunningCount :: (Maybe Int -> f (Maybe Int))
-> StartMultiplexResponse -> f StartMultiplexResponse
startMultiplexResponse_pipelinesRunningCount = (StartMultiplexResponse -> Maybe Int)
-> (StartMultiplexResponse -> Maybe Int -> StartMultiplexResponse)
-> Lens
     StartMultiplexResponse
     StartMultiplexResponse
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMultiplexResponse' {Maybe Int
pipelinesRunningCount :: Maybe Int
$sel:pipelinesRunningCount:StartMultiplexResponse' :: StartMultiplexResponse -> Maybe Int
pipelinesRunningCount} -> Maybe Int
pipelinesRunningCount) (\s :: StartMultiplexResponse
s@StartMultiplexResponse' {} Maybe Int
a -> StartMultiplexResponse
s {$sel:pipelinesRunningCount:StartMultiplexResponse' :: Maybe Int
pipelinesRunningCount = Maybe Int
a} :: StartMultiplexResponse)

-- | A list of availability zones for the multiplex.
startMultiplexResponse_availabilityZones :: Lens.Lens' StartMultiplexResponse (Prelude.Maybe [Prelude.Text])
startMultiplexResponse_availabilityZones :: (Maybe [Text] -> f (Maybe [Text]))
-> StartMultiplexResponse -> f StartMultiplexResponse
startMultiplexResponse_availabilityZones = (StartMultiplexResponse -> Maybe [Text])
-> (StartMultiplexResponse
    -> Maybe [Text] -> StartMultiplexResponse)
-> Lens
     StartMultiplexResponse
     StartMultiplexResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMultiplexResponse' {Maybe [Text]
availabilityZones :: Maybe [Text]
$sel:availabilityZones:StartMultiplexResponse' :: StartMultiplexResponse -> Maybe [Text]
availabilityZones} -> Maybe [Text]
availabilityZones) (\s :: StartMultiplexResponse
s@StartMultiplexResponse' {} Maybe [Text]
a -> StartMultiplexResponse
s {$sel:availabilityZones:StartMultiplexResponse' :: Maybe [Text]
availabilityZones = Maybe [Text]
a} :: StartMultiplexResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> StartMultiplexResponse -> f StartMultiplexResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> StartMultiplexResponse
-> f StartMultiplexResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The number of programs in the multiplex.
startMultiplexResponse_programCount :: Lens.Lens' StartMultiplexResponse (Prelude.Maybe Prelude.Int)
startMultiplexResponse_programCount :: (Maybe Int -> f (Maybe Int))
-> StartMultiplexResponse -> f StartMultiplexResponse
startMultiplexResponse_programCount = (StartMultiplexResponse -> Maybe Int)
-> (StartMultiplexResponse -> Maybe Int -> StartMultiplexResponse)
-> Lens
     StartMultiplexResponse
     StartMultiplexResponse
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMultiplexResponse' {Maybe Int
programCount :: Maybe Int
$sel:programCount:StartMultiplexResponse' :: StartMultiplexResponse -> Maybe Int
programCount} -> Maybe Int
programCount) (\s :: StartMultiplexResponse
s@StartMultiplexResponse' {} Maybe Int
a -> StartMultiplexResponse
s {$sel:programCount:StartMultiplexResponse' :: Maybe Int
programCount = Maybe Int
a} :: StartMultiplexResponse)

-- | A list of the multiplex output destinations.
startMultiplexResponse_destinations :: Lens.Lens' StartMultiplexResponse (Prelude.Maybe [MultiplexOutputDestination])
startMultiplexResponse_destinations :: (Maybe [MultiplexOutputDestination]
 -> f (Maybe [MultiplexOutputDestination]))
-> StartMultiplexResponse -> f StartMultiplexResponse
startMultiplexResponse_destinations = (StartMultiplexResponse -> Maybe [MultiplexOutputDestination])
-> (StartMultiplexResponse
    -> Maybe [MultiplexOutputDestination] -> StartMultiplexResponse)
-> Lens
     StartMultiplexResponse
     StartMultiplexResponse
     (Maybe [MultiplexOutputDestination])
     (Maybe [MultiplexOutputDestination])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMultiplexResponse' {Maybe [MultiplexOutputDestination]
destinations :: Maybe [MultiplexOutputDestination]
$sel:destinations:StartMultiplexResponse' :: StartMultiplexResponse -> Maybe [MultiplexOutputDestination]
destinations} -> Maybe [MultiplexOutputDestination]
destinations) (\s :: StartMultiplexResponse
s@StartMultiplexResponse' {} Maybe [MultiplexOutputDestination]
a -> StartMultiplexResponse
s {$sel:destinations:StartMultiplexResponse' :: Maybe [MultiplexOutputDestination]
destinations = Maybe [MultiplexOutputDestination]
a} :: StartMultiplexResponse) ((Maybe [MultiplexOutputDestination]
  -> f (Maybe [MultiplexOutputDestination]))
 -> StartMultiplexResponse -> f StartMultiplexResponse)
-> ((Maybe [MultiplexOutputDestination]
     -> f (Maybe [MultiplexOutputDestination]))
    -> Maybe [MultiplexOutputDestination]
    -> f (Maybe [MultiplexOutputDestination]))
-> (Maybe [MultiplexOutputDestination]
    -> f (Maybe [MultiplexOutputDestination]))
-> StartMultiplexResponse
-> f StartMultiplexResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MultiplexOutputDestination]
  [MultiplexOutputDestination]
  [MultiplexOutputDestination]
  [MultiplexOutputDestination]
-> Iso
     (Maybe [MultiplexOutputDestination])
     (Maybe [MultiplexOutputDestination])
     (Maybe [MultiplexOutputDestination])
     (Maybe [MultiplexOutputDestination])
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
  [MultiplexOutputDestination]
  [MultiplexOutputDestination]
  [MultiplexOutputDestination]
  [MultiplexOutputDestination]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the multiplex.
startMultiplexResponse_name :: Lens.Lens' StartMultiplexResponse (Prelude.Maybe Prelude.Text)
startMultiplexResponse_name :: (Maybe Text -> f (Maybe Text))
-> StartMultiplexResponse -> f StartMultiplexResponse
startMultiplexResponse_name = (StartMultiplexResponse -> Maybe Text)
-> (StartMultiplexResponse -> Maybe Text -> StartMultiplexResponse)
-> Lens
     StartMultiplexResponse
     StartMultiplexResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMultiplexResponse' {Maybe Text
name :: Maybe Text
$sel:name:StartMultiplexResponse' :: StartMultiplexResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: StartMultiplexResponse
s@StartMultiplexResponse' {} Maybe Text
a -> StartMultiplexResponse
s {$sel:name:StartMultiplexResponse' :: Maybe Text
name = Maybe Text
a} :: StartMultiplexResponse)

-- | The unique id of the multiplex.
startMultiplexResponse_id :: Lens.Lens' StartMultiplexResponse (Prelude.Maybe Prelude.Text)
startMultiplexResponse_id :: (Maybe Text -> f (Maybe Text))
-> StartMultiplexResponse -> f StartMultiplexResponse
startMultiplexResponse_id = (StartMultiplexResponse -> Maybe Text)
-> (StartMultiplexResponse -> Maybe Text -> StartMultiplexResponse)
-> Lens
     StartMultiplexResponse
     StartMultiplexResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMultiplexResponse' {Maybe Text
id :: Maybe Text
$sel:id:StartMultiplexResponse' :: StartMultiplexResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: StartMultiplexResponse
s@StartMultiplexResponse' {} Maybe Text
a -> StartMultiplexResponse
s {$sel:id:StartMultiplexResponse' :: Maybe Text
id = Maybe Text
a} :: StartMultiplexResponse)

-- | Configuration for a multiplex event.
startMultiplexResponse_multiplexSettings :: Lens.Lens' StartMultiplexResponse (Prelude.Maybe MultiplexSettings)
startMultiplexResponse_multiplexSettings :: (Maybe MultiplexSettings -> f (Maybe MultiplexSettings))
-> StartMultiplexResponse -> f StartMultiplexResponse
startMultiplexResponse_multiplexSettings = (StartMultiplexResponse -> Maybe MultiplexSettings)
-> (StartMultiplexResponse
    -> Maybe MultiplexSettings -> StartMultiplexResponse)
-> Lens
     StartMultiplexResponse
     StartMultiplexResponse
     (Maybe MultiplexSettings)
     (Maybe MultiplexSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMultiplexResponse' {Maybe MultiplexSettings
multiplexSettings :: Maybe MultiplexSettings
$sel:multiplexSettings:StartMultiplexResponse' :: StartMultiplexResponse -> Maybe MultiplexSettings
multiplexSettings} -> Maybe MultiplexSettings
multiplexSettings) (\s :: StartMultiplexResponse
s@StartMultiplexResponse' {} Maybe MultiplexSettings
a -> StartMultiplexResponse
s {$sel:multiplexSettings:StartMultiplexResponse' :: Maybe MultiplexSettings
multiplexSettings = Maybe MultiplexSettings
a} :: StartMultiplexResponse)

-- | A collection of key-value pairs.
startMultiplexResponse_tags :: Lens.Lens' StartMultiplexResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
startMultiplexResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> StartMultiplexResponse -> f StartMultiplexResponse
startMultiplexResponse_tags = (StartMultiplexResponse -> Maybe (HashMap Text Text))
-> (StartMultiplexResponse
    -> Maybe (HashMap Text Text) -> StartMultiplexResponse)
-> Lens
     StartMultiplexResponse
     StartMultiplexResponse
     (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 (\StartMultiplexResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:StartMultiplexResponse' :: StartMultiplexResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: StartMultiplexResponse
s@StartMultiplexResponse' {} Maybe (HashMap Text Text)
a -> StartMultiplexResponse
s {$sel:tags:StartMultiplexResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: StartMultiplexResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> StartMultiplexResponse -> f StartMultiplexResponse)
-> ((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)))
-> StartMultiplexResponse
-> f StartMultiplexResponse
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

-- | The response's http status code.
startMultiplexResponse_httpStatus :: Lens.Lens' StartMultiplexResponse Prelude.Int
startMultiplexResponse_httpStatus :: (Int -> f Int)
-> StartMultiplexResponse -> f StartMultiplexResponse
startMultiplexResponse_httpStatus = (StartMultiplexResponse -> Int)
-> (StartMultiplexResponse -> Int -> StartMultiplexResponse)
-> Lens StartMultiplexResponse StartMultiplexResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartMultiplexResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartMultiplexResponse' :: StartMultiplexResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartMultiplexResponse
s@StartMultiplexResponse' {} Int
a -> StartMultiplexResponse
s {$sel:httpStatus:StartMultiplexResponse' :: Int
httpStatus = Int
a} :: StartMultiplexResponse)

instance Prelude.NFData StartMultiplexResponse