{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Script.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data GoogleAppsScriptTypeProcessProcessType
= ProcessTypeUnspecified
| AddOn
| ExecutionAPI
| TimeDriven
| Trigger
| WebApp
| Editor
| SimpleTrigger
| Menu
| BatchTask
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable GoogleAppsScriptTypeProcessProcessType
instance FromHttpApiData GoogleAppsScriptTypeProcessProcessType where
parseQueryParam = \case
"PROCESS_TYPE_UNSPECIFIED" -> Right ProcessTypeUnspecified
"ADD_ON" -> Right AddOn
"EXECUTION_API" -> Right ExecutionAPI
"TIME_DRIVEN" -> Right TimeDriven
"TRIGGER" -> Right Trigger
"WEBAPP" -> Right WebApp
"EDITOR" -> Right Editor
"SIMPLE_TRIGGER" -> Right SimpleTrigger
"MENU" -> Right Menu
"BATCH_TASK" -> Right BatchTask
x -> Left ("Unable to parse GoogleAppsScriptTypeProcessProcessType from: " <> x)
instance ToHttpApiData GoogleAppsScriptTypeProcessProcessType where
toQueryParam = \case
ProcessTypeUnspecified -> "PROCESS_TYPE_UNSPECIFIED"
AddOn -> "ADD_ON"
ExecutionAPI -> "EXECUTION_API"
TimeDriven -> "TIME_DRIVEN"
Trigger -> "TRIGGER"
WebApp -> "WEBAPP"
Editor -> "EDITOR"
SimpleTrigger -> "SIMPLE_TRIGGER"
Menu -> "MENU"
BatchTask -> "BATCH_TASK"
instance FromJSON GoogleAppsScriptTypeProcessProcessType where
parseJSON = parseJSONText "GoogleAppsScriptTypeProcessProcessType"
instance ToJSON GoogleAppsScriptTypeProcessProcessType where
toJSON = toJSONText
data GoogleAppsScriptTypeProcessUserAccessLevel
= UserAccessLevelUnspecified
| None
| Read'
| Write
| Owner
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable GoogleAppsScriptTypeProcessUserAccessLevel
instance FromHttpApiData GoogleAppsScriptTypeProcessUserAccessLevel where
parseQueryParam = \case
"USER_ACCESS_LEVEL_UNSPECIFIED" -> Right UserAccessLevelUnspecified
"NONE" -> Right None
"READ" -> Right Read'
"WRITE" -> Right Write
"OWNER" -> Right Owner
x -> Left ("Unable to parse GoogleAppsScriptTypeProcessUserAccessLevel from: " <> x)
instance ToHttpApiData GoogleAppsScriptTypeProcessUserAccessLevel where
toQueryParam = \case
UserAccessLevelUnspecified -> "USER_ACCESS_LEVEL_UNSPECIFIED"
None -> "NONE"
Read' -> "READ"
Write -> "WRITE"
Owner -> "OWNER"
instance FromJSON GoogleAppsScriptTypeProcessUserAccessLevel where
parseJSON = parseJSONText "GoogleAppsScriptTypeProcessUserAccessLevel"
instance ToJSON GoogleAppsScriptTypeProcessUserAccessLevel where
toJSON = toJSONText
data GoogleAppsScriptTypeWebAppConfigExecuteAs
= UnknownExecuteAs
| UserAccessing
| UserDeploying
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable GoogleAppsScriptTypeWebAppConfigExecuteAs
instance FromHttpApiData GoogleAppsScriptTypeWebAppConfigExecuteAs where
parseQueryParam = \case
"UNKNOWN_EXECUTE_AS" -> Right UnknownExecuteAs
"USER_ACCESSING" -> Right UserAccessing
"USER_DEPLOYING" -> Right UserDeploying
x -> Left ("Unable to parse GoogleAppsScriptTypeWebAppConfigExecuteAs from: " <> x)
instance ToHttpApiData GoogleAppsScriptTypeWebAppConfigExecuteAs where
toQueryParam = \case
UnknownExecuteAs -> "UNKNOWN_EXECUTE_AS"
UserAccessing -> "USER_ACCESSING"
UserDeploying -> "USER_DEPLOYING"
instance FromJSON GoogleAppsScriptTypeWebAppConfigExecuteAs where
parseJSON = parseJSONText "GoogleAppsScriptTypeWebAppConfigExecuteAs"
instance ToJSON GoogleAppsScriptTypeWebAppConfigExecuteAs where
toJSON = toJSONText
data GoogleAppsScriptTypeExecutionAPIConfigAccess
= UnknownAccess
| Myself
| Domain
| Anyone
| AnyoneAnonymous
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable GoogleAppsScriptTypeExecutionAPIConfigAccess
instance FromHttpApiData GoogleAppsScriptTypeExecutionAPIConfigAccess where
parseQueryParam = \case
"UNKNOWN_ACCESS" -> Right UnknownAccess
"MYSELF" -> Right Myself
"DOMAIN" -> Right Domain
"ANYONE" -> Right Anyone
"ANYONE_ANONYMOUS" -> Right AnyoneAnonymous
x -> Left ("Unable to parse GoogleAppsScriptTypeExecutionAPIConfigAccess from: " <> x)
instance ToHttpApiData GoogleAppsScriptTypeExecutionAPIConfigAccess where
toQueryParam = \case
UnknownAccess -> "UNKNOWN_ACCESS"
Myself -> "MYSELF"
Domain -> "DOMAIN"
Anyone -> "ANYONE"
AnyoneAnonymous -> "ANYONE_ANONYMOUS"
instance FromJSON GoogleAppsScriptTypeExecutionAPIConfigAccess where
parseJSON = parseJSONText "GoogleAppsScriptTypeExecutionAPIConfigAccess"
instance ToJSON GoogleAppsScriptTypeExecutionAPIConfigAccess where
toJSON = toJSONText
data FileType
= EnumTypeUnspecified
| ServerJs
| HTML
| JSON
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable FileType
instance FromHttpApiData FileType where
parseQueryParam = \case
"ENUM_TYPE_UNSPECIFIED" -> Right EnumTypeUnspecified
"SERVER_JS" -> Right ServerJs
"HTML" -> Right HTML
"JSON" -> Right JSON
x -> Left ("Unable to parse FileType from: " <> x)
instance ToHttpApiData FileType where
toQueryParam = \case
EnumTypeUnspecified -> "ENUM_TYPE_UNSPECIFIED"
ServerJs -> "SERVER_JS"
HTML -> "HTML"
JSON -> "JSON"
instance FromJSON FileType where
parseJSON = parseJSONText "FileType"
instance ToJSON FileType where
toJSON = toJSONText
data GoogleAppsScriptTypeAddOnEntryPointAddOnType
= UnknownAddonType
| Gmail
| DataStudio
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable GoogleAppsScriptTypeAddOnEntryPointAddOnType
instance FromHttpApiData GoogleAppsScriptTypeAddOnEntryPointAddOnType where
parseQueryParam = \case
"UNKNOWN_ADDON_TYPE" -> Right UnknownAddonType
"GMAIL" -> Right Gmail
"DATA_STUDIO" -> Right DataStudio
x -> Left ("Unable to parse GoogleAppsScriptTypeAddOnEntryPointAddOnType from: " <> x)
instance ToHttpApiData GoogleAppsScriptTypeAddOnEntryPointAddOnType where
toQueryParam = \case
UnknownAddonType -> "UNKNOWN_ADDON_TYPE"
Gmail -> "GMAIL"
DataStudio -> "DATA_STUDIO"
instance FromJSON GoogleAppsScriptTypeAddOnEntryPointAddOnType where
parseJSON = parseJSONText "GoogleAppsScriptTypeAddOnEntryPointAddOnType"
instance ToJSON GoogleAppsScriptTypeAddOnEntryPointAddOnType 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 EntryPointEntryPointType
= EPEPTEntryPointTypeUnspecified
| EPEPTWebApp
| EPEPTExecutionAPI
| EPEPTAddOn
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable EntryPointEntryPointType
instance FromHttpApiData EntryPointEntryPointType where
parseQueryParam = \case
"ENTRY_POINT_TYPE_UNSPECIFIED" -> Right EPEPTEntryPointTypeUnspecified
"WEB_APP" -> Right EPEPTWebApp
"EXECUTION_API" -> Right EPEPTExecutionAPI
"ADD_ON" -> Right EPEPTAddOn
x -> Left ("Unable to parse EntryPointEntryPointType from: " <> x)
instance ToHttpApiData EntryPointEntryPointType where
toQueryParam = \case
EPEPTEntryPointTypeUnspecified -> "ENTRY_POINT_TYPE_UNSPECIFIED"
EPEPTWebApp -> "WEB_APP"
EPEPTExecutionAPI -> "EXECUTION_API"
EPEPTAddOn -> "ADD_ON"
instance FromJSON EntryPointEntryPointType where
parseJSON = parseJSONText "EntryPointEntryPointType"
instance ToJSON EntryPointEntryPointType where
toJSON = toJSONText
data GoogleAppsScriptTypeProcessProcessStatus
= ProcessStatusUnspecified
| Running
| Paused
| Completed
| Canceled
| Failed
| TimedOut
| Unknown
| Delayed
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable GoogleAppsScriptTypeProcessProcessStatus
instance FromHttpApiData GoogleAppsScriptTypeProcessProcessStatus where
parseQueryParam = \case
"PROCESS_STATUS_UNSPECIFIED" -> Right ProcessStatusUnspecified
"RUNNING" -> Right Running
"PAUSED" -> Right Paused
"COMPLETED" -> Right Completed
"CANCELED" -> Right Canceled
"FAILED" -> Right Failed
"TIMED_OUT" -> Right TimedOut
"UNKNOWN" -> Right Unknown
"DELAYED" -> Right Delayed
x -> Left ("Unable to parse GoogleAppsScriptTypeProcessProcessStatus from: " <> x)
instance ToHttpApiData GoogleAppsScriptTypeProcessProcessStatus where
toQueryParam = \case
ProcessStatusUnspecified -> "PROCESS_STATUS_UNSPECIFIED"
Running -> "RUNNING"
Paused -> "PAUSED"
Completed -> "COMPLETED"
Canceled -> "CANCELED"
Failed -> "FAILED"
TimedOut -> "TIMED_OUT"
Unknown -> "UNKNOWN"
Delayed -> "DELAYED"
instance FromJSON GoogleAppsScriptTypeProcessProcessStatus where
parseJSON = parseJSONText "GoogleAppsScriptTypeProcessProcessStatus"
instance ToJSON GoogleAppsScriptTypeProcessProcessStatus where
toJSON = toJSONText
data GoogleAppsScriptTypeWebAppConfigAccess
= GASTWACAUnknownAccess
| GASTWACAMyself
| GASTWACADomain
| GASTWACAAnyone
| GASTWACAAnyoneAnonymous
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable GoogleAppsScriptTypeWebAppConfigAccess
instance FromHttpApiData GoogleAppsScriptTypeWebAppConfigAccess where
parseQueryParam = \case
"UNKNOWN_ACCESS" -> Right GASTWACAUnknownAccess
"MYSELF" -> Right GASTWACAMyself
"DOMAIN" -> Right GASTWACADomain
"ANYONE" -> Right GASTWACAAnyone
"ANYONE_ANONYMOUS" -> Right GASTWACAAnyoneAnonymous
x -> Left ("Unable to parse GoogleAppsScriptTypeWebAppConfigAccess from: " <> x)
instance ToHttpApiData GoogleAppsScriptTypeWebAppConfigAccess where
toQueryParam = \case
GASTWACAUnknownAccess -> "UNKNOWN_ACCESS"
GASTWACAMyself -> "MYSELF"
GASTWACADomain -> "DOMAIN"
GASTWACAAnyone -> "ANYONE"
GASTWACAAnyoneAnonymous -> "ANYONE_ANONYMOUS"
instance FromJSON GoogleAppsScriptTypeWebAppConfigAccess where
parseJSON = parseJSONText "GoogleAppsScriptTypeWebAppConfigAccess"
instance ToJSON GoogleAppsScriptTypeWebAppConfigAccess where
toJSON = toJSONText