{-# 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.MediaConnectFlowRequest
-- 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.MediaConnectFlowRequest 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:/ 'newMediaConnectFlowRequest' smart constructor.
data MediaConnectFlowRequest = MediaConnectFlowRequest'
  { -- | The ARN of the MediaConnect Flow that you want to use as a source.
    MediaConnectFlowRequest -> Maybe Text
flowArn :: Prelude.Maybe Prelude.Text
  }
  deriving (MediaConnectFlowRequest -> MediaConnectFlowRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MediaConnectFlowRequest -> MediaConnectFlowRequest -> Bool
$c/= :: MediaConnectFlowRequest -> MediaConnectFlowRequest -> Bool
== :: MediaConnectFlowRequest -> MediaConnectFlowRequest -> Bool
$c== :: MediaConnectFlowRequest -> MediaConnectFlowRequest -> Bool
Prelude.Eq, ReadPrec [MediaConnectFlowRequest]
ReadPrec MediaConnectFlowRequest
Int -> ReadS MediaConnectFlowRequest
ReadS [MediaConnectFlowRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MediaConnectFlowRequest]
$creadListPrec :: ReadPrec [MediaConnectFlowRequest]
readPrec :: ReadPrec MediaConnectFlowRequest
$creadPrec :: ReadPrec MediaConnectFlowRequest
readList :: ReadS [MediaConnectFlowRequest]
$creadList :: ReadS [MediaConnectFlowRequest]
readsPrec :: Int -> ReadS MediaConnectFlowRequest
$creadsPrec :: Int -> ReadS MediaConnectFlowRequest
Prelude.Read, Int -> MediaConnectFlowRequest -> ShowS
[MediaConnectFlowRequest] -> ShowS
MediaConnectFlowRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MediaConnectFlowRequest] -> ShowS
$cshowList :: [MediaConnectFlowRequest] -> ShowS
show :: MediaConnectFlowRequest -> String
$cshow :: MediaConnectFlowRequest -> String
showsPrec :: Int -> MediaConnectFlowRequest -> ShowS
$cshowsPrec :: Int -> MediaConnectFlowRequest -> ShowS
Prelude.Show, forall x. Rep MediaConnectFlowRequest x -> MediaConnectFlowRequest
forall x. MediaConnectFlowRequest -> Rep MediaConnectFlowRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MediaConnectFlowRequest x -> MediaConnectFlowRequest
$cfrom :: forall x. MediaConnectFlowRequest -> Rep MediaConnectFlowRequest x
Prelude.Generic)

-- |
-- Create a value of 'MediaConnectFlowRequest' 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', 'mediaConnectFlowRequest_flowArn' - The ARN of the MediaConnect Flow that you want to use as a source.
newMediaConnectFlowRequest ::
  MediaConnectFlowRequest
newMediaConnectFlowRequest :: MediaConnectFlowRequest
newMediaConnectFlowRequest =
  MediaConnectFlowRequest' {$sel:flowArn:MediaConnectFlowRequest' :: Maybe Text
flowArn = forall a. Maybe a
Prelude.Nothing}

-- | The ARN of the MediaConnect Flow that you want to use as a source.
mediaConnectFlowRequest_flowArn :: Lens.Lens' MediaConnectFlowRequest (Prelude.Maybe Prelude.Text)
mediaConnectFlowRequest_flowArn :: Lens' MediaConnectFlowRequest (Maybe Text)
mediaConnectFlowRequest_flowArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaConnectFlowRequest' {Maybe Text
flowArn :: Maybe Text
$sel:flowArn:MediaConnectFlowRequest' :: MediaConnectFlowRequest -> Maybe Text
flowArn} -> Maybe Text
flowArn) (\s :: MediaConnectFlowRequest
s@MediaConnectFlowRequest' {} Maybe Text
a -> MediaConnectFlowRequest
s {$sel:flowArn:MediaConnectFlowRequest' :: Maybe Text
flowArn = Maybe Text
a} :: MediaConnectFlowRequest)

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

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

instance Data.ToJSON MediaConnectFlowRequest where
  toJSON :: MediaConnectFlowRequest -> Value
toJSON MediaConnectFlowRequest' {Maybe Text
flowArn :: Maybe Text
$sel:flowArn:MediaConnectFlowRequest' :: MediaConnectFlowRequest -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"flowArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
flowArn]
      )