{-# 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.AppFlow.Types.FlowDefinition
-- 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.AppFlow.Types.FlowDefinition where

import Amazonka.AppFlow.Types.ConnectorType
import Amazonka.AppFlow.Types.ExecutionDetails
import Amazonka.AppFlow.Types.FlowStatus
import Amazonka.AppFlow.Types.TriggerType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The properties of the flow, such as its source, destination, trigger
-- type, and so on.
--
-- /See:/ 'newFlowDefinition' smart constructor.
data FlowDefinition = FlowDefinition'
  { -- | Specifies the account user name that most recently updated the flow.
    FlowDefinition -> Maybe Text
lastUpdatedBy :: Prelude.Maybe Prelude.Text,
    -- | The flow\'s Amazon Resource Name (ARN).
    FlowDefinition -> Maybe Text
flowArn :: Prelude.Maybe Prelude.Text,
    -- | Specifies when the flow was last updated.
    FlowDefinition -> Maybe POSIX
lastUpdatedAt :: Prelude.Maybe Core.POSIX,
    -- | Specifies when the flow was created.
    FlowDefinition -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | Specifies the type of flow trigger. This can be @OnDemand@, @Scheduled@,
    -- or @Event@.
    FlowDefinition -> Maybe TriggerType
triggerType :: Prelude.Maybe TriggerType,
    -- | The ARN of the user who created the flow.
    FlowDefinition -> Maybe Text
createdBy :: Prelude.Maybe Prelude.Text,
    -- | Specifies the source connector type, such as Salesforce, Amazon S3,
    -- Amplitude, and so on.
    FlowDefinition -> Maybe ConnectorType
sourceConnectorType :: Prelude.Maybe ConnectorType,
    -- | Specifies the destination connector type, such as Salesforce, Amazon S3,
    -- Amplitude, and so on.
    FlowDefinition -> Maybe ConnectorType
destinationConnectorType :: Prelude.Maybe ConnectorType,
    -- | The specified name of the flow. Spaces are not allowed. Use underscores
    -- (_) or hyphens (-) only.
    FlowDefinition -> Maybe Text
flowName :: Prelude.Maybe Prelude.Text,
    -- | Describes the details of the most recent flow run.
    FlowDefinition -> Maybe ExecutionDetails
lastRunExecutionDetails :: Prelude.Maybe ExecutionDetails,
    -- | Indicates the current status of the flow.
    FlowDefinition -> Maybe FlowStatus
flowStatus :: Prelude.Maybe FlowStatus,
    -- | A user-entered description of the flow.
    FlowDefinition -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags used to organize, track, or control access for your flow.
    FlowDefinition -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (FlowDefinition -> FlowDefinition -> Bool
(FlowDefinition -> FlowDefinition -> Bool)
-> (FlowDefinition -> FlowDefinition -> Bool) -> Eq FlowDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FlowDefinition -> FlowDefinition -> Bool
$c/= :: FlowDefinition -> FlowDefinition -> Bool
== :: FlowDefinition -> FlowDefinition -> Bool
$c== :: FlowDefinition -> FlowDefinition -> Bool
Prelude.Eq, ReadPrec [FlowDefinition]
ReadPrec FlowDefinition
Int -> ReadS FlowDefinition
ReadS [FlowDefinition]
(Int -> ReadS FlowDefinition)
-> ReadS [FlowDefinition]
-> ReadPrec FlowDefinition
-> ReadPrec [FlowDefinition]
-> Read FlowDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FlowDefinition]
$creadListPrec :: ReadPrec [FlowDefinition]
readPrec :: ReadPrec FlowDefinition
$creadPrec :: ReadPrec FlowDefinition
readList :: ReadS [FlowDefinition]
$creadList :: ReadS [FlowDefinition]
readsPrec :: Int -> ReadS FlowDefinition
$creadsPrec :: Int -> ReadS FlowDefinition
Prelude.Read, Int -> FlowDefinition -> ShowS
[FlowDefinition] -> ShowS
FlowDefinition -> String
(Int -> FlowDefinition -> ShowS)
-> (FlowDefinition -> String)
-> ([FlowDefinition] -> ShowS)
-> Show FlowDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FlowDefinition] -> ShowS
$cshowList :: [FlowDefinition] -> ShowS
show :: FlowDefinition -> String
$cshow :: FlowDefinition -> String
showsPrec :: Int -> FlowDefinition -> ShowS
$cshowsPrec :: Int -> FlowDefinition -> ShowS
Prelude.Show, (forall x. FlowDefinition -> Rep FlowDefinition x)
-> (forall x. Rep FlowDefinition x -> FlowDefinition)
-> Generic FlowDefinition
forall x. Rep FlowDefinition x -> FlowDefinition
forall x. FlowDefinition -> Rep FlowDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FlowDefinition x -> FlowDefinition
$cfrom :: forall x. FlowDefinition -> Rep FlowDefinition x
Prelude.Generic)

-- |
-- Create a value of 'FlowDefinition' 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:
--
-- 'lastUpdatedBy', 'flowDefinition_lastUpdatedBy' - Specifies the account user name that most recently updated the flow.
--
-- 'flowArn', 'flowDefinition_flowArn' - The flow\'s Amazon Resource Name (ARN).
--
-- 'lastUpdatedAt', 'flowDefinition_lastUpdatedAt' - Specifies when the flow was last updated.
--
-- 'createdAt', 'flowDefinition_createdAt' - Specifies when the flow was created.
--
-- 'triggerType', 'flowDefinition_triggerType' - Specifies the type of flow trigger. This can be @OnDemand@, @Scheduled@,
-- or @Event@.
--
-- 'createdBy', 'flowDefinition_createdBy' - The ARN of the user who created the flow.
--
-- 'sourceConnectorType', 'flowDefinition_sourceConnectorType' - Specifies the source connector type, such as Salesforce, Amazon S3,
-- Amplitude, and so on.
--
-- 'destinationConnectorType', 'flowDefinition_destinationConnectorType' - Specifies the destination connector type, such as Salesforce, Amazon S3,
-- Amplitude, and so on.
--
-- 'flowName', 'flowDefinition_flowName' - The specified name of the flow. Spaces are not allowed. Use underscores
-- (_) or hyphens (-) only.
--
-- 'lastRunExecutionDetails', 'flowDefinition_lastRunExecutionDetails' - Describes the details of the most recent flow run.
--
-- 'flowStatus', 'flowDefinition_flowStatus' - Indicates the current status of the flow.
--
-- 'description', 'flowDefinition_description' - A user-entered description of the flow.
--
-- 'tags', 'flowDefinition_tags' - The tags used to organize, track, or control access for your flow.
newFlowDefinition ::
  FlowDefinition
newFlowDefinition :: FlowDefinition
newFlowDefinition =
  FlowDefinition' :: Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe TriggerType
-> Maybe Text
-> Maybe ConnectorType
-> Maybe ConnectorType
-> Maybe Text
-> Maybe ExecutionDetails
-> Maybe FlowStatus
-> Maybe Text
-> Maybe (HashMap Text Text)
-> FlowDefinition
FlowDefinition'
    { $sel:lastUpdatedBy:FlowDefinition' :: Maybe Text
lastUpdatedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:flowArn:FlowDefinition' :: Maybe Text
flowArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedAt:FlowDefinition' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:FlowDefinition' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:triggerType:FlowDefinition' :: Maybe TriggerType
triggerType = Maybe TriggerType
forall a. Maybe a
Prelude.Nothing,
      $sel:createdBy:FlowDefinition' :: Maybe Text
createdBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceConnectorType:FlowDefinition' :: Maybe ConnectorType
sourceConnectorType = Maybe ConnectorType
forall a. Maybe a
Prelude.Nothing,
      $sel:destinationConnectorType:FlowDefinition' :: Maybe ConnectorType
destinationConnectorType = Maybe ConnectorType
forall a. Maybe a
Prelude.Nothing,
      $sel:flowName:FlowDefinition' :: Maybe Text
flowName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastRunExecutionDetails:FlowDefinition' :: Maybe ExecutionDetails
lastRunExecutionDetails = Maybe ExecutionDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:flowStatus:FlowDefinition' :: Maybe FlowStatus
flowStatus = Maybe FlowStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:description:FlowDefinition' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:FlowDefinition' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies the account user name that most recently updated the flow.
flowDefinition_lastUpdatedBy :: Lens.Lens' FlowDefinition (Prelude.Maybe Prelude.Text)
flowDefinition_lastUpdatedBy :: (Maybe Text -> f (Maybe Text))
-> FlowDefinition -> f FlowDefinition
flowDefinition_lastUpdatedBy = (FlowDefinition -> Maybe Text)
-> (FlowDefinition -> Maybe Text -> FlowDefinition)
-> Lens FlowDefinition FlowDefinition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowDefinition' {Maybe Text
lastUpdatedBy :: Maybe Text
$sel:lastUpdatedBy:FlowDefinition' :: FlowDefinition -> Maybe Text
lastUpdatedBy} -> Maybe Text
lastUpdatedBy) (\s :: FlowDefinition
s@FlowDefinition' {} Maybe Text
a -> FlowDefinition
s {$sel:lastUpdatedBy:FlowDefinition' :: Maybe Text
lastUpdatedBy = Maybe Text
a} :: FlowDefinition)

-- | The flow\'s Amazon Resource Name (ARN).
flowDefinition_flowArn :: Lens.Lens' FlowDefinition (Prelude.Maybe Prelude.Text)
flowDefinition_flowArn :: (Maybe Text -> f (Maybe Text))
-> FlowDefinition -> f FlowDefinition
flowDefinition_flowArn = (FlowDefinition -> Maybe Text)
-> (FlowDefinition -> Maybe Text -> FlowDefinition)
-> Lens FlowDefinition FlowDefinition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowDefinition' {Maybe Text
flowArn :: Maybe Text
$sel:flowArn:FlowDefinition' :: FlowDefinition -> Maybe Text
flowArn} -> Maybe Text
flowArn) (\s :: FlowDefinition
s@FlowDefinition' {} Maybe Text
a -> FlowDefinition
s {$sel:flowArn:FlowDefinition' :: Maybe Text
flowArn = Maybe Text
a} :: FlowDefinition)

-- | Specifies when the flow was last updated.
flowDefinition_lastUpdatedAt :: Lens.Lens' FlowDefinition (Prelude.Maybe Prelude.UTCTime)
flowDefinition_lastUpdatedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> FlowDefinition -> f FlowDefinition
flowDefinition_lastUpdatedAt = (FlowDefinition -> Maybe POSIX)
-> (FlowDefinition -> Maybe POSIX -> FlowDefinition)
-> Lens FlowDefinition FlowDefinition (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowDefinition' {Maybe POSIX
lastUpdatedAt :: Maybe POSIX
$sel:lastUpdatedAt:FlowDefinition' :: FlowDefinition -> Maybe POSIX
lastUpdatedAt} -> Maybe POSIX
lastUpdatedAt) (\s :: FlowDefinition
s@FlowDefinition' {} Maybe POSIX
a -> FlowDefinition
s {$sel:lastUpdatedAt:FlowDefinition' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
a} :: FlowDefinition) ((Maybe POSIX -> f (Maybe POSIX))
 -> FlowDefinition -> f FlowDefinition)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> FlowDefinition
-> f FlowDefinition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Specifies when the flow was created.
flowDefinition_createdAt :: Lens.Lens' FlowDefinition (Prelude.Maybe Prelude.UTCTime)
flowDefinition_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> FlowDefinition -> f FlowDefinition
flowDefinition_createdAt = (FlowDefinition -> Maybe POSIX)
-> (FlowDefinition -> Maybe POSIX -> FlowDefinition)
-> Lens FlowDefinition FlowDefinition (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowDefinition' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:FlowDefinition' :: FlowDefinition -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: FlowDefinition
s@FlowDefinition' {} Maybe POSIX
a -> FlowDefinition
s {$sel:createdAt:FlowDefinition' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: FlowDefinition) ((Maybe POSIX -> f (Maybe POSIX))
 -> FlowDefinition -> f FlowDefinition)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> FlowDefinition
-> f FlowDefinition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Specifies the type of flow trigger. This can be @OnDemand@, @Scheduled@,
-- or @Event@.
flowDefinition_triggerType :: Lens.Lens' FlowDefinition (Prelude.Maybe TriggerType)
flowDefinition_triggerType :: (Maybe TriggerType -> f (Maybe TriggerType))
-> FlowDefinition -> f FlowDefinition
flowDefinition_triggerType = (FlowDefinition -> Maybe TriggerType)
-> (FlowDefinition -> Maybe TriggerType -> FlowDefinition)
-> Lens
     FlowDefinition
     FlowDefinition
     (Maybe TriggerType)
     (Maybe TriggerType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowDefinition' {Maybe TriggerType
triggerType :: Maybe TriggerType
$sel:triggerType:FlowDefinition' :: FlowDefinition -> Maybe TriggerType
triggerType} -> Maybe TriggerType
triggerType) (\s :: FlowDefinition
s@FlowDefinition' {} Maybe TriggerType
a -> FlowDefinition
s {$sel:triggerType:FlowDefinition' :: Maybe TriggerType
triggerType = Maybe TriggerType
a} :: FlowDefinition)

-- | The ARN of the user who created the flow.
flowDefinition_createdBy :: Lens.Lens' FlowDefinition (Prelude.Maybe Prelude.Text)
flowDefinition_createdBy :: (Maybe Text -> f (Maybe Text))
-> FlowDefinition -> f FlowDefinition
flowDefinition_createdBy = (FlowDefinition -> Maybe Text)
-> (FlowDefinition -> Maybe Text -> FlowDefinition)
-> Lens FlowDefinition FlowDefinition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowDefinition' {Maybe Text
createdBy :: Maybe Text
$sel:createdBy:FlowDefinition' :: FlowDefinition -> Maybe Text
createdBy} -> Maybe Text
createdBy) (\s :: FlowDefinition
s@FlowDefinition' {} Maybe Text
a -> FlowDefinition
s {$sel:createdBy:FlowDefinition' :: Maybe Text
createdBy = Maybe Text
a} :: FlowDefinition)

-- | Specifies the source connector type, such as Salesforce, Amazon S3,
-- Amplitude, and so on.
flowDefinition_sourceConnectorType :: Lens.Lens' FlowDefinition (Prelude.Maybe ConnectorType)
flowDefinition_sourceConnectorType :: (Maybe ConnectorType -> f (Maybe ConnectorType))
-> FlowDefinition -> f FlowDefinition
flowDefinition_sourceConnectorType = (FlowDefinition -> Maybe ConnectorType)
-> (FlowDefinition -> Maybe ConnectorType -> FlowDefinition)
-> Lens
     FlowDefinition
     FlowDefinition
     (Maybe ConnectorType)
     (Maybe ConnectorType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowDefinition' {Maybe ConnectorType
sourceConnectorType :: Maybe ConnectorType
$sel:sourceConnectorType:FlowDefinition' :: FlowDefinition -> Maybe ConnectorType
sourceConnectorType} -> Maybe ConnectorType
sourceConnectorType) (\s :: FlowDefinition
s@FlowDefinition' {} Maybe ConnectorType
a -> FlowDefinition
s {$sel:sourceConnectorType:FlowDefinition' :: Maybe ConnectorType
sourceConnectorType = Maybe ConnectorType
a} :: FlowDefinition)

-- | Specifies the destination connector type, such as Salesforce, Amazon S3,
-- Amplitude, and so on.
flowDefinition_destinationConnectorType :: Lens.Lens' FlowDefinition (Prelude.Maybe ConnectorType)
flowDefinition_destinationConnectorType :: (Maybe ConnectorType -> f (Maybe ConnectorType))
-> FlowDefinition -> f FlowDefinition
flowDefinition_destinationConnectorType = (FlowDefinition -> Maybe ConnectorType)
-> (FlowDefinition -> Maybe ConnectorType -> FlowDefinition)
-> Lens
     FlowDefinition
     FlowDefinition
     (Maybe ConnectorType)
     (Maybe ConnectorType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowDefinition' {Maybe ConnectorType
destinationConnectorType :: Maybe ConnectorType
$sel:destinationConnectorType:FlowDefinition' :: FlowDefinition -> Maybe ConnectorType
destinationConnectorType} -> Maybe ConnectorType
destinationConnectorType) (\s :: FlowDefinition
s@FlowDefinition' {} Maybe ConnectorType
a -> FlowDefinition
s {$sel:destinationConnectorType:FlowDefinition' :: Maybe ConnectorType
destinationConnectorType = Maybe ConnectorType
a} :: FlowDefinition)

-- | The specified name of the flow. Spaces are not allowed. Use underscores
-- (_) or hyphens (-) only.
flowDefinition_flowName :: Lens.Lens' FlowDefinition (Prelude.Maybe Prelude.Text)
flowDefinition_flowName :: (Maybe Text -> f (Maybe Text))
-> FlowDefinition -> f FlowDefinition
flowDefinition_flowName = (FlowDefinition -> Maybe Text)
-> (FlowDefinition -> Maybe Text -> FlowDefinition)
-> Lens FlowDefinition FlowDefinition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowDefinition' {Maybe Text
flowName :: Maybe Text
$sel:flowName:FlowDefinition' :: FlowDefinition -> Maybe Text
flowName} -> Maybe Text
flowName) (\s :: FlowDefinition
s@FlowDefinition' {} Maybe Text
a -> FlowDefinition
s {$sel:flowName:FlowDefinition' :: Maybe Text
flowName = Maybe Text
a} :: FlowDefinition)

-- | Describes the details of the most recent flow run.
flowDefinition_lastRunExecutionDetails :: Lens.Lens' FlowDefinition (Prelude.Maybe ExecutionDetails)
flowDefinition_lastRunExecutionDetails :: (Maybe ExecutionDetails -> f (Maybe ExecutionDetails))
-> FlowDefinition -> f FlowDefinition
flowDefinition_lastRunExecutionDetails = (FlowDefinition -> Maybe ExecutionDetails)
-> (FlowDefinition -> Maybe ExecutionDetails -> FlowDefinition)
-> Lens
     FlowDefinition
     FlowDefinition
     (Maybe ExecutionDetails)
     (Maybe ExecutionDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowDefinition' {Maybe ExecutionDetails
lastRunExecutionDetails :: Maybe ExecutionDetails
$sel:lastRunExecutionDetails:FlowDefinition' :: FlowDefinition -> Maybe ExecutionDetails
lastRunExecutionDetails} -> Maybe ExecutionDetails
lastRunExecutionDetails) (\s :: FlowDefinition
s@FlowDefinition' {} Maybe ExecutionDetails
a -> FlowDefinition
s {$sel:lastRunExecutionDetails:FlowDefinition' :: Maybe ExecutionDetails
lastRunExecutionDetails = Maybe ExecutionDetails
a} :: FlowDefinition)

-- | Indicates the current status of the flow.
flowDefinition_flowStatus :: Lens.Lens' FlowDefinition (Prelude.Maybe FlowStatus)
flowDefinition_flowStatus :: (Maybe FlowStatus -> f (Maybe FlowStatus))
-> FlowDefinition -> f FlowDefinition
flowDefinition_flowStatus = (FlowDefinition -> Maybe FlowStatus)
-> (FlowDefinition -> Maybe FlowStatus -> FlowDefinition)
-> Lens
     FlowDefinition FlowDefinition (Maybe FlowStatus) (Maybe FlowStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowDefinition' {Maybe FlowStatus
flowStatus :: Maybe FlowStatus
$sel:flowStatus:FlowDefinition' :: FlowDefinition -> Maybe FlowStatus
flowStatus} -> Maybe FlowStatus
flowStatus) (\s :: FlowDefinition
s@FlowDefinition' {} Maybe FlowStatus
a -> FlowDefinition
s {$sel:flowStatus:FlowDefinition' :: Maybe FlowStatus
flowStatus = Maybe FlowStatus
a} :: FlowDefinition)

-- | A user-entered description of the flow.
flowDefinition_description :: Lens.Lens' FlowDefinition (Prelude.Maybe Prelude.Text)
flowDefinition_description :: (Maybe Text -> f (Maybe Text))
-> FlowDefinition -> f FlowDefinition
flowDefinition_description = (FlowDefinition -> Maybe Text)
-> (FlowDefinition -> Maybe Text -> FlowDefinition)
-> Lens FlowDefinition FlowDefinition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowDefinition' {Maybe Text
description :: Maybe Text
$sel:description:FlowDefinition' :: FlowDefinition -> Maybe Text
description} -> Maybe Text
description) (\s :: FlowDefinition
s@FlowDefinition' {} Maybe Text
a -> FlowDefinition
s {$sel:description:FlowDefinition' :: Maybe Text
description = Maybe Text
a} :: FlowDefinition)

-- | The tags used to organize, track, or control access for your flow.
flowDefinition_tags :: Lens.Lens' FlowDefinition (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
flowDefinition_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> FlowDefinition -> f FlowDefinition
flowDefinition_tags = (FlowDefinition -> Maybe (HashMap Text Text))
-> (FlowDefinition -> Maybe (HashMap Text Text) -> FlowDefinition)
-> Lens
     FlowDefinition
     FlowDefinition
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowDefinition' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:FlowDefinition' :: FlowDefinition -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: FlowDefinition
s@FlowDefinition' {} Maybe (HashMap Text Text)
a -> FlowDefinition
s {$sel:tags:FlowDefinition' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: FlowDefinition) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> FlowDefinition -> f FlowDefinition)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> FlowDefinition
-> f FlowDefinition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON FlowDefinition where
  parseJSON :: Value -> Parser FlowDefinition
parseJSON =
    String
-> (Object -> Parser FlowDefinition)
-> Value
-> Parser FlowDefinition
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FlowDefinition"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe TriggerType
-> Maybe Text
-> Maybe ConnectorType
-> Maybe ConnectorType
-> Maybe Text
-> Maybe ExecutionDetails
-> Maybe FlowStatus
-> Maybe Text
-> Maybe (HashMap Text Text)
-> FlowDefinition
FlowDefinition'
            (Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe TriggerType
 -> Maybe Text
 -> Maybe ConnectorType
 -> Maybe ConnectorType
 -> Maybe Text
 -> Maybe ExecutionDetails
 -> Maybe FlowStatus
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> FlowDefinition)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe TriggerType
      -> Maybe Text
      -> Maybe ConnectorType
      -> Maybe ConnectorType
      -> Maybe Text
      -> Maybe ExecutionDetails
      -> Maybe FlowStatus
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> FlowDefinition)
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
"lastUpdatedBy")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe TriggerType
   -> Maybe Text
   -> Maybe ConnectorType
   -> Maybe ConnectorType
   -> Maybe Text
   -> Maybe ExecutionDetails
   -> Maybe FlowStatus
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> FlowDefinition)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe POSIX
      -> Maybe TriggerType
      -> Maybe Text
      -> Maybe ConnectorType
      -> Maybe ConnectorType
      -> Maybe Text
      -> Maybe ExecutionDetails
      -> Maybe FlowStatus
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> FlowDefinition)
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
"flowArn")
            Parser
  (Maybe POSIX
   -> Maybe POSIX
   -> Maybe TriggerType
   -> Maybe Text
   -> Maybe ConnectorType
   -> Maybe ConnectorType
   -> Maybe Text
   -> Maybe ExecutionDetails
   -> Maybe FlowStatus
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> FlowDefinition)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe POSIX
      -> Maybe TriggerType
      -> Maybe Text
      -> Maybe ConnectorType
      -> Maybe ConnectorType
      -> Maybe Text
      -> Maybe ExecutionDetails
      -> Maybe FlowStatus
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> FlowDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastUpdatedAt")
            Parser
  (Maybe POSIX
   -> Maybe TriggerType
   -> Maybe Text
   -> Maybe ConnectorType
   -> Maybe ConnectorType
   -> Maybe Text
   -> Maybe ExecutionDetails
   -> Maybe FlowStatus
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> FlowDefinition)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe TriggerType
      -> Maybe Text
      -> Maybe ConnectorType
      -> Maybe ConnectorType
      -> Maybe Text
      -> Maybe ExecutionDetails
      -> Maybe FlowStatus
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> FlowDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
            Parser
  (Maybe TriggerType
   -> Maybe Text
   -> Maybe ConnectorType
   -> Maybe ConnectorType
   -> Maybe Text
   -> Maybe ExecutionDetails
   -> Maybe FlowStatus
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> FlowDefinition)
-> Parser (Maybe TriggerType)
-> Parser
     (Maybe Text
      -> Maybe ConnectorType
      -> Maybe ConnectorType
      -> Maybe Text
      -> Maybe ExecutionDetails
      -> Maybe FlowStatus
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> FlowDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TriggerType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"triggerType")
            Parser
  (Maybe Text
   -> Maybe ConnectorType
   -> Maybe ConnectorType
   -> Maybe Text
   -> Maybe ExecutionDetails
   -> Maybe FlowStatus
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> FlowDefinition)
-> Parser (Maybe Text)
-> Parser
     (Maybe ConnectorType
      -> Maybe ConnectorType
      -> Maybe Text
      -> Maybe ExecutionDetails
      -> Maybe FlowStatus
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> FlowDefinition)
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
"createdBy")
            Parser
  (Maybe ConnectorType
   -> Maybe ConnectorType
   -> Maybe Text
   -> Maybe ExecutionDetails
   -> Maybe FlowStatus
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> FlowDefinition)
-> Parser (Maybe ConnectorType)
-> Parser
     (Maybe ConnectorType
      -> Maybe Text
      -> Maybe ExecutionDetails
      -> Maybe FlowStatus
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> FlowDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ConnectorType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sourceConnectorType")
            Parser
  (Maybe ConnectorType
   -> Maybe Text
   -> Maybe ExecutionDetails
   -> Maybe FlowStatus
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> FlowDefinition)
-> Parser (Maybe ConnectorType)
-> Parser
     (Maybe Text
      -> Maybe ExecutionDetails
      -> Maybe FlowStatus
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> FlowDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ConnectorType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"destinationConnectorType")
            Parser
  (Maybe Text
   -> Maybe ExecutionDetails
   -> Maybe FlowStatus
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> FlowDefinition)
-> Parser (Maybe Text)
-> Parser
     (Maybe ExecutionDetails
      -> Maybe FlowStatus
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> FlowDefinition)
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
"flowName")
            Parser
  (Maybe ExecutionDetails
   -> Maybe FlowStatus
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> FlowDefinition)
-> Parser (Maybe ExecutionDetails)
-> Parser
     (Maybe FlowStatus
      -> Maybe Text -> Maybe (HashMap Text Text) -> FlowDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ExecutionDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastRunExecutionDetails")
            Parser
  (Maybe FlowStatus
   -> Maybe Text -> Maybe (HashMap Text Text) -> FlowDefinition)
-> Parser (Maybe FlowStatus)
-> Parser
     (Maybe Text -> Maybe (HashMap Text Text) -> FlowDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FlowStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"flowStatus")
            Parser (Maybe Text -> Maybe (HashMap Text Text) -> FlowDefinition)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> FlowDefinition)
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 (Maybe (HashMap Text Text) -> FlowDefinition)
-> Parser (Maybe (HashMap Text Text)) -> Parser FlowDefinition
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable FlowDefinition

instance Prelude.NFData FlowDefinition