{-# 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.Kafka.Types.ClusterOperationStep
-- 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.Kafka.Types.ClusterOperationStep where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Kafka.Types.ClusterOperationStepInfo
import qualified Amazonka.Prelude as Prelude

-- | Step taken during a cluster operation.
--
-- /See:/ 'newClusterOperationStep' smart constructor.
data ClusterOperationStep = ClusterOperationStep'
  { -- | Information about the step and its status.
    ClusterOperationStep -> Maybe ClusterOperationStepInfo
stepInfo :: Prelude.Maybe ClusterOperationStepInfo,
    -- | The name of the step.
    ClusterOperationStep -> Maybe Text
stepName :: Prelude.Maybe Prelude.Text
  }
  deriving (ClusterOperationStep -> ClusterOperationStep -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClusterOperationStep -> ClusterOperationStep -> Bool
$c/= :: ClusterOperationStep -> ClusterOperationStep -> Bool
== :: ClusterOperationStep -> ClusterOperationStep -> Bool
$c== :: ClusterOperationStep -> ClusterOperationStep -> Bool
Prelude.Eq, ReadPrec [ClusterOperationStep]
ReadPrec ClusterOperationStep
Int -> ReadS ClusterOperationStep
ReadS [ClusterOperationStep]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClusterOperationStep]
$creadListPrec :: ReadPrec [ClusterOperationStep]
readPrec :: ReadPrec ClusterOperationStep
$creadPrec :: ReadPrec ClusterOperationStep
readList :: ReadS [ClusterOperationStep]
$creadList :: ReadS [ClusterOperationStep]
readsPrec :: Int -> ReadS ClusterOperationStep
$creadsPrec :: Int -> ReadS ClusterOperationStep
Prelude.Read, Int -> ClusterOperationStep -> ShowS
[ClusterOperationStep] -> ShowS
ClusterOperationStep -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClusterOperationStep] -> ShowS
$cshowList :: [ClusterOperationStep] -> ShowS
show :: ClusterOperationStep -> String
$cshow :: ClusterOperationStep -> String
showsPrec :: Int -> ClusterOperationStep -> ShowS
$cshowsPrec :: Int -> ClusterOperationStep -> ShowS
Prelude.Show, forall x. Rep ClusterOperationStep x -> ClusterOperationStep
forall x. ClusterOperationStep -> Rep ClusterOperationStep x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClusterOperationStep x -> ClusterOperationStep
$cfrom :: forall x. ClusterOperationStep -> Rep ClusterOperationStep x
Prelude.Generic)

-- |
-- Create a value of 'ClusterOperationStep' 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:
--
-- 'stepInfo', 'clusterOperationStep_stepInfo' - Information about the step and its status.
--
-- 'stepName', 'clusterOperationStep_stepName' - The name of the step.
newClusterOperationStep ::
  ClusterOperationStep
newClusterOperationStep :: ClusterOperationStep
newClusterOperationStep =
  ClusterOperationStep'
    { $sel:stepInfo:ClusterOperationStep' :: Maybe ClusterOperationStepInfo
stepInfo = forall a. Maybe a
Prelude.Nothing,
      $sel:stepName:ClusterOperationStep' :: Maybe Text
stepName = forall a. Maybe a
Prelude.Nothing
    }

-- | Information about the step and its status.
clusterOperationStep_stepInfo :: Lens.Lens' ClusterOperationStep (Prelude.Maybe ClusterOperationStepInfo)
clusterOperationStep_stepInfo :: Lens' ClusterOperationStep (Maybe ClusterOperationStepInfo)
clusterOperationStep_stepInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterOperationStep' {Maybe ClusterOperationStepInfo
stepInfo :: Maybe ClusterOperationStepInfo
$sel:stepInfo:ClusterOperationStep' :: ClusterOperationStep -> Maybe ClusterOperationStepInfo
stepInfo} -> Maybe ClusterOperationStepInfo
stepInfo) (\s :: ClusterOperationStep
s@ClusterOperationStep' {} Maybe ClusterOperationStepInfo
a -> ClusterOperationStep
s {$sel:stepInfo:ClusterOperationStep' :: Maybe ClusterOperationStepInfo
stepInfo = Maybe ClusterOperationStepInfo
a} :: ClusterOperationStep)

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

instance Data.FromJSON ClusterOperationStep where
  parseJSON :: Value -> Parser ClusterOperationStep
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ClusterOperationStep"
      ( \Object
x ->
          Maybe ClusterOperationStepInfo
-> Maybe Text -> ClusterOperationStep
ClusterOperationStep'
            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
"stepInfo")
            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
"stepName")
      )

instance Prelude.Hashable ClusterOperationStep where
  hashWithSalt :: Int -> ClusterOperationStep -> Int
hashWithSalt Int
_salt ClusterOperationStep' {Maybe Text
Maybe ClusterOperationStepInfo
stepName :: Maybe Text
stepInfo :: Maybe ClusterOperationStepInfo
$sel:stepName:ClusterOperationStep' :: ClusterOperationStep -> Maybe Text
$sel:stepInfo:ClusterOperationStep' :: ClusterOperationStep -> Maybe ClusterOperationStepInfo
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ClusterOperationStepInfo
stepInfo
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stepName

instance Prelude.NFData ClusterOperationStep where
  rnf :: ClusterOperationStep -> ()
rnf ClusterOperationStep' {Maybe Text
Maybe ClusterOperationStepInfo
stepName :: Maybe Text
stepInfo :: Maybe ClusterOperationStepInfo
$sel:stepName:ClusterOperationStep' :: ClusterOperationStep -> Maybe Text
$sel:stepInfo:ClusterOperationStep' :: ClusterOperationStep -> Maybe ClusterOperationStepInfo
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ClusterOperationStepInfo
stepInfo
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stepName