-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Google Apps Script Execution SDK. -- -- Executes Google Apps Script projects. -- -- Warning: This is an experimental prototype/preview release -- which is still under exploratory development and not intended for -- public use, caveat emptor! -- -- This library is compatible with version v1 of the API. @package gogol-script @version 0.1.0 module Network.Google.Script.Types -- | Default request referring to version v1 of the Google Apps -- Script Execution API. This contains the host and root path used as a -- starting point for constructing service requests. scriptService :: ServiceConfig -- | View and manage your mail mailGoogleComScope :: Proxy '["https://mail.google.com/"] -- | Manage your contacts m8FeedsScope :: Proxy '["https://www.google.com/m8/feeds"] -- | View and manage the provisioning of users on your domain adminDirectoryUserScope :: Proxy '["https://www.googleapis.com/auth/admin.directory.user"] -- | View your email address userInfoEmailScope :: Proxy '["https://www.googleapis.com/auth/userinfo.email"] -- | View and manage forms that this application has been installed in formsCurrentOnlyScope :: Proxy '["https://www.googleapis.com/auth/forms.currentonly"] -- | View and manage the files in your Google Drive driveScope :: Proxy '["https://www.googleapis.com/auth/drive"] -- | View and manage the provisioning of groups on your domain adminDirectoryGroupScope :: Proxy '["https://www.googleapis.com/auth/admin.directory.group"] -- | Manage your calendars calendarFeedsScope :: Proxy '["https://www.google.com/calendar/feeds"] -- | View and manage your forms in Google Drive formsScope :: Proxy '["https://www.googleapis.com/auth/forms"] -- | View and manage your spreadsheets in Google Drive spreadsheetsScope :: Proxy '["https://www.googleapis.com/auth/spreadsheets"] -- | View and manage your Google Groups groupsScope :: Proxy '["https://www.googleapis.com/auth/groups"] -- | If a `run` call succeeds but the script function (or Apps Script -- itself) throws an exception, the response body's `error` field will -- contain this `Status` object. -- -- See: status smart constructor. data Status -- | Creates a value of Status with the minimum fields required to -- make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- status :: Status -- | An array that contains a single `ExecutionError` object that provides -- information about the nature of the error. sDetails :: Lens' Status [StatusDetailsItem] -- | The status code, which should be an enum value of google.rpc.Code. sCode :: Lens' Status (Maybe Int32) -- | A developer-facing error message, which should be in English. Any -- user-facing error message should be localized and sent in the -- google.rpc.Status.details field, or localized by the client. sMessage :: Lens' Status (Maybe Text) -- | The response will not arrive until the function finishes executing. -- The maximum runtime is listed in the guide to limitations in Apps -- Script. If the script function returns successfully, the -- `response` field will contain an `ExecutionResponse` object with the -- function's return value in the object's `result` field. If the script -- function (or Apps Script itself) throws an exception, the `error` -- field will contain a `Status` object. The `Status` object's `details` -- field will contain an array with a single `ExecutionError` object that -- provides information about the nature of the error. If the `run` call -- itself fails (for example, because of a malformed request or an -- authorization error), the method will return an HTTP response code in -- the 4XX range with a different format for the response body. Client -- libraries will automatically convert a 4XX response into an exception -- class. -- -- See: operation smart constructor. data Operation -- | Creates a value of Operation with the minimum fields required -- to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- operation :: Operation -- | This field is not used. oDone :: Lens' Operation (Maybe Bool) -- | If a `run` call succeeds but the script function (or Apps Script -- itself) throws an exception, this field will contain a `Status` -- object. The `Status` object's `details` field will contain an array -- with a single `ExecutionError` object that provides information about -- the nature of the error. oError :: Lens' Operation (Maybe Status) -- | If the script function returns successfully, this field will contain -- an `ExecutionResponse` object with the function's return value as the -- object's `result` field. oResponse :: Lens' Operation (Maybe OperationResponse) -- | This field is not used. oName :: Lens' Operation (Maybe Text) -- | This field is not used. oMetadata :: Lens' Operation (Maybe OperationMetadata) -- | A request to run the function in a script. The script is identified by -- the specified `script_id`. Executing a function on a script will -- return results based on the implementation of the script. -- -- See: executionRequest smart constructor. data ExecutionRequest -- | Creates a value of ExecutionRequest with the minimum fields -- required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- executionRequest :: ExecutionRequest -- | The name of the function to execute in the given script. The name does -- not include parentheses or parameters. erFunction :: Lens' ExecutionRequest (Maybe Text) -- | This field is not used. erSessionState :: Lens' ExecutionRequest (Maybe Text) -- | If `true` and the user is an owner of the script, the script runs at -- the most recently saved version rather than the version deployed for -- use with the Execution API. Optional; default is `false`. erDevMode :: Lens' ExecutionRequest (Maybe Bool) -- | The parameters to be passed to the function being executed. The type -- for each parameter should match the expected type in Apps Script. -- Parameters cannot be Apps Script-specific objects (such as a -- `Document` or `Calendar`); they can only be primitive types such as a -- `string`, `number`, `array`, `object`, or `boolean`. Optional. erParameters :: Lens' ExecutionRequest [JSONValue] data StatusDetailsItem -- | Creates a value of StatusDetailsItem with the minimum fields -- required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- statusDetailsItem :: HashMap Text JSONValue -> StatusDetailsItem -- | Properties of the object. Contains field 'ype with type URL. sdiAddtional :: Lens' StatusDetailsItem (HashMap Text JSONValue) -- | A stack trace through the script that shows where the execution -- failed. -- -- See: scriptStackTraceElement smart constructor. data ScriptStackTraceElement -- | Creates a value of ScriptStackTraceElement with the minimum -- fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- scriptStackTraceElement :: ScriptStackTraceElement -- | The name of the function that failed. ssteFunction :: Lens' ScriptStackTraceElement (Maybe Text) -- | The line number where the script failed. ssteLineNumber :: Lens' ScriptStackTraceElement (Maybe Int32) -- | An object that provides information about the nature of an error in -- the Apps Script Execution API. If an `run` call succeeds but the -- script function (or Apps Script itself) throws an exception, the -- response body's `error` field will contain a `Status` object. The -- `Status` object's `details` field will contain an array with a single -- one of these `ExecutionError` objects. -- -- See: executionError smart constructor. data ExecutionError -- | Creates a value of ExecutionError with the minimum fields -- required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- executionError :: ExecutionError -- | An array of objects that provide a stack trace through the script to -- show where the execution failed, with the deepest call first. eeScriptStackTraceElements :: Lens' ExecutionError [ScriptStackTraceElement] -- | The error type, for example `TypeError` or `ReferenceError`. If the -- error type is unavailable, this field is not included. eeErrorType :: Lens' ExecutionError (Maybe Text) -- | The error message thrown by Apps Script, usually localized into the -- user's language. eeErrorMessage :: Lens' ExecutionError (Maybe Text) -- | This field is not used. -- -- See: operationMetadata smart constructor. data OperationMetadata -- | Creates a value of OperationMetadata with the minimum fields -- required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- operationMetadata :: HashMap Text JSONValue -> OperationMetadata -- | Properties of the object. Contains field 'ype with type URL. omAddtional :: Lens' OperationMetadata (HashMap Text JSONValue) -- | If the script function returns successfully, this field will contain -- an `ExecutionResponse` object with the function's return value as the -- object's `result` field. -- -- See: operationResponse smart constructor. data OperationResponse -- | Creates a value of OperationResponse with the minimum fields -- required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- operationResponse :: HashMap Text JSONValue -> OperationResponse -- | Properties of the object. Contains field 'ype with type URL. orAddtional :: Lens' OperationResponse (HashMap Text JSONValue) -- | An object that provides the return value of a function executed -- through the Apps Script Execution API. If an `run` call succeeds and -- the script function returns successfully, the response body's -- `response` field will contain this `ExecutionResponse` object. -- -- See: executionResponse smart constructor. data ExecutionResponse -- | Creates a value of ExecutionResponse with the minimum fields -- required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- executionResponse :: ExecutionResponse -- | The return value of the script function. The type will match the type -- returned in Apps Script. Functions called through the Execution API -- cannot return Apps Script-specific objects (such as a `Document` or -- `Calendar`); they can only return primitive types such as a `string`, -- `number`, `array`, `object`, or `boolean`. erResult :: Lens' ExecutionResponse (Maybe JSONValue) -- | Runs a function in an Apps Script project that has been deployed for -- use with the Apps Script Execution API. This method requires -- authorization with an OAuth 2.0 token that includes at least one of -- the scopes listed in the Authentication section; script -- projects that do not require authorization cannot be executed through -- this API. To find the correct scopes to include in the authentication -- token, open the project in the script editor, then select **File > -- Project properties** and click the **Scopes** tab. -- -- See: Google Apps Script Execution API Reference for -- script.scripts.run. module Network.Google.Resource.Script.Scripts.Run -- | A resource alias for script.scripts.run method which the -- ScriptsRun request conforms to. type ScriptsRunResource = "v1" :> ("scripts" :> (CaptureMode "scriptId" "run" Text :> (QueryParam "$.xgafv" Text :> (QueryParam "upload_protocol" Text :> (QueryParam "pp" Bool :> (QueryParam "access_token" Text :> (QueryParam "uploadType" Text :> (QueryParam "bearer_token" Text :> (QueryParam "callback" Text :> (QueryParam "alt" AltJSON :> (ReqBody '[JSON] ExecutionRequest :> Post '[JSON] Operation))))))))))) -- | Creates a value of ScriptsRun with the minimum fields required -- to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- scriptsRun :: ExecutionRequest -> Text -> ScriptsRun -- | Runs a function in an Apps Script project that has been deployed for -- use with the Apps Script Execution API. This method requires -- authorization with an OAuth 2.0 token that includes at least one of -- the scopes listed in the Authentication section; script -- projects that do not require authorization cannot be executed through -- this API. To find the correct scopes to include in the authentication -- token, open the project in the script editor, then select **File > -- Project properties** and click the **Scopes** tab. -- -- See: scriptsRun smart constructor. data ScriptsRun -- | V1 error format. srXgafv :: Lens' ScriptsRun (Maybe Text) -- | Upload protocol for media (e.g. "raw", "multipart"). srUploadProtocol :: Lens' ScriptsRun (Maybe Text) -- | Pretty-print response. srPp :: Lens' ScriptsRun Bool -- | OAuth access token. srAccessToken :: Lens' ScriptsRun (Maybe Text) -- | Legacy upload protocol for media (e.g. "media", "multipart"). srUploadType :: Lens' ScriptsRun (Maybe Text) -- | Multipart request metadata. srPayload :: Lens' ScriptsRun ExecutionRequest -- | OAuth bearer token. srBearerToken :: Lens' ScriptsRun (Maybe Text) -- | The project key of the script to be executed. To find the project key, -- open the project in the script editor, then select **File > Project -- properties**. srScriptId :: Lens' ScriptsRun Text -- | JSONP srCallback :: Lens' ScriptsRun (Maybe Text) instance GHC.Generics.Generic Network.Google.Resource.Script.Scripts.Run.ScriptsRun instance Data.Data.Data Network.Google.Resource.Script.Scripts.Run.ScriptsRun instance GHC.Show.Show Network.Google.Resource.Script.Scripts.Run.ScriptsRun instance GHC.Classes.Eq Network.Google.Resource.Script.Scripts.Run.ScriptsRun instance Network.Google.Types.GoogleRequest Network.Google.Resource.Script.Scripts.Run.ScriptsRun -- | Executes Google Apps Script projects. -- -- See: Google Apps Script Execution API Reference module Network.Google.Script -- | Default request referring to version v1 of the Google Apps -- Script Execution API. This contains the host and root path used as a -- starting point for constructing service requests. scriptService :: ServiceConfig -- | View and manage your mail mailGoogleComScope :: Proxy '["https://mail.google.com/"] -- | Manage your contacts m8FeedsScope :: Proxy '["https://www.google.com/m8/feeds"] -- | View and manage the provisioning of users on your domain adminDirectoryUserScope :: Proxy '["https://www.googleapis.com/auth/admin.directory.user"] -- | View your email address userInfoEmailScope :: Proxy '["https://www.googleapis.com/auth/userinfo.email"] -- | View and manage forms that this application has been installed in formsCurrentOnlyScope :: Proxy '["https://www.googleapis.com/auth/forms.currentonly"] -- | View and manage the files in your Google Drive driveScope :: Proxy '["https://www.googleapis.com/auth/drive"] -- | View and manage the provisioning of groups on your domain adminDirectoryGroupScope :: Proxy '["https://www.googleapis.com/auth/admin.directory.group"] -- | Manage your calendars calendarFeedsScope :: Proxy '["https://www.google.com/calendar/feeds"] -- | View and manage your forms in Google Drive formsScope :: Proxy '["https://www.googleapis.com/auth/forms"] -- | View and manage your spreadsheets in Google Drive spreadsheetsScope :: Proxy '["https://www.googleapis.com/auth/spreadsheets"] -- | View and manage your Google Groups groupsScope :: Proxy '["https://www.googleapis.com/auth/groups"] -- | Represents the entirety of the methods and resources available for the -- Google Apps Script Execution API service. type ScriptAPI = ScriptsRunResource -- | If a `run` call succeeds but the script function (or Apps Script -- itself) throws an exception, the response body's `error` field will -- contain this `Status` object. -- -- See: status smart constructor. data Status -- | Creates a value of Status with the minimum fields required to -- make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- status :: Status -- | An array that contains a single `ExecutionError` object that provides -- information about the nature of the error. sDetails :: Lens' Status [StatusDetailsItem] -- | The status code, which should be an enum value of google.rpc.Code. sCode :: Lens' Status (Maybe Int32) -- | A developer-facing error message, which should be in English. Any -- user-facing error message should be localized and sent in the -- google.rpc.Status.details field, or localized by the client. sMessage :: Lens' Status (Maybe Text) -- | The response will not arrive until the function finishes executing. -- The maximum runtime is listed in the guide to limitations in Apps -- Script. If the script function returns successfully, the -- `response` field will contain an `ExecutionResponse` object with the -- function's return value in the object's `result` field. If the script -- function (or Apps Script itself) throws an exception, the `error` -- field will contain a `Status` object. The `Status` object's `details` -- field will contain an array with a single `ExecutionError` object that -- provides information about the nature of the error. If the `run` call -- itself fails (for example, because of a malformed request or an -- authorization error), the method will return an HTTP response code in -- the 4XX range with a different format for the response body. Client -- libraries will automatically convert a 4XX response into an exception -- class. -- -- See: operation smart constructor. data Operation -- | Creates a value of Operation with the minimum fields required -- to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- operation :: Operation -- | This field is not used. oDone :: Lens' Operation (Maybe Bool) -- | If a `run` call succeeds but the script function (or Apps Script -- itself) throws an exception, this field will contain a `Status` -- object. The `Status` object's `details` field will contain an array -- with a single `ExecutionError` object that provides information about -- the nature of the error. oError :: Lens' Operation (Maybe Status) -- | If the script function returns successfully, this field will contain -- an `ExecutionResponse` object with the function's return value as the -- object's `result` field. oResponse :: Lens' Operation (Maybe OperationResponse) -- | This field is not used. oName :: Lens' Operation (Maybe Text) -- | This field is not used. oMetadata :: Lens' Operation (Maybe OperationMetadata) -- | A request to run the function in a script. The script is identified by -- the specified `script_id`. Executing a function on a script will -- return results based on the implementation of the script. -- -- See: executionRequest smart constructor. data ExecutionRequest -- | Creates a value of ExecutionRequest with the minimum fields -- required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- executionRequest :: ExecutionRequest -- | The name of the function to execute in the given script. The name does -- not include parentheses or parameters. erFunction :: Lens' ExecutionRequest (Maybe Text) -- | This field is not used. erSessionState :: Lens' ExecutionRequest (Maybe Text) -- | If `true` and the user is an owner of the script, the script runs at -- the most recently saved version rather than the version deployed for -- use with the Execution API. Optional; default is `false`. erDevMode :: Lens' ExecutionRequest (Maybe Bool) -- | The parameters to be passed to the function being executed. The type -- for each parameter should match the expected type in Apps Script. -- Parameters cannot be Apps Script-specific objects (such as a -- `Document` or `Calendar`); they can only be primitive types such as a -- `string`, `number`, `array`, `object`, or `boolean`. Optional. erParameters :: Lens' ExecutionRequest [JSONValue] data StatusDetailsItem -- | Creates a value of StatusDetailsItem with the minimum fields -- required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- statusDetailsItem :: HashMap Text JSONValue -> StatusDetailsItem -- | Properties of the object. Contains field 'ype with type URL. sdiAddtional :: Lens' StatusDetailsItem (HashMap Text JSONValue) -- | A stack trace through the script that shows where the execution -- failed. -- -- See: scriptStackTraceElement smart constructor. data ScriptStackTraceElement -- | Creates a value of ScriptStackTraceElement with the minimum -- fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- scriptStackTraceElement :: ScriptStackTraceElement -- | The name of the function that failed. ssteFunction :: Lens' ScriptStackTraceElement (Maybe Text) -- | The line number where the script failed. ssteLineNumber :: Lens' ScriptStackTraceElement (Maybe Int32) -- | An object that provides information about the nature of an error in -- the Apps Script Execution API. If an `run` call succeeds but the -- script function (or Apps Script itself) throws an exception, the -- response body's `error` field will contain a `Status` object. The -- `Status` object's `details` field will contain an array with a single -- one of these `ExecutionError` objects. -- -- See: executionError smart constructor. data ExecutionError -- | Creates a value of ExecutionError with the minimum fields -- required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- executionError :: ExecutionError -- | An array of objects that provide a stack trace through the script to -- show where the execution failed, with the deepest call first. eeScriptStackTraceElements :: Lens' ExecutionError [ScriptStackTraceElement] -- | The error type, for example `TypeError` or `ReferenceError`. If the -- error type is unavailable, this field is not included. eeErrorType :: Lens' ExecutionError (Maybe Text) -- | The error message thrown by Apps Script, usually localized into the -- user's language. eeErrorMessage :: Lens' ExecutionError (Maybe Text) -- | This field is not used. -- -- See: operationMetadata smart constructor. data OperationMetadata -- | Creates a value of OperationMetadata with the minimum fields -- required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- operationMetadata :: HashMap Text JSONValue -> OperationMetadata -- | Properties of the object. Contains field 'ype with type URL. omAddtional :: Lens' OperationMetadata (HashMap Text JSONValue) -- | If the script function returns successfully, this field will contain -- an `ExecutionResponse` object with the function's return value as the -- object's `result` field. -- -- See: operationResponse smart constructor. data OperationResponse -- | Creates a value of OperationResponse with the minimum fields -- required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- operationResponse :: HashMap Text JSONValue -> OperationResponse -- | Properties of the object. Contains field 'ype with type URL. orAddtional :: Lens' OperationResponse (HashMap Text JSONValue) -- | An object that provides the return value of a function executed -- through the Apps Script Execution API. If an `run` call succeeds and -- the script function returns successfully, the response body's -- `response` field will contain this `ExecutionResponse` object. -- -- See: executionResponse smart constructor. data ExecutionResponse -- | Creates a value of ExecutionResponse with the minimum fields -- required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- executionResponse :: ExecutionResponse -- | The return value of the script function. The type will match the type -- returned in Apps Script. Functions called through the Execution API -- cannot return Apps Script-specific objects (such as a `Document` or -- `Calendar`); they can only return primitive types such as a `string`, -- `number`, `array`, `object`, or `boolean`. erResult :: Lens' ExecutionResponse (Maybe JSONValue)