{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.AppsActivity.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data EventPrimaryEventType
= EPETComment
| EPETCreate
| EPETEdit
| EPETEmptyTrash
| EPETMove
| EPETPermissionChange
| EPETRename
| EPETTrash
| EPETUnknown
| EPETUntrash
| EPETUpload
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable EventPrimaryEventType
instance FromHttpApiData EventPrimaryEventType where
parseQueryParam = \case
"comment" -> Right EPETComment
"create" -> Right EPETCreate
"edit" -> Right EPETEdit
"emptyTrash" -> Right EPETEmptyTrash
"move" -> Right EPETMove
"permissionChange" -> Right EPETPermissionChange
"rename" -> Right EPETRename
"trash" -> Right EPETTrash
"unknown" -> Right EPETUnknown
"untrash" -> Right EPETUntrash
"upload" -> Right EPETUpload
x -> Left ("Unable to parse EventPrimaryEventType from: " <> x)
instance ToHttpApiData EventPrimaryEventType where
toQueryParam = \case
EPETComment -> "comment"
EPETCreate -> "create"
EPETEdit -> "edit"
EPETEmptyTrash -> "emptyTrash"
EPETMove -> "move"
EPETPermissionChange -> "permissionChange"
EPETRename -> "rename"
EPETTrash -> "trash"
EPETUnknown -> "unknown"
EPETUntrash -> "untrash"
EPETUpload -> "upload"
instance FromJSON EventPrimaryEventType where
parseJSON = parseJSONText "EventPrimaryEventType"
instance ToJSON EventPrimaryEventType where
toJSON = toJSONText
data PermissionRole
= Commenter
| Owner
| PublishedReader
| Reader
| Writer
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable PermissionRole
instance FromHttpApiData PermissionRole where
parseQueryParam = \case
"commenter" -> Right Commenter
"owner" -> Right Owner
"publishedReader" -> Right PublishedReader
"reader" -> Right Reader
"writer" -> Right Writer
x -> Left ("Unable to parse PermissionRole from: " <> x)
instance ToHttpApiData PermissionRole where
toQueryParam = \case
Commenter -> "commenter"
Owner -> "owner"
PublishedReader -> "publishedReader"
Reader -> "reader"
Writer -> "writer"
instance FromJSON PermissionRole where
parseJSON = parseJSONText "PermissionRole"
instance ToJSON PermissionRole where
toJSON = toJSONText
data PermissionType
= PTAnyone
| PTDomain
| PTGroup
| PTUser
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable PermissionType
instance FromHttpApiData PermissionType where
parseQueryParam = \case
"anyone" -> Right PTAnyone
"domain" -> Right PTDomain
"group" -> Right PTGroup
"user" -> Right PTUser
x -> Left ("Unable to parse PermissionType from: " <> x)
instance ToHttpApiData PermissionType where
toQueryParam = \case
PTAnyone -> "anyone"
PTDomain -> "domain"
PTGroup -> "group"
PTUser -> "user"
instance FromJSON PermissionType where
parseJSON = parseJSONText "PermissionType"
instance ToJSON PermissionType where
toJSON = toJSONText
data EventAdditionalEventTypesItem
= EAETIComment
| EAETICreate
| EAETIEdit
| EAETIEmptyTrash
| EAETIMove
| EAETIPermissionChange
| EAETIRename
| EAETITrash
| EAETIUnknown
| EAETIUntrash
| EAETIUpload
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable EventAdditionalEventTypesItem
instance FromHttpApiData EventAdditionalEventTypesItem where
parseQueryParam = \case
"comment" -> Right EAETIComment
"create" -> Right EAETICreate
"edit" -> Right EAETIEdit
"emptyTrash" -> Right EAETIEmptyTrash
"move" -> Right EAETIMove
"permissionChange" -> Right EAETIPermissionChange
"rename" -> Right EAETIRename
"trash" -> Right EAETITrash
"unknown" -> Right EAETIUnknown
"untrash" -> Right EAETIUntrash
"upload" -> Right EAETIUpload
x -> Left ("Unable to parse EventAdditionalEventTypesItem from: " <> x)
instance ToHttpApiData EventAdditionalEventTypesItem where
toQueryParam = \case
EAETIComment -> "comment"
EAETICreate -> "create"
EAETIEdit -> "edit"
EAETIEmptyTrash -> "emptyTrash"
EAETIMove -> "move"
EAETIPermissionChange -> "permissionChange"
EAETIRename -> "rename"
EAETITrash -> "trash"
EAETIUnknown -> "unknown"
EAETIUntrash -> "untrash"
EAETIUpload -> "upload"
instance FromJSON EventAdditionalEventTypesItem where
parseJSON = parseJSONText "EventAdditionalEventTypesItem"
instance ToJSON EventAdditionalEventTypesItem where
toJSON = toJSONText
data ActivitiesListGroupingStrategy
= DriveUi
| None
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ActivitiesListGroupingStrategy
instance FromHttpApiData ActivitiesListGroupingStrategy where
parseQueryParam = \case
"driveUi" -> Right DriveUi
"none" -> Right None
x -> Left ("Unable to parse ActivitiesListGroupingStrategy from: " <> x)
instance ToHttpApiData ActivitiesListGroupingStrategy where
toQueryParam = \case
DriveUi -> "driveUi"
None -> "none"
instance FromJSON ActivitiesListGroupingStrategy where
parseJSON = parseJSONText "ActivitiesListGroupingStrategy"
instance ToJSON ActivitiesListGroupingStrategy where
toJSON = toJSONText