{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
{ $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 :: Lens' DestinationConfiguration Text
destinationConfiguration_destinationIp = 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 :: Lens' DestinationConfiguration Int
destinationConfiguration_destinationPort = 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 :: Lens' DestinationConfiguration Interface
destinationConfiguration_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 :: Lens' DestinationConfiguration Text
destinationConfiguration_outboundIp = 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 Data.FromJSON DestinationConfiguration where
parseJSON :: Value -> Parser DestinationConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DestinationConfiguration"
( \Object
x ->
Text -> Int -> Interface -> Text -> DestinationConfiguration
DestinationConfiguration'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"destinationIp")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"destinationPort")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"interface")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"outboundIp")
)
instance Prelude.Hashable DestinationConfiguration where
hashWithSalt :: Int -> DestinationConfiguration -> Int
hashWithSalt Int
_salt DestinationConfiguration' {Int
Text
Interface
outboundIp :: Text
interface :: Interface
destinationPort :: Int
destinationIp :: Text
$sel:outboundIp:DestinationConfiguration' :: DestinationConfiguration -> Text
$sel:interface:DestinationConfiguration' :: DestinationConfiguration -> Interface
$sel:destinationPort:DestinationConfiguration' :: DestinationConfiguration -> Int
$sel:destinationIp:DestinationConfiguration' :: DestinationConfiguration -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
destinationIp
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
destinationPort
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Interface
interface
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
outboundIp
instance Prelude.NFData DestinationConfiguration where
rnf :: DestinationConfiguration -> ()
rnf DestinationConfiguration' {Int
Text
Interface
outboundIp :: Text
interface :: Interface
destinationPort :: Int
destinationIp :: Text
$sel:outboundIp:DestinationConfiguration' :: DestinationConfiguration -> Text
$sel:interface:DestinationConfiguration' :: DestinationConfiguration -> Interface
$sel:destinationPort:DestinationConfiguration' :: DestinationConfiguration -> Int
$sel:destinationIp:DestinationConfiguration' :: DestinationConfiguration -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
destinationIp
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
destinationPort
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Interface
interface
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
outboundIp