{-# 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.Redshift.Types.UsageLimitPeriod
-- 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.Redshift.Types.UsageLimitPeriod
  ( UsageLimitPeriod
      ( ..,
        UsageLimitPeriod_Daily,
        UsageLimitPeriod_Monthly,
        UsageLimitPeriod_Weekly
      ),
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Internal

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

pattern UsageLimitPeriod_Daily :: UsageLimitPeriod
pattern $bUsageLimitPeriod_Daily :: UsageLimitPeriod
$mUsageLimitPeriod_Daily :: forall r. UsageLimitPeriod -> (Void# -> r) -> (Void# -> r) -> r
UsageLimitPeriod_Daily = UsageLimitPeriod' "daily"

pattern UsageLimitPeriod_Monthly :: UsageLimitPeriod
pattern $bUsageLimitPeriod_Monthly :: UsageLimitPeriod
$mUsageLimitPeriod_Monthly :: forall r. UsageLimitPeriod -> (Void# -> r) -> (Void# -> r) -> r
UsageLimitPeriod_Monthly = UsageLimitPeriod' "monthly"

pattern UsageLimitPeriod_Weekly :: UsageLimitPeriod
pattern $bUsageLimitPeriod_Weekly :: UsageLimitPeriod
$mUsageLimitPeriod_Weekly :: forall r. UsageLimitPeriod -> (Void# -> r) -> (Void# -> r) -> r
UsageLimitPeriod_Weekly = UsageLimitPeriod' "weekly"

{-# COMPLETE
  UsageLimitPeriod_Daily,
  UsageLimitPeriod_Monthly,
  UsageLimitPeriod_Weekly,
  UsageLimitPeriod'
  #-}