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

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

-- | 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 :: Lens' InputDestination (Maybe Text)
inputDestination_ip = 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)

-- | The port number for the input.
inputDestination_port :: Lens.Lens' InputDestination (Prelude.Maybe Prelude.Text)
inputDestination_port :: Lens' InputDestination (Maybe Text)
inputDestination_port = 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)

-- | This represents the endpoint that the customer stream will be pushed to.
inputDestination_url :: Lens.Lens' InputDestination (Prelude.Maybe Prelude.Text)
inputDestination_url :: Lens' InputDestination (Maybe Text)
inputDestination_url = 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)

-- | Undocumented member.
inputDestination_vpc :: Lens.Lens' InputDestination (Prelude.Maybe InputDestinationVpc)
inputDestination_vpc :: Lens' InputDestination (Maybe InputDestinationVpc)
inputDestination_vpc = 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)

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

instance Prelude.Hashable InputDestination where
  hashWithSalt :: Int -> InputDestination -> Int
hashWithSalt Int
_salt InputDestination' {Maybe Text
Maybe InputDestinationVpc
vpc :: Maybe InputDestinationVpc
url :: Maybe Text
port :: Maybe Text
ip :: Maybe Text
$sel:vpc:InputDestination' :: InputDestination -> Maybe InputDestinationVpc
$sel:url:InputDestination' :: InputDestination -> Maybe Text
$sel:port:InputDestination' :: InputDestination -> Maybe Text
$sel:ip:InputDestination' :: InputDestination -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ip
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
port
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
url
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InputDestinationVpc
vpc

instance Prelude.NFData InputDestination where
  rnf :: InputDestination -> ()
rnf InputDestination' {Maybe Text
Maybe InputDestinationVpc
vpc :: Maybe InputDestinationVpc
url :: Maybe Text
port :: Maybe Text
ip :: Maybe Text
$sel:vpc:InputDestination' :: InputDestination -> Maybe InputDestinationVpc
$sel:url:InputDestination' :: InputDestination -> Maybe Text
$sel:port:InputDestination' :: InputDestination -> Maybe Text
$sel:ip:InputDestination' :: InputDestination -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ip
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
port
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
url
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InputDestinationVpc
vpc