{-# 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-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.AdjustmentType where

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

instance Prelude.Hashable AdjustmentType

instance Prelude.NFData AdjustmentType