{-# 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.CostAndUsageReport.Types.TimeUnit
-- 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.CostAndUsageReport.Types.TimeUnit
  ( TimeUnit
      ( ..,
        TimeUnit_DAILY,
        TimeUnit_HOURLY,
        TimeUnit_MONTHLY
      ),
  )
where

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

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

pattern TimeUnit_DAILY :: TimeUnit
pattern $bTimeUnit_DAILY :: TimeUnit
$mTimeUnit_DAILY :: forall r. TimeUnit -> (Void# -> r) -> (Void# -> r) -> r
TimeUnit_DAILY = TimeUnit' "DAILY"

pattern TimeUnit_HOURLY :: TimeUnit
pattern $bTimeUnit_HOURLY :: TimeUnit
$mTimeUnit_HOURLY :: forall r. TimeUnit -> (Void# -> r) -> (Void# -> r) -> r
TimeUnit_HOURLY = TimeUnit' "HOURLY"

pattern TimeUnit_MONTHLY :: TimeUnit
pattern $bTimeUnit_MONTHLY :: TimeUnit
$mTimeUnit_MONTHLY :: forall r. TimeUnit -> (Void# -> r) -> (Void# -> r) -> r
TimeUnit_MONTHLY = TimeUnit' "MONTHLY"

{-# COMPLETE
  TimeUnit_DAILY,
  TimeUnit_HOURLY,
  TimeUnit_MONTHLY,
  TimeUnit'
  #-}