{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.DriveActivity.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data PermissionRole
= PRRoleUnspecified
| PROwner
| PROrganizer
| PRFileOrganizer
| PREditor
| PRCommenter
| PRViewer
| PRPublishedViewer
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable PermissionRole
instance FromHttpApiData PermissionRole where
parseQueryParam = \case
"ROLE_UNSPECIFIED" -> Right PRRoleUnspecified
"OWNER" -> Right PROwner
"ORGANIZER" -> Right PROrganizer
"FILE_ORGANIZER" -> Right PRFileOrganizer
"EDITOR" -> Right PREditor
"COMMENTER" -> Right PRCommenter
"VIEWER" -> Right PRViewer
"PUBLISHED_VIEWER" -> Right PRPublishedViewer
x -> Left ("Unable to parse PermissionRole from: " <> x)
instance ToHttpApiData PermissionRole where
toQueryParam = \case
PRRoleUnspecified -> "ROLE_UNSPECIFIED"
PROwner -> "OWNER"
PROrganizer -> "ORGANIZER"
PRFileOrganizer -> "FILE_ORGANIZER"
PREditor -> "EDITOR"
PRCommenter -> "COMMENTER"
PRViewer -> "VIEWER"
PRPublishedViewer -> "PUBLISHED_VIEWER"
instance FromJSON PermissionRole where
parseJSON = parseJSONText "PermissionRole"
instance ToJSON PermissionRole where
toJSON = toJSONText
data RestrictionChangeNewRestriction
= RestrictionUnspecified
| Unrestricted
| FullyRestricted
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable RestrictionChangeNewRestriction
instance FromHttpApiData RestrictionChangeNewRestriction where
parseQueryParam = \case
"RESTRICTION_UNSPECIFIED" -> Right RestrictionUnspecified
"UNRESTRICTED" -> Right Unrestricted
"FULLY_RESTRICTED" -> Right FullyRestricted
x -> Left ("Unable to parse RestrictionChangeNewRestriction from: " <> x)
instance ToHttpApiData RestrictionChangeNewRestriction where
toQueryParam = \case
RestrictionUnspecified -> "RESTRICTION_UNSPECIFIED"
Unrestricted -> "UNRESTRICTED"
FullyRestricted -> "FULLY_RESTRICTED"
instance FromJSON RestrictionChangeNewRestriction where
parseJSON = parseJSONText "RestrictionChangeNewRestriction"
instance ToJSON RestrictionChangeNewRestriction where
toJSON = toJSONText
data RestrictionChangeFeature
= FeatureUnspecified
| SharingOutsideDomain
| DirectSharing
| ItemDuplication
| DriveFileStream
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable RestrictionChangeFeature
instance FromHttpApiData RestrictionChangeFeature where
parseQueryParam = \case
"FEATURE_UNSPECIFIED" -> Right FeatureUnspecified
"SHARING_OUTSIDE_DOMAIN" -> Right SharingOutsideDomain
"DIRECT_SHARING" -> Right DirectSharing
"ITEM_DUPLICATION" -> Right ItemDuplication
"DRIVE_FILE_STREAM" -> Right DriveFileStream
x -> Left ("Unable to parse RestrictionChangeFeature from: " <> x)
instance ToHttpApiData RestrictionChangeFeature where
toQueryParam = \case
FeatureUnspecified -> "FEATURE_UNSPECIFIED"
SharingOutsideDomain -> "SHARING_OUTSIDE_DOMAIN"
DirectSharing -> "DIRECT_SHARING"
ItemDuplication -> "ITEM_DUPLICATION"
DriveFileStream -> "DRIVE_FILE_STREAM"
instance FromJSON RestrictionChangeFeature where
parseJSON = parseJSONText "RestrictionChangeFeature"
instance ToJSON RestrictionChangeFeature where
toJSON = toJSONText
data SystemEventType
= TypeUnspecified
| UserDeletion
| TrashAutoPurge
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable SystemEventType
instance FromHttpApiData SystemEventType where
parseQueryParam = \case
"TYPE_UNSPECIFIED" -> Right TypeUnspecified
"USER_DELETION" -> Right UserDeletion
"TRASH_AUTO_PURGE" -> Right TrashAutoPurge
x -> Left ("Unable to parse SystemEventType from: " <> x)
instance ToHttpApiData SystemEventType where
toQueryParam = \case
TypeUnspecified -> "TYPE_UNSPECIFIED"
UserDeletion -> "USER_DELETION"
TrashAutoPurge -> "TRASH_AUTO_PURGE"
instance FromJSON SystemEventType where
parseJSON = parseJSONText "SystemEventType"
instance ToJSON SystemEventType where
toJSON = toJSONText
data DeleteType
= DTTypeUnspecified
| DTTrash
| DTPermanentDelete
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DeleteType
instance FromHttpApiData DeleteType where
parseQueryParam = \case
"TYPE_UNSPECIFIED" -> Right DTTypeUnspecified
"TRASH" -> Right DTTrash
"PERMANENT_DELETE" -> Right DTPermanentDelete
x -> Left ("Unable to parse DeleteType from: " <> x)
instance ToHttpApiData DeleteType where
toQueryParam = \case
DTTypeUnspecified -> "TYPE_UNSPECIFIED"
DTTrash -> "TRASH"
DTPermanentDelete -> "PERMANENT_DELETE"
instance FromJSON DeleteType where
parseJSON = parseJSONText "DeleteType"
instance ToJSON DeleteType where
toJSON = toJSONText
data PostSubtype
= SubtypeUnspecified
| Added
| Deleted
| ReplyAdded
| ReplyDeleted
| Resolved
| Reopened
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable PostSubtype
instance FromHttpApiData PostSubtype where
parseQueryParam = \case
"SUBTYPE_UNSPECIFIED" -> Right SubtypeUnspecified
"ADDED" -> Right Added
"DELETED" -> Right Deleted
"REPLY_ADDED" -> Right ReplyAdded
"REPLY_DELETED" -> Right ReplyDeleted
"RESOLVED" -> Right Resolved
"REOPENED" -> Right Reopened
x -> Left ("Unable to parse PostSubtype from: " <> x)
instance ToHttpApiData PostSubtype where
toQueryParam = \case
SubtypeUnspecified -> "SUBTYPE_UNSPECIFIED"
Added -> "ADDED"
Deleted -> "DELETED"
ReplyAdded -> "REPLY_ADDED"
ReplyDeleted -> "REPLY_DELETED"
Resolved -> "RESOLVED"
Reopened -> "REOPENED"
instance FromJSON PostSubtype where
parseJSON = parseJSONText "PostSubtype"
instance ToJSON PostSubtype where
toJSON = toJSONText
data AssignmentSubtype
= ASSubtypeUnspecified
| ASAdded
| ASDeleted
| ASReplyAdded
| ASReplyDeleted
| ASResolved
| ASReopened
| ASReassigned
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AssignmentSubtype
instance FromHttpApiData AssignmentSubtype where
parseQueryParam = \case
"SUBTYPE_UNSPECIFIED" -> Right ASSubtypeUnspecified
"ADDED" -> Right ASAdded
"DELETED" -> Right ASDeleted
"REPLY_ADDED" -> Right ASReplyAdded
"REPLY_DELETED" -> Right ASReplyDeleted
"RESOLVED" -> Right ASResolved
"REOPENED" -> Right ASReopened
"REASSIGNED" -> Right ASReassigned
x -> Left ("Unable to parse AssignmentSubtype from: " <> x)
instance ToHttpApiData AssignmentSubtype where
toQueryParam = \case
ASSubtypeUnspecified -> "SUBTYPE_UNSPECIFIED"
ASAdded -> "ADDED"
ASDeleted -> "DELETED"
ASReplyAdded -> "REPLY_ADDED"
ASReplyDeleted -> "REPLY_DELETED"
ASResolved -> "RESOLVED"
ASReopened -> "REOPENED"
ASReassigned -> "REASSIGNED"
instance FromJSON AssignmentSubtype where
parseJSON = parseJSONText "AssignmentSubtype"
instance ToJSON AssignmentSubtype 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 RestoreType
= RTTypeUnspecified
| RTUntrash
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable RestoreType
instance FromHttpApiData RestoreType where
parseQueryParam = \case
"TYPE_UNSPECIFIED" -> Right RTTypeUnspecified
"UNTRASH" -> Right RTUntrash
x -> Left ("Unable to parse RestoreType from: " <> x)
instance ToHttpApiData RestoreType where
toQueryParam = \case
RTTypeUnspecified -> "TYPE_UNSPECIFIED"
RTUntrash -> "UNTRASH"
instance FromJSON RestoreType where
parseJSON = parseJSONText "RestoreType"
instance ToJSON RestoreType where
toJSON = toJSONText
data SuggestionSubtype
= SSSubtypeUnspecified
| SSAdded
| SSDeleted
| SSReplyAdded
| SSReplyDeleted
| SSAccepted
| SSRejected
| SSAcceptDeleted
| SSRejectDeleted
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable SuggestionSubtype
instance FromHttpApiData SuggestionSubtype where
parseQueryParam = \case
"SUBTYPE_UNSPECIFIED" -> Right SSSubtypeUnspecified
"ADDED" -> Right SSAdded
"DELETED" -> Right SSDeleted
"REPLY_ADDED" -> Right SSReplyAdded
"REPLY_DELETED" -> Right SSReplyDeleted
"ACCEPTED" -> Right SSAccepted
"REJECTED" -> Right SSRejected
"ACCEPT_DELETED" -> Right SSAcceptDeleted
"REJECT_DELETED" -> Right SSRejectDeleted
x -> Left ("Unable to parse SuggestionSubtype from: " <> x)
instance ToHttpApiData SuggestionSubtype where
toQueryParam = \case
SSSubtypeUnspecified -> "SUBTYPE_UNSPECIFIED"
SSAdded -> "ADDED"
SSDeleted -> "DELETED"
SSReplyAdded -> "REPLY_ADDED"
SSReplyDeleted -> "REPLY_DELETED"
SSAccepted -> "ACCEPTED"
SSRejected -> "REJECTED"
SSAcceptDeleted -> "ACCEPT_DELETED"
SSRejectDeleted -> "REJECT_DELETED"
instance FromJSON SuggestionSubtype where
parseJSON = parseJSONText "SuggestionSubtype"
instance ToJSON SuggestionSubtype where
toJSON = toJSONText
data DataLeakPreventionChangeType
= DLPCTTypeUnspecified
| DLPCTFlagged
| DLPCTCleared
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DataLeakPreventionChangeType
instance FromHttpApiData DataLeakPreventionChangeType where
parseQueryParam = \case
"TYPE_UNSPECIFIED" -> Right DLPCTTypeUnspecified
"FLAGGED" -> Right DLPCTFlagged
"CLEARED" -> Right DLPCTCleared
x -> Left ("Unable to parse DataLeakPreventionChangeType from: " <> x)
instance ToHttpApiData DataLeakPreventionChangeType where
toQueryParam = \case
DLPCTTypeUnspecified -> "TYPE_UNSPECIFIED"
DLPCTFlagged -> "FLAGGED"
DLPCTCleared -> "CLEARED"
instance FromJSON DataLeakPreventionChangeType where
parseJSON = parseJSONText "DataLeakPreventionChangeType"
instance ToJSON DataLeakPreventionChangeType where
toJSON = toJSONText
data FolderType
= FTTypeUnspecified
| FTMyDriveRoot
| FTTeamDriveRoot
| FTStandardFolder
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable FolderType
instance FromHttpApiData FolderType where
parseQueryParam = \case
"TYPE_UNSPECIFIED" -> Right FTTypeUnspecified
"MY_DRIVE_ROOT" -> Right FTMyDriveRoot
"TEAM_DRIVE_ROOT" -> Right FTTeamDriveRoot
"STANDARD_FOLDER" -> Right FTStandardFolder
x -> Left ("Unable to parse FolderType from: " <> x)
instance ToHttpApiData FolderType where
toQueryParam = \case
FTTypeUnspecified -> "TYPE_UNSPECIFIED"
FTMyDriveRoot -> "MY_DRIVE_ROOT"
FTTeamDriveRoot -> "TEAM_DRIVE_ROOT"
FTStandardFolder -> "STANDARD_FOLDER"
instance FromJSON FolderType where
parseJSON = parseJSONText "FolderType"
instance ToJSON FolderType where
toJSON = toJSONText
data ApplicationReferenceType
= UnspecifiedReferenceType
| Link
| Discuss
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ApplicationReferenceType
instance FromHttpApiData ApplicationReferenceType where
parseQueryParam = \case
"UNSPECIFIED_REFERENCE_TYPE" -> Right UnspecifiedReferenceType
"LINK" -> Right Link
"DISCUSS" -> Right Discuss
x -> Left ("Unable to parse ApplicationReferenceType from: " <> x)
instance ToHttpApiData ApplicationReferenceType where
toQueryParam = \case
UnspecifiedReferenceType -> "UNSPECIFIED_REFERENCE_TYPE"
Link -> "LINK"
Discuss -> "DISCUSS"
instance FromJSON ApplicationReferenceType where
parseJSON = parseJSONText "ApplicationReferenceType"
instance ToJSON ApplicationReferenceType where
toJSON = toJSONText