{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaLive.Types.MediaConnectFlow where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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' {$sel:flowArn:MediaConnectFlow' :: Maybe Text
flowArn = 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 :: Lens' MediaConnectFlow (Maybe Text)
mediaConnectFlow_flowArn = 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 Data.FromJSON MediaConnectFlow where
  parseJSON :: Value -> Parser MediaConnectFlow
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MediaConnectFlow"
      ( \Object
x ->
          Maybe Text -> MediaConnectFlow
MediaConnectFlow' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"flowArn")
      )

instance Prelude.Hashable MediaConnectFlow where
  hashWithSalt :: Int -> MediaConnectFlow -> Int
hashWithSalt Int
_salt MediaConnectFlow' {Maybe Text
flowArn :: Maybe Text
$sel:flowArn:MediaConnectFlow' :: MediaConnectFlow -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
flowArn

instance Prelude.NFData MediaConnectFlow where
  rnf :: MediaConnectFlow -> ()
rnf MediaConnectFlow' {Maybe Text
flowArn :: Maybe Text
$sel:flowArn:MediaConnectFlow' :: MediaConnectFlow -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
flowArn