{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.UpdateFlow
-- 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)
--
-- Updates an existing flow.
module Amazonka.AppFlow.UpdateFlow
  ( -- * Creating a Request
    UpdateFlow (..),
    newUpdateFlow,

    -- * Request Lenses
    updateFlow_description,
    updateFlow_flowName,
    updateFlow_triggerConfig,
    updateFlow_sourceFlowConfig,
    updateFlow_destinationFlowConfigList,
    updateFlow_tasks,

    -- * Destructuring the Response
    UpdateFlowResponse (..),
    newUpdateFlowResponse,

    -- * Response Lenses
    updateFlowResponse_flowStatus,
    updateFlowResponse_httpStatus,
  )
where

import Amazonka.AppFlow.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateFlow' smart constructor.
data UpdateFlow = UpdateFlow'
  { -- | A description of the flow.
    UpdateFlow -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The specified name of the flow. Spaces are not allowed. Use underscores
    -- (_) or hyphens (-) only.
    UpdateFlow -> Text
flowName :: Prelude.Text,
    -- | The trigger settings that determine how and when the flow runs.
    UpdateFlow -> TriggerConfig
triggerConfig :: TriggerConfig,
    UpdateFlow -> SourceFlowConfig
sourceFlowConfig :: SourceFlowConfig,
    -- | The configuration that controls how Amazon AppFlow transfers data to the
    -- destination connector.
    UpdateFlow -> [DestinationFlowConfig]
destinationFlowConfigList :: [DestinationFlowConfig],
    -- | A list of tasks that Amazon AppFlow performs while transferring the data
    -- in the flow run.
    UpdateFlow -> [Task]
tasks :: [Task]
  }
  deriving (UpdateFlow -> UpdateFlow -> Bool
(UpdateFlow -> UpdateFlow -> Bool)
-> (UpdateFlow -> UpdateFlow -> Bool) -> Eq UpdateFlow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFlow -> UpdateFlow -> Bool
$c/= :: UpdateFlow -> UpdateFlow -> Bool
== :: UpdateFlow -> UpdateFlow -> Bool
$c== :: UpdateFlow -> UpdateFlow -> Bool
Prelude.Eq, ReadPrec [UpdateFlow]
ReadPrec UpdateFlow
Int -> ReadS UpdateFlow
ReadS [UpdateFlow]
(Int -> ReadS UpdateFlow)
-> ReadS [UpdateFlow]
-> ReadPrec UpdateFlow
-> ReadPrec [UpdateFlow]
-> Read UpdateFlow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFlow]
$creadListPrec :: ReadPrec [UpdateFlow]
readPrec :: ReadPrec UpdateFlow
$creadPrec :: ReadPrec UpdateFlow
readList :: ReadS [UpdateFlow]
$creadList :: ReadS [UpdateFlow]
readsPrec :: Int -> ReadS UpdateFlow
$creadsPrec :: Int -> ReadS UpdateFlow
Prelude.Read, Int -> UpdateFlow -> ShowS
[UpdateFlow] -> ShowS
UpdateFlow -> String
(Int -> UpdateFlow -> ShowS)
-> (UpdateFlow -> String)
-> ([UpdateFlow] -> ShowS)
-> Show UpdateFlow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFlow] -> ShowS
$cshowList :: [UpdateFlow] -> ShowS
show :: UpdateFlow -> String
$cshow :: UpdateFlow -> String
showsPrec :: Int -> UpdateFlow -> ShowS
$cshowsPrec :: Int -> UpdateFlow -> ShowS
Prelude.Show, (forall x. UpdateFlow -> Rep UpdateFlow x)
-> (forall x. Rep UpdateFlow x -> UpdateFlow) -> Generic UpdateFlow
forall x. Rep UpdateFlow x -> UpdateFlow
forall x. UpdateFlow -> Rep UpdateFlow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateFlow x -> UpdateFlow
$cfrom :: forall x. UpdateFlow -> Rep UpdateFlow x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFlow' 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:
--
-- 'description', 'updateFlow_description' - A description of the flow.
--
-- 'flowName', 'updateFlow_flowName' - The specified name of the flow. Spaces are not allowed. Use underscores
-- (_) or hyphens (-) only.
--
-- 'triggerConfig', 'updateFlow_triggerConfig' - The trigger settings that determine how and when the flow runs.
--
-- 'sourceFlowConfig', 'updateFlow_sourceFlowConfig' - Undocumented member.
--
-- 'destinationFlowConfigList', 'updateFlow_destinationFlowConfigList' - The configuration that controls how Amazon AppFlow transfers data to the
-- destination connector.
--
-- 'tasks', 'updateFlow_tasks' - A list of tasks that Amazon AppFlow performs while transferring the data
-- in the flow run.
newUpdateFlow ::
  -- | 'flowName'
  Prelude.Text ->
  -- | 'triggerConfig'
  TriggerConfig ->
  -- | 'sourceFlowConfig'
  SourceFlowConfig ->
  UpdateFlow
newUpdateFlow :: Text -> TriggerConfig -> SourceFlowConfig -> UpdateFlow
newUpdateFlow
  Text
pFlowName_
  TriggerConfig
pTriggerConfig_
  SourceFlowConfig
pSourceFlowConfig_ =
    UpdateFlow' :: Maybe Text
-> Text
-> TriggerConfig
-> SourceFlowConfig
-> [DestinationFlowConfig]
-> [Task]
-> UpdateFlow
UpdateFlow'
      { $sel:description:UpdateFlow' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:flowName:UpdateFlow' :: Text
flowName = Text
pFlowName_,
        $sel:triggerConfig:UpdateFlow' :: TriggerConfig
triggerConfig = TriggerConfig
pTriggerConfig_,
        $sel:sourceFlowConfig:UpdateFlow' :: SourceFlowConfig
sourceFlowConfig = SourceFlowConfig
pSourceFlowConfig_,
        $sel:destinationFlowConfigList:UpdateFlow' :: [DestinationFlowConfig]
destinationFlowConfigList = [DestinationFlowConfig]
forall a. Monoid a => a
Prelude.mempty,
        $sel:tasks:UpdateFlow' :: [Task]
tasks = [Task]
forall a. Monoid a => a
Prelude.mempty
      }

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

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

-- | The trigger settings that determine how and when the flow runs.
updateFlow_triggerConfig :: Lens.Lens' UpdateFlow TriggerConfig
updateFlow_triggerConfig :: (TriggerConfig -> f TriggerConfig) -> UpdateFlow -> f UpdateFlow
updateFlow_triggerConfig = (UpdateFlow -> TriggerConfig)
-> (UpdateFlow -> TriggerConfig -> UpdateFlow)
-> Lens UpdateFlow UpdateFlow TriggerConfig TriggerConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFlow' {TriggerConfig
triggerConfig :: TriggerConfig
$sel:triggerConfig:UpdateFlow' :: UpdateFlow -> TriggerConfig
triggerConfig} -> TriggerConfig
triggerConfig) (\s :: UpdateFlow
s@UpdateFlow' {} TriggerConfig
a -> UpdateFlow
s {$sel:triggerConfig:UpdateFlow' :: TriggerConfig
triggerConfig = TriggerConfig
a} :: UpdateFlow)

-- | Undocumented member.
updateFlow_sourceFlowConfig :: Lens.Lens' UpdateFlow SourceFlowConfig
updateFlow_sourceFlowConfig :: (SourceFlowConfig -> f SourceFlowConfig)
-> UpdateFlow -> f UpdateFlow
updateFlow_sourceFlowConfig = (UpdateFlow -> SourceFlowConfig)
-> (UpdateFlow -> SourceFlowConfig -> UpdateFlow)
-> Lens UpdateFlow UpdateFlow SourceFlowConfig SourceFlowConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFlow' {SourceFlowConfig
sourceFlowConfig :: SourceFlowConfig
$sel:sourceFlowConfig:UpdateFlow' :: UpdateFlow -> SourceFlowConfig
sourceFlowConfig} -> SourceFlowConfig
sourceFlowConfig) (\s :: UpdateFlow
s@UpdateFlow' {} SourceFlowConfig
a -> UpdateFlow
s {$sel:sourceFlowConfig:UpdateFlow' :: SourceFlowConfig
sourceFlowConfig = SourceFlowConfig
a} :: UpdateFlow)

-- | The configuration that controls how Amazon AppFlow transfers data to the
-- destination connector.
updateFlow_destinationFlowConfigList :: Lens.Lens' UpdateFlow [DestinationFlowConfig]
updateFlow_destinationFlowConfigList :: ([DestinationFlowConfig] -> f [DestinationFlowConfig])
-> UpdateFlow -> f UpdateFlow
updateFlow_destinationFlowConfigList = (UpdateFlow -> [DestinationFlowConfig])
-> (UpdateFlow -> [DestinationFlowConfig] -> UpdateFlow)
-> Lens
     UpdateFlow
     UpdateFlow
     [DestinationFlowConfig]
     [DestinationFlowConfig]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFlow' {[DestinationFlowConfig]
destinationFlowConfigList :: [DestinationFlowConfig]
$sel:destinationFlowConfigList:UpdateFlow' :: UpdateFlow -> [DestinationFlowConfig]
destinationFlowConfigList} -> [DestinationFlowConfig]
destinationFlowConfigList) (\s :: UpdateFlow
s@UpdateFlow' {} [DestinationFlowConfig]
a -> UpdateFlow
s {$sel:destinationFlowConfigList:UpdateFlow' :: [DestinationFlowConfig]
destinationFlowConfigList = [DestinationFlowConfig]
a} :: UpdateFlow) (([DestinationFlowConfig] -> f [DestinationFlowConfig])
 -> UpdateFlow -> f UpdateFlow)
-> (([DestinationFlowConfig] -> f [DestinationFlowConfig])
    -> [DestinationFlowConfig] -> f [DestinationFlowConfig])
-> ([DestinationFlowConfig] -> f [DestinationFlowConfig])
-> UpdateFlow
-> f UpdateFlow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DestinationFlowConfig] -> f [DestinationFlowConfig])
-> [DestinationFlowConfig] -> f [DestinationFlowConfig]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of tasks that Amazon AppFlow performs while transferring the data
-- in the flow run.
updateFlow_tasks :: Lens.Lens' UpdateFlow [Task]
updateFlow_tasks :: ([Task] -> f [Task]) -> UpdateFlow -> f UpdateFlow
updateFlow_tasks = (UpdateFlow -> [Task])
-> (UpdateFlow -> [Task] -> UpdateFlow)
-> Lens UpdateFlow UpdateFlow [Task] [Task]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFlow' {[Task]
tasks :: [Task]
$sel:tasks:UpdateFlow' :: UpdateFlow -> [Task]
tasks} -> [Task]
tasks) (\s :: UpdateFlow
s@UpdateFlow' {} [Task]
a -> UpdateFlow
s {$sel:tasks:UpdateFlow' :: [Task]
tasks = [Task]
a} :: UpdateFlow) (([Task] -> f [Task]) -> UpdateFlow -> f UpdateFlow)
-> (([Task] -> f [Task]) -> [Task] -> f [Task])
-> ([Task] -> f [Task])
-> UpdateFlow
-> f UpdateFlow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Task] -> f [Task]) -> [Task] -> f [Task]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest UpdateFlow where
  type AWSResponse UpdateFlow = UpdateFlowResponse
  request :: UpdateFlow -> Request UpdateFlow
request = Service -> UpdateFlow -> Request UpdateFlow
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateFlow
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateFlow)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateFlow))
-> Logger
-> Service
-> Proxy UpdateFlow
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateFlow)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe FlowStatus -> Int -> UpdateFlowResponse
UpdateFlowResponse'
            (Maybe FlowStatus -> Int -> UpdateFlowResponse)
-> Either String (Maybe FlowStatus)
-> Either String (Int -> UpdateFlowResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe FlowStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"flowStatus")
            Either String (Int -> UpdateFlowResponse)
-> Either String Int -> Either String UpdateFlowResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateFlow

instance Prelude.NFData UpdateFlow

instance Core.ToHeaders UpdateFlow where
  toHeaders :: UpdateFlow -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateFlow -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON UpdateFlow where
  toJSON :: UpdateFlow -> Value
toJSON UpdateFlow' {[Task]
[DestinationFlowConfig]
Maybe Text
Text
TriggerConfig
SourceFlowConfig
tasks :: [Task]
destinationFlowConfigList :: [DestinationFlowConfig]
sourceFlowConfig :: SourceFlowConfig
triggerConfig :: TriggerConfig
flowName :: Text
description :: Maybe Text
$sel:tasks:UpdateFlow' :: UpdateFlow -> [Task]
$sel:destinationFlowConfigList:UpdateFlow' :: UpdateFlow -> [DestinationFlowConfig]
$sel:sourceFlowConfig:UpdateFlow' :: UpdateFlow -> SourceFlowConfig
$sel:triggerConfig:UpdateFlow' :: UpdateFlow -> TriggerConfig
$sel:flowName:UpdateFlow' :: UpdateFlow -> Text
$sel:description:UpdateFlow' :: UpdateFlow -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"description" 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
description,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"flowName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
flowName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"triggerConfig" Text -> TriggerConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TriggerConfig
triggerConfig),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"sourceFlowConfig" Text -> SourceFlowConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SourceFlowConfig
sourceFlowConfig),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"destinationFlowConfigList"
                  Text -> [DestinationFlowConfig] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [DestinationFlowConfig]
destinationFlowConfigList
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"tasks" Text -> [Task] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Task]
tasks)
          ]
      )

instance Core.ToPath UpdateFlow where
  toPath :: UpdateFlow -> ByteString
toPath = ByteString -> UpdateFlow -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/update-flow"

instance Core.ToQuery UpdateFlow where
  toQuery :: UpdateFlow -> QueryString
toQuery = QueryString -> UpdateFlow -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateFlowResponse' smart constructor.
data UpdateFlowResponse = UpdateFlowResponse'
  { -- | Indicates the current status of the flow.
    UpdateFlowResponse -> Maybe FlowStatus
flowStatus :: Prelude.Maybe FlowStatus,
    -- | The response's http status code.
    UpdateFlowResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateFlowResponse -> UpdateFlowResponse -> Bool
(UpdateFlowResponse -> UpdateFlowResponse -> Bool)
-> (UpdateFlowResponse -> UpdateFlowResponse -> Bool)
-> Eq UpdateFlowResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFlowResponse -> UpdateFlowResponse -> Bool
$c/= :: UpdateFlowResponse -> UpdateFlowResponse -> Bool
== :: UpdateFlowResponse -> UpdateFlowResponse -> Bool
$c== :: UpdateFlowResponse -> UpdateFlowResponse -> Bool
Prelude.Eq, ReadPrec [UpdateFlowResponse]
ReadPrec UpdateFlowResponse
Int -> ReadS UpdateFlowResponse
ReadS [UpdateFlowResponse]
(Int -> ReadS UpdateFlowResponse)
-> ReadS [UpdateFlowResponse]
-> ReadPrec UpdateFlowResponse
-> ReadPrec [UpdateFlowResponse]
-> Read UpdateFlowResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFlowResponse]
$creadListPrec :: ReadPrec [UpdateFlowResponse]
readPrec :: ReadPrec UpdateFlowResponse
$creadPrec :: ReadPrec UpdateFlowResponse
readList :: ReadS [UpdateFlowResponse]
$creadList :: ReadS [UpdateFlowResponse]
readsPrec :: Int -> ReadS UpdateFlowResponse
$creadsPrec :: Int -> ReadS UpdateFlowResponse
Prelude.Read, Int -> UpdateFlowResponse -> ShowS
[UpdateFlowResponse] -> ShowS
UpdateFlowResponse -> String
(Int -> UpdateFlowResponse -> ShowS)
-> (UpdateFlowResponse -> String)
-> ([UpdateFlowResponse] -> ShowS)
-> Show UpdateFlowResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFlowResponse] -> ShowS
$cshowList :: [UpdateFlowResponse] -> ShowS
show :: UpdateFlowResponse -> String
$cshow :: UpdateFlowResponse -> String
showsPrec :: Int -> UpdateFlowResponse -> ShowS
$cshowsPrec :: Int -> UpdateFlowResponse -> ShowS
Prelude.Show, (forall x. UpdateFlowResponse -> Rep UpdateFlowResponse x)
-> (forall x. Rep UpdateFlowResponse x -> UpdateFlowResponse)
-> Generic UpdateFlowResponse
forall x. Rep UpdateFlowResponse x -> UpdateFlowResponse
forall x. UpdateFlowResponse -> Rep UpdateFlowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateFlowResponse x -> UpdateFlowResponse
$cfrom :: forall x. UpdateFlowResponse -> Rep UpdateFlowResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFlowResponse' 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:
--
-- 'flowStatus', 'updateFlowResponse_flowStatus' - Indicates the current status of the flow.
--
-- 'httpStatus', 'updateFlowResponse_httpStatus' - The response's http status code.
newUpdateFlowResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateFlowResponse
newUpdateFlowResponse :: Int -> UpdateFlowResponse
newUpdateFlowResponse Int
pHttpStatus_ =
  UpdateFlowResponse' :: Maybe FlowStatus -> Int -> UpdateFlowResponse
UpdateFlowResponse'
    { $sel:flowStatus:UpdateFlowResponse' :: Maybe FlowStatus
flowStatus = Maybe FlowStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateFlowResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The response's http status code.
updateFlowResponse_httpStatus :: Lens.Lens' UpdateFlowResponse Prelude.Int
updateFlowResponse_httpStatus :: (Int -> f Int) -> UpdateFlowResponse -> f UpdateFlowResponse
updateFlowResponse_httpStatus = (UpdateFlowResponse -> Int)
-> (UpdateFlowResponse -> Int -> UpdateFlowResponse)
-> Lens UpdateFlowResponse UpdateFlowResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFlowResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateFlowResponse' :: UpdateFlowResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateFlowResponse
s@UpdateFlowResponse' {} Int
a -> UpdateFlowResponse
s {$sel:httpStatus:UpdateFlowResponse' :: Int
httpStatus = Int
a} :: UpdateFlowResponse)

instance Prelude.NFData UpdateFlowResponse