{-# 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 #-}
module Amazonka.MediaConnect.Types.DestinationConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types.Interface
import qualified Amazonka.Prelude as Prelude
data DestinationConfiguration = DestinationConfiguration'
{
DestinationConfiguration -> Text
destinationIp :: Prelude.Text,
DestinationConfiguration -> Int
destinationPort :: Prelude.Int,
DestinationConfiguration -> Interface
interface :: Interface,
DestinationConfiguration -> Text
outboundIp :: Prelude.Text
}
deriving (DestinationConfiguration -> DestinationConfiguration -> Bool
(DestinationConfiguration -> DestinationConfiguration -> Bool)
-> (DestinationConfiguration -> DestinationConfiguration -> Bool)
-> Eq DestinationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DestinationConfiguration -> DestinationConfiguration -> Bool
$c/= :: DestinationConfiguration -> DestinationConfiguration -> Bool
== :: DestinationConfiguration -> DestinationConfiguration -> Bool
$c== :: DestinationConfiguration -> DestinationConfiguration -> Bool
Prelude.Eq, ReadPrec [DestinationConfiguration]
ReadPrec DestinationConfiguration
Int -> ReadS DestinationConfiguration
ReadS [DestinationConfiguration]
(Int -> ReadS DestinationConfiguration)
-> ReadS [DestinationConfiguration]
-> ReadPrec DestinationConfiguration
-> ReadPrec [DestinationConfiguration]
-> Read DestinationConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DestinationConfiguration]
$creadListPrec :: ReadPrec [DestinationConfiguration]
readPrec :: ReadPrec DestinationConfiguration
$creadPrec :: ReadPrec DestinationConfiguration
readList :: ReadS [DestinationConfiguration]
$creadList :: ReadS [DestinationConfiguration]
readsPrec :: Int -> ReadS DestinationConfiguration
$creadsPrec :: Int -> ReadS DestinationConfiguration
Prelude.Read, Int -> DestinationConfiguration -> ShowS
[DestinationConfiguration] -> ShowS
DestinationConfiguration -> String
(Int -> DestinationConfiguration -> ShowS)
-> (DestinationConfiguration -> String)
-> ([DestinationConfiguration] -> ShowS)
-> Show DestinationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DestinationConfiguration] -> ShowS
$cshowList :: [DestinationConfiguration] -> ShowS
show :: DestinationConfiguration -> String
$cshow :: DestinationConfiguration -> String
showsPrec :: Int -> DestinationConfiguration -> ShowS
$cshowsPrec :: Int -> DestinationConfiguration -> ShowS
Prelude.Show, (forall x.
DestinationConfiguration -> Rep DestinationConfiguration x)
-> (forall x.
Rep DestinationConfiguration x -> DestinationConfiguration)
-> Generic DestinationConfiguration
forall x.
Rep DestinationConfiguration x -> DestinationConfiguration
forall x.
DestinationConfiguration -> Rep DestinationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DestinationConfiguration x -> DestinationConfiguration
$cfrom :: forall x.
DestinationConfiguration -> Rep DestinationConfiguration x
Prelude.Generic)
newDestinationConfiguration ::
Prelude.Text ->
Prelude.Int ->
Interface ->
Prelude.Text ->
DestinationConfiguration
newDestinationConfiguration :: Text -> Int -> Interface -> Text -> DestinationConfiguration
newDestinationConfiguration
Text
pDestinationIp_
Int
pDestinationPort_
Interface
pInterface_
Text
pOutboundIp_ =
DestinationConfiguration' :: Text -> Int -> Interface -> Text -> DestinationConfiguration
DestinationConfiguration'
{ $sel:destinationIp:DestinationConfiguration' :: Text
destinationIp =
Text
pDestinationIp_,
$sel:destinationPort:DestinationConfiguration' :: Int
destinationPort = Int
pDestinationPort_,
$sel:interface:DestinationConfiguration' :: Interface
interface = Interface
pInterface_,
$sel:outboundIp:DestinationConfiguration' :: Text
outboundIp = Text
pOutboundIp_
}
destinationConfiguration_destinationIp :: Lens.Lens' DestinationConfiguration Prelude.Text
destinationConfiguration_destinationIp :: (Text -> f Text)
-> DestinationConfiguration -> f DestinationConfiguration
destinationConfiguration_destinationIp = (DestinationConfiguration -> Text)
-> (DestinationConfiguration -> Text -> DestinationConfiguration)
-> Lens DestinationConfiguration DestinationConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationConfiguration' {Text
destinationIp :: Text
$sel:destinationIp:DestinationConfiguration' :: DestinationConfiguration -> Text
destinationIp} -> Text
destinationIp) (\s :: DestinationConfiguration
s@DestinationConfiguration' {} Text
a -> DestinationConfiguration
s {$sel:destinationIp:DestinationConfiguration' :: Text
destinationIp = Text
a} :: DestinationConfiguration)
destinationConfiguration_destinationPort :: Lens.Lens' DestinationConfiguration Prelude.Int
destinationConfiguration_destinationPort :: (Int -> f Int)
-> DestinationConfiguration -> f DestinationConfiguration
destinationConfiguration_destinationPort = (DestinationConfiguration -> Int)
-> (DestinationConfiguration -> Int -> DestinationConfiguration)
-> Lens DestinationConfiguration DestinationConfiguration Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationConfiguration' {Int
destinationPort :: Int
$sel:destinationPort:DestinationConfiguration' :: DestinationConfiguration -> Int
destinationPort} -> Int
destinationPort) (\s :: DestinationConfiguration
s@DestinationConfiguration' {} Int
a -> DestinationConfiguration
s {$sel:destinationPort:DestinationConfiguration' :: Int
destinationPort = Int
a} :: DestinationConfiguration)
destinationConfiguration_interface :: Lens.Lens' DestinationConfiguration Interface
destinationConfiguration_interface :: (Interface -> f Interface)
-> DestinationConfiguration -> f DestinationConfiguration
destinationConfiguration_interface = (DestinationConfiguration -> Interface)
-> (DestinationConfiguration
-> Interface -> DestinationConfiguration)
-> Lens
DestinationConfiguration
DestinationConfiguration
Interface
Interface
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationConfiguration' {Interface
interface :: Interface
$sel:interface:DestinationConfiguration' :: DestinationConfiguration -> Interface
interface} -> Interface
interface) (\s :: DestinationConfiguration
s@DestinationConfiguration' {} Interface
a -> DestinationConfiguration
s {$sel:interface:DestinationConfiguration' :: Interface
interface = Interface
a} :: DestinationConfiguration)
destinationConfiguration_outboundIp :: Lens.Lens' DestinationConfiguration Prelude.Text
destinationConfiguration_outboundIp :: (Text -> f Text)
-> DestinationConfiguration -> f DestinationConfiguration
destinationConfiguration_outboundIp = (DestinationConfiguration -> Text)
-> (DestinationConfiguration -> Text -> DestinationConfiguration)
-> Lens DestinationConfiguration DestinationConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationConfiguration' {Text
outboundIp :: Text
$sel:outboundIp:DestinationConfiguration' :: DestinationConfiguration -> Text
outboundIp} -> Text
outboundIp) (\s :: DestinationConfiguration
s@DestinationConfiguration' {} Text
a -> DestinationConfiguration
s {$sel:outboundIp:DestinationConfiguration' :: Text
outboundIp = Text
a} :: DestinationConfiguration)
instance Core.FromJSON DestinationConfiguration where
parseJSON :: Value -> Parser DestinationConfiguration
parseJSON =
String
-> (Object -> Parser DestinationConfiguration)
-> Value
-> Parser DestinationConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DestinationConfiguration"
( \Object
x ->
Text -> Int -> Interface -> Text -> DestinationConfiguration
DestinationConfiguration'
(Text -> Int -> Interface -> Text -> DestinationConfiguration)
-> Parser Text
-> Parser (Int -> Interface -> Text -> DestinationConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"destinationIp")
Parser (Int -> Interface -> Text -> DestinationConfiguration)
-> Parser Int
-> Parser (Interface -> Text -> DestinationConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"destinationPort")
Parser (Interface -> Text -> DestinationConfiguration)
-> Parser Interface -> Parser (Text -> DestinationConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Interface
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"interface")
Parser (Text -> DestinationConfiguration)
-> Parser Text -> Parser DestinationConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"outboundIp")
)
instance Prelude.Hashable DestinationConfiguration
instance Prelude.NFData DestinationConfiguration