{-# 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.ChannelEgressEndpoint
-- 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.ChannelEgressEndpoint 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

-- | Placeholder documentation for ChannelEgressEndpoint
--
-- /See:/ 'newChannelEgressEndpoint' smart constructor.
data ChannelEgressEndpoint = ChannelEgressEndpoint'
  { -- | Public IP of where a channel\'s output comes from
    ChannelEgressEndpoint -> Maybe Text
sourceIp :: Prelude.Maybe Prelude.Text
  }
  deriving (ChannelEgressEndpoint -> ChannelEgressEndpoint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelEgressEndpoint -> ChannelEgressEndpoint -> Bool
$c/= :: ChannelEgressEndpoint -> ChannelEgressEndpoint -> Bool
== :: ChannelEgressEndpoint -> ChannelEgressEndpoint -> Bool
$c== :: ChannelEgressEndpoint -> ChannelEgressEndpoint -> Bool
Prelude.Eq, ReadPrec [ChannelEgressEndpoint]
ReadPrec ChannelEgressEndpoint
Int -> ReadS ChannelEgressEndpoint
ReadS [ChannelEgressEndpoint]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChannelEgressEndpoint]
$creadListPrec :: ReadPrec [ChannelEgressEndpoint]
readPrec :: ReadPrec ChannelEgressEndpoint
$creadPrec :: ReadPrec ChannelEgressEndpoint
readList :: ReadS [ChannelEgressEndpoint]
$creadList :: ReadS [ChannelEgressEndpoint]
readsPrec :: Int -> ReadS ChannelEgressEndpoint
$creadsPrec :: Int -> ReadS ChannelEgressEndpoint
Prelude.Read, Int -> ChannelEgressEndpoint -> ShowS
[ChannelEgressEndpoint] -> ShowS
ChannelEgressEndpoint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelEgressEndpoint] -> ShowS
$cshowList :: [ChannelEgressEndpoint] -> ShowS
show :: ChannelEgressEndpoint -> String
$cshow :: ChannelEgressEndpoint -> String
showsPrec :: Int -> ChannelEgressEndpoint -> ShowS
$cshowsPrec :: Int -> ChannelEgressEndpoint -> ShowS
Prelude.Show, forall x. Rep ChannelEgressEndpoint x -> ChannelEgressEndpoint
forall x. ChannelEgressEndpoint -> Rep ChannelEgressEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChannelEgressEndpoint x -> ChannelEgressEndpoint
$cfrom :: forall x. ChannelEgressEndpoint -> Rep ChannelEgressEndpoint x
Prelude.Generic)

-- |
-- Create a value of 'ChannelEgressEndpoint' 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:
--
-- 'sourceIp', 'channelEgressEndpoint_sourceIp' - Public IP of where a channel\'s output comes from
newChannelEgressEndpoint ::
  ChannelEgressEndpoint
newChannelEgressEndpoint :: ChannelEgressEndpoint
newChannelEgressEndpoint =
  ChannelEgressEndpoint' {$sel:sourceIp:ChannelEgressEndpoint' :: Maybe Text
sourceIp = forall a. Maybe a
Prelude.Nothing}

-- | Public IP of where a channel\'s output comes from
channelEgressEndpoint_sourceIp :: Lens.Lens' ChannelEgressEndpoint (Prelude.Maybe Prelude.Text)
channelEgressEndpoint_sourceIp :: Lens' ChannelEgressEndpoint (Maybe Text)
channelEgressEndpoint_sourceIp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelEgressEndpoint' {Maybe Text
sourceIp :: Maybe Text
$sel:sourceIp:ChannelEgressEndpoint' :: ChannelEgressEndpoint -> Maybe Text
sourceIp} -> Maybe Text
sourceIp) (\s :: ChannelEgressEndpoint
s@ChannelEgressEndpoint' {} Maybe Text
a -> ChannelEgressEndpoint
s {$sel:sourceIp:ChannelEgressEndpoint' :: Maybe Text
sourceIp = Maybe Text
a} :: ChannelEgressEndpoint)

instance Data.FromJSON ChannelEgressEndpoint where
  parseJSON :: Value -> Parser ChannelEgressEndpoint
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ChannelEgressEndpoint"
      ( \Object
x ->
          Maybe Text -> ChannelEgressEndpoint
ChannelEgressEndpoint'
            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
"sourceIp")
      )

instance Prelude.Hashable ChannelEgressEndpoint where
  hashWithSalt :: Int -> ChannelEgressEndpoint -> Int
hashWithSalt Int
_salt ChannelEgressEndpoint' {Maybe Text
sourceIp :: Maybe Text
$sel:sourceIp:ChannelEgressEndpoint' :: ChannelEgressEndpoint -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceIp

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