{-# 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.Transport where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types.Protocol
import qualified Amazonka.Prelude as Prelude
data Transport = Transport'
{
Transport -> Maybe Int
maxLatency :: Prelude.Maybe Prelude.Int,
Transport -> Maybe Int
maxSyncBuffer :: Prelude.Maybe Prelude.Int,
Transport -> Maybe [Text]
cidrAllowList :: Prelude.Maybe [Prelude.Text],
Transport -> Maybe Int
smoothingLatency :: Prelude.Maybe Prelude.Int,
Transport -> Maybe Int
minLatency :: Prelude.Maybe Prelude.Int,
Transport -> Maybe Int
maxBitrate :: Prelude.Maybe Prelude.Int,
Transport -> Maybe Text
streamId :: Prelude.Maybe Prelude.Text,
Transport -> Maybe Text
remoteId :: Prelude.Maybe Prelude.Text,
Transport -> Protocol
protocol :: Protocol
}
deriving (Transport -> Transport -> Bool
(Transport -> Transport -> Bool)
-> (Transport -> Transport -> Bool) -> Eq Transport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Transport -> Transport -> Bool
$c/= :: Transport -> Transport -> Bool
== :: Transport -> Transport -> Bool
$c== :: Transport -> Transport -> Bool
Prelude.Eq, ReadPrec [Transport]
ReadPrec Transport
Int -> ReadS Transport
ReadS [Transport]
(Int -> ReadS Transport)
-> ReadS [Transport]
-> ReadPrec Transport
-> ReadPrec [Transport]
-> Read Transport
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Transport]
$creadListPrec :: ReadPrec [Transport]
readPrec :: ReadPrec Transport
$creadPrec :: ReadPrec Transport
readList :: ReadS [Transport]
$creadList :: ReadS [Transport]
readsPrec :: Int -> ReadS Transport
$creadsPrec :: Int -> ReadS Transport
Prelude.Read, Int -> Transport -> ShowS
[Transport] -> ShowS
Transport -> String
(Int -> Transport -> ShowS)
-> (Transport -> String)
-> ([Transport] -> ShowS)
-> Show Transport
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Transport] -> ShowS
$cshowList :: [Transport] -> ShowS
show :: Transport -> String
$cshow :: Transport -> String
showsPrec :: Int -> Transport -> ShowS
$cshowsPrec :: Int -> Transport -> ShowS
Prelude.Show, (forall x. Transport -> Rep Transport x)
-> (forall x. Rep Transport x -> Transport) -> Generic Transport
forall x. Rep Transport x -> Transport
forall x. Transport -> Rep Transport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Transport x -> Transport
$cfrom :: forall x. Transport -> Rep Transport x
Prelude.Generic)
newTransport ::
Protocol ->
Transport
newTransport :: Protocol -> Transport
newTransport Protocol
pProtocol_ =
Transport' :: Maybe Int
-> Maybe Int
-> Maybe [Text]
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Protocol
-> Transport
Transport'
{ $sel:maxLatency:Transport' :: Maybe Int
maxLatency = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:maxSyncBuffer:Transport' :: Maybe Int
maxSyncBuffer = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:cidrAllowList:Transport' :: Maybe [Text]
cidrAllowList = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:smoothingLatency:Transport' :: Maybe Int
smoothingLatency = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:minLatency:Transport' :: Maybe Int
minLatency = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:maxBitrate:Transport' :: Maybe Int
maxBitrate = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:streamId:Transport' :: Maybe Text
streamId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:remoteId:Transport' :: Maybe Text
remoteId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:protocol:Transport' :: Protocol
protocol = Protocol
pProtocol_
}
transport_maxLatency :: Lens.Lens' Transport (Prelude.Maybe Prelude.Int)
transport_maxLatency :: (Maybe Int -> f (Maybe Int)) -> Transport -> f Transport
transport_maxLatency = (Transport -> Maybe Int)
-> (Transport -> Maybe Int -> Transport)
-> Lens Transport Transport (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transport' {Maybe Int
maxLatency :: Maybe Int
$sel:maxLatency:Transport' :: Transport -> Maybe Int
maxLatency} -> Maybe Int
maxLatency) (\s :: Transport
s@Transport' {} Maybe Int
a -> Transport
s {$sel:maxLatency:Transport' :: Maybe Int
maxLatency = Maybe Int
a} :: Transport)
transport_maxSyncBuffer :: Lens.Lens' Transport (Prelude.Maybe Prelude.Int)
transport_maxSyncBuffer :: (Maybe Int -> f (Maybe Int)) -> Transport -> f Transport
transport_maxSyncBuffer = (Transport -> Maybe Int)
-> (Transport -> Maybe Int -> Transport)
-> Lens Transport Transport (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transport' {Maybe Int
maxSyncBuffer :: Maybe Int
$sel:maxSyncBuffer:Transport' :: Transport -> Maybe Int
maxSyncBuffer} -> Maybe Int
maxSyncBuffer) (\s :: Transport
s@Transport' {} Maybe Int
a -> Transport
s {$sel:maxSyncBuffer:Transport' :: Maybe Int
maxSyncBuffer = Maybe Int
a} :: Transport)
transport_cidrAllowList :: Lens.Lens' Transport (Prelude.Maybe [Prelude.Text])
transport_cidrAllowList :: (Maybe [Text] -> f (Maybe [Text])) -> Transport -> f Transport
transport_cidrAllowList = (Transport -> Maybe [Text])
-> (Transport -> Maybe [Text] -> Transport)
-> Lens Transport Transport (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transport' {Maybe [Text]
cidrAllowList :: Maybe [Text]
$sel:cidrAllowList:Transport' :: Transport -> Maybe [Text]
cidrAllowList} -> Maybe [Text]
cidrAllowList) (\s :: Transport
s@Transport' {} Maybe [Text]
a -> Transport
s {$sel:cidrAllowList:Transport' :: Maybe [Text]
cidrAllowList = Maybe [Text]
a} :: Transport) ((Maybe [Text] -> f (Maybe [Text])) -> Transport -> f Transport)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Transport
-> f Transport
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
transport_smoothingLatency :: Lens.Lens' Transport (Prelude.Maybe Prelude.Int)
transport_smoothingLatency :: (Maybe Int -> f (Maybe Int)) -> Transport -> f Transport
transport_smoothingLatency = (Transport -> Maybe Int)
-> (Transport -> Maybe Int -> Transport)
-> Lens Transport Transport (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transport' {Maybe Int
smoothingLatency :: Maybe Int
$sel:smoothingLatency:Transport' :: Transport -> Maybe Int
smoothingLatency} -> Maybe Int
smoothingLatency) (\s :: Transport
s@Transport' {} Maybe Int
a -> Transport
s {$sel:smoothingLatency:Transport' :: Maybe Int
smoothingLatency = Maybe Int
a} :: Transport)
transport_minLatency :: Lens.Lens' Transport (Prelude.Maybe Prelude.Int)
transport_minLatency :: (Maybe Int -> f (Maybe Int)) -> Transport -> f Transport
transport_minLatency = (Transport -> Maybe Int)
-> (Transport -> Maybe Int -> Transport)
-> Lens Transport Transport (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transport' {Maybe Int
minLatency :: Maybe Int
$sel:minLatency:Transport' :: Transport -> Maybe Int
minLatency} -> Maybe Int
minLatency) (\s :: Transport
s@Transport' {} Maybe Int
a -> Transport
s {$sel:minLatency:Transport' :: Maybe Int
minLatency = Maybe Int
a} :: Transport)
transport_maxBitrate :: Lens.Lens' Transport (Prelude.Maybe Prelude.Int)
transport_maxBitrate :: (Maybe Int -> f (Maybe Int)) -> Transport -> f Transport
transport_maxBitrate = (Transport -> Maybe Int)
-> (Transport -> Maybe Int -> Transport)
-> Lens Transport Transport (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transport' {Maybe Int
maxBitrate :: Maybe Int
$sel:maxBitrate:Transport' :: Transport -> Maybe Int
maxBitrate} -> Maybe Int
maxBitrate) (\s :: Transport
s@Transport' {} Maybe Int
a -> Transport
s {$sel:maxBitrate:Transport' :: Maybe Int
maxBitrate = Maybe Int
a} :: Transport)
transport_streamId :: Lens.Lens' Transport (Prelude.Maybe Prelude.Text)
transport_streamId :: (Maybe Text -> f (Maybe Text)) -> Transport -> f Transport
transport_streamId = (Transport -> Maybe Text)
-> (Transport -> Maybe Text -> Transport)
-> Lens Transport Transport (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transport' {Maybe Text
streamId :: Maybe Text
$sel:streamId:Transport' :: Transport -> Maybe Text
streamId} -> Maybe Text
streamId) (\s :: Transport
s@Transport' {} Maybe Text
a -> Transport
s {$sel:streamId:Transport' :: Maybe Text
streamId = Maybe Text
a} :: Transport)
transport_remoteId :: Lens.Lens' Transport (Prelude.Maybe Prelude.Text)
transport_remoteId :: (Maybe Text -> f (Maybe Text)) -> Transport -> f Transport
transport_remoteId = (Transport -> Maybe Text)
-> (Transport -> Maybe Text -> Transport)
-> Lens Transport Transport (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transport' {Maybe Text
remoteId :: Maybe Text
$sel:remoteId:Transport' :: Transport -> Maybe Text
remoteId} -> Maybe Text
remoteId) (\s :: Transport
s@Transport' {} Maybe Text
a -> Transport
s {$sel:remoteId:Transport' :: Maybe Text
remoteId = Maybe Text
a} :: Transport)
transport_protocol :: Lens.Lens' Transport Protocol
transport_protocol :: (Protocol -> f Protocol) -> Transport -> f Transport
transport_protocol = (Transport -> Protocol)
-> (Transport -> Protocol -> Transport)
-> Lens Transport Transport Protocol Protocol
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transport' {Protocol
protocol :: Protocol
$sel:protocol:Transport' :: Transport -> Protocol
protocol} -> Protocol
protocol) (\s :: Transport
s@Transport' {} Protocol
a -> Transport
s {$sel:protocol:Transport' :: Protocol
protocol = Protocol
a} :: Transport)
instance Core.FromJSON Transport where
parseJSON :: Value -> Parser Transport
parseJSON =
String -> (Object -> Parser Transport) -> Value -> Parser Transport
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Transport"
( \Object
x ->
Maybe Int
-> Maybe Int
-> Maybe [Text]
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Protocol
-> Transport
Transport'
(Maybe Int
-> Maybe Int
-> Maybe [Text]
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Protocol
-> Transport)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe [Text]
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Protocol
-> Transport)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"maxLatency")
Parser
(Maybe Int
-> Maybe [Text]
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Protocol
-> Transport)
-> Parser (Maybe Int)
-> Parser
(Maybe [Text]
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Protocol
-> Transport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"maxSyncBuffer")
Parser
(Maybe [Text]
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Protocol
-> Transport)
-> Parser (Maybe [Text])
-> Parser
(Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Protocol
-> Transport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cidrAllowList" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Protocol
-> Transport)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe Int -> Maybe Text -> Maybe Text -> Protocol -> Transport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"smoothingLatency")
Parser
(Maybe Int
-> Maybe Int -> Maybe Text -> Maybe Text -> Protocol -> Transport)
-> Parser (Maybe Int)
-> Parser
(Maybe Int -> Maybe Text -> Maybe Text -> Protocol -> Transport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"minLatency")
Parser
(Maybe Int -> Maybe Text -> Maybe Text -> Protocol -> Transport)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> Maybe Text -> Protocol -> Transport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"maxBitrate")
Parser (Maybe Text -> Maybe Text -> Protocol -> Transport)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Protocol -> Transport)
forall (f :: * -> *) a b. Applicative f => 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
"streamId")
Parser (Maybe Text -> Protocol -> Transport)
-> Parser (Maybe Text) -> Parser (Protocol -> Transport)
forall (f :: * -> *) a b. Applicative f => 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
"remoteId")
Parser (Protocol -> Transport)
-> Parser Protocol -> Parser Transport
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Protocol
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"protocol")
)
instance Prelude.Hashable Transport
instance Prelude.NFData Transport