{-# 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.DestinationConfigurationRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types.InterfaceRequest
import qualified Amazonka.Prelude as Prelude
data DestinationConfigurationRequest = DestinationConfigurationRequest'
{
DestinationConfigurationRequest -> Text
destinationIp :: Prelude.Text,
DestinationConfigurationRequest -> Int
destinationPort :: Prelude.Int,
DestinationConfigurationRequest -> InterfaceRequest
interface :: InterfaceRequest
}
deriving (DestinationConfigurationRequest
-> DestinationConfigurationRequest -> Bool
(DestinationConfigurationRequest
-> DestinationConfigurationRequest -> Bool)
-> (DestinationConfigurationRequest
-> DestinationConfigurationRequest -> Bool)
-> Eq DestinationConfigurationRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DestinationConfigurationRequest
-> DestinationConfigurationRequest -> Bool
$c/= :: DestinationConfigurationRequest
-> DestinationConfigurationRequest -> Bool
== :: DestinationConfigurationRequest
-> DestinationConfigurationRequest -> Bool
$c== :: DestinationConfigurationRequest
-> DestinationConfigurationRequest -> Bool
Prelude.Eq, ReadPrec [DestinationConfigurationRequest]
ReadPrec DestinationConfigurationRequest
Int -> ReadS DestinationConfigurationRequest
ReadS [DestinationConfigurationRequest]
(Int -> ReadS DestinationConfigurationRequest)
-> ReadS [DestinationConfigurationRequest]
-> ReadPrec DestinationConfigurationRequest
-> ReadPrec [DestinationConfigurationRequest]
-> Read DestinationConfigurationRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DestinationConfigurationRequest]
$creadListPrec :: ReadPrec [DestinationConfigurationRequest]
readPrec :: ReadPrec DestinationConfigurationRequest
$creadPrec :: ReadPrec DestinationConfigurationRequest
readList :: ReadS [DestinationConfigurationRequest]
$creadList :: ReadS [DestinationConfigurationRequest]
readsPrec :: Int -> ReadS DestinationConfigurationRequest
$creadsPrec :: Int -> ReadS DestinationConfigurationRequest
Prelude.Read, Int -> DestinationConfigurationRequest -> ShowS
[DestinationConfigurationRequest] -> ShowS
DestinationConfigurationRequest -> String
(Int -> DestinationConfigurationRequest -> ShowS)
-> (DestinationConfigurationRequest -> String)
-> ([DestinationConfigurationRequest] -> ShowS)
-> Show DestinationConfigurationRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DestinationConfigurationRequest] -> ShowS
$cshowList :: [DestinationConfigurationRequest] -> ShowS
show :: DestinationConfigurationRequest -> String
$cshow :: DestinationConfigurationRequest -> String
showsPrec :: Int -> DestinationConfigurationRequest -> ShowS
$cshowsPrec :: Int -> DestinationConfigurationRequest -> ShowS
Prelude.Show, (forall x.
DestinationConfigurationRequest
-> Rep DestinationConfigurationRequest x)
-> (forall x.
Rep DestinationConfigurationRequest x
-> DestinationConfigurationRequest)
-> Generic DestinationConfigurationRequest
forall x.
Rep DestinationConfigurationRequest x
-> DestinationConfigurationRequest
forall x.
DestinationConfigurationRequest
-> Rep DestinationConfigurationRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DestinationConfigurationRequest x
-> DestinationConfigurationRequest
$cfrom :: forall x.
DestinationConfigurationRequest
-> Rep DestinationConfigurationRequest x
Prelude.Generic)
newDestinationConfigurationRequest ::
Prelude.Text ->
Prelude.Int ->
InterfaceRequest ->
DestinationConfigurationRequest
newDestinationConfigurationRequest :: Text -> Int -> InterfaceRequest -> DestinationConfigurationRequest
newDestinationConfigurationRequest
Text
pDestinationIp_
Int
pDestinationPort_
InterfaceRequest
pInterface_ =
DestinationConfigurationRequest' :: Text -> Int -> InterfaceRequest -> DestinationConfigurationRequest
DestinationConfigurationRequest'
{ $sel:destinationIp:DestinationConfigurationRequest' :: Text
destinationIp =
Text
pDestinationIp_,
$sel:destinationPort:DestinationConfigurationRequest' :: Int
destinationPort = Int
pDestinationPort_,
$sel:interface:DestinationConfigurationRequest' :: InterfaceRequest
interface = InterfaceRequest
pInterface_
}
destinationConfigurationRequest_destinationIp :: Lens.Lens' DestinationConfigurationRequest Prelude.Text
destinationConfigurationRequest_destinationIp :: (Text -> f Text)
-> DestinationConfigurationRequest
-> f DestinationConfigurationRequest
destinationConfigurationRequest_destinationIp = (DestinationConfigurationRequest -> Text)
-> (DestinationConfigurationRequest
-> Text -> DestinationConfigurationRequest)
-> Lens
DestinationConfigurationRequest
DestinationConfigurationRequest
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationConfigurationRequest' {Text
destinationIp :: Text
$sel:destinationIp:DestinationConfigurationRequest' :: DestinationConfigurationRequest -> Text
destinationIp} -> Text
destinationIp) (\s :: DestinationConfigurationRequest
s@DestinationConfigurationRequest' {} Text
a -> DestinationConfigurationRequest
s {$sel:destinationIp:DestinationConfigurationRequest' :: Text
destinationIp = Text
a} :: DestinationConfigurationRequest)
destinationConfigurationRequest_destinationPort :: Lens.Lens' DestinationConfigurationRequest Prelude.Int
destinationConfigurationRequest_destinationPort :: (Int -> f Int)
-> DestinationConfigurationRequest
-> f DestinationConfigurationRequest
destinationConfigurationRequest_destinationPort = (DestinationConfigurationRequest -> Int)
-> (DestinationConfigurationRequest
-> Int -> DestinationConfigurationRequest)
-> Lens
DestinationConfigurationRequest
DestinationConfigurationRequest
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationConfigurationRequest' {Int
destinationPort :: Int
$sel:destinationPort:DestinationConfigurationRequest' :: DestinationConfigurationRequest -> Int
destinationPort} -> Int
destinationPort) (\s :: DestinationConfigurationRequest
s@DestinationConfigurationRequest' {} Int
a -> DestinationConfigurationRequest
s {$sel:destinationPort:DestinationConfigurationRequest' :: Int
destinationPort = Int
a} :: DestinationConfigurationRequest)
destinationConfigurationRequest_interface :: Lens.Lens' DestinationConfigurationRequest InterfaceRequest
destinationConfigurationRequest_interface :: (InterfaceRequest -> f InterfaceRequest)
-> DestinationConfigurationRequest
-> f DestinationConfigurationRequest
destinationConfigurationRequest_interface = (DestinationConfigurationRequest -> InterfaceRequest)
-> (DestinationConfigurationRequest
-> InterfaceRequest -> DestinationConfigurationRequest)
-> Lens
DestinationConfigurationRequest
DestinationConfigurationRequest
InterfaceRequest
InterfaceRequest
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationConfigurationRequest' {InterfaceRequest
interface :: InterfaceRequest
$sel:interface:DestinationConfigurationRequest' :: DestinationConfigurationRequest -> InterfaceRequest
interface} -> InterfaceRequest
interface) (\s :: DestinationConfigurationRequest
s@DestinationConfigurationRequest' {} InterfaceRequest
a -> DestinationConfigurationRequest
s {$sel:interface:DestinationConfigurationRequest' :: InterfaceRequest
interface = InterfaceRequest
a} :: DestinationConfigurationRequest)
instance
Prelude.Hashable
DestinationConfigurationRequest
instance
Prelude.NFData
DestinationConfigurationRequest
instance Core.ToJSON DestinationConfigurationRequest where
toJSON :: DestinationConfigurationRequest -> Value
toJSON DestinationConfigurationRequest' {Int
Text
InterfaceRequest
interface :: InterfaceRequest
destinationPort :: Int
destinationIp :: Text
$sel:interface:DestinationConfigurationRequest' :: DestinationConfigurationRequest -> InterfaceRequest
$sel:destinationPort:DestinationConfigurationRequest' :: DestinationConfigurationRequest -> Int
$sel:destinationIp:DestinationConfigurationRequest' :: DestinationConfigurationRequest -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"destinationIp" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
destinationIp),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"destinationPort" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
destinationPort),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"interface" Text -> InterfaceRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= InterfaceRequest
interface)
]
)