Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 and 403] [Versions 402 and 403]

   1  <?php
   2  // This file is part of Moodle - http://moodle.org/
   3  //
   4  // Moodle is free software: you can redistribute it and/or modify
   5  // it under the terms of the GNU General Public License as published by
   6  // the Free Software Foundation, either version 3 of the License, or
   7  // (at your option) any later version.
   8  //
   9  // Moodle is distributed in the hope that it will be useful,
  10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12  // GNU General Public License for more details.
  13  //
  14  // You should have received a copy of the GNU General Public License
  15  // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  16  
  17  
  18  /**
  19   * Core external functions and service definitions.
  20   *
  21   * The functions and services defined on this file are
  22   * processed and registered into the Moodle DB after any
  23   * install or upgrade operation. All plugins support this.
  24   *
  25   * For more information, take a look to the documentation available:
  26   *     - Webservices API: {@link https://moodledev.io/docs/apis/subsystems/external/writing-a-service}
  27   *     - External API: {@link https://moodledev.io/docs/apis/subsystems/external/functions}
  28   *     - Upgrade API: {@link https://moodledev.io/docs/guides/upgrade}
  29   *
  30   * @package    core_webservice
  31   * @category   webservice
  32   * @copyright  2009 Petr Skodak
  33   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  34   */
  35  
  36  $functions = array(
  37      'core_auth_confirm_user' => array(
  38          'classname'   => 'core_auth_external',
  39          'methodname'  => 'confirm_user',
  40          'description' => 'Confirm a user account.',
  41          'type'        => 'write',
  42          'ajax'          => true,
  43          'loginrequired' => false,
  44      ),
  45      'core_auth_request_password_reset' => array(
  46          'classname'   => 'core_auth_external',
  47          'methodname'  => 'request_password_reset',
  48          'description' => 'Requests a password reset.',
  49          'type'        => 'write',
  50          'ajax'          => true,
  51          'loginrequired' => false,
  52      ),
  53      'core_auth_is_minor' => array(
  54          'classname'   => 'core_auth_external',
  55          'methodname'  => 'is_minor',
  56          'description' => 'Requests a check if a user is a digital minor.',
  57          'type'        => 'read',
  58          'ajax'          => true,
  59          'loginrequired' => false,
  60      ),
  61      'core_auth_is_age_digital_consent_verification_enabled' => array(
  62          'classname'   => 'core_auth_external',
  63          'methodname'  => 'is_age_digital_consent_verification_enabled',
  64          'description' => 'Checks if age digital consent verification is enabled.',
  65          'type'        => 'read',
  66          'ajax'          => true,
  67          'loginrequired' => false,
  68      ),
  69      'core_auth_resend_confirmation_email' => array(
  70          'classname'   => 'core_auth_external',
  71          'methodname'  => 'resend_confirmation_email',
  72          'description' => 'Resend confirmation email.',
  73          'type'        => 'write',
  74          'ajax'          => true,
  75          'loginrequired' => false,
  76      ),
  77      'core_backup_get_async_backup_progress' => array(
  78          'classname'   => 'core_backup_external',
  79          'classpath' => 'backup/externallib.php',
  80          'methodname'  => 'get_async_backup_progress',
  81          'description' => 'Get the progress of an Asyncronhous backup.',
  82          'type'        => 'read',
  83          'ajax'          => true,
  84          'loginrequired' => true,
  85      ),
  86      'core_backup_get_async_backup_links_backup' => array(
  87          'classname'   => 'core_backup_external',
  88          'classpath' => 'backup/externallib.php',
  89          'methodname'  => 'get_async_backup_links_backup',
  90          'description' => 'Gets the data to use when updating the status table row in the UI for when an async backup completes.',
  91          'type'        => 'read',
  92          'ajax'          => true,
  93          'loginrequired' => true,
  94      ),
  95      'core_backup_get_async_backup_links_restore' => array(
  96          'classname'   => 'core_backup_external',
  97          'classpath' => 'backup/externallib.php',
  98          'methodname'  => 'get_async_backup_links_restore',
  99          'description' => 'Gets the data to use when updating the status table row in the UI for when an async restore completes.',
 100          'type'        => 'read',
 101          'ajax'          => true,
 102          'loginrequired' => true,
 103      ),
 104      'core_backup_get_copy_progress' => array(
 105          'classname'   => 'core_backup_external',
 106          'classpath' => 'backup/externallib.php',
 107          'methodname'  => 'get_copy_progress',
 108          'description' => 'Gets the progress of course copy operations.',
 109          'type'        => 'read',
 110          'ajax'          => true,
 111          'loginrequired' => true,
 112      ),
 113      'core_backup_submit_copy_form' => array(
 114          'classname'   => 'core_backup_external',
 115          'classpath' => 'backup/externallib.php',
 116          'methodname'  => 'submit_copy_form',
 117          'description' => 'Handles ajax submission of course copy form.',
 118          'type'        => 'read',
 119          'ajax'          => true,
 120          'loginrequired' => true,
 121      ),
 122      'core_badges_get_user_badges' => array(
 123          'classname'     => 'core_badges_external',
 124          'methodname'    => 'get_user_badges',
 125          'description'   => 'Returns the list of badges awarded to a user.',
 126          'type'          => 'read',
 127          'capabilities'  => 'moodle/badges:viewotherbadges',
 128          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 129      ),
 130      'core_badges_get_user_badge_by_hash' => [
 131          'classname'     => 'core_badges\external\get_user_badge_by_hash',
 132          'description'   => 'Returns the badge awarded to a user by hash.',
 133          'type'          => 'read',
 134          'services'      => [MOODLE_OFFICIAL_MOBILE_SERVICE],
 135      ],
 136      'core_blog_get_entries' => array(
 137          'classname'   => 'core_blog\external',
 138          'methodname'  => 'get_entries',
 139          'description' => 'Returns blog entries.',
 140          'type'        => 'read',
 141          'services'    => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 142          'ajax'          => true,
 143          'loginrequired' => false,
 144      ),
 145      'core_blog_view_entries' => array(
 146          'classname'   => 'core_blog\external',
 147          'methodname'  => 'view_entries',
 148          'description' => 'Trigger the blog_entries_viewed event.',
 149          'type'        => 'read',
 150          'services'    => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 151          'ajax'          => true,
 152          'loginrequired' => false,
 153      ),
 154      'core_calendar_get_calendar_monthly_view' => array(
 155          'classname' => 'core_calendar_external',
 156          'methodname' => 'get_calendar_monthly_view',
 157          'description' => 'Fetch the monthly view data for a calendar',
 158          'classpath' => 'calendar/externallib.php',
 159          'type' => 'read',
 160          'capabilities' => '',
 161          'ajax' => true,
 162          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 163      ),
 164      'core_calendar_get_calendar_day_view' => array(
 165          'classname' => 'core_calendar_external',
 166          'methodname' => 'get_calendar_day_view',
 167          'description' => 'Fetch the day view data for a calendar',
 168          'classpath' => 'calendar/externallib.php',
 169          'type' => 'read',
 170          'capabilities' => '',
 171          'ajax' => true,
 172          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 173      ),
 174      'core_calendar_get_calendar_upcoming_view' => array(
 175          'classname' => 'core_calendar_external',
 176          'methodname' => 'get_calendar_upcoming_view',
 177          'description' => 'Fetch the upcoming view data for a calendar',
 178          'classpath' => 'calendar/externallib.php',
 179          'type' => 'read',
 180          'capabilities' => '',
 181          'ajax' => true,
 182          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 183      ),
 184      'core_calendar_update_event_start_day' => array(
 185          'classname' => 'core_calendar_external',
 186          'methodname' => 'update_event_start_day',
 187          'description' => 'Update the start day (but not time) for an event.',
 188          'classpath' => 'calendar/externallib.php',
 189          'type' => 'write',
 190          'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
 191          'ajax' => true,
 192          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 193      ),
 194      'core_calendar_create_calendar_events' => array(
 195          'classname' => 'core_calendar_external',
 196          'methodname' => 'create_calendar_events',
 197          'description' => 'Create calendar events',
 198          'classpath' => 'calendar/externallib.php',
 199          'type' => 'write',
 200          'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
 201          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 202      ),
 203      'core_calendar_delete_calendar_events' => array(
 204          'classname' => 'core_calendar_external',
 205          'methodname' => 'delete_calendar_events',
 206          'description' => 'Delete calendar events',
 207          'classpath' => 'calendar/externallib.php',
 208          'type' => 'write',
 209          'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
 210          'ajax' => true,
 211          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 212      ),
 213      'core_calendar_get_calendar_events' => array(
 214          'classname' => 'core_calendar_external',
 215          'methodname' => 'get_calendar_events',
 216          'description' => 'Get calendar events',
 217          'classpath' => 'calendar/externallib.php',
 218          'type' => 'read',
 219          'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
 220          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 221      ),
 222      'core_calendar_get_action_events_by_timesort' => array(
 223          'classname' => 'core_calendar_external',
 224          'methodname' => 'get_calendar_action_events_by_timesort',
 225          'description' => 'Get calendar action events by tiemsort',
 226          'classpath' => 'calendar/externallib.php',
 227          'type' => 'read',
 228          'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
 229          'ajax' => true,
 230          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 231      ),
 232      'core_calendar_get_action_events_by_course' => array(
 233          'classname' => 'core_calendar_external',
 234          'methodname' => 'get_calendar_action_events_by_course',
 235          'description' => 'Get calendar action events by course',
 236          'classpath' => 'calendar/externallib.php',
 237          'type' => 'read',
 238          'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
 239          'ajax' => true,
 240          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 241      ),
 242      'core_calendar_get_action_events_by_courses' => array(
 243          'classname' => 'core_calendar_external',
 244          'methodname' => 'get_calendar_action_events_by_courses',
 245          'description' => 'Get calendar action events by courses',
 246          'classpath' => 'calendar/externallib.php',
 247          'type' => 'read',
 248          'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
 249          'ajax' => true,
 250          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 251      ),
 252      'core_calendar_get_calendar_event_by_id' => array(
 253          'classname' => 'core_calendar_external',
 254          'methodname' => 'get_calendar_event_by_id',
 255          'description' => 'Get calendar event by id',
 256          'classpath' => 'calendar/externallib.php',
 257          'type' => 'read',
 258          'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
 259          'ajax' => true,
 260          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 261      ),
 262      'core_calendar_submit_create_update_form' => array(
 263          'classname' => 'core_calendar_external',
 264          'methodname' => 'submit_create_update_form',
 265          'description' => 'Submit form data for event form',
 266          'classpath' => 'calendar/externallib.php',
 267          'type' => 'write',
 268          'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
 269          'ajax' => true,
 270          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 271      ),
 272      'core_calendar_get_calendar_access_information' => array(
 273          'classname' => 'core_calendar_external',
 274          'methodname' => 'get_calendar_access_information',
 275          'description' => 'Convenience function to retrieve some permissions/access information for the given course calendar.',
 276          'classpath' => 'calendar/externallib.php',
 277          'type' => 'read',
 278          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 279      ),
 280      'core_calendar_get_allowed_event_types' => array(
 281          'classname' => 'core_calendar_external',
 282          'methodname' => 'get_allowed_event_types',
 283          'description' => 'Get the type of events a user can create in the given course.',
 284          'classpath' => 'calendar/externallib.php',
 285          'type' => 'read',
 286          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 287      ),
 288      'core_calendar_get_timestamps' => [
 289          'classname'     => 'core_calendar_external',
 290          'methodname'    => 'get_timestamps',
 291          'description'   => 'Fetch unix timestamps for given date times.',
 292          'classpath' => 'calendar/externallib.php',
 293          'type'          => 'read',
 294          'ajax'          => true,
 295      ],
 296      'core_calendar_get_calendar_export_token' => [
 297          'classname'     => 'core_calendar\external\export\token',
 298          'description'   => 'Return the auth token required for exporting a calendar.',
 299          'type'          => 'read',
 300          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 301      ],
 302      'core_calendar_delete_subscription' => [
 303          'classname' => 'core_calendar\external\subscription\delete',
 304          'description' => 'Delete the calendar subscription',
 305          'type' => 'write',
 306          'ajax' => true
 307      ],
 308      'core_cohort_add_cohort_members' => array(
 309          'classname' => 'core_cohort_external',
 310          'methodname' => 'add_cohort_members',
 311          'classpath' => 'cohort/externallib.php',
 312          'description' => 'Adds cohort members.',
 313          'type' => 'write',
 314          'capabilities' => 'moodle/cohort:assign'
 315      ),
 316      'core_cohort_create_cohorts' => array(
 317          'classname' => 'core_cohort_external',
 318          'methodname' => 'create_cohorts',
 319          'classpath' => 'cohort/externallib.php',
 320          'description' => 'Creates new cohorts.',
 321          'type' => 'write',
 322          'capabilities' => 'moodle/cohort:manage'
 323      ),
 324      'core_cohort_delete_cohort_members' => array(
 325          'classname' => 'core_cohort_external',
 326          'methodname' => 'delete_cohort_members',
 327          'classpath' => 'cohort/externallib.php',
 328          'description' => 'Deletes cohort members.',
 329          'type' => 'write',
 330          'capabilities' => 'moodle/cohort:assign'
 331      ),
 332      'core_cohort_delete_cohorts' => array(
 333          'classname' => 'core_cohort_external',
 334          'methodname' => 'delete_cohorts',
 335          'classpath' => 'cohort/externallib.php',
 336          'description' => 'Deletes all specified cohorts.',
 337          'type' => 'write',
 338          'capabilities' => 'moodle/cohort:manage'
 339      ),
 340      'core_cohort_get_cohort_members' => array(
 341          'classname' => 'core_cohort_external',
 342          'methodname' => 'get_cohort_members',
 343          'classpath' => 'cohort/externallib.php',
 344          'description' => 'Returns cohort members.',
 345          'type' => 'read',
 346          'capabilities' => 'moodle/cohort:view'
 347      ),
 348      'core_cohort_search_cohorts' => array(
 349          'classname' => 'core_cohort_external',
 350          'methodname' => 'search_cohorts',
 351          'classpath' => 'cohort/externallib.php',
 352          'description' => 'Search for cohorts.',
 353          'type' => 'read',
 354          'ajax' => true,
 355          'capabilities' => 'moodle/cohort:view'
 356      ),
 357      'core_cohort_get_cohorts' => array(
 358          'classname' => 'core_cohort_external',
 359          'methodname' => 'get_cohorts',
 360          'classpath' => 'cohort/externallib.php',
 361          'description' => 'Returns cohort details.',
 362          'type' => 'read',
 363          'capabilities' => 'moodle/cohort:view'
 364      ),
 365      'core_cohort_update_cohorts' => array(
 366          'classname' => 'core_cohort_external',
 367          'methodname' => 'update_cohorts',
 368          'classpath' => 'cohort/externallib.php',
 369          'description' => 'Updates existing cohorts.',
 370          'type' => 'write',
 371          'capabilities' => 'moodle/cohort:manage'
 372      ),
 373      'core_comment_get_comments' => array(
 374          'classname' => 'core_comment_external',
 375          'methodname' => 'get_comments',
 376          'description' => 'Returns comments.',
 377          'type' => 'read',
 378          'capabilities' => 'moodle/comment:view',
 379          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 380      ),
 381      'core_comment_add_comments' => array(
 382          'classname' => 'core_comment_external',
 383          'methodname' => 'add_comments',
 384          'description' => 'Adds a comment or comments.',
 385          'type' => 'write',
 386          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 387      ),
 388      'core_comment_delete_comments' => array(
 389          'classname' => 'core_comment_external',
 390          'methodname' => 'delete_comments',
 391          'description' => 'Deletes a comment or comments.',
 392          'type' => 'write',
 393          'ajax' => true,
 394          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 395      ),
 396      'core_completion_get_activities_completion_status' => array(
 397          'classname' => 'core_completion_external',
 398          'methodname' => 'get_activities_completion_status',
 399          'description' => 'Return the activities completion status for a user in a course.',
 400          'type' => 'read',
 401          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 402      ),
 403      'core_completion_get_course_completion_status' => array(
 404          'classname' => 'core_completion_external',
 405          'methodname' => 'get_course_completion_status',
 406          'description' => 'Returns course completion status.',
 407          'type' => 'read',
 408          'capabilities' => 'report/completion:view',
 409          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 410      ),
 411      'core_completion_mark_course_self_completed' => array(
 412          'classname' => 'core_completion_external',
 413          'methodname' => 'mark_course_self_completed',
 414          'description' => 'Update the course completion status for the current user (if course self-completion is enabled).',
 415          'type' => 'write',
 416          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 417      ),
 418      'core_completion_update_activity_completion_status_manually' => array(
 419          'classname' => 'core_completion_external',
 420          'methodname' => 'update_activity_completion_status_manually',
 421          'description' => 'Update completion status for the current user in an activity, only for activities with manual tracking.',
 422          'type' => 'write',
 423          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 424          'ajax' => true,
 425      ),
 426      'core_completion_override_activity_completion_status' => array(
 427          'classname'     => 'core_completion_external',
 428          'methodname'    => 'override_activity_completion_status',
 429          'description'   => 'Update completion status for a user in an activity by overriding it.',
 430          'type'          => 'write',
 431          'capabilities'  => 'moodle/course:overridecompletion',
 432          'ajax'          => true,
 433      ),
 434      'core_course_create_categories' => array(
 435          'classname' => 'core_course_external',
 436          'methodname' => 'create_categories',
 437          'classpath' => 'course/externallib.php',
 438          'description' => 'Create course categories',
 439          'type' => 'write',
 440          'capabilities' => 'moodle/category:manage'
 441      ),
 442      'core_course_create_courses' => array(
 443          'classname' => 'core_course_external',
 444          'methodname' => 'create_courses',
 445          'classpath' => 'course/externallib.php',
 446          'description' => 'Create new courses',
 447          'type' => 'write',
 448          'capabilities' => 'moodle/course:create, moodle/course:visibility'
 449      ),
 450      'core_course_delete_categories' => array(
 451          'classname' => 'core_course_external',
 452          'methodname' => 'delete_categories',
 453          'classpath' => 'course/externallib.php',
 454          'description' => 'Delete course categories',
 455          'type' => 'write',
 456          'capabilities' => 'moodle/category:manage'
 457      ),
 458      'core_course_delete_courses' => array(
 459          'classname' => 'core_course_external',
 460          'methodname' => 'delete_courses',
 461          'classpath' => 'course/externallib.php',
 462          'description' => 'Deletes all specified courses',
 463          'type' => 'write',
 464          'capabilities' => 'moodle/course:delete'
 465      ),
 466      'core_course_delete_modules' => array(
 467          'classname' => 'core_course_external',
 468          'methodname' => 'delete_modules',
 469          'classpath' => 'course/externallib.php',
 470          'description' => 'Deletes all specified module instances',
 471          'type' => 'write',
 472          'capabilities' => 'moodle/course:manageactivities'
 473      ),
 474      'core_course_duplicate_course' => array(
 475          'classname' => 'core_course_external',
 476          'methodname' => 'duplicate_course',
 477          'classpath' => 'course/externallib.php',
 478          'description' => 'Duplicate an existing course (creating a new one).',
 479          'type' => 'write',
 480          'capabilities' => 'moodle/backup:backupcourse, moodle/restore:restorecourse, moodle/course:create'
 481      ),
 482      'core_course_get_categories' => array(
 483          'classname' => 'core_course_external',
 484          'methodname' => 'get_categories',
 485          'classpath' => 'course/externallib.php',
 486          'description' => 'Return category details',
 487          'type' => 'read',
 488          'capabilities' => 'moodle/category:viewhiddencategories',
 489          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 490      ),
 491      'core_course_get_contents' => array(
 492          'classname' => 'core_course_external',
 493          'methodname' => 'get_course_contents',
 494          'classpath' => 'course/externallib.php',
 495          'description' => 'Get course contents',
 496          'type' => 'read',
 497          'capabilities' => 'moodle/course:update, moodle/course:viewhiddencourses',
 498          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 499      ),
 500      'core_course_get_course_module' => array(
 501          'classname' => 'core_course_external',
 502          'methodname' => 'get_course_module',
 503          'classpath' => 'course/externallib.php',
 504          'description' => 'Return information about a course module',
 505          'type' => 'read',
 506          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 507      ),
 508      'core_course_get_course_module_by_instance' => array(
 509          'classname' => 'core_course_external',
 510          'methodname' => 'get_course_module_by_instance',
 511          'classpath' => 'course/externallib.php',
 512          'description' => 'Return information about a given module name and instance id',
 513          'type' => 'read',
 514          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 515      ),
 516      'core_course_get_module' => array(
 517          'classname'   => 'core_course_external',
 518          'methodname'  => 'get_module',
 519          'classpath'   => 'course/externallib.php',
 520          'description' => 'Returns html with one activity module on course page',
 521          'type'        => 'read',
 522          'ajax'        => true,
 523      ),
 524      'core_courseformat_file_handlers' => [
 525          'classname'     => 'core_courseformat\external\file_handlers',
 526          'description'   => 'Get the current course file hanlders.',
 527          'type'          => 'read',
 528          'ajax'          => true,
 529      ],
 530      'core_courseformat_get_state' => [
 531          'classname'     => 'core_courseformat\external\get_state',
 532          'description'   => 'Get the current course state.',
 533          'type'          => 'read',
 534          'ajax'          => true,
 535      ],
 536      'core_courseformat_update_course' => [
 537          'classname'     => 'core_courseformat\external\update_course',
 538          'methodname'    => 'execute',
 539          'description'   => 'Update course contents.',
 540          'type'          => 'write',
 541          'ajax'          => true,
 542          'capabilities'  => 'moodle/course:sectionvisibility, moodle/course:activityvisibility',
 543      ],
 544      'core_course_edit_module' => array(
 545          'classname'   => 'core_course_external',
 546          'methodname'  => 'edit_module',
 547          'classpath'   => 'course/externallib.php',
 548          'description' => 'Performs an action on course module (change visibility, duplicate, delete, etc.)',
 549          'type'        => 'write',
 550          'ajax'        => true,
 551      ),
 552      'core_course_edit_section' => array(
 553          'classname'   => 'core_course_external',
 554          'methodname'  => 'edit_section',
 555          'classpath'   => 'course/externallib.php',
 556          'description' => 'Performs an action on course section (change visibility, set marker, delete)',
 557          'type'        => 'write',
 558          'ajax'        => true,
 559      ),
 560      'core_course_get_courses' => array(
 561          'classname' => 'core_course_external',
 562          'methodname' => 'get_courses',
 563          'classpath' => 'course/externallib.php',
 564          'description' => 'Return course details',
 565          'type' => 'read',
 566          'capabilities' => 'moodle/course:view, moodle/course:update, moodle/course:viewhiddencourses',
 567          'ajax' => true,
 568          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 569      ),
 570      'core_course_import_course' => array(
 571          'classname' => 'core_course_external',
 572          'methodname' => 'import_course',
 573          'classpath' => 'course/externallib.php',
 574          'description' => 'Import course data from a course into another course. Does not include any user data.',
 575          'type' => 'write',
 576          'capabilities' => 'moodle/backup:backuptargetimport, moodle/restore:restoretargetimport'
 577      ),
 578      'core_course_search_courses' => array(
 579          'classname' => 'core_course_external',
 580          'methodname' => 'search_courses',
 581          'classpath' => 'course/externallib.php',
 582          'description' => 'Search courses by (name, module, block, tag)',
 583          'type' => 'read',
 584          'ajax' => true,
 585          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 586      ),
 587      'core_course_update_categories' => array(
 588          'classname' => 'core_course_external',
 589          'methodname' => 'update_categories',
 590          'classpath' => 'course/externallib.php',
 591          'description' => 'Update categories',
 592          'type' => 'write',
 593          'capabilities' => 'moodle/category:manage',
 594      ),
 595      'core_course_update_courses' => array(
 596          'classname' => 'core_course_external',
 597          'methodname' => 'update_courses',
 598          'classpath' => 'course/externallib.php',
 599          'description' => 'Update courses',
 600          'type' => 'write',
 601          'capabilities' => 'moodle/course:update, moodle/course:changecategory, moodle/course:changefullname, '
 602              . 'moodle/course:changeshortname, moodle/course:changeidnumber, moodle/course:changesummary, moodle/course:visibility'
 603      ),
 604      'core_course_view_course' => array(
 605          'classname' => 'core_course_external',
 606          'methodname' => 'view_course',
 607          'classpath' => 'course/externallib.php',
 608          'description' => 'Log that the course was viewed',
 609          'type' => 'write',
 610          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 611      ),
 612      'core_course_get_user_navigation_options' => array(
 613          'classname' => 'core_course_external',
 614          'methodname' => 'get_user_navigation_options',
 615          'classpath' => 'course/externallib.php',
 616          'description' => 'Return a list of navigation options in a set of courses that are avaialable or not for the current user.',
 617          'type' => 'read',
 618          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 619      ),
 620      'core_course_get_user_administration_options' => array(
 621          'classname' => 'core_course_external',
 622          'methodname' => 'get_user_administration_options',
 623          'classpath' => 'course/externallib.php',
 624          'description' => 'Return a list of administration options in a set of courses that are avaialable or not for the current
 625                              user.',
 626          'type' => 'read',
 627          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 628      ),
 629      'core_course_get_courses_by_field' => array(
 630          'classname' => 'core_course_external',
 631          'methodname' => 'get_courses_by_field',
 632          'classpath' => 'course/externallib.php',
 633          'description' => 'Get courses matching a specific field (id/s, shortname, idnumber, category)',
 634          'type' => 'read',
 635          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 636      ),
 637      'core_course_check_updates' => array(
 638          'classname' => 'core_course_external',
 639          'methodname' => 'check_updates',
 640          'classpath' => 'course/externallib.php',
 641          'description' => 'Check if there is updates affecting the user for the given course and contexts.',
 642          'type' => 'read',
 643          'ajax' => true,
 644          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 645      ),
 646      'core_course_get_updates_since' => array(
 647          'classname' => 'core_course_external',
 648          'methodname' => 'get_updates_since',
 649          'classpath' => 'course/externallib.php',
 650          'description' => 'Check if there are updates affecting the user for the given course since the given time stamp.',
 651          'type' => 'read',
 652          'ajax' => true,
 653          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 654      ),
 655      'core_course_get_enrolled_courses_by_timeline_classification' => array(
 656          'classname' => 'core_course_external',
 657          'methodname' => 'get_enrolled_courses_by_timeline_classification',
 658          'classpath' => 'course/externallib.php',
 659          'description' => 'List of enrolled courses for the given timeline classification (past, inprogress, or future).',
 660          'type' => 'read',
 661          'ajax' => true,
 662          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 663      ),
 664      'core_course_get_enrolled_courses_with_action_events_by_timeline_classification' => array(
 665          'classname' => '\core_course\external\get_enrolled_courses_with_action_events_by_timeline_classification',
 666          'methodname' => 'execute',
 667          'classpath' => '',
 668          'description' => 'List of enrolled courses with action events in a given timeframe, for the given timeline classification.',
 669          'type' => 'read',
 670          'ajax' => true,
 671          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 672      ),
 673      'core_course_get_recent_courses' => array(
 674          'classname' => 'core_course_external',
 675          'methodname' => 'get_recent_courses',
 676          'classpath' => 'course/externallib.php',
 677          'description' => 'List of courses a user has accessed most recently.',
 678          'type' => 'read',
 679          'ajax' => true,
 680          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 681      ),
 682      'core_course_set_favourite_courses' => array(
 683          'classname' => 'core_course_external',
 684          'methodname' => 'set_favourite_courses',
 685          'classpath' => 'course/externallib.php',
 686          'description' => 'Add a list of courses to the list of favourite courses.',
 687          'type' => 'read',
 688          'ajax' => true,
 689          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 690      ),
 691      'core_course_get_enrolled_users_by_cmid' => array(
 692          'classname' => 'core_course_external',
 693          'methodname' => 'get_enrolled_users_by_cmid',
 694          'classpath' => 'course/externallib.php',
 695          'description' => 'List users by course module id, filter by group and active enrolment status.',
 696          'type' => 'read',
 697          'ajax' => true,
 698      ),
 699      'core_course_add_content_item_to_user_favourites' => array(
 700          'classname' => 'core_course_external',
 701          'methodname' => 'add_content_item_to_user_favourites',
 702          'classpath' => 'course/externallib.php',
 703          'description' => 'Adds a content item (activity, resource or their subtypes) to the favourites for the user.',
 704          'type' => 'write',
 705          'ajax' => true,
 706      ),
 707      'core_course_remove_content_item_from_user_favourites' => array(
 708          'classname' => 'core_course_external',
 709          'methodname' => 'remove_content_item_from_user_favourites',
 710          'classpath' => 'course/externallib.php',
 711          'description' => 'Removes a content item (activity, resource or their subtypes) from the favourites for the user.',
 712          'type' => 'write',
 713          'ajax' => true,
 714      ),
 715      'core_course_get_course_content_items' => array(
 716          'classname' => 'core_course_external',
 717          'methodname' => 'get_course_content_items',
 718          'classpath' => 'course/externallib.php',
 719          'description' => 'Fetch all the content items (activities, resources and their subtypes) for the activity picker',
 720          'type' => 'read',
 721          'ajax' => true,
 722      ),
 723      'core_course_get_activity_chooser_footer' => array(
 724          'classname' => 'core_course_external',
 725          'methodname' => 'get_activity_chooser_footer',
 726          'classpath' => 'course/externallib.php',
 727          'description' => 'Fetch the data for the activity chooser footer.',
 728          'type' => 'read',
 729          'ajax' => true,
 730      ),
 731      'core_course_toggle_activity_recommendation' => array(
 732          'classname' => 'core_course_external',
 733          'methodname' => 'toggle_activity_recommendation',
 734          'classpath' => 'course/externallib.php',
 735          'description' => 'Adds or removes an activity as a recommendation in the activity chooser.',
 736          'type' => 'write',
 737          'ajax' => true,
 738      ),
 739      'core_enrol_get_course_enrolment_methods' => array(
 740          'classname' => 'core_enrol_external',
 741          'methodname' => 'get_course_enrolment_methods',
 742          'classpath' => 'enrol/externallib.php',
 743          'description' => 'Get the list of course enrolment methods',
 744          'type' => 'read',
 745          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 746      ),
 747      'core_enrol_get_enrolled_users' => array(
 748          'classname' => 'core_enrol_external',
 749          'methodname' => 'get_enrolled_users',
 750          'classpath' => 'enrol/externallib.php',
 751          'description' => 'Get enrolled users by course id.',
 752          'type' => 'read',
 753          'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, '
 754              . 'moodle/site:accessallgroups',
 755          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 756      ),
 757      'core_enrol_get_enrolled_users_with_capability' => array(
 758          'classname' => 'core_enrol_external',
 759          'methodname' => 'get_enrolled_users_with_capability',
 760          'classpath' => 'enrol/externallib.php',
 761          'description' => 'For each course and capability specified, return a list of the users that are enrolled in the course
 762                                    and have that capability',
 763          'type' => 'read',
 764      ),
 765      'core_enrol_get_potential_users' => array(
 766          'classname' => 'core_enrol_external',
 767          'methodname' => 'get_potential_users',
 768          'classpath' => 'enrol/externallib.php',
 769          'description' => 'Get the list of potential users to enrol',
 770          'ajax' => true,
 771          'type' => 'read',
 772          'capabilities' => 'moodle/course:enrolreview'
 773      ),
 774      'core_enrol_search_users' => [
 775          'classname' => 'core_enrol_external',
 776          'methodname' => 'search_users',
 777          'classpath' => 'enrol/externallib.php',
 778          'description' => 'Search within the list of course participants',
 779          'ajax' => true,
 780          'type' => 'read',
 781          'capabilities' => 'moodle/course:viewparticipants',
 782          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 783      ],
 784      'core_enrol_get_users_courses' => array(
 785          'classname' => 'core_enrol_external',
 786          'methodname' => 'get_users_courses',
 787          'classpath' => 'enrol/externallib.php',
 788          'description' => 'Get the list of courses where a user is enrolled in',
 789          'type' => 'read',
 790          'capabilities' => 'moodle/course:viewparticipants',
 791          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 792      ),
 793      'core_enrol_submit_user_enrolment_form' => array(
 794          'classname' => 'core_enrol_external',
 795          'methodname' => 'submit_user_enrolment_form',
 796          'classpath' => 'enrol/externallib.php',
 797          'description' => 'Submit form data for enrolment form',
 798          'type' => 'write',
 799          'ajax' => true,
 800      ),
 801      'core_enrol_unenrol_user_enrolment' => array(
 802          'classname' => 'core_enrol_external',
 803          'methodname' => 'unenrol_user_enrolment',
 804          'classpath' => 'enrol/externallib.php',
 805          'description' => 'External function that unenrols a given user enrolment',
 806          'type' => 'write',
 807          'ajax' => true,
 808      ),
 809      'core_fetch_notifications' => array(
 810          'classname' => 'core_external',
 811          'methodname' => 'fetch_notifications',
 812          'classpath' => 'lib/external/externallib.php',
 813          'description' => 'Return a list of notifications for the current session',
 814          'type' => 'read',
 815          'loginrequired' => false,
 816          'ajax' => true,
 817          'readonlysession' => false, // Fetching removes from stack.
 818      ),
 819      'core_session_touch' => array(
 820          'classname' => 'core\session\external',
 821          'methodname' => 'touch_session',
 822          'description' => 'Keep the users session alive',
 823          'type' => 'read',
 824          'loginrequired' => true,
 825          'ajax' => true,
 826      ),
 827      'core_session_time_remaining' => array(
 828          'classname' => 'core\session\external',
 829          'methodname' => 'time_remaining',
 830          'description' => 'Count the seconds remaining in this session',
 831          'type' => 'read',
 832          'loginrequired' => true,
 833          'ajax' => true,
 834      ),
 835      'core_files_get_files' => array(
 836          'classname' => 'core_files_external',
 837          'methodname' => 'get_files',
 838          'description' => 'browse moodle files',
 839          'type' => 'read',
 840          'classpath' => 'files/externallib.php',
 841          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 842      ),
 843      'core_files_upload' => array(
 844          'classname' => 'core_files_external',
 845          'methodname' => 'upload',
 846          'description' => 'upload a file to moodle',
 847          'type'        => 'write',
 848          'classpath'   => 'files/externallib.php',
 849      ),
 850      'core_files_delete_draft_files' => array(
 851          'classname' => 'core_files\external\delete\draft',
 852          'description' => 'Delete the indicated files (or directories) from a user draft file area.',
 853          'type'        => 'write',
 854          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 855      ),
 856      'core_files_get_unused_draft_itemid' => array(
 857          'classname' => 'core_files\external\get\unused_draft',
 858          'description' => 'Generate a new draft itemid for the current user.',
 859          'type'        => 'write',
 860          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 861      ),
 862      'core_form_get_filetypes_browser_data' => array(
 863          'classname' => 'core_form\external',
 864          'methodname' => 'get_filetypes_browser_data',
 865          'classpath' => '',
 866          'description' => 'Provides data for the filetypes element browser.',
 867          'type' => 'read',
 868          'loginrequired' => false,
 869          'ajax' => true,
 870      ),
 871      'core_form_dynamic_form' => array(
 872          'classname' => 'core_form\external\dynamic_form',
 873          'description' => 'Process submission of a dynamic (modal) form',
 874          'type' => 'write',
 875          'ajax' => true,
 876      ),
 877      'core_get_component_strings' => array(
 878          'classname' => 'core_external',
 879          'methodname' => 'get_component_strings',
 880          'classpath' => 'lib/external/externallib.php',
 881          'description' => 'Return all raw strings (with {$a->xxx}), for a specific component ' .
 882              '- similar to core get_component_strings(), call',
 883          'type' => 'read',
 884          'loginrequired' => false,
 885          'ajax' => true,
 886          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
 887      ),
 888      'core_get_fragment' => array(
 889          'classname' => 'core_external',
 890          'methodname' => 'get_fragment',
 891          'classpath' => 'lib/external/externallib.php',
 892          'description' => 'Return a fragment for inclusion, such as a JavaScript page.',
 893          'type' => 'read',
 894          'ajax' => true,
 895      ),
 896      'core_get_string' => array(
 897          'classname' => 'core_external',
 898          'methodname' => 'get_string',
 899          'classpath' => 'lib/external/externallib.php',
 900          'description' => 'Return a translated string - similar to core get_string(), call',
 901          'type' => 'read',
 902          'loginrequired' => false,
 903          'ajax' => true,
 904      ),
 905      'core_get_strings' => array(
 906          'classname' => 'core_external',
 907          'methodname' => 'get_strings',
 908          'classpath' => 'lib/external/externallib.php',
 909          'description' => 'Return some translated strings - like several core get_string(), calls',
 910          'type' => 'read',
 911          'loginrequired' => false,
 912          'ajax' => true,
 913      ),
 914      'core_get_user_dates' => array(
 915          'classname' => 'core_external',
 916          'methodname' => 'get_user_dates',
 917          'classpath' => 'lib/external/externallib.php',
 918          'description' => 'Return formatted timestamps',
 919          'type' => 'read',
 920          'ajax' => true,
 921      ),
 922      'core_grades_update_grades' => array(
 923          'classname' => 'core_grades_external',
 924          'methodname' => 'update_grades',
 925          'description' => 'Update a grade item and associated student grades.',
 926          'type' => 'write',
 927      ),
 928      'core_grades_grader_gradingpanel_point_fetch' => [
 929          'classname' => 'core_grades\\grades\\grader\\gradingpanel\\point\\external\\fetch',
 930          'description' => 'Fetch the data required to display the grader grading panel for simple grading, ' .
 931              'creating the grade item if required',
 932          'type' => 'write',
 933          'ajax' => true,
 934          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
 935      ],
 936      'core_grades_grader_gradingpanel_point_store' => [
 937          'classname' => 'core_grades\\grades\\grader\\gradingpanel\\point\\external\\store',
 938          'description' => 'Store the data required to display the grader grading panel for simple grading',
 939          'type' => 'write',
 940          'ajax' => true,
 941          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
 942      ],
 943      'core_grades_grader_gradingpanel_scale_fetch' => [
 944          'classname' => 'core_grades\\grades\\grader\\gradingpanel\\scale\\external\\fetch',
 945          'description' => 'Fetch the data required to display the grader grading panel for scale-based grading, ' .
 946              'creating the grade item if required',
 947          'type' => 'write',
 948          'ajax' => true,
 949          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
 950      ],
 951      'core_grades_grader_gradingpanel_scale_store' => [
 952          'classname' => 'core_grades\\grades\\grader\\gradingpanel\\scale\\external\\store',
 953          'description' => 'Store the data required to display the grader grading panel for scale-based grading',
 954          'type' => 'write',
 955          'ajax' => true,
 956          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
 957      ],
 958      'core_grades_create_gradecategories' => array (
 959          'classname' => 'core_grades\external\create_gradecategories',
 960          'description' => 'Create grade categories inside a course gradebook.',
 961          'type' => 'write',
 962          'capabilities' => 'moodle/grade:manage',
 963      ),
 964      'core_grades_get_enrolled_users_for_search_widget' => array (
 965          'classname' => 'core_grades\external\get_enrolled_users_for_search_widget',
 966          'description' => '** DEPRECATED ** Please do not call this function any more. ' .
 967              'Use core_grades_get_enrolled_users_for_selector instead. ' .
 968              'Returns the enrolled users within and map some fields to the returned array of user objects.',
 969          'type' => 'read',
 970          'ajax' => true,
 971          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
 972      ),
 973      'core_grades_get_enrolled_users_for_selector' => array (
 974          'classname' => 'core_grades\external\get_enrolled_users_for_selector',
 975          'description' => 'Returns the enrolled users within and map some fields to the returned array of user objects.',
 976          'type' => 'read',
 977          'ajax' => true,
 978          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
 979      ),
 980      'core_grades_get_groups_for_search_widget' => [
 981          'classname' => 'core_group\external\get_groups_for_selector',
 982          'description' => '** DEPRECATED ** Please do not call this function any more. ' .
 983              'Use core_group_get_groups_for_selector instead. ' .
 984              'Get the group/(s) for a course',
 985          'type' => 'read',
 986          'ajax' => true,
 987          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
 988      ],
 989      'core_grades_get_groups_for_selector' => [
 990          'classname' => 'core_group\external\get_groups_for_selector',
 991          'description' => '** DEPRECATED ** Please do not call this function any more. ' .
 992              'Use core_group_get_groups_for_selector instead. ' .
 993              'Get the group/(s) for a course',
 994          'type' => 'read',
 995          'ajax' => true,
 996          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
 997      ],
 998      'core_grades_get_feedback' => [
 999          'classname' => 'core_grades\external\get_feedback',
1000          'description' => 'Get the feedback data for a grade item',
1001          'type' => 'read',
1002          'ajax' => true,
1003          ],
1004      'core_grades_get_gradeitems' => [
1005          'classname' => 'core_grades\external\get_gradeitems',
1006          'description' => 'Get the gradeitems for a course',
1007          'type' => 'read',
1008          'ajax' => true,
1009          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1010      ],
1011      'core_grades_get_grade_tree' => [
1012          'classname' => 'core_grades\external\get_grade_tree',
1013          'description' => 'Get the grade tree structure for a course',
1014          'type' => 'read',
1015          'ajax' => true,
1016      ],
1017      'core_grades_get_gradable_users' => [
1018          'classname' => 'core_grades\external\get_gradable_users',
1019          'description' => 'Returns the gradable users in a course',
1020          'type' => 'read',
1021          'ajax' => true,
1022          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1023      ],
1024      'core_grading_get_definitions' => array(
1025          'classname' => 'core_grading_external',
1026          'methodname' => 'get_definitions',
1027          'description' => 'Get grading definitions',
1028          'type' => 'read',
1029      ),
1030      'core_grading_get_gradingform_instances' => array(
1031          'classname' => 'core_grading_external',
1032          'methodname' => 'get_gradingform_instances',
1033          'description' => 'Get grading form instances',
1034          'type' => 'read',
1035      ),
1036      'core_grading_save_definitions' => array(
1037          'classname' => 'core_grading_external',
1038          'methodname' => 'save_definitions',
1039          'description' => 'Save grading definitions',
1040          'type' => 'write',
1041      ),
1042      'core_group_add_group_members' => array(
1043          'classname' => 'core_group_external',
1044          'methodname' => 'add_group_members',
1045          'classpath' => 'group/externallib.php',
1046          'description' => 'Adds group members.',
1047          'type' => 'write',
1048          'capabilities' => 'moodle/course:managegroups',
1049      ),
1050      'core_group_assign_grouping' => array(
1051          'classname' => 'core_group_external',
1052          'methodname' => 'assign_grouping',
1053          'classpath' => 'group/externallib.php',
1054          'description' => 'Assing groups from groupings',
1055          'type' => 'write',
1056      ),
1057      'core_group_create_groupings' => array(
1058          'classname' => 'core_group_external',
1059          'methodname' => 'create_groupings',
1060          'classpath' => 'group/externallib.php',
1061          'description' => 'Creates new groupings',
1062          'type' => 'write',
1063      ),
1064      'core_group_create_groups' => array(
1065          'classname' => 'core_group_external',
1066          'methodname' => 'create_groups',
1067          'classpath' => 'group/externallib.php',
1068          'description' => 'Creates new groups.',
1069          'type' => 'write',
1070          'capabilities' => 'moodle/course:managegroups'
1071      ),
1072      'core_group_delete_group_members' => array(
1073          'classname' => 'core_group_external',
1074          'methodname' => 'delete_group_members',
1075          'classpath' => 'group/externallib.php',
1076          'description' => 'Deletes group members.',
1077          'type' => 'write',
1078          'capabilities' => 'moodle/course:managegroups'
1079      ),
1080      'core_group_delete_groupings' => array(
1081          'classname' => 'core_group_external',
1082          'methodname' => 'delete_groupings',
1083          'classpath' => 'group/externallib.php',
1084          'description' => 'Deletes all specified groupings.',
1085          'type' => 'write',
1086      ),
1087      'core_group_delete_groups' => array(
1088          'classname' => 'core_group_external',
1089          'methodname' => 'delete_groups',
1090          'classpath' => 'group/externallib.php',
1091          'description' => 'Deletes all specified groups.',
1092          'type' => 'write',
1093          'capabilities' => 'moodle/course:managegroups'
1094      ),
1095      'core_group_get_activity_allowed_groups' => array(
1096          'classname' => 'core_group_external',
1097          'methodname' => 'get_activity_allowed_groups',
1098          'classpath' => 'group/externallib.php',
1099          'description' => 'Gets a list of groups that the user is allowed to access within the specified activity.',
1100          'type' => 'read',
1101          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1102      ),
1103      'core_group_get_activity_groupmode' => array(
1104          'classname' => 'core_group_external',
1105          'methodname' => 'get_activity_groupmode',
1106          'classpath' => 'group/externallib.php',
1107          'description' => 'Returns effective groupmode used in a given activity.',
1108          'type' => 'read',
1109          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1110      ),
1111      'core_group_get_course_groupings' => array(
1112          'classname' => 'core_group_external',
1113          'methodname' => 'get_course_groupings',
1114          'classpath' => 'group/externallib.php',
1115          'description' => 'Returns all groupings in specified course.',
1116          'type' => 'read',
1117          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1118      ),
1119      'core_group_get_course_groups' => array(
1120          'classname' => 'core_group_external',
1121          'methodname' => 'get_course_groups',
1122          'classpath' => 'group/externallib.php',
1123          'description' => 'Returns all groups in specified course.',
1124          'type' => 'read',
1125          'ajax' => true,
1126          'capabilities' => 'moodle/course:managegroups',
1127          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1128      ),
1129      'core_group_get_course_user_groups' => array(
1130          'classname' => 'core_group_external',
1131          'methodname' => 'get_course_user_groups',
1132          'classpath' => 'group/externallib.php',
1133          'description' => 'Returns all groups in specified course for the specified user.',
1134          'type' => 'read',
1135          'capabilities' => 'moodle/course:managegroups',
1136          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1137      ),
1138      'core_group_get_group_members' => array(
1139          'classname' => 'core_group_external',
1140          'methodname' => 'get_group_members',
1141          'classpath' => 'group/externallib.php',
1142          'description' => 'Returns group members.',
1143          'type' => 'read',
1144          'capabilities' => 'moodle/course:managegroups'
1145      ),
1146      'core_group_get_groupings' => array(
1147          'classname' => 'core_group_external',
1148          'methodname' => 'get_groupings',
1149          'classpath' => 'group/externallib.php',
1150          'description' => 'Returns groupings details.',
1151          'type' => 'read',
1152      ),
1153      'core_group_get_groups' => array(
1154          'classname' => 'core_group_external',
1155          'methodname' => 'get_groups',
1156          'classpath' => 'group/externallib.php',
1157          'description' => 'Returns group details.',
1158          'type' => 'read',
1159          'capabilities' => 'moodle/course:managegroups'
1160      ),
1161      'core_group_get_groups_for_selector' => [
1162          'classname' => 'core_group\external\get_groups_for_selector',
1163          'description' => 'Get the group/(s) for a course',
1164          'type' => 'read',
1165          'ajax' => true,
1166          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1167      ],
1168      'core_group_unassign_grouping' => array(
1169          'classname' => 'core_group_external',
1170          'methodname' => 'unassign_grouping',
1171          'classpath' => 'group/externallib.php',
1172          'description' => 'Unassing groups from groupings',
1173          'type' => 'write',
1174      ),
1175      'core_group_update_groupings' => array(
1176          'classname' => 'core_group_external',
1177          'methodname' => 'update_groupings',
1178          'classpath' => 'group/externallib.php',
1179          'description' => 'Updates existing groupings',
1180          'type' => 'write',
1181      ),
1182      'core_group_update_groups' => array(
1183          'classname' => 'core_group_external',
1184          'methodname' => 'update_groups',
1185          'classpath' => 'group/externallib.php',
1186          'description' => 'Updates existing groups.',
1187          'type' => 'write',
1188          'capabilities' => 'moodle/course:managegroups'
1189      ),
1190      'core_message_mute_conversations' => array(
1191          'classname' => 'core_message_external',
1192          'methodname' => 'mute_conversations',
1193          'classpath' => 'message/externallib.php',
1194          'description' => 'Mutes a list of conversations',
1195          'type' => 'write',
1196          'ajax' => true,
1197          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1198      ),
1199      'core_message_unmute_conversations' => array(
1200          'classname' => 'core_message_external',
1201          'methodname' => 'unmute_conversations',
1202          'classpath' => 'message/externallib.php',
1203          'description' => 'Unmutes a list of conversations',
1204          'type' => 'write',
1205          'ajax' => true,
1206          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1207      ),
1208      'core_message_block_user' => array(
1209          'classname' => 'core_message_external',
1210          'methodname' => 'block_user',
1211          'classpath' => 'message/externallib.php',
1212          'description' => 'Blocks a user',
1213          'type' => 'write',
1214          'ajax' => true,
1215          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1216      ),
1217      'core_message_get_contact_requests' => array(
1218          'classname' => 'core_message_external',
1219          'methodname' => 'get_contact_requests',
1220          'classpath' => 'message/externallib.php',
1221          'description' => 'Returns contact requests for a user',
1222          'type' => 'read',
1223          'ajax' => true,
1224          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1225      ),
1226      'core_message_create_contact_request' => array(
1227          'classname' => 'core_message_external',
1228          'methodname' => 'create_contact_request',
1229          'classpath' => 'message/externallib.php',
1230          'description' => 'Creates a contact request',
1231          'type' => 'write',
1232          'ajax' => true,
1233          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1234      ),
1235      'core_message_confirm_contact_request' => array(
1236          'classname' => 'core_message_external',
1237          'methodname' => 'confirm_contact_request',
1238          'classpath' => 'message/externallib.php',
1239          'description' => 'Confirms a contact request',
1240          'type' => 'write',
1241          'ajax' => true,
1242          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1243      ),
1244      'core_message_decline_contact_request' => array(
1245          'classname' => 'core_message_external',
1246          'methodname' => 'decline_contact_request',
1247          'classpath' => 'message/externallib.php',
1248          'description' => 'Declines a contact request',
1249          'type' => 'write',
1250          'ajax' => true,
1251          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1252      ),
1253      'core_message_get_received_contact_requests_count' => array(
1254          'classname' => 'core_message_external',
1255          'methodname' => 'get_received_contact_requests_count',
1256          'classpath' => 'message/externallib.php',
1257          'description' => 'Gets the number of received contact requests',
1258          'type' => 'read',
1259          'ajax' => true,
1260          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1261      ),
1262      'core_message_delete_contacts' => array(
1263          'classname' => 'core_message_external',
1264          'methodname' => 'delete_contacts',
1265          'classpath' => 'message/externallib.php',
1266          'description' => 'Remove contacts from the contact list',
1267          'type' => 'write',
1268          'ajax' => true,
1269          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1270      ),
1271      'core_message_delete_conversations_by_id' => array(
1272          'classname' => 'core_message_external',
1273          'methodname' => 'delete_conversations_by_id',
1274          'classpath' => 'message/externallib.php',
1275          'description' => 'Deletes a list of conversations.',
1276          'type' => 'write',
1277          'capabilities' => 'moodle/site:deleteownmessage',
1278          'ajax' => true,
1279          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1280      ),
1281      'core_message_delete_message' => array(
1282          'classname' => 'core_message_external',
1283          'methodname' => 'delete_message',
1284          'classpath' => 'message/externallib.php',
1285          'description' => 'Deletes a message.',
1286          'type' => 'write',
1287          'capabilities' => 'moodle/site:deleteownmessage',
1288          'ajax' => true,
1289          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1290      ),
1291      'core_message_get_blocked_users' => array(
1292          'classname' => 'core_message_external',
1293          'methodname' => 'get_blocked_users',
1294          'classpath' => 'message/externallib.php',
1295          'description' => 'Retrieve a list of users blocked',
1296          'type' => 'read',
1297          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1298      ),
1299      'core_message_data_for_messagearea_search_messages' => array(
1300          'classname' => 'core_message_external',
1301          'methodname' => 'data_for_messagearea_search_messages',
1302          'classpath' => 'message/externallib.php',
1303          'description' => 'Retrieve the template data for searching for messages',
1304          'type' => 'read',
1305          'ajax' => true,
1306          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1307      ),
1308      'core_message_message_search_users' => array(
1309          'classname' => 'core_message_external',
1310          'methodname' => 'message_search_users',
1311          'classpath' => 'message/externallib.php',
1312          'description' => 'Retrieve the data for searching for people',
1313          'type' => 'read',
1314          'ajax' => true,
1315          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1316      ),
1317      'core_message_get_user_contacts' => array(
1318          'classname' => 'core_message_external',
1319          'methodname' => 'get_user_contacts',
1320          'classpath' => 'message/externallib.php',
1321          'description' => 'Retrieve the contact list',
1322          'type' => 'read',
1323          'ajax' => true,
1324          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1325      ),
1326      'core_message_get_conversations' => array(
1327          'classname' => 'core_message_external',
1328          'methodname' => 'get_conversations',
1329          'classpath' => 'message/externallib.php',
1330          'description' => 'Retrieve a list of conversations for a user',
1331          'type' => 'read',
1332          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1333          'ajax' => true
1334      ),
1335      'core_message_get_conversation' => array(
1336          'classname' => 'core_message_external',
1337          'methodname' => 'get_conversation',
1338          'classpath' => 'message/externallib.php',
1339          'description' => 'Retrieve a conversation for a user',
1340          'type' => 'read',
1341          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1342          'ajax' => true
1343      ),
1344      'core_message_get_conversation_between_users' => array(
1345          'classname' => 'core_message_external',
1346          'methodname' => 'get_conversation_between_users',
1347          'classpath' => 'message/externallib.php',
1348          'description' => 'Retrieve a conversation for a user between another user',
1349          'type' => 'read',
1350          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1351          'ajax' => true
1352      ),
1353      'core_message_get_self_conversation' => array(
1354          'classname' => 'core_message_external',
1355          'methodname' => 'get_self_conversation',
1356          'classpath' => 'message/externallib.php',
1357          'description' => 'Retrieve a self-conversation for a user',
1358          'type' => 'read',
1359          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1360          'ajax' => true
1361      ),
1362      'core_message_get_messages' => array(
1363          'classname' => 'core_message_external',
1364          'methodname' => 'get_messages',
1365          'classpath' => 'message/externallib.php',
1366          'description' => 'Retrieve a list of messages sent and received by a user (conversations, notifications or both)',
1367          'type' => 'read',
1368          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1369          'ajax' => true,
1370      ),
1371      'core_message_get_conversation_counts' => array(
1372          'classname' => 'core_message_external',
1373          'methodname' => 'get_conversation_counts',
1374          'classpath' => 'message/externallib.php',
1375          'description' => 'Retrieve a list of conversation counts, indexed by type.',
1376          'type' => 'read',
1377          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1378          'ajax' => true,
1379      ),
1380      'core_message_get_unread_conversation_counts' => array(
1381          'classname' => 'core_message_external',
1382          'methodname' => 'get_unread_conversation_counts',
1383          'classpath' => 'message/externallib.php',
1384          'description' => 'Retrieve a list of unread conversation counts, indexed by type.',
1385          'type' => 'read',
1386          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1387          'ajax' => true,
1388      ),
1389      'core_message_get_conversation_members' => array(
1390          'classname' => 'core_message_external',
1391          'methodname' => 'get_conversation_members',
1392          'classpath' => 'message/externallib.php',
1393          'description' => 'Retrieve a list of members in a conversation',
1394          'type' => 'read',
1395          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1396          'ajax' => true,
1397      ),
1398      'core_message_get_member_info' => array(
1399          'classname' => 'core_message_external',
1400          'methodname' => 'get_member_info',
1401          'classpath' => 'message/externallib.php',
1402          'description' => 'Retrieve a user message profiles',
1403          'type' => 'read',
1404          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1405          'ajax' => true,
1406      ),
1407      'core_message_get_unread_conversations_count' => array(
1408          'classname' => 'core_message_external',
1409          'methodname' => 'get_unread_conversations_count',
1410          'classpath' => 'message/externallib.php',
1411          'description' => 'Retrieve the count of unread conversations for a given user',
1412          'type' => 'read',
1413          'ajax' => true,
1414          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1415          'readonlysession' => true, // We don't modify the session.
1416      ),
1417      'core_message_mark_all_notifications_as_read' => array(
1418          'classname' => 'core_message_external',
1419          'methodname' => 'mark_all_notifications_as_read',
1420          'classpath' => 'message/externallib.php',
1421          'description' => 'Mark all notifications as read for a given user',
1422          'type' => 'write',
1423          'ajax' => true,
1424          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1425      ),
1426      'core_message_mark_all_conversation_messages_as_read' => array(
1427          'classname' => 'core_message_external',
1428          'methodname' => 'mark_all_conversation_messages_as_read',
1429          'classpath' => 'message/externallib.php',
1430          'description' => 'Mark all conversation messages as read for a given user',
1431          'type' => 'write',
1432          'ajax' => true,
1433          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1434      ),
1435      'core_message_mark_message_read' => array(
1436          'classname' => 'core_message_external',
1437          'methodname' => 'mark_message_read',
1438          'classpath' => 'message/externallib.php',
1439          'description' => 'Mark a single message as read, trigger message_viewed event.',
1440          'type' => 'write',
1441          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1442          'ajax' => true,
1443      ),
1444      'core_message_mark_notification_read' => array(
1445          'classname' => 'core_message_external',
1446          'methodname' => 'mark_notification_read',
1447          'classpath' => 'message/externallib.php',
1448          'description' => 'Mark a single notification as read, trigger notification_viewed event.',
1449          'type' => 'write',
1450          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1451          'ajax' => true,
1452      ),
1453      'core_message_message_processor_config_form' => array(
1454          'classname' => 'core_message_external',
1455          'methodname' => 'message_processor_config_form',
1456          'classpath' => 'message/externallib.php',
1457          'description' => 'Process the message processor config form',
1458          'type' => 'write',
1459          'ajax' => true,
1460          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1461      ),
1462      'core_message_get_message_processor' => array(
1463          'classname' => 'core_message_external',
1464          'methodname' => 'get_message_processor',
1465          'classpath' => 'message/externallib.php',
1466          'description' => 'Get a message processor',
1467          'type' => 'read',
1468          'ajax' => true,
1469      ),
1470      'core_message_search_contacts' => array(
1471          'classname' => 'core_message_external',
1472          'methodname' => 'search_contacts',
1473          'classpath' => 'message/externallib.php',
1474          'description' => 'Search for contacts',
1475          'type' => 'read',
1476          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1477      ),
1478      'core_message_send_instant_messages' => array(
1479          'classname' => 'core_message_external',
1480          'methodname' => 'send_instant_messages',
1481          'classpath' => 'message/externallib.php',
1482          'description' => 'Send instant messages',
1483          'type' => 'write',
1484          'capabilities' => 'moodle/site:sendmessage',
1485          'ajax' => true,
1486          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1487      ),
1488      'core_message_send_messages_to_conversation' => array(
1489          'classname' => 'core_message_external',
1490          'methodname' => 'send_messages_to_conversation',
1491          'classpath' => 'message/externallib.php',
1492          'description' => 'Send messages to an existing conversation between users',
1493          'type' => 'write',
1494          'capabilities' => 'moodle/site:sendmessage',
1495          'ajax' => true,
1496          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1497      ),
1498      'core_message_get_conversation_messages' => array(
1499          'classname' => 'core_message_external',
1500          'methodname' => 'get_conversation_messages',
1501          'classpath' => 'message/externallib.php',
1502          'description' => 'Retrieve the conversation messages and relevant member information',
1503          'type' => 'read',
1504          'ajax' => true,
1505          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1506      ),
1507      'core_message_unblock_user' => array(
1508          'classname' => 'core_message_external',
1509          'methodname' => 'unblock_user',
1510          'classpath' => 'message/externallib.php',
1511          'description' => 'Unblocks a user',
1512          'type' => 'write',
1513          'ajax' => true,
1514          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1515      ),
1516      'core_message_get_user_notification_preferences' => array(
1517          'classname' => 'core_message_external',
1518          'methodname' => 'get_user_notification_preferences',
1519          'classpath' => 'message/externallib.php',
1520          'description' => 'Get the notification preferences for a given user.',
1521          'type' => 'read',
1522          'capabilities' => 'moodle/user:editownmessageprofile',
1523          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1524      ),
1525      'core_message_get_user_message_preferences' => array(
1526          'classname' => 'core_message_external',
1527          'methodname' => 'get_user_message_preferences',
1528          'classpath' => 'message/externallib.php',
1529          'description' => 'Get the message preferences for a given user.',
1530          'type' => 'read',
1531          'capabilities' => 'moodle/user:editownmessageprofile',
1532          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1533          'ajax' => true
1534      ),
1535      'core_message_set_favourite_conversations' => array(
1536          'classname' => 'core_message_external',
1537          'methodname' => 'set_favourite_conversations',
1538          'classpath' => 'message/externallib.php',
1539          'description' => 'Mark a conversation or group of conversations as favourites/starred conversations.',
1540          'type' => 'write',
1541          'ajax' => true,
1542          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1543      ),
1544      'core_message_unset_favourite_conversations' => array(
1545          'classname' => 'core_message_external',
1546          'methodname' => 'unset_favourite_conversations',
1547          'classpath' => 'message/externallib.php',
1548          'description' => 'Unset a conversation or group of conversations as favourites/starred conversations.',
1549          'type' => 'write',
1550          'ajax' => true,
1551          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1552      ),
1553      'core_message_delete_message_for_all_users' => array(
1554          'classname' => 'core_message_external',
1555          'methodname' => 'delete_message_for_all_users',
1556          'classpath' => 'message/externallib.php',
1557          'description' => 'Deletes a message for all users.',
1558          'type' => 'write',
1559          'capabilities' => 'moodle/site:deleteanymessage',
1560          'ajax' => true,
1561          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1562      ),
1563      'core_message_get_unread_notification_count' => [
1564          'classname'     => '\core_message\external\get_unread_notification_count',
1565          'description'   => 'Get number of unread notifications.',
1566          'type'          => 'read',
1567          'services'      => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1568      ],
1569      'core_my_view_page' => [
1570          'classname'     => '\core_my\external\view_page',
1571          'methodname'    => 'execute',
1572          'description'   => 'Trigger the My or Dashboard viewed event.',
1573          'type'          => 'write',
1574          'services'      => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1575      ],
1576      'core_notes_create_notes' => array(
1577          'classname' => 'core_notes_external',
1578          'methodname' => 'create_notes',
1579          'classpath' => 'notes/externallib.php',
1580          'description' => 'Create notes',
1581          'type' => 'write',
1582          'ajax' => true,
1583          'capabilities' => 'moodle/notes:manage',
1584          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1585      ),
1586      'core_notes_delete_notes' => array(
1587          'classname' => 'core_notes_external',
1588          'methodname' => 'delete_notes',
1589          'classpath' => 'notes/externallib.php',
1590          'description' => 'Delete notes',
1591          'type' => 'write',
1592          'capabilities' => 'moodle/notes:manage',
1593          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1594      ),
1595      'core_notes_get_course_notes' => array(
1596          'classname' => 'core_notes_external',
1597          'methodname' => 'get_course_notes',
1598          'classpath' => 'notes/externallib.php',
1599          'description' => 'Returns all notes in specified course (or site), for the specified user.',
1600          'type' => 'read',
1601          'capabilities' => 'moodle/notes:view',
1602          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1603      ),
1604      'core_notes_get_notes' => array(
1605          'classname' => 'core_notes_external',
1606          'methodname' => 'get_notes',
1607          'classpath' => 'notes/externallib.php',
1608          'description' => 'Get notes',
1609          'type' => 'read',
1610          'capabilities' => 'moodle/notes:view'
1611      ),
1612      'core_notes_update_notes' => array(
1613          'classname' => 'core_notes_external',
1614          'methodname' => 'update_notes',
1615          'classpath' => 'notes/externallib.php',
1616          'description' => 'Update notes',
1617          'type' => 'write',
1618          'capabilities' => 'moodle/notes:manage'
1619      ),
1620      'core_notes_view_notes' => array(
1621          'classname' => 'core_notes_external',
1622          'methodname' => 'view_notes',
1623          'classpath' => 'notes/externallib.php',
1624          'description' => 'Simulates the web interface view of notes/index.php: trigger events.',
1625          'type' => 'write',
1626          'capabilities' => 'moodle/notes:view',
1627          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1628      ),
1629      'core_output_load_template' => array(
1630          'classname' => 'core\output\external',
1631          'methodname' => 'load_template',
1632          'description' => 'Load a template for a renderable',
1633          'type' => 'read',
1634          'loginrequired' => false,
1635          'ajax' => true,
1636      ),
1637      'core_output_load_template_with_dependencies' => array(
1638          'classname' => 'core\output\external',
1639          'methodname' => 'load_template_with_dependencies',
1640          'description' => 'Load a template and its dependencies for a renderable',
1641          'type' => 'read',
1642          'loginrequired' => false,
1643          'ajax' => true,
1644      ),
1645      'core_output_load_fontawesome_icon_map' => array(
1646          'classname' => 'core\output\external',
1647          'methodname' => 'load_fontawesome_icon_map',
1648          'description' => 'Load the mapping of names to icons',
1649          'type' => 'read',
1650          'loginrequired' => false,
1651          'ajax' => true,
1652      ),
1653      'core_output_load_fontawesome_icon_system_map' => array(
1654          'classname' => 'core\external\output\icon_system\load_fontawesome_map',
1655          'description' => 'Load the mapping of moodle pix names to fontawesome icon names',
1656          'type' => 'read',
1657          'loginrequired' => false,
1658          'ajax' => true,
1659      ),
1660      // Question related functions.
1661      'core_question_update_flag' => array(
1662          'classname'     => 'core_question_external',
1663          'methodname'    => 'update_flag',
1664          'description'   => 'Update the flag state of a question attempt.',
1665          'type'          => 'write',
1666          'capabilities'  => 'moodle/question:flag',
1667          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1668      ),
1669      'core_question_submit_tags_form' => array(
1670          'classname'     => 'core_question_external',
1671          'methodname'    => 'submit_tags_form',
1672          'description'   => 'Update the question tags.',
1673          'type'          => 'write',
1674          'ajax' => true,
1675      ),
1676      'core_question_get_random_question_summaries' => array(
1677          'classname' => 'core_question_external',
1678          'methodname' => 'get_random_question_summaries',
1679          'description' => 'Get the random question set for a criteria',
1680          'type' => 'read',
1681          'ajax' => true,
1682      ),
1683      'core_rating_get_item_ratings' => array(
1684          'classname' => 'core_rating_external',
1685          'methodname' => 'get_item_ratings',
1686          'description' => 'Retrieve all the ratings for an item.',
1687          'type' => 'read',
1688          'capabilities' => 'moodle/rating:view',
1689          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1690      ),
1691      'core_rating_add_rating' => array(
1692          'classname' => 'core_rating_external',
1693          'methodname' => 'add_rating',
1694          'description' => 'Rates an item.',
1695          'type' => 'write',
1696          'capabilities' => 'moodle/rating:rate',
1697          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1698      ),
1699      'core_role_assign_roles' => array(
1700          'classname' => 'core_role_external',
1701          'methodname' => 'assign_roles',
1702          'classpath' => 'enrol/externallib.php',
1703          'description' => 'Manual role assignments.',
1704          'type' => 'write',
1705          'capabilities' => 'moodle/role:assign'
1706      ),
1707      'core_role_unassign_roles' => array(
1708          'classname' => 'core_role_external',
1709          'methodname' => 'unassign_roles',
1710          'classpath' => 'enrol/externallib.php',
1711          'description' => 'Manual role unassignments.',
1712          'type' => 'write',
1713          'capabilities' => 'moodle/role:assign'
1714      ),
1715      'core_search_get_relevant_users' => array(
1716          'classname' => '\core_search\external',
1717          'methodname' => 'get_relevant_users',
1718          'description' => 'Gets relevant users for a search request.',
1719          'type' => 'read',
1720          'ajax' => true
1721      ),
1722      'core_search_get_results' => [
1723          'classname' => '\core_search\external\get_results',
1724          'description' => 'Get search results.',
1725          'type' => 'read',
1726          'capabilities' => 'moodle/search:query',
1727          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1728      ],
1729      'core_search_get_search_areas_list' => [
1730          'classname' => '\core_search\external\get_search_areas_list',
1731          'description' => 'Get search areas.',
1732          'type' => 'read',
1733          'capabilities' => 'moodle/search:query',
1734          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1735      ],
1736      'core_search_view_results' => [
1737          'classname' => '\core_search\external\view_results',
1738          'description' => 'Trigger view search results event.',
1739          'type' => 'write',
1740          'capabilities' => 'moodle/search:query',
1741          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1742      ],
1743      'core_search_get_top_results' => [
1744          'classname' => '\core_search\external\get_top_results',
1745          'description' => 'Get top search results.',
1746          'type' => 'read',
1747          'capabilities' => 'moodle/search:query',
1748          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
1749      ],
1750      'core_tag_get_tagindex' => array(
1751          'classname' => 'core_tag_external',
1752          'methodname' => 'get_tagindex',
1753          'description' => 'Gets tag index page for one tag and one tag area',
1754          'type' => 'read',
1755          'ajax' => true,
1756          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1757      ),
1758      'core_tag_get_tags' => array(
1759          'classname' => 'core_tag_external',
1760          'methodname' => 'get_tags',
1761          'description' => 'Gets tags by their ids',
1762          'type' => 'read',
1763          'ajax' => true,
1764      ),
1765      'core_tag_update_tags' => array(
1766          'classname' => 'core_tag_external',
1767          'methodname' => 'update_tags',
1768          'description' => 'Updates tags',
1769          'type' => 'write',
1770          'ajax' => true,
1771      ),
1772      'core_tag_get_tagindex_per_area' => array(
1773          'classname' => 'core_tag_external',
1774          'methodname' => 'get_tagindex_per_area',
1775          'description' => 'Gets tag index page per different areas.',
1776          'type' => 'read',
1777          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1778      ),
1779      'core_tag_get_tag_areas' => array(
1780          'classname' => 'core_tag_external',
1781          'methodname' => 'get_tag_areas',
1782          'description' => 'Retrieves existing tag areas.',
1783          'type' => 'read',
1784          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1785      ),
1786      'core_tag_get_tag_collections' => array(
1787          'classname' => 'core_tag_external',
1788          'methodname' => 'get_tag_collections',
1789          'description' => 'Retrieves existing tag collections.',
1790          'type' => 'read',
1791          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1792      ),
1793      'core_tag_get_tag_cloud' => array(
1794          'classname' => 'core_tag_external',
1795          'methodname' => 'get_tag_cloud',
1796          'description' => 'Retrieves a tag cloud for the given collection and/or query search.',
1797          'type' => 'read',
1798          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1799      ),
1800      'core_update_inplace_editable' => array(
1801          'classname' => 'core_external',
1802          'methodname' => 'update_inplace_editable',
1803          'classpath' => 'lib/external/externallib.php',
1804          'description' => 'Generic service to update title',
1805          'type' => 'write',
1806          'loginrequired' => true,
1807          'ajax' => true,
1808      ),
1809      'core_user_add_user_device' => array(
1810          'classname' => 'core_user_external',
1811          'methodname' => 'add_user_device',
1812          'classpath' => 'user/externallib.php',
1813          'description' => 'Store mobile user devices information for PUSH Notifications.',
1814          'type' => 'write',
1815          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1816      ),
1817      'core_user_update_user_device_public_key' => array(
1818          'classname' => '\core_user\external\update_user_device_public_key',
1819          'description' => 'Store mobile user public key.',
1820          'type' => 'write',
1821          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1822      ),
1823      'core_user_add_user_private_files' => array(
1824          'classname' => 'core_user_external',
1825          'methodname' => 'add_user_private_files',
1826          'classpath' => 'user/externallib.php',
1827          'description' => 'Copy files from a draft area to users private files area.',
1828          'type' => 'write',
1829          'capabilities' => 'moodle/user:manageownfiles',
1830          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1831      ),
1832      'core_user_create_users' => array(
1833          'classname' => 'core_user_external',
1834          'methodname' => 'create_users',
1835          'classpath' => 'user/externallib.php',
1836          'description' => 'Create users.',
1837          'type' => 'write',
1838          'capabilities' => 'moodle/user:create'
1839      ),
1840      'core_user_delete_users' => array(
1841          'classname' => 'core_user_external',
1842          'methodname' => 'delete_users',
1843          'classpath' => 'user/externallib.php',
1844          'description' => 'Delete users.',
1845          'type' => 'write',
1846          'capabilities' => 'moodle/user:delete'
1847      ),
1848      'core_user_get_course_user_profiles' => array(
1849          'classname' => 'core_user_external',
1850          'methodname' => 'get_course_user_profiles',
1851          'classpath' => 'user/externallib.php',
1852          'description' => 'Get course user profiles (each of the profils matching a course id and a user id),.',
1853          'type' => 'read',
1854          'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, '
1855              . 'moodle/site:accessallgroups',
1856          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1857      ),
1858      'core_user_get_users' => array(
1859          'classname' => 'core_user_external',
1860          'methodname' => 'get_users',
1861          'classpath' => 'user/externallib.php',
1862          'description' => 'search for users matching the parameters',
1863          'type' => 'read',
1864          'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update'
1865      ),
1866      'core_user_get_users_by_field' => array(
1867          'classname' => 'core_user_external',
1868          'methodname' => 'get_users_by_field',
1869          'classpath' => 'user/externallib.php',
1870          'description' => 'Retrieve users\' information for a specified unique field - If you want to do a user search, use '
1871              . 'core_user_get_users() or core_user_search_identity().',
1872          'type' => 'read',
1873          'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
1874          'ajax' => true,
1875          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1876      ),
1877      'core_user_search_identity' => array(
1878          'classname' => '\core_user\external\search_identity',
1879          'description' => 'Return list of users identities matching the given criteria in their name or other identity fields.',
1880          'type' => 'read',
1881          'capabilities' => 'moodle/user:viewalldetails',
1882          'ajax' => true,
1883          'loginrequired' => true,
1884      ),
1885      'core_user_remove_user_device' => array(
1886          'classname' => 'core_user_external',
1887          'methodname' => 'remove_user_device',
1888          'classpath' => 'user/externallib.php',
1889          'description' => 'Remove a user device from the Moodle database.',
1890          'type' => 'write',
1891          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1892      ),
1893      'core_user_update_users' => array(
1894          'classname' => 'core_user_external',
1895          'methodname' => 'update_users',
1896          'classpath' => 'user/externallib.php',
1897          'description' => 'Update users.',
1898          'type' => 'write',
1899          'capabilities' => 'moodle/user:update',
1900          'ajax' => true,
1901      ),
1902      'core_user_update_user_preferences' => array(
1903          'classname' => 'core_user_external',
1904          'methodname' => 'update_user_preferences',
1905          'classpath' => 'user/externallib.php',
1906          'description' => 'Update a user\'s preferences',
1907          'type' => 'write',
1908          'capabilities' => 'moodle/user:editownmessageprofile, moodle/user:editmessageprofile',
1909          'ajax' => true,
1910          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1911      ),
1912      'core_user_view_user_list' => array(
1913          'classname' => 'core_user_external',
1914          'methodname' => 'view_user_list',
1915          'classpath' => 'user/externallib.php',
1916          'description' => 'Simulates the web-interface view of user/index.php (triggering events),.',
1917          'type' => 'write',
1918          'capabilities' => 'moodle/course:viewparticipants',
1919          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1920      ),
1921      'core_user_view_user_profile' => array(
1922          'classname' => 'core_user_external',
1923          'methodname' => 'view_user_profile',
1924          'classpath' => 'user/externallib.php',
1925          'description' => 'Simulates the web-interface view of user/view.php and user/profile.php (triggering events),.',
1926          'type' => 'write',
1927          'capabilities' => 'moodle/user:viewdetails',
1928          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1929      ),
1930      'core_user_get_user_preferences' => array(
1931          'classname' => 'core_user_external',
1932          'methodname' => 'get_user_preferences',
1933          'classpath' => 'user/externallib.php',
1934          'description' => 'Return user preferences.',
1935          'type' => 'read',
1936          'ajax' => true,
1937          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1938      ),
1939      'core_user_update_picture' => array(
1940          'classname' => 'core_user_external',
1941          'methodname' => 'update_picture',
1942          'classpath' => 'user/externallib.php',
1943          'description' => 'Update or delete the user picture in the site',
1944          'type' => 'write',
1945          'capabilities' => 'moodle/user:editownprofile, moodle/user:editprofile',
1946          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1947      ),
1948      'core_user_set_user_preferences' => array(
1949          'classname' => 'core_user_external',
1950          'methodname' => 'set_user_preferences',
1951          'classpath' => 'user/externallib.php',
1952          'description' => 'Set user preferences.',
1953          'type' => 'write',
1954          'capabilities' => 'moodle/site:config',
1955          'ajax' => true,
1956          'loginrequired' => false,
1957          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1958      ),
1959      'core_user_agree_site_policy' => array(
1960          'classname' => 'core_user_external',
1961          'methodname' => 'agree_site_policy',
1962          'classpath' => 'user/externallib.php',
1963          'description' => 'Agree the site policy for the current user.',
1964          'type' => 'write',
1965          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1966      ),
1967      'core_user_get_private_files_info' => array(
1968          'classname' => 'core_user_external',
1969          'methodname' => 'get_private_files_info',
1970          'classpath' => 'user/externallib.php',
1971          'description' => 'Returns general information about files in the user private files area.',
1972          'type' => 'read',
1973          'capabilities' => 'moodle/user:manageownfiles',
1974          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1975      ),
1976  
1977      // Competencies functions.
1978      'core_competency_create_competency_framework' => array(
1979          'classname'    => 'core_competency\external',
1980          'methodname'   => 'create_competency_framework',
1981          'classpath'    => '',
1982          'description'  => 'Creates new competency frameworks.',
1983          'type'         => 'write',
1984          'capabilities' => 'moodle/competency:competencymanage',
1985          'ajax'         => true,
1986      ),
1987      'core_competency_read_competency_framework' => array(
1988          'classname'    => 'core_competency\external',
1989          'methodname'   => 'read_competency_framework',
1990          'classpath'    => '',
1991          'description'  => 'Load a summary of a competency framework.',
1992          'type'         => 'read',
1993          'capabilities' => 'moodle/competency:competencyview',
1994          'ajax'         => true,
1995      ),
1996      'core_competency_duplicate_competency_framework' => array(
1997          'classname'    => 'core_competency\external',
1998          'methodname'   => 'duplicate_competency_framework',
1999          'classpath'    => '',
2000          'description'  => 'Duplicate a competency framework.',
2001          'type'         => 'write',
2002          'capabilities' => 'moodle/competency:competencymanage',
2003          'ajax'         => true,
2004      ),
2005      'core_competency_delete_competency_framework' => array(
2006          'classname'    => 'core_competency\external',
2007          'methodname'   => 'delete_competency_framework',
2008          'classpath'    => '',
2009          'description'  => 'Delete a competency framework.',
2010          'type'         => 'write',
2011          'capabilities' => 'moodle/competency:competencymanage',
2012          'ajax'         => true,
2013      ),
2014      'core_competency_update_competency_framework' => array(
2015          'classname'    => 'core_competency\external',
2016          'methodname'   => 'update_competency_framework',
2017          'classpath'    => '',
2018          'description'  => 'Update a competency framework.',
2019          'type'         => 'write',
2020          'capabilities' => 'moodle/competency:competencymanage',
2021          'ajax'         => true,
2022      ),
2023      'core_competency_list_competency_frameworks' => array(
2024          'classname'    => 'core_competency\external',
2025          'methodname'   => 'list_competency_frameworks',
2026          'classpath'    => '',
2027          'description'  => 'Load a list of a competency frameworks.',
2028          'type'         => 'read',
2029          'capabilities' => 'moodle/competency:competencyview',
2030          'ajax'         => true,
2031      ),
2032      'core_competency_count_competency_frameworks' => array(
2033          'classname'    => 'core_competency\external',
2034          'methodname'   => 'count_competency_frameworks',
2035          'classpath'    => '',
2036          'description'  => 'Count a list of a competency frameworks.',
2037          'type'         => 'read',
2038          'capabilities' => 'moodle/competency:competencyview',
2039          'ajax'         => true,
2040      ),
2041      'core_competency_competency_framework_viewed' => array(
2042          'classname'    => 'core_competency\external',
2043          'methodname'   => 'competency_framework_viewed',
2044          'classpath'    => '',
2045          'description'  => 'Log event competency framework viewed',
2046          'type'         => 'read',
2047          'capabilities' => 'moodle/competency:competencyview',
2048          'ajax'         => true,
2049      ),
2050      'core_competency_create_competency' => array(
2051          'classname'    => 'core_competency\external',
2052          'methodname'   => 'create_competency',
2053          'classpath'    => '',
2054          'description'  => 'Creates new competencies.',
2055          'type'         => 'write',
2056          'capabilities' => 'moodle/competency:competencymanage',
2057          'ajax'         => true,
2058      ),
2059      'core_competency_read_competency' => array(
2060          'classname'    => 'core_competency\external',
2061          'methodname'   => 'read_competency',
2062          'classpath'    => '',
2063          'description'  => 'Load a summary of a competency.',
2064          'type'         => 'read',
2065          'capabilities' => 'moodle/competency:competencyview',
2066          'ajax'         => true,
2067      ),
2068      'core_competency_competency_viewed' => array(
2069          'classname'    => 'core_competency\external',
2070          'methodname'   => 'competency_viewed',
2071          'classpath'    => '',
2072          'description'  => 'Log event competency viewed',
2073          'type'         => 'read',
2074          'capabilities' => 'moodle/competency:competencyview',
2075          'ajax'         => true,
2076          'services'     => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2077      ),
2078      'core_competency_delete_competency' => array(
2079          'classname'    => 'core_competency\external',
2080          'methodname'   => 'delete_competency',
2081          'classpath'    => '',
2082          'description'  => 'Delete a competency.',
2083          'type'         => 'write',
2084          'capabilities' => 'moodle/competency:competencymanage',
2085          'ajax'         => true,
2086      ),
2087      'core_competency_update_competency' => array(
2088          'classname'    => 'core_competency\external',
2089          'methodname'   => 'update_competency',
2090          'classpath'    => '',
2091          'description'  => 'Update a competency.',
2092          'type'         => 'write',
2093          'capabilities' => 'moodle/competency:competencymanage',
2094          'ajax'         => true,
2095      ),
2096      'core_competency_list_competencies' => array(
2097          'classname'    => 'core_competency\external',
2098          'methodname'   => 'list_competencies',
2099          'classpath'    => '',
2100          'description'  => 'Load a list of a competencies.',
2101          'type'         => 'read',
2102          'capabilities' => 'moodle/competency:competencyview',
2103          'ajax'         => true,
2104      ),
2105      'core_competency_list_competencies_in_template' => array(
2106          'classname'    => 'core_competency\external',
2107          'methodname'   => 'list_competencies_in_template',
2108          'classpath'    => '',
2109          'description'  => 'Load a list of a competencies for a given template.',
2110          'type'         => 'read',
2111          'capabilities' => 'moodle/competency:competencyview',
2112          'ajax'         => true,
2113      ),
2114      'core_competency_count_competencies' => array(
2115          'classname'    => 'core_competency\external',
2116          'methodname'   => 'count_competencies',
2117          'classpath'    => '',
2118          'description'  => 'Count a list of a competencies.',
2119          'type'         => 'read',
2120          'capabilities' => 'moodle/competency:competencyview',
2121          'ajax'         => true,
2122      ),
2123      'core_competency_count_competencies_in_template' => array(
2124          'classname'    => 'core_competency\external',
2125          'methodname'   => 'count_competencies_in_template',
2126          'classpath'    => '',
2127          'description'  => 'Count a list of a competencies for a given template.',
2128          'type'         => 'read',
2129          'capabilities' => 'moodle/competency:competencyview',
2130          'ajax'         => true,
2131      ),
2132      'core_competency_search_competencies' => array(
2133          'classname'    => 'core_competency\external',
2134          'methodname'   => 'search_competencies',
2135          'classpath'    => '',
2136          'description'  => 'Search a list of a competencies.',
2137          'type'         => 'read',
2138          'capabilities' => 'moodle/competency:competencyview',
2139          'ajax'         => true,
2140      ),
2141      'core_competency_set_parent_competency' => array(
2142          'classname'    => 'core_competency\external',
2143          'methodname'   => 'set_parent_competency',
2144          'classpath'    => '',
2145          'description'  => 'Set a new parent for a competency.',
2146          'type'         => 'write',
2147          'capabilities' => 'moodle/competency:competencymanage',
2148          'ajax'         => true,
2149      ),
2150      'core_competency_move_up_competency' => array(
2151          'classname'    => 'core_competency\external',
2152          'methodname'   => 'move_up_competency',
2153          'classpath'    => '',
2154          'description'  => 'Re-order a competency.',
2155          'type'         => 'write',
2156          'capabilities' => 'moodle/competency:competencymanage',
2157          'ajax'         => true,
2158      ),
2159      'core_competency_move_down_competency' => array(
2160          'classname'    => 'core_competency\external',
2161          'methodname'   => 'move_down_competency',
2162          'classpath'    => '',
2163          'description'  => 'Re-order a competency.',
2164          'type'         => 'write',
2165          'capabilities' => 'moodle/competency:competencymanage',
2166          'ajax'         => true,
2167      ),
2168      'core_competency_list_course_module_competencies' => array(
2169          'classname'    => 'core_competency\external',
2170          'methodname'   => 'list_course_module_competencies',
2171          'classpath'    => '',
2172          'description'  => 'List the competencies in a course module',
2173          'type'         => 'read',
2174          'capabilities' => 'moodle/competency:coursecompetencyview',
2175          'ajax'         => true,
2176      ),
2177      'core_competency_count_course_module_competencies' => array(
2178          'classname'    => 'core_competency\external',
2179          'methodname'   => 'count_course_module_competencies',
2180          'classpath'    => '',
2181          'description'  => 'Count the competencies in a course module',
2182          'type'         => 'read',
2183          'capabilities' => 'moodle/competency:coursecompetencyview',
2184          'ajax'         => true,
2185      ),
2186      'core_competency_list_course_competencies' => array(
2187          'classname'    => 'core_competency\external',
2188          'methodname'   => 'list_course_competencies',
2189          'classpath'    => '',
2190          'description'  => 'List the competencies in a course',
2191          'type'         => 'read',
2192          'capabilities' => 'moodle/competency:coursecompetencyview',
2193          'ajax'         => true,
2194          'services'     => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2195      ),
2196      'core_competency_count_competencies_in_course' => array(
2197          'classname'    => 'core_competency\external',
2198          'methodname'   => 'count_competencies_in_course',
2199          'classpath'    => '',
2200          'description'  => 'List the competencies in a course',
2201          'type'         => 'read',
2202          'capabilities' => 'moodle/competency:coursecompetencyview',
2203          'ajax'         => true,
2204      ),
2205      'core_competency_count_courses_using_competency' => array(
2206          'classname'    => 'core_competency\external',
2207          'methodname'   => 'count_courses_using_competency',
2208          'classpath'    => '',
2209          'description'  => 'List the courses using a competency',
2210          'type'         => 'read',
2211          'capabilities' => 'moodle/competency:coursecompetencyview',
2212          'ajax'         => true,
2213      ),
2214      'core_competency_add_competency_to_course' => array(
2215          'classname'    => 'core_competency\external',
2216          'methodname'   => 'add_competency_to_course',
2217          'classpath'    => '',
2218          'description'  => 'Add the competency to a course',
2219          'type'         => 'write',
2220          'capabilities' => 'moodle/competency:coursecompetencymanage',
2221          'ajax'         => true,
2222      ),
2223      'core_competency_add_competency_to_template' => array(
2224          'classname'    => 'core_competency\external',
2225          'methodname'   => 'add_competency_to_template',
2226          'classpath'    => '',
2227          'description'  => 'Add the competency to a template',
2228          'type'         => 'write',
2229          'capabilities' => 'moodle/competency:templatemanage',
2230          'ajax'         => true,
2231      ),
2232      'core_competency_remove_competency_from_course' => array(
2233          'classname'    => 'core_competency\external',
2234          'methodname'   => 'remove_competency_from_course',
2235          'classpath'    => '',
2236          'description'  => 'Remove a competency from a course',
2237          'type'         => 'write',
2238          'capabilities' => 'moodle/competency:coursecompetencymanage',
2239          'ajax'         => true,
2240      ),
2241      'core_competency_set_course_competency_ruleoutcome' => array(
2242          'classname'    => 'core_competency\external',
2243          'methodname'   => 'set_course_competency_ruleoutcome',
2244          'classpath'    => '',
2245          'description'  => 'Modify the ruleoutcome value for course competency',
2246          'type'         => 'write',
2247          'capabilities' => 'moodle/competency:coursecompetencymanage',
2248          'ajax'         => true,
2249      ),
2250      'core_competency_remove_competency_from_template' => array(
2251          'classname'    => 'core_competency\external',
2252          'methodname'   => 'remove_competency_from_template',
2253          'classpath'    => '',
2254          'description'  => 'Remove a competency from a template',
2255          'type'         => 'write',
2256          'capabilities' => 'moodle/competency:templatemanage',
2257          'ajax'         => true,
2258      ),
2259      'core_competency_reorder_course_competency' => array(
2260          'classname'    => 'core_competency\external',
2261          'methodname'   => 'reorder_course_competency',
2262          'classpath'    => '',
2263          'description'  => 'Move a course competency to a new relative sort order.',
2264          'type'         => 'write',
2265          'capabilities' => 'moodle/competency:coursecompetencymanage',
2266          'ajax'         => true,
2267      ),
2268      'core_competency_reorder_template_competency' => array(
2269          'classname'    => 'core_competency\external',
2270          'methodname'   => 'reorder_template_competency',
2271          'classpath'    => '',
2272          'description'  => 'Move a template competency to a new relative sort order.',
2273          'type'         => 'write',
2274          'capabilities' => 'moodle/competency:templatemanage',
2275          'ajax'         => true,
2276      ),
2277      'core_competency_create_template' => array(
2278          'classname'    => 'core_competency\external',
2279          'methodname'   => 'create_template',
2280          'classpath'    => '',
2281          'description'  => 'Creates new learning plan templates.',
2282          'type'         => 'write',
2283          'capabilities' => 'moodle/competency:templatemanage',
2284          'ajax'         => true,
2285      ),
2286      'core_competency_duplicate_template' => array(
2287          'classname'    => 'core_competency\external',
2288          'methodname'   => 'duplicate_template',
2289          'classpath'    => '',
2290          'description'  => 'Duplicate learning plan template.',
2291          'type'         => 'write',
2292          'capabilities' => 'moodle/competency:templatemanage',
2293          'ajax'         => true,
2294      ),
2295      'core_competency_read_template' => array(
2296          'classname'    => 'core_competency\external',
2297          'methodname'   => 'read_template',
2298          'classpath'    => '',
2299          'description'  => 'Load a summary of a learning plan template.',
2300          'type'         => 'read',
2301          'capabilities' => 'moodle/competency:templateview',
2302          'ajax'         => true,
2303      ),
2304      'core_competency_delete_template' => array(
2305          'classname'    => 'core_competency\external',
2306          'methodname'   => 'delete_template',
2307          'classpath'    => '',
2308          'description'  => 'Delete a learning plan template.',
2309          'type'         => 'write',
2310          'capabilities' => 'moodle/competency:templatemanage',
2311          'ajax'         => true,
2312      ),
2313      'core_competency_update_template' => array(
2314          'classname'    => 'core_competency\external',
2315          'methodname'   => 'update_template',
2316          'classpath'    => '',
2317          'description'  => 'Update a learning plan template.',
2318          'type'         => 'write',
2319          'capabilities' => 'moodle/competency:templatemanage',
2320          'ajax'         => true,
2321      ),
2322      'core_competency_list_templates' => array(
2323          'classname'    => 'core_competency\external',
2324          'methodname'   => 'list_templates',
2325          'classpath'    => '',
2326          'description'  => 'Load a list of a learning plan templates.',
2327          'type'         => 'read',
2328          'capabilities' => 'moodle/competency:templateview',
2329          'ajax'         => true,
2330      ),
2331      'core_competency_list_templates_using_competency' => array(
2332          'classname'    => 'core_competency\external',
2333          'methodname'   => 'list_templates_using_competency',
2334          'classpath'    => '',
2335          'description'  => 'Load a list of a learning plan templates for a given competency.',
2336          'type'         => 'read',
2337          'capabilities' => 'moodle/competency:templateview',
2338          'ajax'         => true,
2339      ),
2340      'core_competency_count_templates' => array(
2341          'classname'    => 'core_competency\external',
2342          'methodname'   => 'count_templates',
2343          'classpath'    => '',
2344          'description'  => 'Count a list of a learning plan templates.',
2345          'type'         => 'read',
2346          'capabilities' => 'moodle/competency:templateview',
2347          'ajax'         => true,
2348      ),
2349      'core_competency_count_templates_using_competency' => array(
2350          'classname'    => 'core_competency\external',
2351          'methodname'   => 'count_templates_using_competency',
2352          'classpath'    => '',
2353          'description'  => 'Count a list of a learning plan templates for a given competency.',
2354          'type'         => 'read',
2355          'capabilities' => 'moodle/competency:templateview',
2356          'ajax'         => true,
2357      ),
2358      'core_competency_create_plan' => array(
2359          'classname'    => 'core_competency\external',
2360          'methodname'   => 'create_plan',
2361          'classpath'    => '',
2362          'description'  => 'Creates a learning plan.',
2363          'type'         => 'write',
2364          'capabilities' => 'moodle/competency:planmanage',
2365          'ajax'         => true,
2366      ),
2367      'core_competency_update_plan' => array(
2368          'classname'    => 'core_competency\external',
2369          'methodname'   => 'update_plan',
2370          'classpath'    => '',
2371          'description'  => 'Updates a learning plan.',
2372          'type'         => 'write',
2373          'capabilities' => 'moodle/competency:planmanage',
2374          'ajax'         => true,
2375      ),
2376      'core_competency_complete_plan' => array(
2377          'classname'    => 'core_competency\external',
2378          'methodname'   => 'complete_plan',
2379          'classpath'    => '',
2380          'description'  => 'Complete learning plan.',
2381          'type'         => 'write',
2382          'capabilities' => 'moodle/competency:planmanage',
2383          'ajax'         => true,
2384      ),
2385      'core_competency_reopen_plan' => array(
2386          'classname'    => 'core_competency\external',
2387          'methodname'   => 'reopen_plan',
2388          'classpath'    => '',
2389          'description'  => 'Reopen learning plan.',
2390          'type'         => 'write',
2391          'capabilities' => 'moodle/competency:planmanage',
2392          'ajax'         => true,
2393      ),
2394      'core_competency_read_plan' => array(
2395          'classname'    => 'core_competency\external',
2396          'methodname'   => 'read_plan',
2397          'classpath'    => '',
2398          'description'  => 'Load a learning plan.',
2399          'type'         => 'read',
2400          'capabilities' => 'moodle/competency:planviewown',
2401          'ajax'         => true,
2402      ),
2403      'core_competency_delete_plan' => array(
2404          'classname'    => 'core_competency\external',
2405          'methodname'   => 'delete_plan',
2406          'classpath'    => '',
2407          'description'  => 'Delete a learning plan.',
2408          'type'         => 'write',
2409          'capabilities' => 'moodle/competency:planmanage',
2410          'ajax'         => true,
2411      ),
2412      'core_competency_list_user_plans' => array(
2413          'classname'    => 'core_competency\external',
2414          'methodname'   => 'list_user_plans',
2415          'classpath'    => '',
2416          'description'  => 'List a user\'s learning plans.',
2417          'type'         => 'read',
2418          'capabilities' => 'moodle/competency:planviewown',
2419          'ajax'         => true,
2420      ),
2421      'core_competency_list_plan_competencies' => array(
2422          'classname'    => 'core_competency\external',
2423          'methodname'   => 'list_plan_competencies',
2424          'classpath'    => '',
2425          'description'  => 'List the competencies in a plan',
2426          'type'         => 'read',
2427          'capabilities' => 'moodle/competency:planviewown',
2428          'ajax'         => true,
2429      ),
2430      'core_competency_add_competency_to_plan' => array(
2431          'classname'    => 'core_competency\external',
2432          'methodname'   => 'add_competency_to_plan',
2433          'classpath'    => '',
2434          'description'  => 'Add the competency to a learning plan',
2435          'type'         => 'write',
2436          'capabilities' => 'moodle/competency:planmanage',
2437          'ajax'         => true,
2438      ),
2439      'core_competency_remove_competency_from_plan' => array(
2440          'classname'    => 'core_competency\external',
2441          'methodname'   => 'remove_competency_from_plan',
2442          'classpath'    => '',
2443          'description'  => 'Remove the competency from a learning plan',
2444          'type'         => 'write',
2445          'capabilities' => 'moodle/competency:planmanage',
2446          'ajax'         => true,
2447      ),
2448      'core_competency_reorder_plan_competency' => array(
2449          'classname'    => 'core_competency\external',
2450          'methodname'   => 'reorder_plan_competency',
2451          'classpath'    => '',
2452          'description'  => 'Move a plan competency to a new relative sort order.',
2453          'type'         => 'write',
2454          'capabilities' => 'moodle/competency:planmanage',
2455          'ajax'         => true,
2456      ),
2457      'core_competency_plan_request_review' => array(
2458          'classname'    => 'core_competency\external',
2459          'methodname'   => 'plan_request_review',
2460          'classpath'    => '',
2461          'description'  => 'Request for a plan to be reviewed.',
2462          'type'         => 'write',
2463          'capabilities' => 'moodle/competency:planmanagedraft',
2464          'ajax'         => true,
2465      ),
2466      'core_competency_plan_start_review' => array(
2467          'classname'    => 'core_competency\external',
2468          'methodname'   => 'plan_start_review',
2469          'classpath'    => '',
2470          'description'  => 'Start the review of a plan.',
2471          'type'         => 'write',
2472          'capabilities' => 'moodle/competency:planmanage',
2473          'ajax'         => true,
2474      ),
2475      'core_competency_plan_stop_review' => array(
2476          'classname'    => 'core_competency\external',
2477          'methodname'   => 'plan_stop_review',
2478          'classpath'    => '',
2479          'description'  => 'Stop the review of a plan.',
2480          'type'         => 'write',
2481          'capabilities' => 'moodle/competency:planmanage',
2482          'ajax'         => true,
2483      ),
2484      'core_competency_plan_cancel_review_request' => array(
2485          'classname'    => 'core_competency\external',
2486          'methodname'   => 'plan_cancel_review_request',
2487          'classpath'    => '',
2488          'description'  => 'Cancel the review of a plan.',
2489          'type'         => 'write',
2490          'capabilities' => 'moodle/competency:planmanagedraft',
2491          'ajax'         => true,
2492      ),
2493      'core_competency_approve_plan' => array(
2494          'classname'    => 'core_competency\external',
2495          'methodname'   => 'approve_plan',
2496          'classpath'    => '',
2497          'description'  => 'Approve a plan.',
2498          'type'         => 'write',
2499          'capabilities' => 'moodle/competency:planmanage',
2500          'ajax'         => true,
2501      ),
2502      'core_competency_unapprove_plan' => array(
2503          'classname'    => 'core_competency\external',
2504          'methodname'   => 'unapprove_plan',
2505          'classpath'    => '',
2506          'description'  => 'Unapprove a plan.',
2507          'type'         => 'write',
2508          'capabilities' => 'moodle/competency:planmanage',
2509          'ajax'         => true,
2510      ),
2511       'core_competency_template_has_related_data' => array(
2512          'classname'    => 'core_competency\external',
2513          'methodname'   => 'template_has_related_data',
2514          'classpath'    => '',
2515          'description'  => 'Check if a template has related data',
2516          'type'         => 'read',
2517          'capabilities' => 'moodle/competency:templateview',
2518          'ajax'         => true,
2519      ),
2520      'core_competency_get_scale_values' => array(
2521          'classname'    => 'core_competency\external',
2522          'methodname'   => 'get_scale_values',
2523          'classpath'    => '',
2524          'description'  => 'Fetch the values for a specific scale',
2525          'type'         => 'read',
2526          'capabilities' => 'moodle/competency:competencymanage',
2527          'ajax'         => true,
2528          'services'     => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2529      ),
2530      'core_competency_add_related_competency' => array(
2531          'classname'    => 'core_competency\external',
2532          'methodname'   => 'add_related_competency',
2533          'classpath'    => '',
2534          'description'  => 'Adds a related competency',
2535          'type'         => 'write',
2536          'capabilities' => 'moodle/competency:competencymanage',
2537          'ajax'         => true,
2538      ),
2539      'core_competency_remove_related_competency' => array(
2540          'classname'    => 'core_competency\external',
2541          'methodname'   => 'remove_related_competency',
2542          'classpath'    => '',
2543          'description'  => 'Remove a related competency',
2544          'type'         => 'write',
2545          'capabilities' => 'moodle/competency:competencymanage',
2546          'ajax'         => true,
2547      ),
2548      'core_competency_read_user_evidence' => array(
2549          'classname'    => 'core_competency\external',
2550          'methodname'   => 'read_user_evidence',
2551          'classpath'    => '',
2552          'description'  => 'Read an evidence of prior learning.',
2553          'type'         => 'read',
2554          'capabilities' => 'moodle/competency:userevidenceview',
2555          'ajax'         => true,
2556      ),
2557      'core_competency_delete_user_evidence' => array(
2558          'classname'    => 'core_competency\external',
2559          'methodname'   => 'delete_user_evidence',
2560          'classpath'    => '',
2561          'description'  => 'Delete an evidence of prior learning.',
2562          'type'         => 'write',
2563          'capabilities' => 'moodle/competency:userevidencemanageown',
2564          'ajax'         => true,
2565      ),
2566      'core_competency_create_user_evidence_competency' => array(
2567          'classname'    => 'core_competency\external',
2568          'methodname'   => 'create_user_evidence_competency',
2569          'classpath'    => '',
2570          'description'  => 'Create an evidence of prior learning relationship with a competency.',
2571          'type'         => 'read',
2572          'capabilities' => 'moodle/competency:userevidencemanageown, moodle/competency:competencyview',
2573          'ajax'         => true,
2574      ),
2575      'core_competency_delete_user_evidence_competency' => array(
2576          'classname'    => 'core_competency\external',
2577          'methodname'   => 'delete_user_evidence_competency',
2578          'classpath'    => '',
2579          'description'  => 'Delete an evidence of prior learning relationship with a competency.',
2580          'type'         => 'write',
2581          'capabilities' => 'moodle/competency:userevidencemanageown',
2582          'ajax'         => true,
2583      ),
2584      'core_competency_user_competency_cancel_review_request' => array(
2585          'classname'    => 'core_competency\external',
2586          'methodname'   => 'user_competency_cancel_review_request',
2587          'classpath'    => '',
2588          'description'  => 'Cancel a review request.',
2589          'type'         => 'write',
2590          'capabilities' => 'moodle/competency:userevidencemanageown',
2591          'ajax'         => true,
2592      ),
2593      'core_competency_user_competency_request_review' => array(
2594          'classname'    => 'core_competency\external',
2595          'methodname'   => 'user_competency_request_review',
2596          'classpath'    => '',
2597          'description'  => 'Request a review.',
2598          'type'         => 'write',
2599          'capabilities' => 'moodle/competency:userevidencemanageown',
2600          'ajax'         => true,
2601      ),
2602      'core_competency_user_competency_start_review' => array(
2603          'classname'    => 'core_competency\external',
2604          'methodname'   => 'user_competency_start_review',
2605          'classpath'    => '',
2606          'description'  => 'Start a review.',
2607          'type'         => 'write',
2608          'capabilities' => 'moodle/competency:competencygrade',
2609          'ajax'         => true,
2610      ),
2611      'core_competency_user_competency_stop_review' => array(
2612          'classname'    => 'core_competency\external',
2613          'methodname'   => 'user_competency_stop_review',
2614          'classpath'    => '',
2615          'description'  => 'Stop a review.',
2616          'type'         => 'write',
2617          'capabilities' => 'moodle/competency:competencygrade',
2618          'ajax'         => true,
2619      ),
2620      'core_competency_user_competency_viewed' => array(
2621          'classname'    => 'core_competency\external',
2622          'methodname'   => 'user_competency_viewed',
2623          'classpath'    => '',
2624          'description'  => 'Log the user competency viewed event.',
2625          'type'         => 'read',
2626          'capabilities' => 'moodle/competency:usercompetencyview',
2627          'ajax'         => true,
2628          'services'     => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2629      ),
2630      'core_competency_user_competency_viewed_in_plan' => array(
2631          'classname'    => 'core_competency\external',
2632          'methodname'   => 'user_competency_viewed_in_plan',
2633          'classpath'    => '',
2634          'description'  => 'Log the user competency viewed in plan event.',
2635          'type'         => 'read',
2636          'capabilities' => 'moodle/competency:usercompetencyview',
2637          'ajax'         => true,
2638          'services'     => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2639      ),
2640      'core_competency_user_competency_viewed_in_course' => array(
2641          'classname'    => 'core_competency\external',
2642          'methodname'   => 'user_competency_viewed_in_course',
2643          'classpath'    => '',
2644          'description'  => 'Log the user competency viewed in course event',
2645          'type'         => 'read',
2646          'capabilities' => 'moodle/competency:usercompetencyview',
2647          'ajax'         => true,
2648          'services'     => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2649      ),
2650      'core_competency_user_competency_plan_viewed' => array(
2651          'classname'    => 'core_competency\external',
2652          'methodname'   => 'user_competency_plan_viewed',
2653          'classpath'    => '',
2654          'description'  => 'Log the user competency plan viewed event.',
2655          'type'         => 'read',
2656          'capabilities' => 'moodle/competency:usercompetencyview',
2657          'ajax'         => true,
2658          'services'     => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2659      ),
2660      'core_competency_grade_competency' => array(
2661          'classname'    => 'core_competency\external',
2662          'methodname'   => 'grade_competency',
2663          'classpath'    => '',
2664          'description'  => 'Grade a competency.',
2665          'type'         => 'write',
2666          'capabilities' => 'moodle/competency:competencygrade',
2667          'ajax'         => true,
2668      ),
2669      'core_competency_grade_competency_in_plan' => array(
2670          'classname'    => 'core_competency\external',
2671          'methodname'   => 'grade_competency_in_plan',
2672          'classpath'    => '',
2673          'description'  => 'Grade a competency from the user plan page.',
2674          'type'         => 'write',
2675          'capabilities' => 'moodle/competency:competencygrade',
2676          'ajax'         => true,
2677      ),
2678      'core_competency_grade_competency_in_course' => array(
2679          'classname'    => 'core_competency\external',
2680          'methodname'   => 'grade_competency_in_course',
2681          'classpath'    => '',
2682          'description'  => 'Grade a competency from the course page.',
2683          'type'         => 'write',
2684          'capabilities' => 'moodle/competency:competencygrade',
2685          'ajax'         => true,
2686          'services'     => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2687      ),
2688      'core_competency_unlink_plan_from_template' => array(
2689          'classname'    => 'core_competency\external',
2690          'methodname'   => 'unlink_plan_from_template',
2691          'classpath'    => '',
2692          'description'  => 'Unlink a plan form it template.',
2693          'type'         => 'write',
2694          'capabilities' => 'moodle/competency:planmanage',
2695          'ajax'         => true,
2696      ),
2697      'core_competency_template_viewed' => array(
2698          'classname'     => 'core_competency\external',
2699          'methodname'    => 'template_viewed',
2700          'classpath'     => '',
2701          'description'   => 'Log event template viewed',
2702          'type'          => 'read',
2703          'capabilities'  => 'moodle/competency:templateview',
2704          'ajax'          => true,
2705      ),
2706      'core_competency_request_review_of_user_evidence_linked_competencies' => array(
2707          'classname'     => 'core_competency\external',
2708          'methodname'    => 'request_review_of_user_evidence_linked_competencies',
2709          'classpath'     => '',
2710          'description'   => 'Send user evidence competencies in review',
2711          'type'          => 'write',
2712          'capabilities'  => 'moodle/competency:userevidencemanageown',
2713          'ajax'          => true,
2714      ),
2715      'core_competency_update_course_competency_settings' => array(
2716          'classname'     => 'core_competency\external',
2717          'methodname'    => 'update_course_competency_settings',
2718          'classpath'     => '',
2719          'description'   => 'Update the course competency settings',
2720          'type'          => 'write',
2721          'capabilities'  => 'moodle/competency:coursecompetencyconfigure',
2722          'ajax'          => true,
2723      ),
2724      'core_competency_delete_evidence' => array(
2725          'classname'     => 'core_competency\external',
2726          'methodname'    => 'delete_evidence',
2727          'classpath'     => '',
2728          'description'   => 'Delete an evidence',
2729          'type'          => 'write',
2730          'capabilities'  => 'moodle/competency:evidencedelete',
2731          'ajax'          => true,
2732          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2733      ),
2734  
2735      'core_webservice_get_site_info' => array(
2736          'classname' => 'core_webservice_external',
2737          'methodname' => 'get_site_info',
2738          'classpath' => 'webservice/externallib.php',
2739          'description' => 'Return some site info / user info / list web service functions',
2740          'type' => 'read',
2741          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2742      ),
2743  
2744      // Blocks functions.
2745      'core_block_get_course_blocks' => array(
2746          'classname'     => 'core_block_external',
2747          'methodname'    => 'get_course_blocks',
2748          'description'   => 'Returns blocks information for a course.',
2749          'type'          => 'read',
2750          'capabilities'  => '',
2751          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2752      ),
2753  
2754      'core_block_get_dashboard_blocks' => array(
2755          'classname'     => 'core_block_external',
2756          'methodname'    => 'get_dashboard_blocks',
2757          'description'   => 'Returns blocks information for the given user dashboard.',
2758          'type'          => 'read',
2759          'capabilities'  => '',
2760          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2761      ),
2762  
2763      'core_block_fetch_addable_blocks' => array(
2764          'classname'     => 'core_block\external\fetch_addable_blocks',
2765          'description'   => 'Returns all addable blocks in a given page.',
2766          'type'          => 'read',
2767          'capabilities'  => 'moodle/site:manageblocks',
2768          'ajax'          => true,
2769          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2770      ),
2771  
2772      // Filters functions.
2773      'core_filters_get_available_in_context' => array(
2774          'classname'   => 'core_filters\external',
2775          'methodname'  => 'get_available_in_context',
2776          'description' => 'Returns the filters available in the given contexts.',
2777          'type'        => 'read',
2778          'services'    => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2779      ),
2780      'core_customfield_delete_field' => array(
2781          'classname'   => 'core_customfield_external',
2782          'methodname'  => 'delete_field',
2783          'classpath'   => 'customfield/externallib.php',
2784          'description' => 'Deletes an entry',
2785          'type'        => 'write',
2786          'ajax'        => true,
2787      ),
2788      'core_customfield_reload_template' => array(
2789          'classname'   => 'core_customfield_external',
2790          'methodname'  => 'reload_template',
2791          'classpath'   => 'customfield/externallib.php',
2792          'description' => 'Reloads template',
2793          'type'        => 'read',
2794          'ajax'        => true,
2795      ),
2796      'core_customfield_create_category' => array(
2797          'classname'   => 'core_customfield_external',
2798          'methodname'  => 'create_category',
2799          'classpath'   => 'customfield/externallib.php',
2800          'description' => 'Creates a new category',
2801          'type'        => 'write',
2802          'ajax'        => true,
2803      ),
2804      'core_customfield_delete_category' => array(
2805          'classname'   => 'core_customfield_external',
2806          'methodname'  => 'delete_category',
2807          'classpath'   => 'customfield/externallib.php',
2808          'description' => 'Deletes a category',
2809          'type'        => 'write',
2810          'ajax'        => true,
2811      ),
2812      'core_customfield_move_field'   => array(
2813          'classname'   => 'core_customfield_external',
2814          'methodname'  => 'move_field',
2815          'classpath'   => 'customfield/externallib.php',
2816          'description' => 'Drag and drop',
2817          'type'        => 'write',
2818          'ajax'        => true,
2819      ),
2820      'core_customfield_move_category' => array(
2821          'classname'   => 'core_customfield_external',
2822          'methodname'  => 'move_category',
2823          'classpath'   => 'customfield/externallib.php',
2824          'description' => 'Drag and drop categories',
2825          'type'        => 'write',
2826          'ajax'        => true,
2827      ),
2828      'core_h5p_get_trusted_h5p_file' => [
2829          'classname'     => 'core_h5p\external',
2830          'methodname'    => 'get_trusted_h5p_file',
2831          'classpath'     => '',
2832          'description'   => 'Get the H5P file cleaned for Mobile App.',
2833          'type'          => 'read',
2834          'ajax'          => true,
2835          'capabilities'  => '',
2836          'services'      => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2837      ],
2838      'core_table_get_dynamic_table_content' => [
2839          'classname' => 'core_table\external\dynamic\get',
2840          'description' => 'Get the dynamic table content raw html',
2841          'type' => 'read',
2842          'ajax' => true,
2843          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2844      ],
2845      'core_xapi_statement_post' => [
2846          'classname'     => 'core_xapi\external\post_statement',
2847          'classpath'     => '',
2848          'description'   => 'Post an xAPI statement.',
2849          'type'          => 'write',
2850          'ajax'          => true,
2851          'capabilities'  => '',
2852          'services'      => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2853      ],
2854      'core_xapi_post_state' => [
2855          'classname' => 'core_xapi\external\post_state',
2856          'classpath' => '',
2857          'description' => 'Post an xAPI state into an activityId.',
2858          'type' => 'write',
2859          'ajax' => true,
2860          'capabilities' => '',
2861          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2862      ],
2863      'core_xapi_get_state' => [
2864          'classname' => 'core_xapi\external\get_state',
2865          'classpath' => '',
2866          'description' => 'Get an xAPI state data from an activityId.',
2867          'type' => 'read',
2868          'ajax' => true,
2869          'capabilities' => '',
2870          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2871      ],
2872      'core_xapi_get_states' => [
2873          'classname' => 'core_xapi\external\get_states',
2874          'description' => 'Get all state ID from an activityId.',
2875          'type' => 'read',
2876          'ajax' => true,
2877          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2878      ],
2879      'core_xapi_delete_state' => [
2880          'classname' => 'core_xapi\external\delete_state',
2881          'classpath' => '',
2882          'description' => 'Delete an xAPI state data from an activityId.',
2883          'type' => 'write',
2884          'ajax' => true,
2885          'capabilities' => '',
2886          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2887      ],
2888      'core_xapi_delete_states' => [
2889          'classname' => 'core_xapi\external\delete_states',
2890          'description' => 'Delete all xAPI state data from an activityId.',
2891          'type' => 'write',
2892          'ajax' => true,
2893          'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2894      ],
2895      'core_contentbank_delete_content' => [
2896          'classname'     => 'core_contentbank\external\delete_content',
2897          'classpath'     => '',
2898          'description'   => 'Delete a content from the content bank.',
2899          'type'          => 'write',
2900          'ajax'          => true,
2901          'capabilities'  => 'moodle/contentbank:deleteanycontent',
2902      ],
2903      'core_contentbank_rename_content' => [
2904          'classname'     => 'core_contentbank\external\rename_content',
2905          'classpath'     => '',
2906          'description'   => 'Rename a content in the content bank.',
2907          'type'          => 'write',
2908          'ajax'          => true,
2909          'capabilities'  => 'moodle/contentbank:manageowncontent',
2910      ],
2911      'core_contentbank_copy_content' => [
2912          'classname'     => 'core_contentbank\external\copy_content',
2913          'classpath'     => '',
2914          'description'   => 'Copy a content in the content bank.',
2915          'type'          => 'write',
2916          'ajax'          => 'true',
2917          'capabilities'  => 'moodle/contentbank:copycontent, moodle/contentbank:copyanycontent',
2918      ],
2919      'core_contentbank_set_content_visibility' => [
2920          'classname'     => 'core_contentbank\external\set_content_visibility',
2921          'classpath'     => '',
2922          'description'   => 'Set the visibility of a content in the content bank.',
2923          'type'          => 'write',
2924          'ajax'          => true,
2925          'capabilities'  => 'moodle/contentbank:manageowncontent',
2926      ],
2927      'core_create_userfeedback_action_record' => [
2928          'classname'     => 'core\external\record_userfeedback_action',
2929          'classpath'     => '',
2930          'description'   => 'Record the action that the user takes in the user feedback notification for future use.',
2931          'type'          => 'write',
2932          'ajax'          => true,
2933          'capabilities'  => '',
2934      ],
2935      'core_payment_get_available_gateways' => [
2936          'classname'   => 'core_payment\external\get_available_gateways',
2937          'description' => 'Get the list of payment gateways that support the given component/area',
2938          'type'        => 'read',
2939          'ajax'        => true,
2940      ],
2941      'core_reportbuilder_filters_reset' => [
2942          'classname'   => 'core_reportbuilder\external\filters\reset',
2943          'description' => 'Reset filters for given report',
2944          'type'        => 'write',
2945          'ajax'        => true,
2946      ],
2947      'core_reportbuilder_set_filters' => [
2948          'classname'   => 'core_reportbuilder\external\filters\set',
2949          'description' => 'Set filter values for given report',
2950          'type'        => 'write',
2951          'ajax'        => true,
2952      ],
2953      'core_dynamic_tabs_get_content' => [
2954          'classname'   => 'core\external\dynamic_tabs_get_content',
2955          'description' => 'Returns the content for a dynamic tab',
2956          'type'        => 'read',
2957          'ajax'        => true,
2958      ],
2959      'core_change_editmode' => [
2960          'classname'   => 'core\external\editmode',
2961          'methodname'   => 'change_editmode',
2962          'description' => 'Change the editing mode',
2963          'type'        => 'write',
2964          'ajax'        => true,
2965      ],
2966      'core_reportbuilder_reports_delete' => [
2967          'classname'   => 'core_reportbuilder\external\reports\delete',
2968          'description' => 'Delete report',
2969          'type'        => 'write',
2970          'ajax'        => true,
2971      ],
2972      'core_reportbuilder_reports_get' => [
2973          'classname'   => 'core_reportbuilder\external\reports\get',
2974          'description' => 'Get custom report',
2975          'type'        => 'read',
2976          'ajax'        => true,
2977      ],
2978      'core_reportbuilder_list_reports' => [
2979          'classname'   => 'core_reportbuilder\external\reports\listing',
2980          'description' => 'List custom reports for current user',
2981          'type'        => 'read',
2982          'services'    => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2983      ],
2984      'core_reportbuilder_retrieve_report' => [
2985          'classname'   => 'core_reportbuilder\external\reports\retrieve',
2986          'description' => 'Retrieve custom report content',
2987          'type'        => 'read',
2988          'services'    => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2989      ],
2990      'core_reportbuilder_retrieve_system_report' => [
2991          'classname'   => 'core_reportbuilder\external\systemreports\retrieve',
2992          'description' => 'Retrieve system report content',
2993          'type'        => 'read',
2994          'services'    => [MOODLE_OFFICIAL_MOBILE_SERVICE],
2995      ],
2996      'core_reportbuilder_can_view_system_report' => [
2997          'classname'   => 'core_reportbuilder\external\systemreports\can_view',
2998          'description' => 'Determine access to a system report',
2999          'type'        => 'read',
3000          'services'    => [MOODLE_OFFICIAL_MOBILE_SERVICE],
3001      ],
3002      'core_reportbuilder_view_report' => [
3003          'classname'   => 'core_reportbuilder\external\reports\view',
3004          'description' => 'Trigger custom report viewed',
3005          'type'        => 'write',
3006          'services'    => [MOODLE_OFFICIAL_MOBILE_SERVICE],
3007      ],
3008      'core_reportbuilder_columns_add' => [
3009          'classname'   => 'core_reportbuilder\external\columns\add',
3010          'description' => 'Add column to report',
3011          'type'        => 'write',
3012          'ajax'        => true,
3013      ],
3014      'core_reportbuilder_columns_delete' => [
3015          'classname'   => 'core_reportbuilder\external\columns\delete',
3016          'description' => 'Delete column from report',
3017          'type'        => 'write',
3018          'ajax'        => true,
3019      ],
3020      'core_reportbuilder_columns_reorder' => [
3021          'classname'   => 'core_reportbuilder\external\columns\reorder',
3022          'description' => 'Re-order column within report',
3023          'type'        => 'write',
3024          'ajax'        => true,
3025      ],
3026      'core_reportbuilder_columns_sort_get' => [
3027          'classname'   => 'core_reportbuilder\external\columns\sort\get',
3028          'description' => 'Retrieve column sorting for report',
3029          'type'        => 'read',
3030          'ajax'        => true,
3031      ],
3032      'core_reportbuilder_columns_sort_reorder' => [
3033          'classname'   => 'core_reportbuilder\external\columns\sort\reorder',
3034          'description' => 'Re-order column sorting within report',
3035          'type'        => 'write',
3036          'ajax'        => true,
3037      ],
3038      'core_reportbuilder_columns_sort_toggle' => [
3039          'classname'   => 'core_reportbuilder\external\columns\sort\toggle',
3040          'description' => 'Toggle sorting of column within report',
3041          'type'        => 'write',
3042          'ajax'        => true,
3043      ],
3044      'core_reportbuilder_conditions_add' => [
3045          'classname'   => 'core_reportbuilder\external\conditions\add',
3046          'description' => 'Add condition to report',
3047          'type'        => 'write',
3048          'ajax'        => true,
3049      ],
3050      'core_reportbuilder_conditions_delete' => [
3051          'classname'   => 'core_reportbuilder\external\conditions\delete',
3052          'description' => 'Delete condition from report',
3053          'type'        => 'write',
3054          'ajax'        => true,
3055      ],
3056      'core_reportbuilder_conditions_reorder' => [
3057          'classname'   => 'core_reportbuilder\external\conditions\reorder',
3058          'description' => 'Re-order condition within report',
3059          'type'        => 'write',
3060          'ajax'        => true,
3061      ],
3062      'core_reportbuilder_conditions_reset' => [
3063          'classname'   => 'core_reportbuilder\external\conditions\reset',
3064          'description' => 'Reset conditions for given report',
3065          'type'        => 'write',
3066          'ajax'        => true,
3067      ],
3068      'core_reportbuilder_filters_add' => [
3069          'classname'   => 'core_reportbuilder\external\filters\add',
3070          'description' => 'Add filter to report',
3071          'type'        => 'write',
3072          'ajax'        => true,
3073      ],
3074      'core_reportbuilder_filters_delete' => [
3075          'classname'   => 'core_reportbuilder\external\filters\delete',
3076          'description' => 'Delete filter from report',
3077          'type'        => 'write',
3078          'ajax'        => true,
3079      ],
3080      'core_reportbuilder_filters_reorder' => [
3081          'classname'   => 'core_reportbuilder\external\filters\reorder',
3082          'description' => 'Re-order filter within report',
3083          'type'        => 'write',
3084          'ajax'        => true,
3085      ],
3086      'core_reportbuilder_audiences_delete' => [
3087          'classname'   => 'core_reportbuilder\external\audiences\delete',
3088          'description' => 'Delete audience from report',
3089          'type'        => 'write',
3090          'ajax'        => true,
3091      ],
3092      'core_reportbuilder_schedules_delete' => [
3093          'classname'   => 'core_reportbuilder\external\schedules\delete',
3094          'description' => 'Delete schedule from report',
3095          'type'        => 'write',
3096          'ajax'        => true,
3097      ],
3098      'core_reportbuilder_schedules_send' => [
3099          'classname'   => 'core_reportbuilder\external\schedules\send',
3100          'description' => 'Send report schedule',
3101          'type'        => 'write',
3102          'ajax'        => true,
3103      ],
3104      'core_reportbuilder_schedules_toggle' => [
3105          'classname'   => 'core_reportbuilder\external\schedules\toggle',
3106          'description' => 'Toggle state of report schedule',
3107          'type'        => 'write',
3108          'ajax'        => true,
3109      ],
3110      'core_admin_set_plugin_state' => [
3111          'classname' => 'core_admin\external\set_plugin_state',
3112          'description' => 'Set the state of a plugin',
3113          'type' => 'write',
3114          'ajax' => true,
3115      ],
3116      'core_admin_set_plugin_order' => [
3117          'classname' => 'core_admin\external\set_plugin_order',
3118          'description' => 'Set the order of a plugin',
3119          'type' => 'write',
3120          'ajax' => true,
3121      ],
3122      'core_admin_set_block_protection' => [
3123          'classname' => 'core_admin\external\set_block_protection',
3124          'description' => 'Set the protection state for a block plugin',
3125          'type' => 'write',
3126          'ajax' => true,
3127      ],
3128      'core_moodlenet_send_activity' => [
3129          'classname'   => 'core\external\moodlenet_send_activity',
3130          'description' => 'Send activity to MoodleNet',
3131          'type'        => 'read',
3132          'ajax'        => true,
3133      ],
3134      'core_moodlenet_get_share_info_activity' => [
3135          'classname'   => 'core\external\moodlenet_get_share_info_activity',
3136          'description' => 'Get information about an activity being shared',
3137          'type'        => 'read',
3138          'ajax'        => true,
3139      ],
3140      'core_moodlenet_auth_check' => [
3141          'classname'   => 'core\external\moodlenet_auth_check',
3142          'description' => 'Check a user has authorized for a given MoodleNet site',
3143          'type'        => 'write',
3144          'ajax'        => true,
3145      ],
3146      'core_moodlenet_get_shared_course_info' => [
3147          'classname'   => 'core\external\moodlenet_get_shared_course_info',
3148          'description' => 'Get information about an course being shared',
3149          'type'        => 'read',
3150          'ajax'        => true,
3151      ],
3152      'core_moodlenet_send_course' => [
3153          'classname'   => 'core\external\moodlenet_send_course',
3154          'description' => 'Send course to MoodleNet',
3155          'type'        => 'read',
3156          'ajax'        => true,
3157      ],
3158  );
3159  
3160  $services = array(
3161     'Moodle mobile web service'  => array(
3162          'functions' => array(), // Unused as we add the service in each function definition, third party services would use this.
3163          'enabled' => 0,
3164          'restrictedusers' => 0,
3165          'shortname' => MOODLE_OFFICIAL_MOBILE_SERVICE,
3166          'downloadfiles' => 1,
3167          'uploadfiles' => 1
3168      ),
3169  );