{-# 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.InputDestination
-- 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.InputDestination where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.InputDestinationVpc
import qualified Amazonka.Prelude as Prelude

-- | The settings for a PUSH type input.
--
-- /See:/ 'newInputDestination' smart constructor.
data InputDestination = InputDestination'
  { -- | This represents the endpoint that the customer stream will be pushed to.
    InputDestination -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
    -- | The system-generated static IP address of endpoint. It remains fixed for
    -- the lifetime of the input.
    InputDestination -> Maybe Text
ip :: Prelude.Maybe Prelude.Text,
    InputDestination -> Maybe InputDestinationVpc
vpc :: Prelude.Maybe InputDestinationVpc,
    -- | The port number for the input.
    InputDestination -> Maybe Text
port :: Prelude.Maybe Prelude.Text
  }
  deriving (InputDestination -> InputDestination -> Bool
(InputDestination -> InputDestination -> Bool)
-> (InputDestination -> InputDestination -> Bool)
-> Eq InputDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputDestination -> InputDestination -> Bool
$c/= :: InputDestination -> InputDestination -> Bool
== :: InputDestination -> InputDestination -> Bool
$c== :: InputDestination -> InputDestination -> Bool
Prelude.Eq, ReadPrec [InputDestination]
ReadPrec InputDestination
Int -> ReadS InputDestination
ReadS [InputDestination]
(Int -> ReadS InputDestination)
-> ReadS [InputDestination]
-> ReadPrec InputDestination
-> ReadPrec [InputDestination]
-> Read InputDestination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputDestination]
$creadListPrec :: ReadPrec [InputDestination]
readPrec :: ReadPrec InputDestination
$creadPrec :: ReadPrec InputDestination
readList :: ReadS [InputDestination]
$creadList :: ReadS [InputDestination]
readsPrec :: Int -> ReadS InputDestination
$creadsPrec :: Int -> ReadS InputDestination
Prelude.Read, Int -> InputDestination -> ShowS
[InputDestination] -> ShowS
InputDestination -> String
(Int -> InputDestination -> ShowS)
-> (InputDestination -> String)
-> ([InputDestination] -> ShowS)
-> Show InputDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputDestination] -> ShowS
$cshowList :: [InputDestination] -> ShowS
show :: InputDestination -> String
$cshow :: InputDestination -> String
showsPrec :: Int -> InputDestination -> ShowS
$cshowsPrec :: Int -> InputDestination -> ShowS
Prelude.Show, (forall x. InputDestination -> Rep InputDestination x)
-> (forall x. Rep InputDestination x -> InputDestination)
-> Generic InputDestination
forall x. Rep InputDestination x -> InputDestination
forall x. InputDestination -> Rep InputDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputDestination x -> InputDestination
$cfrom :: forall x. InputDestination -> Rep InputDestination x
Prelude.Generic)

-- |
-- Create a value of 'InputDestination' 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:
--
-- 'url', 'inputDestination_url' - This represents the endpoint that the customer stream will be pushed to.
--
-- 'ip', 'inputDestination_ip' - The system-generated static IP address of endpoint. It remains fixed for
-- the lifetime of the input.
--
-- 'vpc', 'inputDestination_vpc' - Undocumented member.
--
-- 'port', 'inputDestination_port' - The port number for the input.
newInputDestination ::
  InputDestination
newInputDestination :: InputDestination
newInputDestination =
  InputDestination' :: Maybe Text
-> Maybe Text
-> Maybe InputDestinationVpc
-> Maybe Text
-> InputDestination
InputDestination'
    { $sel:url:InputDestination' :: Maybe Text
url = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ip:InputDestination' :: Maybe Text
ip = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpc:InputDestination' :: Maybe InputDestinationVpc
vpc = Maybe InputDestinationVpc
forall a. Maybe a
Prelude.Nothing,
      $sel:port:InputDestination' :: Maybe Text
port = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | This represents the endpoint that the customer stream will be pushed to.
inputDestination_url :: Lens.Lens' InputDestination (Prelude.Maybe Prelude.Text)
inputDestination_url :: (Maybe Text -> f (Maybe Text))
-> InputDestination -> f InputDestination
inputDestination_url = (InputDestination -> Maybe Text)
-> (InputDestination -> Maybe Text -> InputDestination)
-> Lens InputDestination InputDestination (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputDestination' {Maybe Text
url :: Maybe Text
$sel:url:InputDestination' :: InputDestination -> Maybe Text
url} -> Maybe Text
url) (\s :: InputDestination
s@InputDestination' {} Maybe Text
a -> InputDestination
s {$sel:url:InputDestination' :: Maybe Text
url = Maybe Text
a} :: InputDestination)

-- | The system-generated static IP address of endpoint. It remains fixed for
-- the lifetime of the input.
inputDestination_ip :: Lens.Lens' InputDestination (Prelude.Maybe Prelude.Text)
inputDestination_ip :: (Maybe Text -> f (Maybe Text))
-> InputDestination -> f InputDestination
inputDestination_ip = (InputDestination -> Maybe Text)
-> (InputDestination -> Maybe Text -> InputDestination)
-> Lens InputDestination InputDestination (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputDestination' {Maybe Text
ip :: Maybe Text
$sel:ip:InputDestination' :: InputDestination -> Maybe Text
ip} -> Maybe Text
ip) (\s :: InputDestination
s@InputDestination' {} Maybe Text
a -> InputDestination
s {$sel:ip:InputDestination' :: Maybe Text
ip = Maybe Text
a} :: InputDestination)

-- | Undocumented member.
inputDestination_vpc :: Lens.Lens' InputDestination (Prelude.Maybe InputDestinationVpc)
inputDestination_vpc :: (Maybe InputDestinationVpc -> f (Maybe InputDestinationVpc))
-> InputDestination -> f InputDestination
inputDestination_vpc = (InputDestination -> Maybe InputDestinationVpc)
-> (InputDestination
    -> Maybe InputDestinationVpc -> InputDestination)
-> Lens
     InputDestination
     InputDestination
     (Maybe InputDestinationVpc)
     (Maybe InputDestinationVpc)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputDestination' {Maybe InputDestinationVpc
vpc :: Maybe InputDestinationVpc
$sel:vpc:InputDestination' :: InputDestination -> Maybe InputDestinationVpc
vpc} -> Maybe InputDestinationVpc
vpc) (\s :: InputDestination
s@InputDestination' {} Maybe InputDestinationVpc
a -> InputDestination
s {$sel:vpc:InputDestination' :: Maybe InputDestinationVpc
vpc = Maybe InputDestinationVpc
a} :: InputDestination)

-- | The port number for the input.
inputDestination_port :: Lens.Lens' InputDestination (Prelude.Maybe Prelude.Text)
inputDestination_port :: (Maybe Text -> f (Maybe Text))
-> InputDestination -> f InputDestination
inputDestination_port = (InputDestination -> Maybe Text)
-> (InputDestination -> Maybe Text -> InputDestination)
-> Lens InputDestination InputDestination (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputDestination' {Maybe Text
port :: Maybe Text
$sel:port:InputDestination' :: InputDestination -> Maybe Text
port} -> Maybe Text
port) (\s :: InputDestination
s@InputDestination' {} Maybe Text
a -> InputDestination
s {$sel:port:InputDestination' :: Maybe Text
port = Maybe Text
a} :: InputDestination)

instance Core.FromJSON InputDestination where
  parseJSON :: Value -> Parser InputDestination
parseJSON =
    String
-> (Object -> Parser InputDestination)
-> Value
-> Parser InputDestination
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InputDestination"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe InputDestinationVpc
-> Maybe Text
-> InputDestination
InputDestination'
            (Maybe Text
 -> Maybe Text
 -> Maybe InputDestinationVpc
 -> Maybe Text
 -> InputDestination)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe InputDestinationVpc -> Maybe Text -> InputDestination)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"url")
            Parser
  (Maybe Text
   -> Maybe InputDestinationVpc -> Maybe Text -> InputDestination)
-> Parser (Maybe Text)
-> Parser
     (Maybe InputDestinationVpc -> Maybe Text -> InputDestination)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ip")
            Parser
  (Maybe InputDestinationVpc -> Maybe Text -> InputDestination)
-> Parser (Maybe InputDestinationVpc)
-> Parser (Maybe Text -> InputDestination)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InputDestinationVpc)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"vpc")
            Parser (Maybe Text -> InputDestination)
-> Parser (Maybe Text) -> Parser InputDestination
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"port")
      )

instance Prelude.Hashable InputDestination

instance Prelude.NFData InputDestination