{-# 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.AdjustmentType
-- 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.AdjustmentType 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 policy adjustment type.
--
-- /See:/ 'newAdjustmentType' smart constructor.
data AdjustmentType = AdjustmentType'
  { -- | The policy adjustment type. The valid values are @ChangeInCapacity@,
    -- @ExactCapacity@, and @PercentChangeInCapacity@.
    AdjustmentType -> Maybe Text
adjustmentType :: Prelude.Maybe Prelude.Text
  }
  deriving (AdjustmentType -> AdjustmentType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdjustmentType -> AdjustmentType -> Bool
$c/= :: AdjustmentType -> AdjustmentType -> Bool
== :: AdjustmentType -> AdjustmentType -> Bool
$c== :: AdjustmentType -> AdjustmentType -> Bool
Prelude.Eq, ReadPrec [AdjustmentType]
ReadPrec AdjustmentType
Int -> ReadS AdjustmentType
ReadS [AdjustmentType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AdjustmentType]
$creadListPrec :: ReadPrec [AdjustmentType]
readPrec :: ReadPrec AdjustmentType
$creadPrec :: ReadPrec AdjustmentType
readList :: ReadS [AdjustmentType]
$creadList :: ReadS [AdjustmentType]
readsPrec :: Int -> ReadS AdjustmentType
$creadsPrec :: Int -> ReadS AdjustmentType
Prelude.Read, Int -> AdjustmentType -> ShowS
[AdjustmentType] -> ShowS
AdjustmentType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdjustmentType] -> ShowS
$cshowList :: [AdjustmentType] -> ShowS
show :: AdjustmentType -> String
$cshow :: AdjustmentType -> String
showsPrec :: Int -> AdjustmentType -> ShowS
$cshowsPrec :: Int -> AdjustmentType -> ShowS
Prelude.Show, forall x. Rep AdjustmentType x -> AdjustmentType
forall x. AdjustmentType -> Rep AdjustmentType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AdjustmentType x -> AdjustmentType
$cfrom :: forall x. AdjustmentType -> Rep AdjustmentType x
Prelude.Generic)

-- |
-- Create a value of 'AdjustmentType' 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:
--
-- 'adjustmentType', 'adjustmentType_adjustmentType' - The policy adjustment type. The valid values are @ChangeInCapacity@,
-- @ExactCapacity@, and @PercentChangeInCapacity@.
newAdjustmentType ::
  AdjustmentType
newAdjustmentType :: AdjustmentType
newAdjustmentType =
  AdjustmentType' {$sel:adjustmentType:AdjustmentType' :: Maybe Text
adjustmentType = forall a. Maybe a
Prelude.Nothing}

-- | The policy adjustment type. The valid values are @ChangeInCapacity@,
-- @ExactCapacity@, and @PercentChangeInCapacity@.
adjustmentType_adjustmentType :: Lens.Lens' AdjustmentType (Prelude.Maybe Prelude.Text)
adjustmentType_adjustmentType :: Lens' AdjustmentType (Maybe Text)
adjustmentType_adjustmentType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdjustmentType' {Maybe Text
adjustmentType :: Maybe Text
$sel:adjustmentType:AdjustmentType' :: AdjustmentType -> Maybe Text
adjustmentType} -> Maybe Text
adjustmentType) (\s :: AdjustmentType
s@AdjustmentType' {} Maybe Text
a -> AdjustmentType
s {$sel:adjustmentType:AdjustmentType' :: Maybe Text
adjustmentType = Maybe Text
a} :: AdjustmentType)

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

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

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