{-# 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.SavingsPlans.Types.CurrencyCode
-- 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.SavingsPlans.Types.CurrencyCode
  ( CurrencyCode
      ( ..,
        CurrencyCode_CNY,
        CurrencyCode_USD
      ),
  )
where

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

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

pattern CurrencyCode_CNY :: CurrencyCode
pattern $bCurrencyCode_CNY :: CurrencyCode
$mCurrencyCode_CNY :: forall r. CurrencyCode -> (Void# -> r) -> (Void# -> r) -> r
CurrencyCode_CNY = CurrencyCode' "CNY"

pattern CurrencyCode_USD :: CurrencyCode
pattern $bCurrencyCode_USD :: CurrencyCode
$mCurrencyCode_USD :: forall r. CurrencyCode -> (Void# -> r) -> (Void# -> r) -> r
CurrencyCode_USD = CurrencyCode' "USD"

{-# COMPLETE
  CurrencyCode_CNY,
  CurrencyCode_USD,
  CurrencyCode'
  #-}