{-# 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.WorkflowStepGroupSummary
-- 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.WorkflowStepGroupSummary 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.StepGroupStatus
import qualified Amazonka.Prelude as Prelude

-- | The summary of a step group in a workflow.
--
-- /See:/ 'newWorkflowStepGroupSummary' smart constructor.
data WorkflowStepGroupSummary = WorkflowStepGroupSummary'
  { -- | The ID of the step group.
    WorkflowStepGroupSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the step group.
    WorkflowStepGroupSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The next step group.
    WorkflowStepGroupSummary -> Maybe [Text]
next :: Prelude.Maybe [Prelude.Text],
    -- | The owner of the step group.
    WorkflowStepGroupSummary -> Maybe Owner
owner :: Prelude.Maybe Owner,
    -- | The previous step group.
    WorkflowStepGroupSummary -> Maybe [Text]
previous :: Prelude.Maybe [Prelude.Text],
    -- | The status of the step group.
    WorkflowStepGroupSummary -> Maybe StepGroupStatus
status :: Prelude.Maybe StepGroupStatus
  }
  deriving (WorkflowStepGroupSummary -> WorkflowStepGroupSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkflowStepGroupSummary -> WorkflowStepGroupSummary -> Bool
$c/= :: WorkflowStepGroupSummary -> WorkflowStepGroupSummary -> Bool
== :: WorkflowStepGroupSummary -> WorkflowStepGroupSummary -> Bool
$c== :: WorkflowStepGroupSummary -> WorkflowStepGroupSummary -> Bool
Prelude.Eq, ReadPrec [WorkflowStepGroupSummary]
ReadPrec WorkflowStepGroupSummary
Int -> ReadS WorkflowStepGroupSummary
ReadS [WorkflowStepGroupSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkflowStepGroupSummary]
$creadListPrec :: ReadPrec [WorkflowStepGroupSummary]
readPrec :: ReadPrec WorkflowStepGroupSummary
$creadPrec :: ReadPrec WorkflowStepGroupSummary
readList :: ReadS [WorkflowStepGroupSummary]
$creadList :: ReadS [WorkflowStepGroupSummary]
readsPrec :: Int -> ReadS WorkflowStepGroupSummary
$creadsPrec :: Int -> ReadS WorkflowStepGroupSummary
Prelude.Read, Int -> WorkflowStepGroupSummary -> ShowS
[WorkflowStepGroupSummary] -> ShowS
WorkflowStepGroupSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkflowStepGroupSummary] -> ShowS
$cshowList :: [WorkflowStepGroupSummary] -> ShowS
show :: WorkflowStepGroupSummary -> String
$cshow :: WorkflowStepGroupSummary -> String
showsPrec :: Int -> WorkflowStepGroupSummary -> ShowS
$cshowsPrec :: Int -> WorkflowStepGroupSummary -> ShowS
Prelude.Show, forall x.
Rep WorkflowStepGroupSummary x -> WorkflowStepGroupSummary
forall x.
WorkflowStepGroupSummary -> Rep WorkflowStepGroupSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WorkflowStepGroupSummary x -> WorkflowStepGroupSummary
$cfrom :: forall x.
WorkflowStepGroupSummary -> Rep WorkflowStepGroupSummary x
Prelude.Generic)

-- |
-- Create a value of 'WorkflowStepGroupSummary' 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', 'workflowStepGroupSummary_id' - The ID of the step group.
--
-- 'name', 'workflowStepGroupSummary_name' - The name of the step group.
--
-- 'next', 'workflowStepGroupSummary_next' - The next step group.
--
-- 'owner', 'workflowStepGroupSummary_owner' - The owner of the step group.
--
-- 'previous', 'workflowStepGroupSummary_previous' - The previous step group.
--
-- 'status', 'workflowStepGroupSummary_status' - The status of the step group.
newWorkflowStepGroupSummary ::
  WorkflowStepGroupSummary
newWorkflowStepGroupSummary :: WorkflowStepGroupSummary
newWorkflowStepGroupSummary =
  WorkflowStepGroupSummary'
    { $sel:id:WorkflowStepGroupSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:WorkflowStepGroupSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:next:WorkflowStepGroupSummary' :: Maybe [Text]
next = forall a. Maybe a
Prelude.Nothing,
      $sel:owner:WorkflowStepGroupSummary' :: Maybe Owner
owner = forall a. Maybe a
Prelude.Nothing,
      $sel:previous:WorkflowStepGroupSummary' :: Maybe [Text]
previous = forall a. Maybe a
Prelude.Nothing,
      $sel:status:WorkflowStepGroupSummary' :: Maybe StepGroupStatus
status = forall a. Maybe a
Prelude.Nothing
    }

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

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

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

-- | The previous step group.
workflowStepGroupSummary_previous :: Lens.Lens' WorkflowStepGroupSummary (Prelude.Maybe [Prelude.Text])
workflowStepGroupSummary_previous :: Lens' WorkflowStepGroupSummary (Maybe [Text])
workflowStepGroupSummary_previous = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowStepGroupSummary' {Maybe [Text]
previous :: Maybe [Text]
$sel:previous:WorkflowStepGroupSummary' :: WorkflowStepGroupSummary -> Maybe [Text]
previous} -> Maybe [Text]
previous) (\s :: WorkflowStepGroupSummary
s@WorkflowStepGroupSummary' {} Maybe [Text]
a -> WorkflowStepGroupSummary
s {$sel:previous:WorkflowStepGroupSummary' :: Maybe [Text]
previous = Maybe [Text]
a} :: WorkflowStepGroupSummary) 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 status of the step group.
workflowStepGroupSummary_status :: Lens.Lens' WorkflowStepGroupSummary (Prelude.Maybe StepGroupStatus)
workflowStepGroupSummary_status :: Lens' WorkflowStepGroupSummary (Maybe StepGroupStatus)
workflowStepGroupSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowStepGroupSummary' {Maybe StepGroupStatus
status :: Maybe StepGroupStatus
$sel:status:WorkflowStepGroupSummary' :: WorkflowStepGroupSummary -> Maybe StepGroupStatus
status} -> Maybe StepGroupStatus
status) (\s :: WorkflowStepGroupSummary
s@WorkflowStepGroupSummary' {} Maybe StepGroupStatus
a -> WorkflowStepGroupSummary
s {$sel:status:WorkflowStepGroupSummary' :: Maybe StepGroupStatus
status = Maybe StepGroupStatus
a} :: WorkflowStepGroupSummary)

instance Data.FromJSON WorkflowStepGroupSummary where
  parseJSON :: Value -> Parser WorkflowStepGroupSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"WorkflowStepGroupSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Owner
-> Maybe [Text]
-> Maybe StepGroupStatus
-> WorkflowStepGroupSummary
WorkflowStepGroupSummary'
            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
"status")
      )

instance Prelude.Hashable WorkflowStepGroupSummary where
  hashWithSalt :: Int -> WorkflowStepGroupSummary -> Int
hashWithSalt Int
_salt WorkflowStepGroupSummary' {Maybe [Text]
Maybe Text
Maybe Owner
Maybe StepGroupStatus
status :: Maybe StepGroupStatus
previous :: Maybe [Text]
owner :: Maybe Owner
next :: Maybe [Text]
name :: Maybe Text
id :: Maybe Text
$sel:status:WorkflowStepGroupSummary' :: WorkflowStepGroupSummary -> Maybe StepGroupStatus
$sel:previous:WorkflowStepGroupSummary' :: WorkflowStepGroupSummary -> Maybe [Text]
$sel:owner:WorkflowStepGroupSummary' :: WorkflowStepGroupSummary -> Maybe Owner
$sel:next:WorkflowStepGroupSummary' :: WorkflowStepGroupSummary -> Maybe [Text]
$sel:name:WorkflowStepGroupSummary' :: WorkflowStepGroupSummary -> Maybe Text
$sel:id:WorkflowStepGroupSummary' :: WorkflowStepGroupSummary -> 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 StepGroupStatus
status

instance Prelude.NFData WorkflowStepGroupSummary where
  rnf :: WorkflowStepGroupSummary -> ()
rnf WorkflowStepGroupSummary' {Maybe [Text]
Maybe Text
Maybe Owner
Maybe StepGroupStatus
status :: Maybe StepGroupStatus
previous :: Maybe [Text]
owner :: Maybe Owner
next :: Maybe [Text]
name :: Maybe Text
id :: Maybe Text
$sel:status:WorkflowStepGroupSummary' :: WorkflowStepGroupSummary -> Maybe StepGroupStatus
$sel:previous:WorkflowStepGroupSummary' :: WorkflowStepGroupSummary -> Maybe [Text]
$sel:owner:WorkflowStepGroupSummary' :: WorkflowStepGroupSummary -> Maybe Owner
$sel:next:WorkflowStepGroupSummary' :: WorkflowStepGroupSummary -> Maybe [Text]
$sel:name:WorkflowStepGroupSummary' :: WorkflowStepGroupSummary -> Maybe Text
$sel:id:WorkflowStepGroupSummary' :: WorkflowStepGroupSummary -> 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 StepGroupStatus
status