{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaLive.Types.InputDestinationRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
    { $sel:streamName:InputDestinationRequest' :: Maybe Text
streamName =
        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 :: Lens' InputDestinationRequest (Maybe Text)
inputDestinationRequest_streamName = 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 where
  hashWithSalt :: Int -> InputDestinationRequest -> Int
hashWithSalt Int
_salt InputDestinationRequest' {Maybe Text
streamName :: Maybe Text
$sel:streamName:InputDestinationRequest' :: InputDestinationRequest -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
streamName

instance Prelude.NFData InputDestinationRequest where
  rnf :: InputDestinationRequest -> ()
rnf InputDestinationRequest' {Maybe Text
streamName :: Maybe Text
$sel:streamName:InputDestinationRequest' :: InputDestinationRequest -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
streamName

instance Data.ToJSON InputDestinationRequest where
  toJSON :: InputDestinationRequest -> Value
toJSON InputDestinationRequest' {Maybe Text
streamName :: Maybe Text
$sel:streamName:InputDestinationRequest' :: InputDestinationRequest -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"streamName" 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
streamName]
      )