{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Budgets.Types.ThresholdType
-- 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.Budgets.Types.ThresholdType
  ( ThresholdType
      ( ..,
        ThresholdType_ABSOLUTE_VALUE,
        ThresholdType_PERCENTAGE
      ),
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Prelude as Prelude

-- | The type of threshold for a notification.
newtype ThresholdType = ThresholdType'
  { ThresholdType -> Text
fromThresholdType ::
      Core.Text
  }
  deriving stock
    ( Int -> ThresholdType -> ShowS
[ThresholdType] -> ShowS
ThresholdType -> String
(Int -> ThresholdType -> ShowS)
-> (ThresholdType -> String)
-> ([ThresholdType] -> ShowS)
-> Show ThresholdType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ThresholdType] -> ShowS
$cshowList :: [ThresholdType] -> ShowS
show :: ThresholdType -> String
$cshow :: ThresholdType -> String
showsPrec :: Int -> ThresholdType -> ShowS
$cshowsPrec :: Int -> ThresholdType -> ShowS
Prelude.Show,
      ReadPrec [ThresholdType]
ReadPrec ThresholdType
Int -> ReadS ThresholdType
ReadS [ThresholdType]
(Int -> ReadS ThresholdType)
-> ReadS [ThresholdType]
-> ReadPrec ThresholdType
-> ReadPrec [ThresholdType]
-> Read ThresholdType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ThresholdType]
$creadListPrec :: ReadPrec [ThresholdType]
readPrec :: ReadPrec ThresholdType
$creadPrec :: ReadPrec ThresholdType
readList :: ReadS [ThresholdType]
$creadList :: ReadS [ThresholdType]
readsPrec :: Int -> ReadS ThresholdType
$creadsPrec :: Int -> ReadS ThresholdType
Prelude.Read,
      ThresholdType -> ThresholdType -> Bool
(ThresholdType -> ThresholdType -> Bool)
-> (ThresholdType -> ThresholdType -> Bool) -> Eq ThresholdType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ThresholdType -> ThresholdType -> Bool
$c/= :: ThresholdType -> ThresholdType -> Bool
== :: ThresholdType -> ThresholdType -> Bool
$c== :: ThresholdType -> ThresholdType -> Bool
Prelude.Eq,
      Eq ThresholdType
Eq ThresholdType
-> (ThresholdType -> ThresholdType -> Ordering)
-> (ThresholdType -> ThresholdType -> Bool)
-> (ThresholdType -> ThresholdType -> Bool)
-> (ThresholdType -> ThresholdType -> Bool)
-> (ThresholdType -> ThresholdType -> Bool)
-> (ThresholdType -> ThresholdType -> ThresholdType)
-> (ThresholdType -> ThresholdType -> ThresholdType)
-> Ord ThresholdType
ThresholdType -> ThresholdType -> Bool
ThresholdType -> ThresholdType -> Ordering
ThresholdType -> ThresholdType -> ThresholdType
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ThresholdType -> ThresholdType -> ThresholdType
$cmin :: ThresholdType -> ThresholdType -> ThresholdType
max :: ThresholdType -> ThresholdType -> ThresholdType
$cmax :: ThresholdType -> ThresholdType -> ThresholdType
>= :: ThresholdType -> ThresholdType -> Bool
$c>= :: ThresholdType -> ThresholdType -> Bool
> :: ThresholdType -> ThresholdType -> Bool
$c> :: ThresholdType -> ThresholdType -> Bool
<= :: ThresholdType -> ThresholdType -> Bool
$c<= :: ThresholdType -> ThresholdType -> Bool
< :: ThresholdType -> ThresholdType -> Bool
$c< :: ThresholdType -> ThresholdType -> Bool
compare :: ThresholdType -> ThresholdType -> Ordering
$ccompare :: ThresholdType -> ThresholdType -> Ordering
$cp1Ord :: Eq ThresholdType
Prelude.Ord,
      (forall x. ThresholdType -> Rep ThresholdType x)
-> (forall x. Rep ThresholdType x -> ThresholdType)
-> Generic ThresholdType
forall x. Rep ThresholdType x -> ThresholdType
forall x. ThresholdType -> Rep ThresholdType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ThresholdType x -> ThresholdType
$cfrom :: forall x. ThresholdType -> Rep ThresholdType x
Prelude.Generic
    )
  deriving newtype
    ( Int -> ThresholdType -> Int
ThresholdType -> Int
(Int -> ThresholdType -> Int)
-> (ThresholdType -> Int) -> Hashable ThresholdType
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ThresholdType -> Int
$chash :: ThresholdType -> Int
hashWithSalt :: Int -> ThresholdType -> Int
$chashWithSalt :: Int -> ThresholdType -> Int
Prelude.Hashable,
      ThresholdType -> ()
(ThresholdType -> ()) -> NFData ThresholdType
forall a. (a -> ()) -> NFData a
rnf :: ThresholdType -> ()
$crnf :: ThresholdType -> ()
Prelude.NFData,
      Text -> Either String ThresholdType
(Text -> Either String ThresholdType) -> FromText ThresholdType
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String ThresholdType
$cfromText :: Text -> Either String ThresholdType
Core.FromText,
      ThresholdType -> Text
(ThresholdType -> Text) -> ToText ThresholdType
forall a. (a -> Text) -> ToText a
toText :: ThresholdType -> Text
$ctoText :: ThresholdType -> Text
Core.ToText,
      ThresholdType -> ByteString
(ThresholdType -> ByteString) -> ToByteString ThresholdType
forall a. (a -> ByteString) -> ToByteString a
toBS :: ThresholdType -> ByteString
$ctoBS :: ThresholdType -> ByteString
Core.ToByteString,
      ThresholdType -> ByteStringBuilder
(ThresholdType -> ByteStringBuilder) -> ToLog ThresholdType
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: ThresholdType -> ByteStringBuilder
$cbuild :: ThresholdType -> ByteStringBuilder
Core.ToLog,
      HeaderName -> ThresholdType -> [Header]
(HeaderName -> ThresholdType -> [Header]) -> ToHeader ThresholdType
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> ThresholdType -> [Header]
$ctoHeader :: HeaderName -> ThresholdType -> [Header]
Core.ToHeader,
      ThresholdType -> QueryString
(ThresholdType -> QueryString) -> ToQuery ThresholdType
forall a. (a -> QueryString) -> ToQuery a
toQuery :: ThresholdType -> QueryString
$ctoQuery :: ThresholdType -> QueryString
Core.ToQuery,
      Value -> Parser [ThresholdType]
Value -> Parser ThresholdType
(Value -> Parser ThresholdType)
-> (Value -> Parser [ThresholdType]) -> FromJSON ThresholdType
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [ThresholdType]
$cparseJSONList :: Value -> Parser [ThresholdType]
parseJSON :: Value -> Parser ThresholdType
$cparseJSON :: Value -> Parser ThresholdType
Core.FromJSON,
      FromJSONKeyFunction [ThresholdType]
FromJSONKeyFunction ThresholdType
FromJSONKeyFunction ThresholdType
-> FromJSONKeyFunction [ThresholdType] -> FromJSONKey ThresholdType
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [ThresholdType]
$cfromJSONKeyList :: FromJSONKeyFunction [ThresholdType]
fromJSONKey :: FromJSONKeyFunction ThresholdType
$cfromJSONKey :: FromJSONKeyFunction ThresholdType
Core.FromJSONKey,
      [ThresholdType] -> Encoding
[ThresholdType] -> Value
ThresholdType -> Encoding
ThresholdType -> Value
(ThresholdType -> Value)
-> (ThresholdType -> Encoding)
-> ([ThresholdType] -> Value)
-> ([ThresholdType] -> Encoding)
-> ToJSON ThresholdType
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [ThresholdType] -> Encoding
$ctoEncodingList :: [ThresholdType] -> Encoding
toJSONList :: [ThresholdType] -> Value
$ctoJSONList :: [ThresholdType] -> Value
toEncoding :: ThresholdType -> Encoding
$ctoEncoding :: ThresholdType -> Encoding
toJSON :: ThresholdType -> Value
$ctoJSON :: ThresholdType -> Value
Core.ToJSON,
      ToJSONKeyFunction [ThresholdType]
ToJSONKeyFunction ThresholdType
ToJSONKeyFunction ThresholdType
-> ToJSONKeyFunction [ThresholdType] -> ToJSONKey ThresholdType
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [ThresholdType]
$ctoJSONKeyList :: ToJSONKeyFunction [ThresholdType]
toJSONKey :: ToJSONKeyFunction ThresholdType
$ctoJSONKey :: ToJSONKeyFunction ThresholdType
Core.ToJSONKey,
      [Node] -> Either String ThresholdType
([Node] -> Either String ThresholdType) -> FromXML ThresholdType
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String ThresholdType
$cparseXML :: [Node] -> Either String ThresholdType
Core.FromXML,
      ThresholdType -> XML
(ThresholdType -> XML) -> ToXML ThresholdType
forall a. (a -> XML) -> ToXML a
toXML :: ThresholdType -> XML
$ctoXML :: ThresholdType -> XML
Core.ToXML
    )

pattern ThresholdType_ABSOLUTE_VALUE :: ThresholdType
pattern $bThresholdType_ABSOLUTE_VALUE :: ThresholdType
$mThresholdType_ABSOLUTE_VALUE :: forall r. ThresholdType -> (Void# -> r) -> (Void# -> r) -> r
ThresholdType_ABSOLUTE_VALUE = ThresholdType' "ABSOLUTE_VALUE"

pattern ThresholdType_PERCENTAGE :: ThresholdType
pattern $bThresholdType_PERCENTAGE :: ThresholdType
$mThresholdType_PERCENTAGE :: forall r. ThresholdType -> (Void# -> r) -> (Void# -> r) -> r
ThresholdType_PERCENTAGE = ThresholdType' "PERCENTAGE"

{-# COMPLETE
  ThresholdType_ABSOLUTE_VALUE,
  ThresholdType_PERCENTAGE,
  ThresholdType'
  #-}