{-# 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.MediaConnect.Types.Source
-- 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.MediaConnect.Types.Source where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types.Encryption
import Amazonka.MediaConnect.Types.MediaStreamSourceConfiguration
import Amazonka.MediaConnect.Types.Transport
import qualified Amazonka.Prelude as Prelude

-- | The settings for the source of the flow.
--
-- /See:/ 'newSource' smart constructor.
data Source = Source'
  { -- | The ARN of the entitlement that allows you to subscribe to content that
    -- comes from another AWS account. The entitlement is set by the content
    -- originator and the ARN is generated as part of the originator\'s flow.
    Source -> Maybe Text
entitlementArn :: Prelude.Maybe Prelude.Text,
    -- | Percentage from 0-100 of the data transfer cost to be billed to the
    -- subscriber.
    Source -> Maybe Int
dataTransferSubscriberFeePercent :: Prelude.Maybe Prelude.Int,
    -- | The name of the VPC interface that is used for this source.
    Source -> Maybe Text
vpcInterfaceName :: Prelude.Maybe Prelude.Text,
    -- | The type of encryption that is used on the content ingested from this
    -- source.
    Source -> Maybe Encryption
decryption :: Prelude.Maybe Encryption,
    -- | The IP address that the flow will be listening on for incoming content.
    Source -> Maybe Text
ingestIp :: Prelude.Maybe Prelude.Text,
    -- | The port that the flow will be listening on for incoming content.
    Source -> Maybe Int
ingestPort :: Prelude.Maybe Prelude.Int,
    -- | Attributes related to the transport stream that are used in the source.
    Source -> Maybe Transport
transport :: Prelude.Maybe Transport,
    -- | A description for the source. This value is not used or seen outside of
    -- the current AWS Elemental MediaConnect account.
    Source -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The media streams that are associated with the source, and the
    -- parameters for those associations.
    Source -> Maybe [MediaStreamSourceConfiguration]
mediaStreamSourceConfigurations :: Prelude.Maybe [MediaStreamSourceConfiguration],
    -- | The range of IP addresses that should be allowed to contribute content
    -- to your source. These IP addresses should be in the form of a Classless
    -- Inter-Domain Routing (CIDR) block; for example, 10.0.0.0\/16.
    Source -> Maybe Text
whitelistCidr :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the source.
    Source -> Text
sourceArn :: Prelude.Text,
    -- | The name of the source.
    Source -> Text
name :: Prelude.Text
  }
  deriving (Source -> Source -> Bool
(Source -> Source -> Bool)
-> (Source -> Source -> Bool) -> Eq Source
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Source -> Source -> Bool
$c/= :: Source -> Source -> Bool
== :: Source -> Source -> Bool
$c== :: Source -> Source -> Bool
Prelude.Eq, ReadPrec [Source]
ReadPrec Source
Int -> ReadS Source
ReadS [Source]
(Int -> ReadS Source)
-> ReadS [Source]
-> ReadPrec Source
-> ReadPrec [Source]
-> Read Source
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Source]
$creadListPrec :: ReadPrec [Source]
readPrec :: ReadPrec Source
$creadPrec :: ReadPrec Source
readList :: ReadS [Source]
$creadList :: ReadS [Source]
readsPrec :: Int -> ReadS Source
$creadsPrec :: Int -> ReadS Source
Prelude.Read, Int -> Source -> ShowS
[Source] -> ShowS
Source -> String
(Int -> Source -> ShowS)
-> (Source -> String) -> ([Source] -> ShowS) -> Show Source
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Source] -> ShowS
$cshowList :: [Source] -> ShowS
show :: Source -> String
$cshow :: Source -> String
showsPrec :: Int -> Source -> ShowS
$cshowsPrec :: Int -> Source -> ShowS
Prelude.Show, (forall x. Source -> Rep Source x)
-> (forall x. Rep Source x -> Source) -> Generic Source
forall x. Rep Source x -> Source
forall x. Source -> Rep Source x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Source x -> Source
$cfrom :: forall x. Source -> Rep Source x
Prelude.Generic)

-- |
-- Create a value of 'Source' 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:
--
-- 'entitlementArn', 'source_entitlementArn' - The ARN of the entitlement that allows you to subscribe to content that
-- comes from another AWS account. The entitlement is set by the content
-- originator and the ARN is generated as part of the originator\'s flow.
--
-- 'dataTransferSubscriberFeePercent', 'source_dataTransferSubscriberFeePercent' - Percentage from 0-100 of the data transfer cost to be billed to the
-- subscriber.
--
-- 'vpcInterfaceName', 'source_vpcInterfaceName' - The name of the VPC interface that is used for this source.
--
-- 'decryption', 'source_decryption' - The type of encryption that is used on the content ingested from this
-- source.
--
-- 'ingestIp', 'source_ingestIp' - The IP address that the flow will be listening on for incoming content.
--
-- 'ingestPort', 'source_ingestPort' - The port that the flow will be listening on for incoming content.
--
-- 'transport', 'source_transport' - Attributes related to the transport stream that are used in the source.
--
-- 'description', 'source_description' - A description for the source. This value is not used or seen outside of
-- the current AWS Elemental MediaConnect account.
--
-- 'mediaStreamSourceConfigurations', 'source_mediaStreamSourceConfigurations' - The media streams that are associated with the source, and the
-- parameters for those associations.
--
-- 'whitelistCidr', 'source_whitelistCidr' - The range of IP addresses that should be allowed to contribute content
-- to your source. These IP addresses should be in the form of a Classless
-- Inter-Domain Routing (CIDR) block; for example, 10.0.0.0\/16.
--
-- 'sourceArn', 'source_sourceArn' - The ARN of the source.
--
-- 'name', 'source_name' - The name of the source.
newSource ::
  -- | 'sourceArn'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  Source
newSource :: Text -> Text -> Source
newSource Text
pSourceArn_ Text
pName_ =
  Source' :: Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Encryption
-> Maybe Text
-> Maybe Int
-> Maybe Transport
-> Maybe Text
-> Maybe [MediaStreamSourceConfiguration]
-> Maybe Text
-> Text
-> Text
-> Source
Source'
    { $sel:entitlementArn:Source' :: Maybe Text
entitlementArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dataTransferSubscriberFeePercent:Source' :: Maybe Int
dataTransferSubscriberFeePercent = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcInterfaceName:Source' :: Maybe Text
vpcInterfaceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:decryption:Source' :: Maybe Encryption
decryption = Maybe Encryption
forall a. Maybe a
Prelude.Nothing,
      $sel:ingestIp:Source' :: Maybe Text
ingestIp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ingestPort:Source' :: Maybe Int
ingestPort = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:transport:Source' :: Maybe Transport
transport = Maybe Transport
forall a. Maybe a
Prelude.Nothing,
      $sel:description:Source' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:mediaStreamSourceConfigurations:Source' :: Maybe [MediaStreamSourceConfiguration]
mediaStreamSourceConfigurations = Maybe [MediaStreamSourceConfiguration]
forall a. Maybe a
Prelude.Nothing,
      $sel:whitelistCidr:Source' :: Maybe Text
whitelistCidr = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceArn:Source' :: Text
sourceArn = Text
pSourceArn_,
      $sel:name:Source' :: Text
name = Text
pName_
    }

-- | The ARN of the entitlement that allows you to subscribe to content that
-- comes from another AWS account. The entitlement is set by the content
-- originator and the ARN is generated as part of the originator\'s flow.
source_entitlementArn :: Lens.Lens' Source (Prelude.Maybe Prelude.Text)
source_entitlementArn :: (Maybe Text -> f (Maybe Text)) -> Source -> f Source
source_entitlementArn = (Source -> Maybe Text)
-> (Source -> Maybe Text -> Source)
-> Lens Source Source (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Source' {Maybe Text
entitlementArn :: Maybe Text
$sel:entitlementArn:Source' :: Source -> Maybe Text
entitlementArn} -> Maybe Text
entitlementArn) (\s :: Source
s@Source' {} Maybe Text
a -> Source
s {$sel:entitlementArn:Source' :: Maybe Text
entitlementArn = Maybe Text
a} :: Source)

-- | Percentage from 0-100 of the data transfer cost to be billed to the
-- subscriber.
source_dataTransferSubscriberFeePercent :: Lens.Lens' Source (Prelude.Maybe Prelude.Int)
source_dataTransferSubscriberFeePercent :: (Maybe Int -> f (Maybe Int)) -> Source -> f Source
source_dataTransferSubscriberFeePercent = (Source -> Maybe Int)
-> (Source -> Maybe Int -> Source)
-> Lens Source Source (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Source' {Maybe Int
dataTransferSubscriberFeePercent :: Maybe Int
$sel:dataTransferSubscriberFeePercent:Source' :: Source -> Maybe Int
dataTransferSubscriberFeePercent} -> Maybe Int
dataTransferSubscriberFeePercent) (\s :: Source
s@Source' {} Maybe Int
a -> Source
s {$sel:dataTransferSubscriberFeePercent:Source' :: Maybe Int
dataTransferSubscriberFeePercent = Maybe Int
a} :: Source)

-- | The name of the VPC interface that is used for this source.
source_vpcInterfaceName :: Lens.Lens' Source (Prelude.Maybe Prelude.Text)
source_vpcInterfaceName :: (Maybe Text -> f (Maybe Text)) -> Source -> f Source
source_vpcInterfaceName = (Source -> Maybe Text)
-> (Source -> Maybe Text -> Source)
-> Lens Source Source (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Source' {Maybe Text
vpcInterfaceName :: Maybe Text
$sel:vpcInterfaceName:Source' :: Source -> Maybe Text
vpcInterfaceName} -> Maybe Text
vpcInterfaceName) (\s :: Source
s@Source' {} Maybe Text
a -> Source
s {$sel:vpcInterfaceName:Source' :: Maybe Text
vpcInterfaceName = Maybe Text
a} :: Source)

-- | The type of encryption that is used on the content ingested from this
-- source.
source_decryption :: Lens.Lens' Source (Prelude.Maybe Encryption)
source_decryption :: (Maybe Encryption -> f (Maybe Encryption)) -> Source -> f Source
source_decryption = (Source -> Maybe Encryption)
-> (Source -> Maybe Encryption -> Source)
-> Lens Source Source (Maybe Encryption) (Maybe Encryption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Source' {Maybe Encryption
decryption :: Maybe Encryption
$sel:decryption:Source' :: Source -> Maybe Encryption
decryption} -> Maybe Encryption
decryption) (\s :: Source
s@Source' {} Maybe Encryption
a -> Source
s {$sel:decryption:Source' :: Maybe Encryption
decryption = Maybe Encryption
a} :: Source)

-- | The IP address that the flow will be listening on for incoming content.
source_ingestIp :: Lens.Lens' Source (Prelude.Maybe Prelude.Text)
source_ingestIp :: (Maybe Text -> f (Maybe Text)) -> Source -> f Source
source_ingestIp = (Source -> Maybe Text)
-> (Source -> Maybe Text -> Source)
-> Lens Source Source (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Source' {Maybe Text
ingestIp :: Maybe Text
$sel:ingestIp:Source' :: Source -> Maybe Text
ingestIp} -> Maybe Text
ingestIp) (\s :: Source
s@Source' {} Maybe Text
a -> Source
s {$sel:ingestIp:Source' :: Maybe Text
ingestIp = Maybe Text
a} :: Source)

-- | The port that the flow will be listening on for incoming content.
source_ingestPort :: Lens.Lens' Source (Prelude.Maybe Prelude.Int)
source_ingestPort :: (Maybe Int -> f (Maybe Int)) -> Source -> f Source
source_ingestPort = (Source -> Maybe Int)
-> (Source -> Maybe Int -> Source)
-> Lens Source Source (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Source' {Maybe Int
ingestPort :: Maybe Int
$sel:ingestPort:Source' :: Source -> Maybe Int
ingestPort} -> Maybe Int
ingestPort) (\s :: Source
s@Source' {} Maybe Int
a -> Source
s {$sel:ingestPort:Source' :: Maybe Int
ingestPort = Maybe Int
a} :: Source)

-- | Attributes related to the transport stream that are used in the source.
source_transport :: Lens.Lens' Source (Prelude.Maybe Transport)
source_transport :: (Maybe Transport -> f (Maybe Transport)) -> Source -> f Source
source_transport = (Source -> Maybe Transport)
-> (Source -> Maybe Transport -> Source)
-> Lens Source Source (Maybe Transport) (Maybe Transport)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Source' {Maybe Transport
transport :: Maybe Transport
$sel:transport:Source' :: Source -> Maybe Transport
transport} -> Maybe Transport
transport) (\s :: Source
s@Source' {} Maybe Transport
a -> Source
s {$sel:transport:Source' :: Maybe Transport
transport = Maybe Transport
a} :: Source)

-- | A description for the source. This value is not used or seen outside of
-- the current AWS Elemental MediaConnect account.
source_description :: Lens.Lens' Source (Prelude.Maybe Prelude.Text)
source_description :: (Maybe Text -> f (Maybe Text)) -> Source -> f Source
source_description = (Source -> Maybe Text)
-> (Source -> Maybe Text -> Source)
-> Lens Source Source (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Source' {Maybe Text
description :: Maybe Text
$sel:description:Source' :: Source -> Maybe Text
description} -> Maybe Text
description) (\s :: Source
s@Source' {} Maybe Text
a -> Source
s {$sel:description:Source' :: Maybe Text
description = Maybe Text
a} :: Source)

-- | The media streams that are associated with the source, and the
-- parameters for those associations.
source_mediaStreamSourceConfigurations :: Lens.Lens' Source (Prelude.Maybe [MediaStreamSourceConfiguration])
source_mediaStreamSourceConfigurations :: (Maybe [MediaStreamSourceConfiguration]
 -> f (Maybe [MediaStreamSourceConfiguration]))
-> Source -> f Source
source_mediaStreamSourceConfigurations = (Source -> Maybe [MediaStreamSourceConfiguration])
-> (Source -> Maybe [MediaStreamSourceConfiguration] -> Source)
-> Lens
     Source
     Source
     (Maybe [MediaStreamSourceConfiguration])
     (Maybe [MediaStreamSourceConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Source' {Maybe [MediaStreamSourceConfiguration]
mediaStreamSourceConfigurations :: Maybe [MediaStreamSourceConfiguration]
$sel:mediaStreamSourceConfigurations:Source' :: Source -> Maybe [MediaStreamSourceConfiguration]
mediaStreamSourceConfigurations} -> Maybe [MediaStreamSourceConfiguration]
mediaStreamSourceConfigurations) (\s :: Source
s@Source' {} Maybe [MediaStreamSourceConfiguration]
a -> Source
s {$sel:mediaStreamSourceConfigurations:Source' :: Maybe [MediaStreamSourceConfiguration]
mediaStreamSourceConfigurations = Maybe [MediaStreamSourceConfiguration]
a} :: Source) ((Maybe [MediaStreamSourceConfiguration]
  -> f (Maybe [MediaStreamSourceConfiguration]))
 -> Source -> f Source)
-> ((Maybe [MediaStreamSourceConfiguration]
     -> f (Maybe [MediaStreamSourceConfiguration]))
    -> Maybe [MediaStreamSourceConfiguration]
    -> f (Maybe [MediaStreamSourceConfiguration]))
-> (Maybe [MediaStreamSourceConfiguration]
    -> f (Maybe [MediaStreamSourceConfiguration]))
-> Source
-> f Source
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MediaStreamSourceConfiguration]
  [MediaStreamSourceConfiguration]
  [MediaStreamSourceConfiguration]
  [MediaStreamSourceConfiguration]
-> Iso
     (Maybe [MediaStreamSourceConfiguration])
     (Maybe [MediaStreamSourceConfiguration])
     (Maybe [MediaStreamSourceConfiguration])
     (Maybe [MediaStreamSourceConfiguration])
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
  [MediaStreamSourceConfiguration]
  [MediaStreamSourceConfiguration]
  [MediaStreamSourceConfiguration]
  [MediaStreamSourceConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The range of IP addresses that should be allowed to contribute content
-- to your source. These IP addresses should be in the form of a Classless
-- Inter-Domain Routing (CIDR) block; for example, 10.0.0.0\/16.
source_whitelistCidr :: Lens.Lens' Source (Prelude.Maybe Prelude.Text)
source_whitelistCidr :: (Maybe Text -> f (Maybe Text)) -> Source -> f Source
source_whitelistCidr = (Source -> Maybe Text)
-> (Source -> Maybe Text -> Source)
-> Lens Source Source (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Source' {Maybe Text
whitelistCidr :: Maybe Text
$sel:whitelistCidr:Source' :: Source -> Maybe Text
whitelistCidr} -> Maybe Text
whitelistCidr) (\s :: Source
s@Source' {} Maybe Text
a -> Source
s {$sel:whitelistCidr:Source' :: Maybe Text
whitelistCidr = Maybe Text
a} :: Source)

-- | The ARN of the source.
source_sourceArn :: Lens.Lens' Source Prelude.Text
source_sourceArn :: (Text -> f Text) -> Source -> f Source
source_sourceArn = (Source -> Text)
-> (Source -> Text -> Source) -> Lens Source Source Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Source' {Text
sourceArn :: Text
$sel:sourceArn:Source' :: Source -> Text
sourceArn} -> Text
sourceArn) (\s :: Source
s@Source' {} Text
a -> Source
s {$sel:sourceArn:Source' :: Text
sourceArn = Text
a} :: Source)

-- | The name of the source.
source_name :: Lens.Lens' Source Prelude.Text
source_name :: (Text -> f Text) -> Source -> f Source
source_name = (Source -> Text)
-> (Source -> Text -> Source) -> Lens Source Source Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Source' {Text
name :: Text
$sel:name:Source' :: Source -> Text
name} -> Text
name) (\s :: Source
s@Source' {} Text
a -> Source
s {$sel:name:Source' :: Text
name = Text
a} :: Source)

instance Core.FromJSON Source where
  parseJSON :: Value -> Parser Source
parseJSON =
    String -> (Object -> Parser Source) -> Value -> Parser Source
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Source"
      ( \Object
x ->
          Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Encryption
-> Maybe Text
-> Maybe Int
-> Maybe Transport
-> Maybe Text
-> Maybe [MediaStreamSourceConfiguration]
-> Maybe Text
-> Text
-> Text
-> Source
Source'
            (Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> Maybe Encryption
 -> Maybe Text
 -> Maybe Int
 -> Maybe Transport
 -> Maybe Text
 -> Maybe [MediaStreamSourceConfiguration]
 -> Maybe Text
 -> Text
 -> Text
 -> Source)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Encryption
      -> Maybe Text
      -> Maybe Int
      -> Maybe Transport
      -> Maybe Text
      -> Maybe [MediaStreamSourceConfiguration]
      -> Maybe Text
      -> Text
      -> Text
      -> Source)
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
"entitlementArn")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Encryption
   -> Maybe Text
   -> Maybe Int
   -> Maybe Transport
   -> Maybe Text
   -> Maybe [MediaStreamSourceConfiguration]
   -> Maybe Text
   -> Text
   -> Text
   -> Source)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Encryption
      -> Maybe Text
      -> Maybe Int
      -> Maybe Transport
      -> Maybe Text
      -> Maybe [MediaStreamSourceConfiguration]
      -> Maybe Text
      -> Text
      -> Text
      -> Source)
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
"dataTransferSubscriberFeePercent")
            Parser
  (Maybe Text
   -> Maybe Encryption
   -> Maybe Text
   -> Maybe Int
   -> Maybe Transport
   -> Maybe Text
   -> Maybe [MediaStreamSourceConfiguration]
   -> Maybe Text
   -> Text
   -> Text
   -> Source)
-> Parser (Maybe Text)
-> Parser
     (Maybe Encryption
      -> Maybe Text
      -> Maybe Int
      -> Maybe Transport
      -> Maybe Text
      -> Maybe [MediaStreamSourceConfiguration]
      -> Maybe Text
      -> Text
      -> Text
      -> Source)
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
"vpcInterfaceName")
            Parser
  (Maybe Encryption
   -> Maybe Text
   -> Maybe Int
   -> Maybe Transport
   -> Maybe Text
   -> Maybe [MediaStreamSourceConfiguration]
   -> Maybe Text
   -> Text
   -> Text
   -> Source)
-> Parser (Maybe Encryption)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Transport
      -> Maybe Text
      -> Maybe [MediaStreamSourceConfiguration]
      -> Maybe Text
      -> Text
      -> Text
      -> Source)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Encryption)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"decryption")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Transport
   -> Maybe Text
   -> Maybe [MediaStreamSourceConfiguration]
   -> Maybe Text
   -> Text
   -> Text
   -> Source)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Transport
      -> Maybe Text
      -> Maybe [MediaStreamSourceConfiguration]
      -> Maybe Text
      -> Text
      -> Text
      -> Source)
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
"ingestIp")
            Parser
  (Maybe Int
   -> Maybe Transport
   -> Maybe Text
   -> Maybe [MediaStreamSourceConfiguration]
   -> Maybe Text
   -> Text
   -> Text
   -> Source)
-> Parser (Maybe Int)
-> Parser
     (Maybe Transport
      -> Maybe Text
      -> Maybe [MediaStreamSourceConfiguration]
      -> Maybe Text
      -> Text
      -> Text
      -> Source)
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
"ingestPort")
            Parser
  (Maybe Transport
   -> Maybe Text
   -> Maybe [MediaStreamSourceConfiguration]
   -> Maybe Text
   -> Text
   -> Text
   -> Source)
-> Parser (Maybe Transport)
-> Parser
     (Maybe Text
      -> Maybe [MediaStreamSourceConfiguration]
      -> Maybe Text
      -> Text
      -> Text
      -> Source)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Transport)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"transport")
            Parser
  (Maybe Text
   -> Maybe [MediaStreamSourceConfiguration]
   -> Maybe Text
   -> Text
   -> Text
   -> Source)
-> Parser (Maybe Text)
-> Parser
     (Maybe [MediaStreamSourceConfiguration]
      -> Maybe Text -> Text -> Text -> Source)
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
"description")
            Parser
  (Maybe [MediaStreamSourceConfiguration]
   -> Maybe Text -> Text -> Text -> Source)
-> Parser (Maybe [MediaStreamSourceConfiguration])
-> Parser (Maybe Text -> Text -> Text -> Source)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Parser (Maybe (Maybe [MediaStreamSourceConfiguration]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"mediaStreamSourceConfigurations"
                            Parser (Maybe (Maybe [MediaStreamSourceConfiguration]))
-> Maybe [MediaStreamSourceConfiguration]
-> Parser (Maybe [MediaStreamSourceConfiguration])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [MediaStreamSourceConfiguration]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe Text -> Text -> Text -> Source)
-> Parser (Maybe Text) -> Parser (Text -> Text -> Source)
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
"whitelistCidr")
            Parser (Text -> Text -> Source)
-> Parser Text -> Parser (Text -> Source)
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
"sourceArn")
            Parser (Text -> Source) -> Parser Text -> Parser Source
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
"name")
      )

instance Prelude.Hashable Source

instance Prelude.NFData Source