{-# 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.MediaLive.Types.MediaConnectFlow
-- 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.MediaLive.Types.MediaConnectFlow where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The settings for a MediaConnect Flow.
--
-- /See:/ 'newMediaConnectFlow' smart constructor.
data MediaConnectFlow = MediaConnectFlow'
  { -- | The unique ARN of the MediaConnect Flow being used as a source.
    MediaConnectFlow -> Maybe Text
flowArn :: Prelude.Maybe Prelude.Text
  }
  deriving (MediaConnectFlow -> MediaConnectFlow -> Bool
(MediaConnectFlow -> MediaConnectFlow -> Bool)
-> (MediaConnectFlow -> MediaConnectFlow -> Bool)
-> Eq MediaConnectFlow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MediaConnectFlow -> MediaConnectFlow -> Bool
$c/= :: MediaConnectFlow -> MediaConnectFlow -> Bool
== :: MediaConnectFlow -> MediaConnectFlow -> Bool
$c== :: MediaConnectFlow -> MediaConnectFlow -> Bool
Prelude.Eq, ReadPrec [MediaConnectFlow]
ReadPrec MediaConnectFlow
Int -> ReadS MediaConnectFlow
ReadS [MediaConnectFlow]
(Int -> ReadS MediaConnectFlow)
-> ReadS [MediaConnectFlow]
-> ReadPrec MediaConnectFlow
-> ReadPrec [MediaConnectFlow]
-> Read MediaConnectFlow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MediaConnectFlow]
$creadListPrec :: ReadPrec [MediaConnectFlow]
readPrec :: ReadPrec MediaConnectFlow
$creadPrec :: ReadPrec MediaConnectFlow
readList :: ReadS [MediaConnectFlow]
$creadList :: ReadS [MediaConnectFlow]
readsPrec :: Int -> ReadS MediaConnectFlow
$creadsPrec :: Int -> ReadS MediaConnectFlow
Prelude.Read, Int -> MediaConnectFlow -> ShowS
[MediaConnectFlow] -> ShowS
MediaConnectFlow -> String
(Int -> MediaConnectFlow -> ShowS)
-> (MediaConnectFlow -> String)
-> ([MediaConnectFlow] -> ShowS)
-> Show MediaConnectFlow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MediaConnectFlow] -> ShowS
$cshowList :: [MediaConnectFlow] -> ShowS
show :: MediaConnectFlow -> String
$cshow :: MediaConnectFlow -> String
showsPrec :: Int -> MediaConnectFlow -> ShowS
$cshowsPrec :: Int -> MediaConnectFlow -> ShowS
Prelude.Show, (forall x. MediaConnectFlow -> Rep MediaConnectFlow x)
-> (forall x. Rep MediaConnectFlow x -> MediaConnectFlow)
-> Generic MediaConnectFlow
forall x. Rep MediaConnectFlow x -> MediaConnectFlow
forall x. MediaConnectFlow -> Rep MediaConnectFlow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MediaConnectFlow x -> MediaConnectFlow
$cfrom :: forall x. MediaConnectFlow -> Rep MediaConnectFlow x
Prelude.Generic)

-- |
-- Create a value of 'MediaConnectFlow' 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:
--
-- 'flowArn', 'mediaConnectFlow_flowArn' - The unique ARN of the MediaConnect Flow being used as a source.
newMediaConnectFlow ::
  MediaConnectFlow
newMediaConnectFlow :: MediaConnectFlow
newMediaConnectFlow =
  MediaConnectFlow' :: Maybe Text -> MediaConnectFlow
MediaConnectFlow' {$sel:flowArn:MediaConnectFlow' :: Maybe Text
flowArn = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The unique ARN of the MediaConnect Flow being used as a source.
mediaConnectFlow_flowArn :: Lens.Lens' MediaConnectFlow (Prelude.Maybe Prelude.Text)
mediaConnectFlow_flowArn :: (Maybe Text -> f (Maybe Text))
-> MediaConnectFlow -> f MediaConnectFlow
mediaConnectFlow_flowArn = (MediaConnectFlow -> Maybe Text)
-> (MediaConnectFlow -> Maybe Text -> MediaConnectFlow)
-> Lens MediaConnectFlow MediaConnectFlow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaConnectFlow' {Maybe Text
flowArn :: Maybe Text
$sel:flowArn:MediaConnectFlow' :: MediaConnectFlow -> Maybe Text
flowArn} -> Maybe Text
flowArn) (\s :: MediaConnectFlow
s@MediaConnectFlow' {} Maybe Text
a -> MediaConnectFlow
s {$sel:flowArn:MediaConnectFlow' :: Maybe Text
flowArn = Maybe Text
a} :: MediaConnectFlow)

instance Core.FromJSON MediaConnectFlow where
  parseJSON :: Value -> Parser MediaConnectFlow
parseJSON =
    String
-> (Object -> Parser MediaConnectFlow)
-> Value
-> Parser MediaConnectFlow
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MediaConnectFlow"
      ( \Object
x ->
          Maybe Text -> MediaConnectFlow
MediaConnectFlow' (Maybe Text -> MediaConnectFlow)
-> Parser (Maybe Text) -> Parser MediaConnectFlow
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
"flowArn")
      )

instance Prelude.Hashable MediaConnectFlow

instance Prelude.NFData MediaConnectFlow