{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.AutoScaling.Types.ProcessType where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(ProcessType -> ProcessType -> Bool)
-> (ProcessType -> ProcessType -> Bool) -> Eq ProcessType
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]
(Int -> ReadS ProcessType)
-> ReadS [ProcessType]
-> ReadPrec ProcessType
-> ReadPrec [ProcessType]
-> Read 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
(Int -> ProcessType -> ShowS)
-> (ProcessType -> String)
-> ([ProcessType] -> ShowS)
-> Show ProcessType
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. ProcessType -> Rep ProcessType x)
-> (forall x. Rep ProcessType x -> ProcessType)
-> Generic ProcessType
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' :: Text -> ProcessType
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 :: (Text -> f Text) -> ProcessType -> f ProcessType
processType_processName = (ProcessType -> Text)
-> (ProcessType -> Text -> ProcessType)
-> Lens ProcessType ProcessType Text Text
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 Core.FromXML ProcessType where
  parseXML :: [Node] -> Either String ProcessType
parseXML [Node]
x =
    Text -> ProcessType
ProcessType' (Text -> ProcessType)
-> Either String Text -> Either String ProcessType
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"ProcessName")

instance Prelude.Hashable ProcessType

instance Prelude.NFData ProcessType