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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(ChannelEgressEndpoint -> ChannelEgressEndpoint -> Bool)
-> (ChannelEgressEndpoint -> ChannelEgressEndpoint -> Bool)
-> Eq ChannelEgressEndpoint
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]
(Int -> ReadS ChannelEgressEndpoint)
-> ReadS [ChannelEgressEndpoint]
-> ReadPrec ChannelEgressEndpoint
-> ReadPrec [ChannelEgressEndpoint]
-> Read 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
(Int -> ChannelEgressEndpoint -> ShowS)
-> (ChannelEgressEndpoint -> String)
-> ([ChannelEgressEndpoint] -> ShowS)
-> Show ChannelEgressEndpoint
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. ChannelEgressEndpoint -> Rep ChannelEgressEndpoint x)
-> (forall x. Rep ChannelEgressEndpoint x -> ChannelEgressEndpoint)
-> Generic ChannelEgressEndpoint
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' :: Maybe Text -> ChannelEgressEndpoint
ChannelEgressEndpoint' {$sel:sourceIp:ChannelEgressEndpoint' :: Maybe Text
sourceIp = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> ChannelEgressEndpoint -> f ChannelEgressEndpoint
channelEgressEndpoint_sourceIp = (ChannelEgressEndpoint -> Maybe Text)
-> (ChannelEgressEndpoint -> Maybe Text -> ChannelEgressEndpoint)
-> Lens
     ChannelEgressEndpoint
     ChannelEgressEndpoint
     (Maybe Text)
     (Maybe Text)
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 Core.FromJSON ChannelEgressEndpoint where
  parseJSON :: Value -> Parser ChannelEgressEndpoint
parseJSON =
    String
-> (Object -> Parser ChannelEgressEndpoint)
-> Value
-> Parser ChannelEgressEndpoint
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ChannelEgressEndpoint"
      ( \Object
x ->
          Maybe Text -> ChannelEgressEndpoint
ChannelEgressEndpoint'
            (Maybe Text -> ChannelEgressEndpoint)
-> Parser (Maybe Text) -> Parser ChannelEgressEndpoint
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
"sourceIp")
      )

instance Prelude.Hashable ChannelEgressEndpoint

instance Prelude.NFData ChannelEgressEndpoint