{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.CloudProFiler.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data ProFileProFileType
= ProFileTypeUnspecified
| CPU
| Wall
| Heap
| Threads
| Contention
| PeakHeap
| HeapAlloc
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ProFileProFileType
instance FromHttpApiData ProFileProFileType where
parseQueryParam = \case
"PROFILE_TYPE_UNSPECIFIED" -> Right ProFileTypeUnspecified
"CPU" -> Right CPU
"WALL" -> Right Wall
"HEAP" -> Right Heap
"THREADS" -> Right Threads
"CONTENTION" -> Right Contention
"PEAK_HEAP" -> Right PeakHeap
"HEAP_ALLOC" -> Right HeapAlloc
x -> Left ("Unable to parse ProFileProFileType from: " <> x)
instance ToHttpApiData ProFileProFileType where
toQueryParam = \case
ProFileTypeUnspecified -> "PROFILE_TYPE_UNSPECIFIED"
CPU -> "CPU"
Wall -> "WALL"
Heap -> "HEAP"
Threads -> "THREADS"
Contention -> "CONTENTION"
PeakHeap -> "PEAK_HEAP"
HeapAlloc -> "HEAP_ALLOC"
instance FromJSON ProFileProFileType where
parseJSON = parseJSONText "ProFileProFileType"
instance ToJSON ProFileProFileType where
toJSON = toJSONText
data Xgafv
= X1
| X2
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable Xgafv
instance FromHttpApiData Xgafv where
parseQueryParam = \case
"1" -> Right X1
"2" -> Right X2
x -> Left ("Unable to parse Xgafv from: " <> x)
instance ToHttpApiData Xgafv where
toQueryParam = \case
X1 -> "1"
X2 -> "2"
instance FromJSON Xgafv where
parseJSON = parseJSONText "Xgafv"
instance ToJSON Xgafv where
toJSON = toJSONText