{-# 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.LookoutMetrics.Types.AggregationFunction
-- 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.LookoutMetrics.Types.AggregationFunction
  ( AggregationFunction
      ( ..,
        AggregationFunction_AVG,
        AggregationFunction_SUM
      ),
  )
where

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

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

pattern AggregationFunction_AVG :: AggregationFunction
pattern $bAggregationFunction_AVG :: AggregationFunction
$mAggregationFunction_AVG :: forall r. AggregationFunction -> (Void# -> r) -> (Void# -> r) -> r
AggregationFunction_AVG = AggregationFunction' "AVG"

pattern AggregationFunction_SUM :: AggregationFunction
pattern $bAggregationFunction_SUM :: AggregationFunction
$mAggregationFunction_SUM :: forall r. AggregationFunction -> (Void# -> r) -> (Void# -> r) -> r
AggregationFunction_SUM = AggregationFunction' "SUM"

{-# COMPLETE
  AggregationFunction_AVG,
  AggregationFunction_SUM,
  AggregationFunction'
  #-}