Skip to content
Snippets Groups Projects
Commit ac952d71 authored by Benjamin Ledel's avatar Benjamin Ledel
Browse files

* add sample service

parent f43c35a3
No related branches found
No related tags found
No related merge requests found
<?php
namespace local_polaris_gateway\external;
use external_function_parameters;
use external_multiple_structure;
use external_single_structure;
use external_value;
class create_groups extends \core_external\external_api {
/**
* Returns description of method parameters
* @return external_function_parameters
*/
public static function execute_parameters() {
return new external_function_parameters([
'groups' => new external_multiple_structure(
new external_single_structure([
'courseid' => new external_value(PARAM_INT, 'id of course'),
'name' => new external_value(
PARAM_TEXT,
'multilang compatible name, course unique'
),
'description' => new external_value(
PARAM_RAW,
'group description text'
),
'enrolmentkey' => new external_value(
PARAM_RAW,
'group enrol secret phrase'
),
])
)
]);
}
public static function execute_returns() {
return new external_multiple_structure(
new external_single_structure([
'id' => new external_value(PARAM_INT, 'group record id'),
'courseid' => new external_value(PARAM_INT, 'id of course'),
'name' => new external_value(PARAM_TEXT, 'multilang compatible name, course unique'),
'description' => new external_value(PARAM_RAW, 'group description text'),
'enrolmentkey' => new external_value(PARAM_RAW, 'group enrol secret phrase'),
])
);
}
}
\ No newline at end of file
<?php
$functions = [
// The name of your web service function, as discussed above.
'local_polaris_gateway_collect_groups' => [
// The name of the namespaced class that the function is located in.
'classname' => 'local_polaris_gateway\external\collect_groups',
// A brief, human-readable, description of the web service function.
'description' => 'Collects information about courses members to show them in polaris',
// Options include read, and write.
'type' => 'read',
// Whether the service is available for use in AJAX calls from the web.
'ajax' => true,
// An optional list of services where the function will be included.
'services' => [
]
],
];
$services = [
'Polaris Gateway' => [
'functions' => [
'local_polaris_gateway_collect_groups',
'local_o365_get_onenoteassignment',
'local_o365_update_onenoteassignment',
'local_o365_delete_onenoteassignment',
'local_o365_get_teachercourses',
'local_o365_get_course_users',
'local_o365_get_assignments',
'local_o365_get_bot_message',
'local_o365_update_grade',
'mod_assign_get_assignments',
'mod_assign_get_grades',
'mod_assign_save_grade',
],
'restrictedusers' => 0,
'enabled' => 0,
'shortname' => 'polaris_gateway',
]
];
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment