{-# 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.MigrationHubOrchestrator.Types.TemplateStepSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MigrationHubOrchestrator.Types.TemplateStepSummary 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.Owner
import Amazonka.MigrationHubOrchestrator.Types.StepActionType
import Amazonka.MigrationHubOrchestrator.Types.TargetType
import qualified Amazonka.Prelude as Prelude

-- | The summary of the step.
--
-- /See:/ 'newTemplateStepSummary' smart constructor.
data TemplateStepSummary = TemplateStepSummary'
  { -- | The ID of the step.
    TemplateStepSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the step.
    TemplateStepSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The next step.
    TemplateStepSummary -> Maybe [Text]
next :: Prelude.Maybe [Prelude.Text],
    -- | The owner of the step.
    TemplateStepSummary -> Maybe Owner
owner :: Prelude.Maybe Owner,
    -- | The previous step.
    TemplateStepSummary -> Maybe [Text]
previous :: Prelude.Maybe [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.
    TemplateStepSummary -> Maybe StepActionType
stepActionType :: Prelude.Maybe StepActionType,
    -- | The ID of the step group.
    TemplateStepSummary -> Maybe Text
stepGroupId :: Prelude.Maybe Prelude.Text,
    -- | The servers on which to run the script.
    TemplateStepSummary -> Maybe TargetType
targetType :: Prelude.Maybe TargetType,
    -- | The ID of the template.
    TemplateStepSummary -> Maybe Text
templateId :: Prelude.Maybe Prelude.Text
  }
  deriving (TemplateStepSummary -> TemplateStepSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TemplateStepSummary -> TemplateStepSummary -> Bool
$c/= :: TemplateStepSummary -> TemplateStepSummary -> Bool
== :: TemplateStepSummary -> TemplateStepSummary -> Bool
$c== :: TemplateStepSummary -> TemplateStepSummary -> Bool
Prelude.Eq, ReadPrec [TemplateStepSummary]
ReadPrec TemplateStepSummary
Int -> ReadS TemplateStepSummary
ReadS [TemplateStepSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TemplateStepSummary]
$creadListPrec :: ReadPrec [TemplateStepSummary]
readPrec :: ReadPrec TemplateStepSummary
$creadPrec :: ReadPrec TemplateStepSummary
readList :: ReadS [TemplateStepSummary]
$creadList :: ReadS [TemplateStepSummary]
readsPrec :: Int -> ReadS TemplateStepSummary
$creadsPrec :: Int -> ReadS TemplateStepSummary
Prelude.Read, Int -> TemplateStepSummary -> ShowS
[TemplateStepSummary] -> ShowS
TemplateStepSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TemplateStepSummary] -> ShowS
$cshowList :: [TemplateStepSummary] -> ShowS
show :: TemplateStepSummary -> String
$cshow :: TemplateStepSummary -> String
showsPrec :: Int -> TemplateStepSummary -> ShowS
$cshowsPrec :: Int -> TemplateStepSummary -> ShowS
Prelude.Show, forall x. Rep TemplateStepSummary x -> TemplateStepSummary
forall x. TemplateStepSummary -> Rep TemplateStepSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TemplateStepSummary x -> TemplateStepSummary
$cfrom :: forall x. TemplateStepSummary -> Rep TemplateStepSummary x
Prelude.Generic)

-- |
-- Create a value of 'TemplateStepSummary' 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', 'templateStepSummary_id' - The ID of the step.
--
-- 'name', 'templateStepSummary_name' - The name of the step.
--
-- 'next', 'templateStepSummary_next' - The next step.
--
-- 'owner', 'templateStepSummary_owner' - The owner of the step.
--
-- 'previous', 'templateStepSummary_previous' - The previous step.
--
-- 'stepActionType', 'templateStepSummary_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.
--
-- 'stepGroupId', 'templateStepSummary_stepGroupId' - The ID of the step group.
--
-- 'targetType', 'templateStepSummary_targetType' - The servers on which to run the script.
--
-- 'templateId', 'templateStepSummary_templateId' - The ID of the template.
newTemplateStepSummary ::
  TemplateStepSummary
newTemplateStepSummary :: TemplateStepSummary
newTemplateStepSummary =
  TemplateStepSummary'
    { $sel:id:TemplateStepSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:TemplateStepSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:next:TemplateStepSummary' :: Maybe [Text]
next = forall a. Maybe a
Prelude.Nothing,
      $sel:owner:TemplateStepSummary' :: Maybe Owner
owner = forall a. Maybe a
Prelude.Nothing,
      $sel:previous:TemplateStepSummary' :: Maybe [Text]
previous = forall a. Maybe a
Prelude.Nothing,
      $sel:stepActionType:TemplateStepSummary' :: Maybe StepActionType
stepActionType = forall a. Maybe a
Prelude.Nothing,
      $sel:stepGroupId:TemplateStepSummary' :: Maybe Text
stepGroupId = forall a. Maybe a
Prelude.Nothing,
      $sel:targetType:TemplateStepSummary' :: Maybe TargetType
targetType = forall a. Maybe a
Prelude.Nothing,
      $sel:templateId:TemplateStepSummary' :: Maybe Text
templateId = forall a. Maybe a
Prelude.Nothing
    }

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

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

-- | The next step.
templateStepSummary_next :: Lens.Lens' TemplateStepSummary (Prelude.Maybe [Prelude.Text])
templateStepSummary_next :: Lens' TemplateStepSummary (Maybe [Text])
templateStepSummary_next = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateStepSummary' {Maybe [Text]
next :: Maybe [Text]
$sel:next:TemplateStepSummary' :: TemplateStepSummary -> Maybe [Text]
next} -> Maybe [Text]
next) (\s :: TemplateStepSummary
s@TemplateStepSummary' {} Maybe [Text]
a -> TemplateStepSummary
s {$sel:next:TemplateStepSummary' :: Maybe [Text]
next = Maybe [Text]
a} :: TemplateStepSummary) 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 owner of the step.
templateStepSummary_owner :: Lens.Lens' TemplateStepSummary (Prelude.Maybe Owner)
templateStepSummary_owner :: Lens' TemplateStepSummary (Maybe Owner)
templateStepSummary_owner = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateStepSummary' {Maybe Owner
owner :: Maybe Owner
$sel:owner:TemplateStepSummary' :: TemplateStepSummary -> Maybe Owner
owner} -> Maybe Owner
owner) (\s :: TemplateStepSummary
s@TemplateStepSummary' {} Maybe Owner
a -> TemplateStepSummary
s {$sel:owner:TemplateStepSummary' :: Maybe Owner
owner = Maybe Owner
a} :: TemplateStepSummary)

-- | The previous step.
templateStepSummary_previous :: Lens.Lens' TemplateStepSummary (Prelude.Maybe [Prelude.Text])
templateStepSummary_previous :: Lens' TemplateStepSummary (Maybe [Text])
templateStepSummary_previous = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateStepSummary' {Maybe [Text]
previous :: Maybe [Text]
$sel:previous:TemplateStepSummary' :: TemplateStepSummary -> Maybe [Text]
previous} -> Maybe [Text]
previous) (\s :: TemplateStepSummary
s@TemplateStepSummary' {} Maybe [Text]
a -> TemplateStepSummary
s {$sel:previous:TemplateStepSummary' :: Maybe [Text]
previous = Maybe [Text]
a} :: TemplateStepSummary) 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 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.
templateStepSummary_stepActionType :: Lens.Lens' TemplateStepSummary (Prelude.Maybe StepActionType)
templateStepSummary_stepActionType :: Lens' TemplateStepSummary (Maybe StepActionType)
templateStepSummary_stepActionType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateStepSummary' {Maybe StepActionType
stepActionType :: Maybe StepActionType
$sel:stepActionType:TemplateStepSummary' :: TemplateStepSummary -> Maybe StepActionType
stepActionType} -> Maybe StepActionType
stepActionType) (\s :: TemplateStepSummary
s@TemplateStepSummary' {} Maybe StepActionType
a -> TemplateStepSummary
s {$sel:stepActionType:TemplateStepSummary' :: Maybe StepActionType
stepActionType = Maybe StepActionType
a} :: TemplateStepSummary)

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

-- | The servers on which to run the script.
templateStepSummary_targetType :: Lens.Lens' TemplateStepSummary (Prelude.Maybe TargetType)
templateStepSummary_targetType :: Lens' TemplateStepSummary (Maybe TargetType)
templateStepSummary_targetType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateStepSummary' {Maybe TargetType
targetType :: Maybe TargetType
$sel:targetType:TemplateStepSummary' :: TemplateStepSummary -> Maybe TargetType
targetType} -> Maybe TargetType
targetType) (\s :: TemplateStepSummary
s@TemplateStepSummary' {} Maybe TargetType
a -> TemplateStepSummary
s {$sel:targetType:TemplateStepSummary' :: Maybe TargetType
targetType = Maybe TargetType
a} :: TemplateStepSummary)

-- | The ID of the template.
templateStepSummary_templateId :: Lens.Lens' TemplateStepSummary (Prelude.Maybe Prelude.Text)
templateStepSummary_templateId :: Lens' TemplateStepSummary (Maybe Text)
templateStepSummary_templateId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateStepSummary' {Maybe Text
templateId :: Maybe Text
$sel:templateId:TemplateStepSummary' :: TemplateStepSummary -> Maybe Text
templateId} -> Maybe Text
templateId) (\s :: TemplateStepSummary
s@TemplateStepSummary' {} Maybe Text
a -> TemplateStepSummary
s {$sel:templateId:TemplateStepSummary' :: Maybe Text
templateId = Maybe Text
a} :: TemplateStepSummary)

instance Data.FromJSON TemplateStepSummary where
  parseJSON :: Value -> Parser TemplateStepSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"TemplateStepSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Owner
-> Maybe [Text]
-> Maybe StepActionType
-> Maybe Text
-> Maybe TargetType
-> Maybe Text
-> TemplateStepSummary
TemplateStepSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (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 -> Parser (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 -> Parser (Maybe a)
Data..:? Key
"next" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"owner")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"previous" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"stepActionType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (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 -> Parser (Maybe a)
Data..:? Key
"targetType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"templateId")
      )

instance Prelude.Hashable TemplateStepSummary where
  hashWithSalt :: Int -> TemplateStepSummary -> Int
hashWithSalt Int
_salt TemplateStepSummary' {Maybe [Text]
Maybe Text
Maybe Owner
Maybe StepActionType
Maybe TargetType
templateId :: Maybe Text
targetType :: Maybe TargetType
stepGroupId :: Maybe Text
stepActionType :: Maybe StepActionType
previous :: Maybe [Text]
owner :: Maybe Owner
next :: Maybe [Text]
name :: Maybe Text
id :: Maybe Text
$sel:templateId:TemplateStepSummary' :: TemplateStepSummary -> Maybe Text
$sel:targetType:TemplateStepSummary' :: TemplateStepSummary -> Maybe TargetType
$sel:stepGroupId:TemplateStepSummary' :: TemplateStepSummary -> Maybe Text
$sel:stepActionType:TemplateStepSummary' :: TemplateStepSummary -> Maybe StepActionType
$sel:previous:TemplateStepSummary' :: TemplateStepSummary -> Maybe [Text]
$sel:owner:TemplateStepSummary' :: TemplateStepSummary -> Maybe Owner
$sel:next:TemplateStepSummary' :: TemplateStepSummary -> Maybe [Text]
$sel:name:TemplateStepSummary' :: TemplateStepSummary -> Maybe Text
$sel:id:TemplateStepSummary' :: TemplateStepSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
next
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Owner
owner
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
previous
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StepActionType
stepActionType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stepGroupId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TargetType
targetType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
templateId

instance Prelude.NFData TemplateStepSummary where
  rnf :: TemplateStepSummary -> ()
rnf TemplateStepSummary' {Maybe [Text]
Maybe Text
Maybe Owner
Maybe StepActionType
Maybe TargetType
templateId :: Maybe Text
targetType :: Maybe TargetType
stepGroupId :: Maybe Text
stepActionType :: Maybe StepActionType
previous :: Maybe [Text]
owner :: Maybe Owner
next :: Maybe [Text]
name :: Maybe Text
id :: Maybe Text
$sel:templateId:TemplateStepSummary' :: TemplateStepSummary -> Maybe Text
$sel:targetType:TemplateStepSummary' :: TemplateStepSummary -> Maybe TargetType
$sel:stepGroupId:TemplateStepSummary' :: TemplateStepSummary -> Maybe Text
$sel:stepActionType:TemplateStepSummary' :: TemplateStepSummary -> Maybe StepActionType
$sel:previous:TemplateStepSummary' :: TemplateStepSummary -> Maybe [Text]
$sel:owner:TemplateStepSummary' :: TemplateStepSummary -> Maybe Owner
$sel:next:TemplateStepSummary' :: TemplateStepSummary -> Maybe [Text]
$sel:name:TemplateStepSummary' :: TemplateStepSummary -> Maybe Text
$sel:id:TemplateStepSummary' :: TemplateStepSummary -> 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]
next
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Owner
owner
      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 StepActionType
stepActionType
      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 TargetType
targetType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
templateId