{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.InputDestinationRequest
-- 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)
module Amazonka.MediaLive.Types.InputDestinationRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Endpoint settings for a PUSH type input.
--
-- /See:/ 'newInputDestinationRequest' smart constructor.
data InputDestinationRequest = InputDestinationRequest'
  { -- | A unique name for the location the RTMP stream is being pushed to.
    InputDestinationRequest -> Maybe Text
streamName :: Prelude.Maybe Prelude.Text
  }
  deriving (InputDestinationRequest -> InputDestinationRequest -> Bool
(InputDestinationRequest -> InputDestinationRequest -> Bool)
-> (InputDestinationRequest -> InputDestinationRequest -> Bool)
-> Eq InputDestinationRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputDestinationRequest -> InputDestinationRequest -> Bool
$c/= :: InputDestinationRequest -> InputDestinationRequest -> Bool
== :: InputDestinationRequest -> InputDestinationRequest -> Bool
$c== :: InputDestinationRequest -> InputDestinationRequest -> Bool
Prelude.Eq, ReadPrec [InputDestinationRequest]
ReadPrec InputDestinationRequest
Int -> ReadS InputDestinationRequest
ReadS [InputDestinationRequest]
(Int -> ReadS InputDestinationRequest)
-> ReadS [InputDestinationRequest]
-> ReadPrec InputDestinationRequest
-> ReadPrec [InputDestinationRequest]
-> Read InputDestinationRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputDestinationRequest]
$creadListPrec :: ReadPrec [InputDestinationRequest]
readPrec :: ReadPrec InputDestinationRequest
$creadPrec :: ReadPrec InputDestinationRequest
readList :: ReadS [InputDestinationRequest]
$creadList :: ReadS [InputDestinationRequest]
readsPrec :: Int -> ReadS InputDestinationRequest
$creadsPrec :: Int -> ReadS InputDestinationRequest
Prelude.Read, Int -> InputDestinationRequest -> ShowS
[InputDestinationRequest] -> ShowS
InputDestinationRequest -> String
(Int -> InputDestinationRequest -> ShowS)
-> (InputDestinationRequest -> String)
-> ([InputDestinationRequest] -> ShowS)
-> Show InputDestinationRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputDestinationRequest] -> ShowS
$cshowList :: [InputDestinationRequest] -> ShowS
show :: InputDestinationRequest -> String
$cshow :: InputDestinationRequest -> String
showsPrec :: Int -> InputDestinationRequest -> ShowS
$cshowsPrec :: Int -> InputDestinationRequest -> ShowS
Prelude.Show, (forall x.
 InputDestinationRequest -> Rep InputDestinationRequest x)
-> (forall x.
    Rep InputDestinationRequest x -> InputDestinationRequest)
-> Generic InputDestinationRequest
forall x. Rep InputDestinationRequest x -> InputDestinationRequest
forall x. InputDestinationRequest -> Rep InputDestinationRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputDestinationRequest x -> InputDestinationRequest
$cfrom :: forall x. InputDestinationRequest -> Rep InputDestinationRequest x
Prelude.Generic)

-- |
-- Create a value of 'InputDestinationRequest' 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:
--
-- 'streamName', 'inputDestinationRequest_streamName' - A unique name for the location the RTMP stream is being pushed to.
newInputDestinationRequest ::
  InputDestinationRequest
newInputDestinationRequest :: InputDestinationRequest
newInputDestinationRequest =
  InputDestinationRequest' :: Maybe Text -> InputDestinationRequest
InputDestinationRequest'
    { $sel:streamName:InputDestinationRequest' :: Maybe Text
streamName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A unique name for the location the RTMP stream is being pushed to.
inputDestinationRequest_streamName :: Lens.Lens' InputDestinationRequest (Prelude.Maybe Prelude.Text)
inputDestinationRequest_streamName :: (Maybe Text -> f (Maybe Text))
-> InputDestinationRequest -> f InputDestinationRequest
inputDestinationRequest_streamName = (InputDestinationRequest -> Maybe Text)
-> (InputDestinationRequest
    -> Maybe Text -> InputDestinationRequest)
-> Lens
     InputDestinationRequest
     InputDestinationRequest
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputDestinationRequest' {Maybe Text
streamName :: Maybe Text
$sel:streamName:InputDestinationRequest' :: InputDestinationRequest -> Maybe Text
streamName} -> Maybe Text
streamName) (\s :: InputDestinationRequest
s@InputDestinationRequest' {} Maybe Text
a -> InputDestinationRequest
s {$sel:streamName:InputDestinationRequest' :: Maybe Text
streamName = Maybe Text
a} :: InputDestinationRequest)

instance Prelude.Hashable InputDestinationRequest

instance Prelude.NFData InputDestinationRequest

instance Core.ToJSON InputDestinationRequest where
  toJSON :: InputDestinationRequest -> Value
toJSON InputDestinationRequest' {Maybe Text
streamName :: Maybe Text
$sel:streamName:InputDestinationRequest' :: InputDestinationRequest -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"streamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
streamName]
      )