module Network.Google.Gmail.Types.Sum where
import Network.Google.Prelude
data UsersMessagesGetFormat
= Full
| Metadata
| Minimal
| Raw
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable UsersMessagesGetFormat
instance FromHttpApiData UsersMessagesGetFormat where
parseQueryParam = \case
"full" -> Right Full
"metadata" -> Right Metadata
"minimal" -> Right Minimal
"raw" -> Right Raw
x -> Left ("Unable to parse UsersMessagesGetFormat from: " <> x)
instance ToHttpApiData UsersMessagesGetFormat where
toQueryParam = \case
Full -> "full"
Metadata -> "metadata"
Minimal -> "minimal"
Raw -> "raw"
instance FromJSON UsersMessagesGetFormat where
parseJSON = parseJSONText "UsersMessagesGetFormat"
instance ToJSON UsersMessagesGetFormat where
toJSON = toJSONText
data LabelType
= System
| User
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable LabelType
instance FromHttpApiData LabelType where
parseQueryParam = \case
"system" -> Right System
"user" -> Right User
x -> Left ("Unable to parse LabelType from: " <> x)
instance ToHttpApiData LabelType where
toQueryParam = \case
System -> "system"
User -> "user"
instance FromJSON LabelType where
parseJSON = parseJSONText "LabelType"
instance ToJSON LabelType where
toJSON = toJSONText
data UsersDraftsGetFormat
= UDGFFull
| UDGFMetadata
| UDGFMinimal
| UDGFRaw
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable UsersDraftsGetFormat
instance FromHttpApiData UsersDraftsGetFormat where
parseQueryParam = \case
"full" -> Right UDGFFull
"metadata" -> Right UDGFMetadata
"minimal" -> Right UDGFMinimal
"raw" -> Right UDGFRaw
x -> Left ("Unable to parse UsersDraftsGetFormat from: " <> x)
instance ToHttpApiData UsersDraftsGetFormat where
toQueryParam = \case
UDGFFull -> "full"
UDGFMetadata -> "metadata"
UDGFMinimal -> "minimal"
UDGFRaw -> "raw"
instance FromJSON UsersDraftsGetFormat where
parseJSON = parseJSONText "UsersDraftsGetFormat"
instance ToJSON UsersDraftsGetFormat where
toJSON = toJSONText
data UsersMessagesImportInternalDateSource
= DateHeader
| ReceivedTime
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable UsersMessagesImportInternalDateSource
instance FromHttpApiData UsersMessagesImportInternalDateSource where
parseQueryParam = \case
"dateHeader" -> Right DateHeader
"receivedTime" -> Right ReceivedTime
x -> Left ("Unable to parse UsersMessagesImportInternalDateSource from: " <> x)
instance ToHttpApiData UsersMessagesImportInternalDateSource where
toQueryParam = \case
DateHeader -> "dateHeader"
ReceivedTime -> "receivedTime"
instance FromJSON UsersMessagesImportInternalDateSource where
parseJSON = parseJSONText "UsersMessagesImportInternalDateSource"
instance ToJSON UsersMessagesImportInternalDateSource where
toJSON = toJSONText
data LabelMessageListVisibility
= Hide
| Show
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable LabelMessageListVisibility
instance FromHttpApiData LabelMessageListVisibility where
parseQueryParam = \case
"hide" -> Right Hide
"show" -> Right Show
x -> Left ("Unable to parse LabelMessageListVisibility from: " <> x)
instance ToHttpApiData LabelMessageListVisibility where
toQueryParam = \case
Hide -> "hide"
Show -> "show"
instance FromJSON LabelMessageListVisibility where
parseJSON = parseJSONText "LabelMessageListVisibility"
instance ToJSON LabelMessageListVisibility where
toJSON = toJSONText
data LabelLabelListVisibility
= LabelHide
| LabelShow
| LabelShowIfUnread
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable LabelLabelListVisibility
instance FromHttpApiData LabelLabelListVisibility where
parseQueryParam = \case
"labelHide" -> Right LabelHide
"labelShow" -> Right LabelShow
"labelShowIfUnread" -> Right LabelShowIfUnread
x -> Left ("Unable to parse LabelLabelListVisibility from: " <> x)
instance ToHttpApiData LabelLabelListVisibility where
toQueryParam = \case
LabelHide -> "labelHide"
LabelShow -> "labelShow"
LabelShowIfUnread -> "labelShowIfUnread"
instance FromJSON LabelLabelListVisibility where
parseJSON = parseJSONText "LabelLabelListVisibility"
instance ToJSON LabelLabelListVisibility where
toJSON = toJSONText
data UsersThreadsGetFormat
= UTGFFull
| UTGFMetadata
| UTGFMinimal
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable UsersThreadsGetFormat
instance FromHttpApiData UsersThreadsGetFormat where
parseQueryParam = \case
"full" -> Right UTGFFull
"metadata" -> Right UTGFMetadata
"minimal" -> Right UTGFMinimal
x -> Left ("Unable to parse UsersThreadsGetFormat from: " <> x)
instance ToHttpApiData UsersThreadsGetFormat where
toQueryParam = \case
UTGFFull -> "full"
UTGFMetadata -> "metadata"
UTGFMinimal -> "minimal"
instance FromJSON UsersThreadsGetFormat where
parseJSON = parseJSONText "UsersThreadsGetFormat"
instance ToJSON UsersThreadsGetFormat where
toJSON = toJSONText
data WatchRequestLabelFilterAction
= Exclude
| Include
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable WatchRequestLabelFilterAction
instance FromHttpApiData WatchRequestLabelFilterAction where
parseQueryParam = \case
"exclude" -> Right Exclude
"include" -> Right Include
x -> Left ("Unable to parse WatchRequestLabelFilterAction from: " <> x)
instance ToHttpApiData WatchRequestLabelFilterAction where
toQueryParam = \case
Exclude -> "exclude"
Include -> "include"
instance FromJSON WatchRequestLabelFilterAction where
parseJSON = parseJSONText "WatchRequestLabelFilterAction"
instance ToJSON WatchRequestLabelFilterAction where
toJSON = toJSONText
data UsersMessagesInsertInternalDateSource
= UMIIDSDateHeader
| UMIIDSReceivedTime
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable UsersMessagesInsertInternalDateSource
instance FromHttpApiData UsersMessagesInsertInternalDateSource where
parseQueryParam = \case
"dateHeader" -> Right UMIIDSDateHeader
"receivedTime" -> Right UMIIDSReceivedTime
x -> Left ("Unable to parse UsersMessagesInsertInternalDateSource from: " <> x)
instance ToHttpApiData UsersMessagesInsertInternalDateSource where
toQueryParam = \case
UMIIDSDateHeader -> "dateHeader"
UMIIDSReceivedTime -> "receivedTime"
instance FromJSON UsersMessagesInsertInternalDateSource where
parseJSON = parseJSONText "UsersMessagesInsertInternalDateSource"
instance ToJSON UsersMessagesInsertInternalDateSource where
toJSON = toJSONText