{-# 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.Flow
-- 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.Flow where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types.Entitlement
import Amazonka.MediaConnect.Types.FailoverConfig
import Amazonka.MediaConnect.Types.MediaStream
import Amazonka.MediaConnect.Types.Output
import Amazonka.MediaConnect.Types.Source
import Amazonka.MediaConnect.Types.Status
import Amazonka.MediaConnect.Types.VpcInterface
import qualified Amazonka.Prelude as Prelude

-- | The settings for a flow, including its source, outputs, and
-- entitlements.
--
-- /See:/ 'newFlow' smart constructor.
data Flow = Flow'
  { -- | The media streams that are associated with the flow. After you associate
    -- a media stream with a source, you can also associate it with outputs on
    -- the flow.
    Flow -> Maybe [MediaStream]
mediaStreams :: Prelude.Maybe [MediaStream],
    Flow -> Maybe FailoverConfig
sourceFailoverConfig :: Prelude.Maybe FailoverConfig,
    -- | The VPC Interfaces for this flow.
    Flow -> Maybe [VpcInterface]
vpcInterfaces :: Prelude.Maybe [VpcInterface],
    Flow -> Maybe [Source]
sources :: Prelude.Maybe [Source],
    -- | The IP address from which video will be sent to output destinations.
    Flow -> Maybe Text
egressIp :: Prelude.Maybe Prelude.Text,
    -- | A description of the flow. This value is not used or seen outside of the
    -- current AWS Elemental MediaConnect account.
    Flow -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The current status of the flow.
    Flow -> Status
status :: Status,
    -- | The entitlements in this flow.
    Flow -> [Entitlement]
entitlements :: [Entitlement],
    -- | The outputs in this flow.
    Flow -> [Output]
outputs :: [Output],
    -- | The Availability Zone that you want to create the flow in. These options
    -- are limited to the Availability Zones within the current AWS.
    Flow -> Text
availabilityZone :: Prelude.Text,
    -- | The Amazon Resource Name (ARN), a unique identifier for any AWS
    -- resource, of the flow.
    Flow -> Text
flowArn :: Prelude.Text,
    Flow -> Source
source :: Source,
    -- | The name of the flow.
    Flow -> Text
name :: Prelude.Text
  }
  deriving (Flow -> Flow -> Bool
(Flow -> Flow -> Bool) -> (Flow -> Flow -> Bool) -> Eq Flow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Flow -> Flow -> Bool
$c/= :: Flow -> Flow -> Bool
== :: Flow -> Flow -> Bool
$c== :: Flow -> Flow -> Bool
Prelude.Eq, ReadPrec [Flow]
ReadPrec Flow
Int -> ReadS Flow
ReadS [Flow]
(Int -> ReadS Flow)
-> ReadS [Flow] -> ReadPrec Flow -> ReadPrec [Flow] -> Read Flow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Flow]
$creadListPrec :: ReadPrec [Flow]
readPrec :: ReadPrec Flow
$creadPrec :: ReadPrec Flow
readList :: ReadS [Flow]
$creadList :: ReadS [Flow]
readsPrec :: Int -> ReadS Flow
$creadsPrec :: Int -> ReadS Flow
Prelude.Read, Int -> Flow -> ShowS
[Flow] -> ShowS
Flow -> String
(Int -> Flow -> ShowS)
-> (Flow -> String) -> ([Flow] -> ShowS) -> Show Flow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Flow] -> ShowS
$cshowList :: [Flow] -> ShowS
show :: Flow -> String
$cshow :: Flow -> String
showsPrec :: Int -> Flow -> ShowS
$cshowsPrec :: Int -> Flow -> ShowS
Prelude.Show, (forall x. Flow -> Rep Flow x)
-> (forall x. Rep Flow x -> Flow) -> Generic Flow
forall x. Rep Flow x -> Flow
forall x. Flow -> Rep Flow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Flow x -> Flow
$cfrom :: forall x. Flow -> Rep Flow x
Prelude.Generic)

-- |
-- Create a value of 'Flow' 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:
--
-- 'mediaStreams', 'flow_mediaStreams' - The media streams that are associated with the flow. After you associate
-- a media stream with a source, you can also associate it with outputs on
-- the flow.
--
-- 'sourceFailoverConfig', 'flow_sourceFailoverConfig' - Undocumented member.
--
-- 'vpcInterfaces', 'flow_vpcInterfaces' - The VPC Interfaces for this flow.
--
-- 'sources', 'flow_sources' - Undocumented member.
--
-- 'egressIp', 'flow_egressIp' - The IP address from which video will be sent to output destinations.
--
-- 'description', 'flow_description' - A description of the flow. This value is not used or seen outside of the
-- current AWS Elemental MediaConnect account.
--
-- 'status', 'flow_status' - The current status of the flow.
--
-- 'entitlements', 'flow_entitlements' - The entitlements in this flow.
--
-- 'outputs', 'flow_outputs' - The outputs in this flow.
--
-- 'availabilityZone', 'flow_availabilityZone' - The Availability Zone that you want to create the flow in. These options
-- are limited to the Availability Zones within the current AWS.
--
-- 'flowArn', 'flow_flowArn' - The Amazon Resource Name (ARN), a unique identifier for any AWS
-- resource, of the flow.
--
-- 'source', 'flow_source' - Undocumented member.
--
-- 'name', 'flow_name' - The name of the flow.
newFlow ::
  -- | 'status'
  Status ->
  -- | 'availabilityZone'
  Prelude.Text ->
  -- | 'flowArn'
  Prelude.Text ->
  -- | 'source'
  Source ->
  -- | 'name'
  Prelude.Text ->
  Flow
newFlow :: Status -> Text -> Text -> Source -> Text -> Flow
newFlow
  Status
pStatus_
  Text
pAvailabilityZone_
  Text
pFlowArn_
  Source
pSource_
  Text
pName_ =
    Flow' :: Maybe [MediaStream]
-> Maybe FailoverConfig
-> Maybe [VpcInterface]
-> Maybe [Source]
-> Maybe Text
-> Maybe Text
-> Status
-> [Entitlement]
-> [Output]
-> Text
-> Text
-> Source
-> Text
-> Flow
Flow'
      { $sel:mediaStreams:Flow' :: Maybe [MediaStream]
mediaStreams = Maybe [MediaStream]
forall a. Maybe a
Prelude.Nothing,
        $sel:sourceFailoverConfig:Flow' :: Maybe FailoverConfig
sourceFailoverConfig = Maybe FailoverConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:vpcInterfaces:Flow' :: Maybe [VpcInterface]
vpcInterfaces = Maybe [VpcInterface]
forall a. Maybe a
Prelude.Nothing,
        $sel:sources:Flow' :: Maybe [Source]
sources = Maybe [Source]
forall a. Maybe a
Prelude.Nothing,
        $sel:egressIp:Flow' :: Maybe Text
egressIp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:description:Flow' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:status:Flow' :: Status
status = Status
pStatus_,
        $sel:entitlements:Flow' :: [Entitlement]
entitlements = [Entitlement]
forall a. Monoid a => a
Prelude.mempty,
        $sel:outputs:Flow' :: [Output]
outputs = [Output]
forall a. Monoid a => a
Prelude.mempty,
        $sel:availabilityZone:Flow' :: Text
availabilityZone = Text
pAvailabilityZone_,
        $sel:flowArn:Flow' :: Text
flowArn = Text
pFlowArn_,
        $sel:source:Flow' :: Source
source = Source
pSource_,
        $sel:name:Flow' :: Text
name = Text
pName_
      }

-- | The media streams that are associated with the flow. After you associate
-- a media stream with a source, you can also associate it with outputs on
-- the flow.
flow_mediaStreams :: Lens.Lens' Flow (Prelude.Maybe [MediaStream])
flow_mediaStreams :: (Maybe [MediaStream] -> f (Maybe [MediaStream])) -> Flow -> f Flow
flow_mediaStreams = (Flow -> Maybe [MediaStream])
-> (Flow -> Maybe [MediaStream] -> Flow)
-> Lens Flow Flow (Maybe [MediaStream]) (Maybe [MediaStream])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Flow' {Maybe [MediaStream]
mediaStreams :: Maybe [MediaStream]
$sel:mediaStreams:Flow' :: Flow -> Maybe [MediaStream]
mediaStreams} -> Maybe [MediaStream]
mediaStreams) (\s :: Flow
s@Flow' {} Maybe [MediaStream]
a -> Flow
s {$sel:mediaStreams:Flow' :: Maybe [MediaStream]
mediaStreams = Maybe [MediaStream]
a} :: Flow) ((Maybe [MediaStream] -> f (Maybe [MediaStream]))
 -> Flow -> f Flow)
-> ((Maybe [MediaStream] -> f (Maybe [MediaStream]))
    -> Maybe [MediaStream] -> f (Maybe [MediaStream]))
-> (Maybe [MediaStream] -> f (Maybe [MediaStream]))
-> Flow
-> f Flow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [MediaStream] [MediaStream] [MediaStream] [MediaStream]
-> Iso
     (Maybe [MediaStream])
     (Maybe [MediaStream])
     (Maybe [MediaStream])
     (Maybe [MediaStream])
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 [MediaStream] [MediaStream] [MediaStream] [MediaStream]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
flow_sourceFailoverConfig :: Lens.Lens' Flow (Prelude.Maybe FailoverConfig)
flow_sourceFailoverConfig :: (Maybe FailoverConfig -> f (Maybe FailoverConfig))
-> Flow -> f Flow
flow_sourceFailoverConfig = (Flow -> Maybe FailoverConfig)
-> (Flow -> Maybe FailoverConfig -> Flow)
-> Lens Flow Flow (Maybe FailoverConfig) (Maybe FailoverConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Flow' {Maybe FailoverConfig
sourceFailoverConfig :: Maybe FailoverConfig
$sel:sourceFailoverConfig:Flow' :: Flow -> Maybe FailoverConfig
sourceFailoverConfig} -> Maybe FailoverConfig
sourceFailoverConfig) (\s :: Flow
s@Flow' {} Maybe FailoverConfig
a -> Flow
s {$sel:sourceFailoverConfig:Flow' :: Maybe FailoverConfig
sourceFailoverConfig = Maybe FailoverConfig
a} :: Flow)

-- | The VPC Interfaces for this flow.
flow_vpcInterfaces :: Lens.Lens' Flow (Prelude.Maybe [VpcInterface])
flow_vpcInterfaces :: (Maybe [VpcInterface] -> f (Maybe [VpcInterface]))
-> Flow -> f Flow
flow_vpcInterfaces = (Flow -> Maybe [VpcInterface])
-> (Flow -> Maybe [VpcInterface] -> Flow)
-> Lens Flow Flow (Maybe [VpcInterface]) (Maybe [VpcInterface])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Flow' {Maybe [VpcInterface]
vpcInterfaces :: Maybe [VpcInterface]
$sel:vpcInterfaces:Flow' :: Flow -> Maybe [VpcInterface]
vpcInterfaces} -> Maybe [VpcInterface]
vpcInterfaces) (\s :: Flow
s@Flow' {} Maybe [VpcInterface]
a -> Flow
s {$sel:vpcInterfaces:Flow' :: Maybe [VpcInterface]
vpcInterfaces = Maybe [VpcInterface]
a} :: Flow) ((Maybe [VpcInterface] -> f (Maybe [VpcInterface]))
 -> Flow -> f Flow)
-> ((Maybe [VpcInterface] -> f (Maybe [VpcInterface]))
    -> Maybe [VpcInterface] -> f (Maybe [VpcInterface]))
-> (Maybe [VpcInterface] -> f (Maybe [VpcInterface]))
-> Flow
-> f Flow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [VpcInterface] [VpcInterface] [VpcInterface] [VpcInterface]
-> Iso
     (Maybe [VpcInterface])
     (Maybe [VpcInterface])
     (Maybe [VpcInterface])
     (Maybe [VpcInterface])
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 [VpcInterface] [VpcInterface] [VpcInterface] [VpcInterface]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
flow_sources :: Lens.Lens' Flow (Prelude.Maybe [Source])
flow_sources :: (Maybe [Source] -> f (Maybe [Source])) -> Flow -> f Flow
flow_sources = (Flow -> Maybe [Source])
-> (Flow -> Maybe [Source] -> Flow)
-> Lens Flow Flow (Maybe [Source]) (Maybe [Source])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Flow' {Maybe [Source]
sources :: Maybe [Source]
$sel:sources:Flow' :: Flow -> Maybe [Source]
sources} -> Maybe [Source]
sources) (\s :: Flow
s@Flow' {} Maybe [Source]
a -> Flow
s {$sel:sources:Flow' :: Maybe [Source]
sources = Maybe [Source]
a} :: Flow) ((Maybe [Source] -> f (Maybe [Source])) -> Flow -> f Flow)
-> ((Maybe [Source] -> f (Maybe [Source]))
    -> Maybe [Source] -> f (Maybe [Source]))
-> (Maybe [Source] -> f (Maybe [Source]))
-> Flow
-> f Flow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Source] [Source] [Source] [Source]
-> Iso
     (Maybe [Source]) (Maybe [Source]) (Maybe [Source]) (Maybe [Source])
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 [Source] [Source] [Source] [Source]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The IP address from which video will be sent to output destinations.
flow_egressIp :: Lens.Lens' Flow (Prelude.Maybe Prelude.Text)
flow_egressIp :: (Maybe Text -> f (Maybe Text)) -> Flow -> f Flow
flow_egressIp = (Flow -> Maybe Text)
-> (Flow -> Maybe Text -> Flow)
-> Lens Flow Flow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Flow' {Maybe Text
egressIp :: Maybe Text
$sel:egressIp:Flow' :: Flow -> Maybe Text
egressIp} -> Maybe Text
egressIp) (\s :: Flow
s@Flow' {} Maybe Text
a -> Flow
s {$sel:egressIp:Flow' :: Maybe Text
egressIp = Maybe Text
a} :: Flow)

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

-- | The current status of the flow.
flow_status :: Lens.Lens' Flow Status
flow_status :: (Status -> f Status) -> Flow -> f Flow
flow_status = (Flow -> Status)
-> (Flow -> Status -> Flow) -> Lens Flow Flow Status Status
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Flow' {Status
status :: Status
$sel:status:Flow' :: Flow -> Status
status} -> Status
status) (\s :: Flow
s@Flow' {} Status
a -> Flow
s {$sel:status:Flow' :: Status
status = Status
a} :: Flow)

-- | The entitlements in this flow.
flow_entitlements :: Lens.Lens' Flow [Entitlement]
flow_entitlements :: ([Entitlement] -> f [Entitlement]) -> Flow -> f Flow
flow_entitlements = (Flow -> [Entitlement])
-> (Flow -> [Entitlement] -> Flow)
-> Lens Flow Flow [Entitlement] [Entitlement]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Flow' {[Entitlement]
entitlements :: [Entitlement]
$sel:entitlements:Flow' :: Flow -> [Entitlement]
entitlements} -> [Entitlement]
entitlements) (\s :: Flow
s@Flow' {} [Entitlement]
a -> Flow
s {$sel:entitlements:Flow' :: [Entitlement]
entitlements = [Entitlement]
a} :: Flow) (([Entitlement] -> f [Entitlement]) -> Flow -> f Flow)
-> (([Entitlement] -> f [Entitlement])
    -> [Entitlement] -> f [Entitlement])
-> ([Entitlement] -> f [Entitlement])
-> Flow
-> f Flow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Entitlement] -> f [Entitlement])
-> [Entitlement] -> f [Entitlement]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The outputs in this flow.
flow_outputs :: Lens.Lens' Flow [Output]
flow_outputs :: ([Output] -> f [Output]) -> Flow -> f Flow
flow_outputs = (Flow -> [Output])
-> (Flow -> [Output] -> Flow) -> Lens Flow Flow [Output] [Output]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Flow' {[Output]
outputs :: [Output]
$sel:outputs:Flow' :: Flow -> [Output]
outputs} -> [Output]
outputs) (\s :: Flow
s@Flow' {} [Output]
a -> Flow
s {$sel:outputs:Flow' :: [Output]
outputs = [Output]
a} :: Flow) (([Output] -> f [Output]) -> Flow -> f Flow)
-> (([Output] -> f [Output]) -> [Output] -> f [Output])
-> ([Output] -> f [Output])
-> Flow
-> f Flow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Output] -> f [Output]) -> [Output] -> f [Output]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Availability Zone that you want to create the flow in. These options
-- are limited to the Availability Zones within the current AWS.
flow_availabilityZone :: Lens.Lens' Flow Prelude.Text
flow_availabilityZone :: (Text -> f Text) -> Flow -> f Flow
flow_availabilityZone = (Flow -> Text)
-> (Flow -> Text -> Flow) -> Lens Flow Flow Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Flow' {Text
availabilityZone :: Text
$sel:availabilityZone:Flow' :: Flow -> Text
availabilityZone} -> Text
availabilityZone) (\s :: Flow
s@Flow' {} Text
a -> Flow
s {$sel:availabilityZone:Flow' :: Text
availabilityZone = Text
a} :: Flow)

-- | The Amazon Resource Name (ARN), a unique identifier for any AWS
-- resource, of the flow.
flow_flowArn :: Lens.Lens' Flow Prelude.Text
flow_flowArn :: (Text -> f Text) -> Flow -> f Flow
flow_flowArn = (Flow -> Text)
-> (Flow -> Text -> Flow) -> Lens Flow Flow Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Flow' {Text
flowArn :: Text
$sel:flowArn:Flow' :: Flow -> Text
flowArn} -> Text
flowArn) (\s :: Flow
s@Flow' {} Text
a -> Flow
s {$sel:flowArn:Flow' :: Text
flowArn = Text
a} :: Flow)

-- | Undocumented member.
flow_source :: Lens.Lens' Flow Source
flow_source :: (Source -> f Source) -> Flow -> f Flow
flow_source = (Flow -> Source)
-> (Flow -> Source -> Flow) -> Lens Flow Flow Source Source
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Flow' {Source
source :: Source
$sel:source:Flow' :: Flow -> Source
source} -> Source
source) (\s :: Flow
s@Flow' {} Source
a -> Flow
s {$sel:source:Flow' :: Source
source = Source
a} :: Flow)

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

instance Core.FromJSON Flow where
  parseJSON :: Value -> Parser Flow
parseJSON =
    String -> (Object -> Parser Flow) -> Value -> Parser Flow
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Flow"
      ( \Object
x ->
          Maybe [MediaStream]
-> Maybe FailoverConfig
-> Maybe [VpcInterface]
-> Maybe [Source]
-> Maybe Text
-> Maybe Text
-> Status
-> [Entitlement]
-> [Output]
-> Text
-> Text
-> Source
-> Text
-> Flow
Flow'
            (Maybe [MediaStream]
 -> Maybe FailoverConfig
 -> Maybe [VpcInterface]
 -> Maybe [Source]
 -> Maybe Text
 -> Maybe Text
 -> Status
 -> [Entitlement]
 -> [Output]
 -> Text
 -> Text
 -> Source
 -> Text
 -> Flow)
-> Parser (Maybe [MediaStream])
-> Parser
     (Maybe FailoverConfig
      -> Maybe [VpcInterface]
      -> Maybe [Source]
      -> Maybe Text
      -> Maybe Text
      -> Status
      -> [Entitlement]
      -> [Output]
      -> Text
      -> Text
      -> Source
      -> Text
      -> Flow)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [MediaStream]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"mediaStreams" Parser (Maybe (Maybe [MediaStream]))
-> Maybe [MediaStream] -> Parser (Maybe [MediaStream])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [MediaStream]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe FailoverConfig
   -> Maybe [VpcInterface]
   -> Maybe [Source]
   -> Maybe Text
   -> Maybe Text
   -> Status
   -> [Entitlement]
   -> [Output]
   -> Text
   -> Text
   -> Source
   -> Text
   -> Flow)
-> Parser (Maybe FailoverConfig)
-> Parser
     (Maybe [VpcInterface]
      -> Maybe [Source]
      -> Maybe Text
      -> Maybe Text
      -> Status
      -> [Entitlement]
      -> [Output]
      -> Text
      -> Text
      -> Source
      -> Text
      -> Flow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FailoverConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sourceFailoverConfig")
            Parser
  (Maybe [VpcInterface]
   -> Maybe [Source]
   -> Maybe Text
   -> Maybe Text
   -> Status
   -> [Entitlement]
   -> [Output]
   -> Text
   -> Text
   -> Source
   -> Text
   -> Flow)
-> Parser (Maybe [VpcInterface])
-> Parser
     (Maybe [Source]
      -> Maybe Text
      -> Maybe Text
      -> Status
      -> [Entitlement]
      -> [Output]
      -> Text
      -> Text
      -> Source
      -> Text
      -> Flow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [VpcInterface]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"vpcInterfaces" Parser (Maybe (Maybe [VpcInterface]))
-> Maybe [VpcInterface] -> Parser (Maybe [VpcInterface])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [VpcInterface]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe [Source]
   -> Maybe Text
   -> Maybe Text
   -> Status
   -> [Entitlement]
   -> [Output]
   -> Text
   -> Text
   -> Source
   -> Text
   -> Flow)
-> Parser (Maybe [Source])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Status
      -> [Entitlement]
      -> [Output]
      -> Text
      -> Text
      -> Source
      -> Text
      -> Flow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Source]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sources" Parser (Maybe (Maybe [Source]))
-> Maybe [Source] -> Parser (Maybe [Source])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Source]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text
   -> Status
   -> [Entitlement]
   -> [Output]
   -> Text
   -> Text
   -> Source
   -> Text
   -> Flow)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Status
      -> [Entitlement]
      -> [Output]
      -> Text
      -> Text
      -> Source
      -> Text
      -> Flow)
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
"egressIp")
            Parser
  (Maybe Text
   -> Status
   -> [Entitlement]
   -> [Output]
   -> Text
   -> Text
   -> Source
   -> Text
   -> Flow)
-> Parser (Maybe Text)
-> Parser
     (Status
      -> [Entitlement]
      -> [Output]
      -> Text
      -> Text
      -> Source
      -> Text
      -> Flow)
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
  (Status
   -> [Entitlement]
   -> [Output]
   -> Text
   -> Text
   -> Source
   -> Text
   -> Flow)
-> Parser Status
-> Parser
     ([Entitlement]
      -> [Output] -> Text -> Text -> Source -> Text -> Flow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Status
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
            Parser
  ([Entitlement]
   -> [Output] -> Text -> Text -> Source -> Text -> Flow)
-> Parser [Entitlement]
-> Parser ([Output] -> Text -> Text -> Source -> Text -> Flow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [Entitlement])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"entitlements" Parser (Maybe [Entitlement])
-> [Entitlement] -> Parser [Entitlement]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Entitlement]
forall a. Monoid a => a
Prelude.mempty)
            Parser ([Output] -> Text -> Text -> Source -> Text -> Flow)
-> Parser [Output]
-> Parser (Text -> Text -> Source -> Text -> Flow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [Output])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"outputs" Parser (Maybe [Output]) -> [Output] -> Parser [Output]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Output]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Text -> Text -> Source -> Text -> Flow)
-> Parser Text -> Parser (Text -> Source -> Text -> Flow)
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
"availabilityZone")
            Parser (Text -> Source -> Text -> Flow)
-> Parser Text -> Parser (Source -> Text -> Flow)
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
"flowArn")
            Parser (Source -> Text -> Flow)
-> Parser Source -> Parser (Text -> Flow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Source
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"source")
            Parser (Text -> Flow) -> Parser Text -> Parser Flow
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 Flow

instance Prelude.NFData Flow