{-# 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.ServiceQuotas.Types.PeriodUnit
-- 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.ServiceQuotas.Types.PeriodUnit
  ( PeriodUnit
      ( ..,
        PeriodUnit_DAY,
        PeriodUnit_HOUR,
        PeriodUnit_MICROSECOND,
        PeriodUnit_MILLISECOND,
        PeriodUnit_MINUTE,
        PeriodUnit_SECOND,
        PeriodUnit_WEEK
      ),
  )
where

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

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

pattern PeriodUnit_DAY :: PeriodUnit
pattern $bPeriodUnit_DAY :: PeriodUnit
$mPeriodUnit_DAY :: forall r. PeriodUnit -> (Void# -> r) -> (Void# -> r) -> r
PeriodUnit_DAY = PeriodUnit' "DAY"

pattern PeriodUnit_HOUR :: PeriodUnit
pattern $bPeriodUnit_HOUR :: PeriodUnit
$mPeriodUnit_HOUR :: forall r. PeriodUnit -> (Void# -> r) -> (Void# -> r) -> r
PeriodUnit_HOUR = PeriodUnit' "HOUR"

pattern PeriodUnit_MICROSECOND :: PeriodUnit
pattern $bPeriodUnit_MICROSECOND :: PeriodUnit
$mPeriodUnit_MICROSECOND :: forall r. PeriodUnit -> (Void# -> r) -> (Void# -> r) -> r
PeriodUnit_MICROSECOND = PeriodUnit' "MICROSECOND"

pattern PeriodUnit_MILLISECOND :: PeriodUnit
pattern $bPeriodUnit_MILLISECOND :: PeriodUnit
$mPeriodUnit_MILLISECOND :: forall r. PeriodUnit -> (Void# -> r) -> (Void# -> r) -> r
PeriodUnit_MILLISECOND = PeriodUnit' "MILLISECOND"

pattern PeriodUnit_MINUTE :: PeriodUnit
pattern $bPeriodUnit_MINUTE :: PeriodUnit
$mPeriodUnit_MINUTE :: forall r. PeriodUnit -> (Void# -> r) -> (Void# -> r) -> r
PeriodUnit_MINUTE = PeriodUnit' "MINUTE"

pattern PeriodUnit_SECOND :: PeriodUnit
pattern $bPeriodUnit_SECOND :: PeriodUnit
$mPeriodUnit_SECOND :: forall r. PeriodUnit -> (Void# -> r) -> (Void# -> r) -> r
PeriodUnit_SECOND = PeriodUnit' "SECOND"

pattern PeriodUnit_WEEK :: PeriodUnit
pattern $bPeriodUnit_WEEK :: PeriodUnit
$mPeriodUnit_WEEK :: forall r. PeriodUnit -> (Void# -> r) -> (Void# -> r) -> r
PeriodUnit_WEEK = PeriodUnit' "WEEK"

{-# COMPLETE
  PeriodUnit_DAY,
  PeriodUnit_HOUR,
  PeriodUnit_MICROSECOND,
  PeriodUnit_MILLISECOND,
  PeriodUnit_MINUTE,
  PeriodUnit_SECOND,
  PeriodUnit_WEEK,
  PeriodUnit'
  #-}