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

-- | The output of the step.
--
-- /See:/ 'newStepOutput' smart constructor.
data StepOutput = StepOutput'
  { -- | The data type of the step output.
    StepOutput -> Maybe DataType
dataType :: Prelude.Maybe DataType,
    -- | The name of the step.
    StepOutput -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Determine if an output is required from a step.
    StepOutput -> Maybe Bool
required :: Prelude.Maybe Prelude.Bool
  }
  deriving (StepOutput -> StepOutput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StepOutput -> StepOutput -> Bool
$c/= :: StepOutput -> StepOutput -> Bool
== :: StepOutput -> StepOutput -> Bool
$c== :: StepOutput -> StepOutput -> Bool
Prelude.Eq, ReadPrec [StepOutput]
ReadPrec StepOutput
Int -> ReadS StepOutput
ReadS [StepOutput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StepOutput]
$creadListPrec :: ReadPrec [StepOutput]
readPrec :: ReadPrec StepOutput
$creadPrec :: ReadPrec StepOutput
readList :: ReadS [StepOutput]
$creadList :: ReadS [StepOutput]
readsPrec :: Int -> ReadS StepOutput
$creadsPrec :: Int -> ReadS StepOutput
Prelude.Read, Int -> StepOutput -> ShowS
[StepOutput] -> ShowS
StepOutput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StepOutput] -> ShowS
$cshowList :: [StepOutput] -> ShowS
show :: StepOutput -> String
$cshow :: StepOutput -> String
showsPrec :: Int -> StepOutput -> ShowS
$cshowsPrec :: Int -> StepOutput -> ShowS
Prelude.Show, forall x. Rep StepOutput x -> StepOutput
forall x. StepOutput -> Rep StepOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StepOutput x -> StepOutput
$cfrom :: forall x. StepOutput -> Rep StepOutput x
Prelude.Generic)

-- |
-- Create a value of 'StepOutput' 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:
--
-- 'dataType', 'stepOutput_dataType' - The data type of the step output.
--
-- 'name', 'stepOutput_name' - The name of the step.
--
-- 'required', 'stepOutput_required' - Determine if an output is required from a step.
newStepOutput ::
  StepOutput
newStepOutput :: StepOutput
newStepOutput =
  StepOutput'
    { $sel:dataType:StepOutput' :: Maybe DataType
dataType = forall a. Maybe a
Prelude.Nothing,
      $sel:name:StepOutput' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:required:StepOutput' :: Maybe Bool
required = forall a. Maybe a
Prelude.Nothing
    }

-- | The data type of the step output.
stepOutput_dataType :: Lens.Lens' StepOutput (Prelude.Maybe DataType)
stepOutput_dataType :: Lens' StepOutput (Maybe DataType)
stepOutput_dataType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepOutput' {Maybe DataType
dataType :: Maybe DataType
$sel:dataType:StepOutput' :: StepOutput -> Maybe DataType
dataType} -> Maybe DataType
dataType) (\s :: StepOutput
s@StepOutput' {} Maybe DataType
a -> StepOutput
s {$sel:dataType:StepOutput' :: Maybe DataType
dataType = Maybe DataType
a} :: StepOutput)

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

-- | Determine if an output is required from a step.
stepOutput_required :: Lens.Lens' StepOutput (Prelude.Maybe Prelude.Bool)
stepOutput_required :: Lens' StepOutput (Maybe Bool)
stepOutput_required = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StepOutput' {Maybe Bool
required :: Maybe Bool
$sel:required:StepOutput' :: StepOutput -> Maybe Bool
required} -> Maybe Bool
required) (\s :: StepOutput
s@StepOutput' {} Maybe Bool
a -> StepOutput
s {$sel:required:StepOutput' :: Maybe Bool
required = Maybe Bool
a} :: StepOutput)

instance Data.FromJSON StepOutput where
  parseJSON :: Value -> Parser StepOutput
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"StepOutput"
      ( \Object
x ->
          Maybe DataType -> Maybe Text -> Maybe Bool -> StepOutput
StepOutput'
            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
"dataType")
            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
"required")
      )

instance Prelude.Hashable StepOutput where
  hashWithSalt :: Int -> StepOutput -> Int
hashWithSalt Int
_salt StepOutput' {Maybe Bool
Maybe Text
Maybe DataType
required :: Maybe Bool
name :: Maybe Text
dataType :: Maybe DataType
$sel:required:StepOutput' :: StepOutput -> Maybe Bool
$sel:name:StepOutput' :: StepOutput -> Maybe Text
$sel:dataType:StepOutput' :: StepOutput -> Maybe DataType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DataType
dataType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
required

instance Prelude.NFData StepOutput where
  rnf :: StepOutput -> ()
rnf StepOutput' {Maybe Bool
Maybe Text
Maybe DataType
required :: Maybe Bool
name :: Maybe Text
dataType :: Maybe DataType
$sel:required:StepOutput' :: StepOutput -> Maybe Bool
$sel:name:StepOutput' :: StepOutput -> Maybe Text
$sel:dataType:StepOutput' :: StepOutput -> Maybe DataType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe DataType
dataType
      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 Bool
required