{-# 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.AutoScaling.Types.ProcessType
-- 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.AutoScaling.Types.ProcessType where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Describes a process type.
--
-- For more information, see
-- <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html#process-types Scaling processes>
-- in the /Amazon EC2 Auto Scaling User Guide/.
--
-- /See:/ 'newProcessType' smart constructor.
data ProcessType = ProcessType'
  { -- | One of the following processes:
    --
    -- -   @Launch@
    --
    -- -   @Terminate@
    --
    -- -   @AddToLoadBalancer@
    --
    -- -   @AlarmNotification@
    --
    -- -   @AZRebalance@
    --
    -- -   @HealthCheck@
    --
    -- -   @InstanceRefresh@
    --
    -- -   @ReplaceUnhealthy@
    --
    -- -   @ScheduledActions@
    ProcessType -> Text
processName :: Prelude.Text
  }
  deriving (ProcessType -> ProcessType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProcessType -> ProcessType -> Bool
$c/= :: ProcessType -> ProcessType -> Bool
== :: ProcessType -> ProcessType -> Bool
$c== :: ProcessType -> ProcessType -> Bool
Prelude.Eq, ReadPrec [ProcessType]
ReadPrec ProcessType
Int -> ReadS ProcessType
ReadS [ProcessType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProcessType]
$creadListPrec :: ReadPrec [ProcessType]
readPrec :: ReadPrec ProcessType
$creadPrec :: ReadPrec ProcessType
readList :: ReadS [ProcessType]
$creadList :: ReadS [ProcessType]
readsPrec :: Int -> ReadS ProcessType
$creadsPrec :: Int -> ReadS ProcessType
Prelude.Read, Int -> ProcessType -> ShowS
[ProcessType] -> ShowS
ProcessType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProcessType] -> ShowS
$cshowList :: [ProcessType] -> ShowS
show :: ProcessType -> String
$cshow :: ProcessType -> String
showsPrec :: Int -> ProcessType -> ShowS
$cshowsPrec :: Int -> ProcessType -> ShowS
Prelude.Show, forall x. Rep ProcessType x -> ProcessType
forall x. ProcessType -> Rep ProcessType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProcessType x -> ProcessType
$cfrom :: forall x. ProcessType -> Rep ProcessType x
Prelude.Generic)

-- |
-- Create a value of 'ProcessType' 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:
--
-- 'processName', 'processType_processName' - One of the following processes:
--
-- -   @Launch@
--
-- -   @Terminate@
--
-- -   @AddToLoadBalancer@
--
-- -   @AlarmNotification@
--
-- -   @AZRebalance@
--
-- -   @HealthCheck@
--
-- -   @InstanceRefresh@
--
-- -   @ReplaceUnhealthy@
--
-- -   @ScheduledActions@
newProcessType ::
  -- | 'processName'
  Prelude.Text ->
  ProcessType
newProcessType :: Text -> ProcessType
newProcessType Text
pProcessName_ =
  ProcessType' {$sel:processName:ProcessType' :: Text
processName = Text
pProcessName_}

-- | One of the following processes:
--
-- -   @Launch@
--
-- -   @Terminate@
--
-- -   @AddToLoadBalancer@
--
-- -   @AlarmNotification@
--
-- -   @AZRebalance@
--
-- -   @HealthCheck@
--
-- -   @InstanceRefresh@
--
-- -   @ReplaceUnhealthy@
--
-- -   @ScheduledActions@
processType_processName :: Lens.Lens' ProcessType Prelude.Text
processType_processName :: Lens' ProcessType Text
processType_processName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProcessType' {Text
processName :: Text
$sel:processName:ProcessType' :: ProcessType -> Text
processName} -> Text
processName) (\s :: ProcessType
s@ProcessType' {} Text
a -> ProcessType
s {$sel:processName:ProcessType' :: Text
processName = Text
a} :: ProcessType)

instance Data.FromXML ProcessType where
  parseXML :: [Node] -> Either String ProcessType
parseXML [Node]
x =
    Text -> ProcessType
ProcessType' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"ProcessName")

instance Prelude.Hashable ProcessType where
  hashWithSalt :: Int -> ProcessType -> Int
hashWithSalt Int
_salt ProcessType' {Text
processName :: Text
$sel:processName:ProcessType' :: ProcessType -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
processName

instance Prelude.NFData ProcessType where
  rnf :: ProcessType -> ()
rnf ProcessType' {Text
processName :: Text
$sel:processName:ProcessType' :: ProcessType -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
processName