{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Tracing.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data NetworkEventType
= TypeUnspecified
| Sent
| Recv
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable NetworkEventType
instance FromHttpApiData NetworkEventType where
parseQueryParam = \case
"TYPE_UNSPECIFIED" -> Right TypeUnspecified
"SENT" -> Right Sent
"RECV" -> Right Recv
x -> Left ("Unable to parse NetworkEventType from: " <> x)
instance ToHttpApiData NetworkEventType where
toQueryParam = \case
TypeUnspecified -> "TYPE_UNSPECIFIED"
Sent -> "SENT"
Recv -> "RECV"
instance FromJSON NetworkEventType where
parseJSON = parseJSONText "NetworkEventType"
instance ToJSON NetworkEventType 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
data LinkType
= LTTypeUnspecified
| LTChild
| LTParent
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable LinkType
instance FromHttpApiData LinkType where
parseQueryParam = \case
"TYPE_UNSPECIFIED" -> Right LTTypeUnspecified
"CHILD" -> Right LTChild
"PARENT" -> Right LTParent
x -> Left ("Unable to parse LinkType from: " <> x)
instance ToHttpApiData LinkType where
toQueryParam = \case
LTTypeUnspecified -> "TYPE_UNSPECIFIED"
LTChild -> "CHILD"
LTParent -> "PARENT"
instance FromJSON LinkType where
parseJSON = parseJSONText "LinkType"
instance ToJSON LinkType where
toJSON = toJSONText