{-# 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.MigrationHubOrchestrator.CreateWorkflowStep
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Create a step in the migration workflow.
module Amazonka.MigrationHubOrchestrator.CreateWorkflowStep
  ( -- * Creating a Request
    CreateWorkflowStep (..),
    newCreateWorkflowStep,

    -- * Request Lenses
    createWorkflowStep_description,
    createWorkflowStep_next,
    createWorkflowStep_outputs,
    createWorkflowStep_previous,
    createWorkflowStep_stepTarget,
    createWorkflowStep_workflowStepAutomationConfiguration,
    createWorkflowStep_name,
    createWorkflowStep_stepGroupId,
    createWorkflowStep_workflowId,
    createWorkflowStep_stepActionType,

    -- * Destructuring the Response
    CreateWorkflowStepResponse (..),
    newCreateWorkflowStepResponse,

    -- * Response Lenses
    createWorkflowStepResponse_id,
    createWorkflowStepResponse_name,
    createWorkflowStepResponse_stepGroupId,
    createWorkflowStepResponse_workflowId,
    createWorkflowStepResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MigrationHubOrchestrator.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateWorkflowStep' smart constructor.
data CreateWorkflowStep = CreateWorkflowStep'
  { -- | The description of the step.
    CreateWorkflowStep -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The next step.
    CreateWorkflowStep -> Maybe [Text]
next :: Prelude.Maybe [Prelude.Text],
    -- | The key value pairs added for the expected output.
    CreateWorkflowStep -> Maybe [WorkflowStepOutput]
outputs :: Prelude.Maybe [WorkflowStepOutput],
    -- | The previous step.
    CreateWorkflowStep -> Maybe [Text]
previous :: Prelude.Maybe [Prelude.Text],
    -- | The servers on which a step will be run.
    CreateWorkflowStep -> Maybe [Text]
stepTarget :: Prelude.Maybe [Prelude.Text],
    -- | The custom script to run tests on source or target environments.
    CreateWorkflowStep -> Maybe WorkflowStepAutomationConfiguration
workflowStepAutomationConfiguration :: Prelude.Maybe WorkflowStepAutomationConfiguration,
    -- | The name of the step.
    CreateWorkflowStep -> Text
name :: Prelude.Text,
    -- | The ID of the step group.
    CreateWorkflowStep -> Text
stepGroupId :: Prelude.Text,
    -- | The ID of the migration workflow.
    CreateWorkflowStep -> Text
workflowId :: Prelude.Text,
    -- | The action type of the step. You must run and update the status of a
    -- manual step for the workflow to continue after the completion of the
    -- step.
    CreateWorkflowStep -> StepActionType
stepActionType :: StepActionType
  }
  deriving (CreateWorkflowStep -> CreateWorkflowStep -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorkflowStep -> CreateWorkflowStep -> Bool
$c/= :: CreateWorkflowStep -> CreateWorkflowStep -> Bool
== :: CreateWorkflowStep -> CreateWorkflowStep -> Bool
$c== :: CreateWorkflowStep -> CreateWorkflowStep -> Bool
Prelude.Eq, ReadPrec [CreateWorkflowStep]
ReadPrec CreateWorkflowStep
Int -> ReadS CreateWorkflowStep
ReadS [CreateWorkflowStep]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorkflowStep]
$creadListPrec :: ReadPrec [CreateWorkflowStep]
readPrec :: ReadPrec CreateWorkflowStep
$creadPrec :: ReadPrec CreateWorkflowStep
readList :: ReadS [CreateWorkflowStep]
$creadList :: ReadS [CreateWorkflowStep]
readsPrec :: Int -> ReadS CreateWorkflowStep
$creadsPrec :: Int -> ReadS CreateWorkflowStep
Prelude.Read, Int -> CreateWorkflowStep -> ShowS
[CreateWorkflowStep] -> ShowS
CreateWorkflowStep -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorkflowStep] -> ShowS
$cshowList :: [CreateWorkflowStep] -> ShowS
show :: CreateWorkflowStep -> String
$cshow :: CreateWorkflowStep -> String
showsPrec :: Int -> CreateWorkflowStep -> ShowS
$cshowsPrec :: Int -> CreateWorkflowStep -> ShowS
Prelude.Show, forall x. Rep CreateWorkflowStep x -> CreateWorkflowStep
forall x. CreateWorkflowStep -> Rep CreateWorkflowStep x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateWorkflowStep x -> CreateWorkflowStep
$cfrom :: forall x. CreateWorkflowStep -> Rep CreateWorkflowStep x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorkflowStep' 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', 'createWorkflowStep_description' - The description of the step.
--
-- 'next', 'createWorkflowStep_next' - The next step.
--
-- 'outputs', 'createWorkflowStep_outputs' - The key value pairs added for the expected output.
--
-- 'previous', 'createWorkflowStep_previous' - The previous step.
--
-- 'stepTarget', 'createWorkflowStep_stepTarget' - The servers on which a step will be run.
--
-- 'workflowStepAutomationConfiguration', 'createWorkflowStep_workflowStepAutomationConfiguration' - The custom script to run tests on source or target environments.
--
-- 'name', 'createWorkflowStep_name' - The name of the step.
--
-- 'stepGroupId', 'createWorkflowStep_stepGroupId' - The ID of the step group.
--
-- 'workflowId', 'createWorkflowStep_workflowId' - The ID of the migration workflow.
--
-- 'stepActionType', 'createWorkflowStep_stepActionType' - The action type of the step. You must run and update the status of a
-- manual step for the workflow to continue after the completion of the
-- step.
newCreateWorkflowStep ::
  -- | 'name'
  Prelude.Text ->
  -- | 'stepGroupId'
  Prelude.Text ->
  -- | 'workflowId'
  Prelude.Text ->
  -- | 'stepActionType'
  StepActionType ->
  CreateWorkflowStep
newCreateWorkflowStep :: Text -> Text -> Text -> StepActionType -> CreateWorkflowStep
newCreateWorkflowStep
  Text
pName_
  Text
pStepGroupId_
  Text
pWorkflowId_
  StepActionType
pStepActionType_ =
    CreateWorkflowStep'
      { $sel:description:CreateWorkflowStep' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
        $sel:next:CreateWorkflowStep' :: Maybe [Text]
next = forall a. Maybe a
Prelude.Nothing,
        $sel:outputs:CreateWorkflowStep' :: Maybe [WorkflowStepOutput]
outputs = forall a. Maybe a
Prelude.Nothing,
        $sel:previous:CreateWorkflowStep' :: Maybe [Text]
previous = forall a. Maybe a
Prelude.Nothing,
        $sel:stepTarget:CreateWorkflowStep' :: Maybe [Text]
stepTarget = forall a. Maybe a
Prelude.Nothing,
        $sel:workflowStepAutomationConfiguration:CreateWorkflowStep' :: Maybe WorkflowStepAutomationConfiguration
workflowStepAutomationConfiguration =
          forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateWorkflowStep' :: Text
name = Text
pName_,
        $sel:stepGroupId:CreateWorkflowStep' :: Text
stepGroupId = Text
pStepGroupId_,
        $sel:workflowId:CreateWorkflowStep' :: Text
workflowId = Text
pWorkflowId_,
        $sel:stepActionType:CreateWorkflowStep' :: StepActionType
stepActionType = StepActionType
pStepActionType_
      }

-- | The description of the step.
createWorkflowStep_description :: Lens.Lens' CreateWorkflowStep (Prelude.Maybe Prelude.Text)
createWorkflowStep_description :: Lens' CreateWorkflowStep (Maybe Text)
createWorkflowStep_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflowStep' {Maybe Text
description :: Maybe Text
$sel:description:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateWorkflowStep
s@CreateWorkflowStep' {} Maybe Text
a -> CreateWorkflowStep
s {$sel:description:CreateWorkflowStep' :: Maybe Text
description = Maybe Text
a} :: CreateWorkflowStep)

-- | The next step.
createWorkflowStep_next :: Lens.Lens' CreateWorkflowStep (Prelude.Maybe [Prelude.Text])
createWorkflowStep_next :: Lens' CreateWorkflowStep (Maybe [Text])
createWorkflowStep_next = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflowStep' {Maybe [Text]
next :: Maybe [Text]
$sel:next:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe [Text]
next} -> Maybe [Text]
next) (\s :: CreateWorkflowStep
s@CreateWorkflowStep' {} Maybe [Text]
a -> CreateWorkflowStep
s {$sel:next:CreateWorkflowStep' :: Maybe [Text]
next = Maybe [Text]
a} :: CreateWorkflowStep) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The key value pairs added for the expected output.
createWorkflowStep_outputs :: Lens.Lens' CreateWorkflowStep (Prelude.Maybe [WorkflowStepOutput])
createWorkflowStep_outputs :: Lens' CreateWorkflowStep (Maybe [WorkflowStepOutput])
createWorkflowStep_outputs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflowStep' {Maybe [WorkflowStepOutput]
outputs :: Maybe [WorkflowStepOutput]
$sel:outputs:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe [WorkflowStepOutput]
outputs} -> Maybe [WorkflowStepOutput]
outputs) (\s :: CreateWorkflowStep
s@CreateWorkflowStep' {} Maybe [WorkflowStepOutput]
a -> CreateWorkflowStep
s {$sel:outputs:CreateWorkflowStep' :: Maybe [WorkflowStepOutput]
outputs = Maybe [WorkflowStepOutput]
a} :: CreateWorkflowStep) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The previous step.
createWorkflowStep_previous :: Lens.Lens' CreateWorkflowStep (Prelude.Maybe [Prelude.Text])
createWorkflowStep_previous :: Lens' CreateWorkflowStep (Maybe [Text])
createWorkflowStep_previous = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflowStep' {Maybe [Text]
previous :: Maybe [Text]
$sel:previous:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe [Text]
previous} -> Maybe [Text]
previous) (\s :: CreateWorkflowStep
s@CreateWorkflowStep' {} Maybe [Text]
a -> CreateWorkflowStep
s {$sel:previous:CreateWorkflowStep' :: Maybe [Text]
previous = Maybe [Text]
a} :: CreateWorkflowStep) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The servers on which a step will be run.
createWorkflowStep_stepTarget :: Lens.Lens' CreateWorkflowStep (Prelude.Maybe [Prelude.Text])
createWorkflowStep_stepTarget :: Lens' CreateWorkflowStep (Maybe [Text])
createWorkflowStep_stepTarget = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflowStep' {Maybe [Text]
stepTarget :: Maybe [Text]
$sel:stepTarget:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe [Text]
stepTarget} -> Maybe [Text]
stepTarget) (\s :: CreateWorkflowStep
s@CreateWorkflowStep' {} Maybe [Text]
a -> CreateWorkflowStep
s {$sel:stepTarget:CreateWorkflowStep' :: Maybe [Text]
stepTarget = Maybe [Text]
a} :: CreateWorkflowStep) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The custom script to run tests on source or target environments.
createWorkflowStep_workflowStepAutomationConfiguration :: Lens.Lens' CreateWorkflowStep (Prelude.Maybe WorkflowStepAutomationConfiguration)
createWorkflowStep_workflowStepAutomationConfiguration :: Lens'
  CreateWorkflowStep (Maybe WorkflowStepAutomationConfiguration)
createWorkflowStep_workflowStepAutomationConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflowStep' {Maybe WorkflowStepAutomationConfiguration
workflowStepAutomationConfiguration :: Maybe WorkflowStepAutomationConfiguration
$sel:workflowStepAutomationConfiguration:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe WorkflowStepAutomationConfiguration
workflowStepAutomationConfiguration} -> Maybe WorkflowStepAutomationConfiguration
workflowStepAutomationConfiguration) (\s :: CreateWorkflowStep
s@CreateWorkflowStep' {} Maybe WorkflowStepAutomationConfiguration
a -> CreateWorkflowStep
s {$sel:workflowStepAutomationConfiguration:CreateWorkflowStep' :: Maybe WorkflowStepAutomationConfiguration
workflowStepAutomationConfiguration = Maybe WorkflowStepAutomationConfiguration
a} :: CreateWorkflowStep)

-- | The name of the step.
createWorkflowStep_name :: Lens.Lens' CreateWorkflowStep Prelude.Text
createWorkflowStep_name :: Lens' CreateWorkflowStep Text
createWorkflowStep_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflowStep' {Text
name :: Text
$sel:name:CreateWorkflowStep' :: CreateWorkflowStep -> Text
name} -> Text
name) (\s :: CreateWorkflowStep
s@CreateWorkflowStep' {} Text
a -> CreateWorkflowStep
s {$sel:name:CreateWorkflowStep' :: Text
name = Text
a} :: CreateWorkflowStep)

-- | The ID of the step group.
createWorkflowStep_stepGroupId :: Lens.Lens' CreateWorkflowStep Prelude.Text
createWorkflowStep_stepGroupId :: Lens' CreateWorkflowStep Text
createWorkflowStep_stepGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflowStep' {Text
stepGroupId :: Text
$sel:stepGroupId:CreateWorkflowStep' :: CreateWorkflowStep -> Text
stepGroupId} -> Text
stepGroupId) (\s :: CreateWorkflowStep
s@CreateWorkflowStep' {} Text
a -> CreateWorkflowStep
s {$sel:stepGroupId:CreateWorkflowStep' :: Text
stepGroupId = Text
a} :: CreateWorkflowStep)

-- | The ID of the migration workflow.
createWorkflowStep_workflowId :: Lens.Lens' CreateWorkflowStep Prelude.Text
createWorkflowStep_workflowId :: Lens' CreateWorkflowStep Text
createWorkflowStep_workflowId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflowStep' {Text
workflowId :: Text
$sel:workflowId:CreateWorkflowStep' :: CreateWorkflowStep -> Text
workflowId} -> Text
workflowId) (\s :: CreateWorkflowStep
s@CreateWorkflowStep' {} Text
a -> CreateWorkflowStep
s {$sel:workflowId:CreateWorkflowStep' :: Text
workflowId = Text
a} :: CreateWorkflowStep)

-- | The action type of the step. You must run and update the status of a
-- manual step for the workflow to continue after the completion of the
-- step.
createWorkflowStep_stepActionType :: Lens.Lens' CreateWorkflowStep StepActionType
createWorkflowStep_stepActionType :: Lens' CreateWorkflowStep StepActionType
createWorkflowStep_stepActionType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflowStep' {StepActionType
stepActionType :: StepActionType
$sel:stepActionType:CreateWorkflowStep' :: CreateWorkflowStep -> StepActionType
stepActionType} -> StepActionType
stepActionType) (\s :: CreateWorkflowStep
s@CreateWorkflowStep' {} StepActionType
a -> CreateWorkflowStep
s {$sel:stepActionType:CreateWorkflowStep' :: StepActionType
stepActionType = StepActionType
a} :: CreateWorkflowStep)

instance Core.AWSRequest CreateWorkflowStep where
  type
    AWSResponse CreateWorkflowStep =
      CreateWorkflowStepResponse
  request :: (Service -> Service)
-> CreateWorkflowStep -> Request CreateWorkflowStep
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateWorkflowStep
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateWorkflowStep)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateWorkflowStepResponse
CreateWorkflowStepResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"stepGroupId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"workflowId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateWorkflowStep where
  hashWithSalt :: Int -> CreateWorkflowStep -> Int
hashWithSalt Int
_salt CreateWorkflowStep' {Maybe [Text]
Maybe [WorkflowStepOutput]
Maybe Text
Maybe WorkflowStepAutomationConfiguration
Text
StepActionType
stepActionType :: StepActionType
workflowId :: Text
stepGroupId :: Text
name :: Text
workflowStepAutomationConfiguration :: Maybe WorkflowStepAutomationConfiguration
stepTarget :: Maybe [Text]
previous :: Maybe [Text]
outputs :: Maybe [WorkflowStepOutput]
next :: Maybe [Text]
description :: Maybe Text
$sel:stepActionType:CreateWorkflowStep' :: CreateWorkflowStep -> StepActionType
$sel:workflowId:CreateWorkflowStep' :: CreateWorkflowStep -> Text
$sel:stepGroupId:CreateWorkflowStep' :: CreateWorkflowStep -> Text
$sel:name:CreateWorkflowStep' :: CreateWorkflowStep -> Text
$sel:workflowStepAutomationConfiguration:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe WorkflowStepAutomationConfiguration
$sel:stepTarget:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe [Text]
$sel:previous:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe [Text]
$sel:outputs:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe [WorkflowStepOutput]
$sel:next:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe [Text]
$sel:description:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
next
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [WorkflowStepOutput]
outputs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
previous
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
stepTarget
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WorkflowStepAutomationConfiguration
workflowStepAutomationConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
stepGroupId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workflowId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` StepActionType
stepActionType

instance Prelude.NFData CreateWorkflowStep where
  rnf :: CreateWorkflowStep -> ()
rnf CreateWorkflowStep' {Maybe [Text]
Maybe [WorkflowStepOutput]
Maybe Text
Maybe WorkflowStepAutomationConfiguration
Text
StepActionType
stepActionType :: StepActionType
workflowId :: Text
stepGroupId :: Text
name :: Text
workflowStepAutomationConfiguration :: Maybe WorkflowStepAutomationConfiguration
stepTarget :: Maybe [Text]
previous :: Maybe [Text]
outputs :: Maybe [WorkflowStepOutput]
next :: Maybe [Text]
description :: Maybe Text
$sel:stepActionType:CreateWorkflowStep' :: CreateWorkflowStep -> StepActionType
$sel:workflowId:CreateWorkflowStep' :: CreateWorkflowStep -> Text
$sel:stepGroupId:CreateWorkflowStep' :: CreateWorkflowStep -> Text
$sel:name:CreateWorkflowStep' :: CreateWorkflowStep -> Text
$sel:workflowStepAutomationConfiguration:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe WorkflowStepAutomationConfiguration
$sel:stepTarget:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe [Text]
$sel:previous:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe [Text]
$sel:outputs:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe [WorkflowStepOutput]
$sel:next:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe [Text]
$sel:description:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
next
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [WorkflowStepOutput]
outputs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
previous
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
stepTarget
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WorkflowStepAutomationConfiguration
workflowStepAutomationConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
stepGroupId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
workflowId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf StepActionType
stepActionType

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

instance Data.ToJSON CreateWorkflowStep where
  toJSON :: CreateWorkflowStep -> Value
toJSON CreateWorkflowStep' {Maybe [Text]
Maybe [WorkflowStepOutput]
Maybe Text
Maybe WorkflowStepAutomationConfiguration
Text
StepActionType
stepActionType :: StepActionType
workflowId :: Text
stepGroupId :: Text
name :: Text
workflowStepAutomationConfiguration :: Maybe WorkflowStepAutomationConfiguration
stepTarget :: Maybe [Text]
previous :: Maybe [Text]
outputs :: Maybe [WorkflowStepOutput]
next :: Maybe [Text]
description :: Maybe Text
$sel:stepActionType:CreateWorkflowStep' :: CreateWorkflowStep -> StepActionType
$sel:workflowId:CreateWorkflowStep' :: CreateWorkflowStep -> Text
$sel:stepGroupId:CreateWorkflowStep' :: CreateWorkflowStep -> Text
$sel:name:CreateWorkflowStep' :: CreateWorkflowStep -> Text
$sel:workflowStepAutomationConfiguration:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe WorkflowStepAutomationConfiguration
$sel:stepTarget:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe [Text]
$sel:previous:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe [Text]
$sel:outputs:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe [WorkflowStepOutput]
$sel:next:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe [Text]
$sel:description:CreateWorkflowStep' :: CreateWorkflowStep -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"description" 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
description,
            (Key
"next" 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]
next,
            (Key
"outputs" 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 [WorkflowStepOutput]
outputs,
            (Key
"previous" 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]
previous,
            (Key
"stepTarget" 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]
stepTarget,
            (Key
"workflowStepAutomationConfiguration" 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 WorkflowStepAutomationConfiguration
workflowStepAutomationConfiguration,
            forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
            forall a. a -> Maybe a
Prelude.Just (Key
"stepGroupId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
stepGroupId),
            forall a. a -> Maybe a
Prelude.Just (Key
"workflowId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
workflowId),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"stepActionType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= StepActionType
stepActionType)
          ]
      )

instance Data.ToPath CreateWorkflowStep where
  toPath :: CreateWorkflowStep -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/workflowstep"

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

-- | /See:/ 'newCreateWorkflowStepResponse' smart constructor.
data CreateWorkflowStepResponse = CreateWorkflowStepResponse'
  { -- | The ID of the step.
    CreateWorkflowStepResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the step.
    CreateWorkflowStepResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ID of the step group.
    CreateWorkflowStepResponse -> Maybe Text
stepGroupId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the migration workflow.
    CreateWorkflowStepResponse -> Maybe Text
workflowId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateWorkflowStepResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateWorkflowStepResponse -> CreateWorkflowStepResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorkflowStepResponse -> CreateWorkflowStepResponse -> Bool
$c/= :: CreateWorkflowStepResponse -> CreateWorkflowStepResponse -> Bool
== :: CreateWorkflowStepResponse -> CreateWorkflowStepResponse -> Bool
$c== :: CreateWorkflowStepResponse -> CreateWorkflowStepResponse -> Bool
Prelude.Eq, ReadPrec [CreateWorkflowStepResponse]
ReadPrec CreateWorkflowStepResponse
Int -> ReadS CreateWorkflowStepResponse
ReadS [CreateWorkflowStepResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorkflowStepResponse]
$creadListPrec :: ReadPrec [CreateWorkflowStepResponse]
readPrec :: ReadPrec CreateWorkflowStepResponse
$creadPrec :: ReadPrec CreateWorkflowStepResponse
readList :: ReadS [CreateWorkflowStepResponse]
$creadList :: ReadS [CreateWorkflowStepResponse]
readsPrec :: Int -> ReadS CreateWorkflowStepResponse
$creadsPrec :: Int -> ReadS CreateWorkflowStepResponse
Prelude.Read, Int -> CreateWorkflowStepResponse -> ShowS
[CreateWorkflowStepResponse] -> ShowS
CreateWorkflowStepResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorkflowStepResponse] -> ShowS
$cshowList :: [CreateWorkflowStepResponse] -> ShowS
show :: CreateWorkflowStepResponse -> String
$cshow :: CreateWorkflowStepResponse -> String
showsPrec :: Int -> CreateWorkflowStepResponse -> ShowS
$cshowsPrec :: Int -> CreateWorkflowStepResponse -> ShowS
Prelude.Show, forall x.
Rep CreateWorkflowStepResponse x -> CreateWorkflowStepResponse
forall x.
CreateWorkflowStepResponse -> Rep CreateWorkflowStepResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateWorkflowStepResponse x -> CreateWorkflowStepResponse
$cfrom :: forall x.
CreateWorkflowStepResponse -> Rep CreateWorkflowStepResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorkflowStepResponse' 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:
--
-- 'id', 'createWorkflowStepResponse_id' - The ID of the step.
--
-- 'name', 'createWorkflowStepResponse_name' - The name of the step.
--
-- 'stepGroupId', 'createWorkflowStepResponse_stepGroupId' - The ID of the step group.
--
-- 'workflowId', 'createWorkflowStepResponse_workflowId' - The ID of the migration workflow.
--
-- 'httpStatus', 'createWorkflowStepResponse_httpStatus' - The response's http status code.
newCreateWorkflowStepResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateWorkflowStepResponse
newCreateWorkflowStepResponse :: Int -> CreateWorkflowStepResponse
newCreateWorkflowStepResponse Int
pHttpStatus_ =
  CreateWorkflowStepResponse'
    { $sel:id:CreateWorkflowStepResponse' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateWorkflowStepResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:stepGroupId:CreateWorkflowStepResponse' :: Maybe Text
stepGroupId = forall a. Maybe a
Prelude.Nothing,
      $sel:workflowId:CreateWorkflowStepResponse' :: Maybe Text
workflowId = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateWorkflowStepResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ID of the step.
createWorkflowStepResponse_id :: Lens.Lens' CreateWorkflowStepResponse (Prelude.Maybe Prelude.Text)
createWorkflowStepResponse_id :: Lens' CreateWorkflowStepResponse (Maybe Text)
createWorkflowStepResponse_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflowStepResponse' {Maybe Text
id :: Maybe Text
$sel:id:CreateWorkflowStepResponse' :: CreateWorkflowStepResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: CreateWorkflowStepResponse
s@CreateWorkflowStepResponse' {} Maybe Text
a -> CreateWorkflowStepResponse
s {$sel:id:CreateWorkflowStepResponse' :: Maybe Text
id = Maybe Text
a} :: CreateWorkflowStepResponse)

-- | The name of the step.
createWorkflowStepResponse_name :: Lens.Lens' CreateWorkflowStepResponse (Prelude.Maybe Prelude.Text)
createWorkflowStepResponse_name :: Lens' CreateWorkflowStepResponse (Maybe Text)
createWorkflowStepResponse_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflowStepResponse' {Maybe Text
name :: Maybe Text
$sel:name:CreateWorkflowStepResponse' :: CreateWorkflowStepResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateWorkflowStepResponse
s@CreateWorkflowStepResponse' {} Maybe Text
a -> CreateWorkflowStepResponse
s {$sel:name:CreateWorkflowStepResponse' :: Maybe Text
name = Maybe Text
a} :: CreateWorkflowStepResponse)

-- | The ID of the step group.
createWorkflowStepResponse_stepGroupId :: Lens.Lens' CreateWorkflowStepResponse (Prelude.Maybe Prelude.Text)
createWorkflowStepResponse_stepGroupId :: Lens' CreateWorkflowStepResponse (Maybe Text)
createWorkflowStepResponse_stepGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflowStepResponse' {Maybe Text
stepGroupId :: Maybe Text
$sel:stepGroupId:CreateWorkflowStepResponse' :: CreateWorkflowStepResponse -> Maybe Text
stepGroupId} -> Maybe Text
stepGroupId) (\s :: CreateWorkflowStepResponse
s@CreateWorkflowStepResponse' {} Maybe Text
a -> CreateWorkflowStepResponse
s {$sel:stepGroupId:CreateWorkflowStepResponse' :: Maybe Text
stepGroupId = Maybe Text
a} :: CreateWorkflowStepResponse)

-- | The ID of the migration workflow.
createWorkflowStepResponse_workflowId :: Lens.Lens' CreateWorkflowStepResponse (Prelude.Maybe Prelude.Text)
createWorkflowStepResponse_workflowId :: Lens' CreateWorkflowStepResponse (Maybe Text)
createWorkflowStepResponse_workflowId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflowStepResponse' {Maybe Text
workflowId :: Maybe Text
$sel:workflowId:CreateWorkflowStepResponse' :: CreateWorkflowStepResponse -> Maybe Text
workflowId} -> Maybe Text
workflowId) (\s :: CreateWorkflowStepResponse
s@CreateWorkflowStepResponse' {} Maybe Text
a -> CreateWorkflowStepResponse
s {$sel:workflowId:CreateWorkflowStepResponse' :: Maybe Text
workflowId = Maybe Text
a} :: CreateWorkflowStepResponse)

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

instance Prelude.NFData CreateWorkflowStepResponse where
  rnf :: CreateWorkflowStepResponse -> ()
rnf CreateWorkflowStepResponse' {Int
Maybe Text
httpStatus :: Int
workflowId :: Maybe Text
stepGroupId :: Maybe Text
name :: Maybe Text
id :: Maybe Text
$sel:httpStatus:CreateWorkflowStepResponse' :: CreateWorkflowStepResponse -> Int
$sel:workflowId:CreateWorkflowStepResponse' :: CreateWorkflowStepResponse -> Maybe Text
$sel:stepGroupId:CreateWorkflowStepResponse' :: CreateWorkflowStepResponse -> Maybe Text
$sel:name:CreateWorkflowStepResponse' :: CreateWorkflowStepResponse -> Maybe Text
$sel:id:CreateWorkflowStepResponse' :: CreateWorkflowStepResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stepGroupId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
workflowId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus