{-# 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-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.MediaConnectFlowRequest 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:/ '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
(MediaConnectFlowRequest -> MediaConnectFlowRequest -> Bool)
-> (MediaConnectFlowRequest -> MediaConnectFlowRequest -> Bool)
-> Eq MediaConnectFlowRequest
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]
(Int -> ReadS MediaConnectFlowRequest)
-> ReadS [MediaConnectFlowRequest]
-> ReadPrec MediaConnectFlowRequest
-> ReadPrec [MediaConnectFlowRequest]
-> Read 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
(Int -> MediaConnectFlowRequest -> ShowS)
-> (MediaConnectFlowRequest -> String)
-> ([MediaConnectFlowRequest] -> ShowS)
-> Show MediaConnectFlowRequest
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.
 MediaConnectFlowRequest -> Rep MediaConnectFlowRequest x)
-> (forall x.
    Rep MediaConnectFlowRequest x -> MediaConnectFlowRequest)
-> Generic MediaConnectFlowRequest
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' :: Maybe Text -> MediaConnectFlowRequest
MediaConnectFlowRequest' {$sel:flowArn:MediaConnectFlowRequest' :: Maybe Text
flowArn = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> MediaConnectFlowRequest -> f MediaConnectFlowRequest
mediaConnectFlowRequest_flowArn = (MediaConnectFlowRequest -> Maybe Text)
-> (MediaConnectFlowRequest
    -> Maybe Text -> MediaConnectFlowRequest)
-> Lens
     MediaConnectFlowRequest
     MediaConnectFlowRequest
     (Maybe Text)
     (Maybe Text)
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

instance Prelude.NFData MediaConnectFlowRequest

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