External function return structure.

@return \external_description
19036
public static function list_plan_competencies_returns() {
        $uc = user_competency_exporter::get_read_structure();
        $ucp = user_competency_plan_exporter::get_read_structure();

        $uc->required = VALUE_OPTIONAL;
        $ucp->required = VALUE_OPTIONAL;

        return new external_multiple_structure(
            new external_single_structure(array(
                'competency' => competency_exporter::get_read_structure(),
                'usercompetency' => $uc,
                'usercompetencyplan' => $ucp
            ))
        );
    }
392056
public static function get_assessment_form_definition_returns() {
        return new external_single_structure(
            array(
                'dimenssionscount' => new external_value(PARAM_INT, 'The number of dimenssions used by the form.'),
                'descriptionfiles' => new external_files('Files in the description text'),
                'options' => new external_multiple_structure(
                    new external_single_structure(
                        array(
                            'name' => new external_value(PARAM_ALPHANUMEXT, 'Option name.'),
                            'value' => new external_value(PARAM_NOTAGS, 'Option value.')
                        )
                    ), 'The form options.'
                ),
                'fields' => new external_multiple_structure(
                    new external_single_structure(
                        array(
                            'name' => new external_value(PARAM_ALPHANUMEXT, 'Field name.'),
                            'value' => new external_value(PARAM_RAW, 'Field default value.')
                        )
                    ), 'The form fields.'
                ),
                'current' => new external_multiple_structure(
                    new external_single_structure(
                        array(
                            'name' => new external_value(PARAM_ALPHANUMEXT, 'Field name.'),
                            'value' => new external_value(PARAM_RAW, 'Current field value.')
                        )
                    ), 'The current field values.'
                ),
                'dimensionsinfo' => new external_multiple_structure(
                    new external_single_structure(
                        array(
                            'id' => new external_value(PARAM_INT, 'Dimension id.'),
                            'min' => new external_value(PARAM_FLOAT, 'Minimum grade for the dimension.'),
                            'max' => new external_value(PARAM_FLOAT, 'Maximum grade for the dimension.'),
                            'weight' => new external_value(PARAM_TEXT, 'The weight of the dimension.'),
                            'scale' => new external_value(PARAM_TEXT, 'Scale items (if used).', VALUE_OPTIONAL),
                        )
                    ), 'The dimensions general information.'
                ),
                'warnings' => new external_warnings()
            )
        );
    }
1238234
public static function get_content_returns() {
        return new external_single_structure(
            array(
                'templates' => new external_multiple_structure(
                    new external_single_structure(
                        array(
                            'id' => new external_value(PARAM_TEXT, 'ID of the template.'),
                            'html' => new external_value(PARAM_RAW, 'HTML code.'),
                        )
                    ),
                    'Templates required by the generated content.'
                ),
                'javascript' => new external_value(PARAM_RAW, 'JavaScript code.'),
                'otherdata' => new external_multiple_structure(
                    new external_single_structure(
                        array(
                            'name' => new external_value(PARAM_RAW, 'Field name.'),
                            'value' => new external_value(PARAM_RAW, 'Field value.')
                        )
                    ),
                    'Other data that can be used or manipulated by the template via 2-way data-binding.'
                ),
                'files' => new external_files('Files in the content.'),
                'restrict' => new external_single_structure(
                    array(
                        'users' => new external_multiple_structure(
                            new external_value(PARAM_INT, 'user id'), 'List of allowed users.', VALUE_OPTIONAL
                        ),
                        'courses' => new external_multiple_structure(
                            new external_value(PARAM_INT, 'course id'), 'List of allowed courses.', VALUE_OPTIONAL
                        ),
                    ),
                    'Restrict this content to certain users or courses.'
                )
            )
        );
    }
231721
public static function get_purpose_options_parameters() {
        return new external_function_parameters([
            'includeinherit' => new external_value(PARAM_BOOL, 'Include option "Inherit"', VALUE_DEFAULT, true),
            'includenotset' => new external_value(PARAM_BOOL, 'Include option "Not set"', VALUE_DEFAULT, false),
        ]);
    }
184034
public static function get_cohorts_returns() {
        return new external_multiple_structure(
            new external_single_structure(
                array(
                    'id' => new external_value(PARAM_INT, 'ID of the cohort'),
                    'name' => new external_value(PARAM_RAW, 'cohort name'),
                    'idnumber' => new external_value(PARAM_RAW, 'cohort idnumber'),
                    'description' => new external_value(PARAM_RAW, 'cohort description'),
                    'descriptionformat' => new external_format_value('description'),
                    'visible' => new external_value(PARAM_BOOL, 'cohort visible'),
                    'theme' => new external_value(PARAM_THEME, 'cohort theme', VALUE_OPTIONAL),
                )
            )
        );
    }
1099108
public static function get_course_notes_returns() {
        return new external_single_structure(
            array(
                'sitenotes' => new external_multiple_structure(
                    new external_single_structure(self::get_note_structure() , ''), 'site notes', VALUE_OPTIONAL
                ),
                'coursenotes' => new external_multiple_structure(
                    new external_single_structure(self::get_note_structure() , ''), 'couse notes', VALUE_OPTIONAL
                ),
                'personalnotes' => new external_multiple_structure(
                    new external_single_structure(self::get_note_structure() , ''), 'personal notes', VALUE_OPTIONAL
                ),
                'canmanagesystemnotes' => new external_value(PARAM_BOOL, 'Whether the user can manage notes at system level.',
                    VALUE_OPTIONAL),
                'canmanagecoursenotes' => new external_value(PARAM_BOOL, 'Whether the user can manage notes at the given course.',
                    VALUE_OPTIONAL),
                'warnings' => new external_warnings()
            ), 'notes'
        );
    }
213514
public static function get_notes_returns() {
        return new external_single_structure(
            array(
                'notes' => new external_multiple_structure(
                    new external_single_structure(
                        array(
                            'noteid' => new external_value(PARAM_INT, 'id of the note', VALUE_OPTIONAL),
                            'userid' => new external_value(PARAM_INT, 'id of the user the note is about', VALUE_OPTIONAL),
                            'publishstate' => new external_value(PARAM_ALPHA, '\'personal\', \'course\' or \'site\'', VALUE_OPTIONAL),
                            'courseid' => new external_value(PARAM_INT, 'course id of the note', VALUE_OPTIONAL),
                            'text' => new external_value(PARAM_RAW, 'the text of the message - text or HTML', VALUE_OPTIONAL),
                            'format' => new external_format_value('text', VALUE_OPTIONAL),
                        ), 'note'
                    )
                 ),
                 'warnings' => new external_warnings('item is always \'note\'',
                        'When errorcode is savedfailed the note could not be modified.' .
                        'When errorcode is badparam, an incorrect parameter was provided.' .
                        'When errorcode is badid, the note does not exist',
                        'errorcode can be badparam (incorrect parameter), savedfailed (could not be modified), or badid (note does not exist)')
            )
        );
    }
1075734
public static function get_course_groups_returns() {
        return new external_multiple_structure(
            new external_single_structure(
                array(
                    'id' => new external_value(PARAM_INT, 'group record id'),
                    'courseid' => new external_value(PARAM_INT, 'id of course'),
                    'name' => new external_value(PARAM_TEXT, 'multilang compatible name, course unique'),
                    'description' => new external_value(PARAM_RAW, 'group description text'),
                    'descriptionformat' => new external_format_value('description'),
                    'enrolmentkey' => new external_value(PARAM_RAW, 'group enrol secret phrase'),
                    'idnumber' => new external_value(PARAM_RAW, 'id number')
                )
            )
        );
    }
576617
public static function get_filetypes_browser_data_returns() {

        $type = new external_single_structure([
            'key' => new external_value(PARAM_RAW, 'The file type identifier'),
            'name' => new external_value(PARAM_RAW, 'The file type name'),
            'selected' => new external_value(PARAM_BOOL, 'Should it be marked as selected'),
            'ext' => new external_value(PARAM_RAW, 'The file extension associated with the file type'),
        ]);

        $group = new external_single_structure([
            'key' => new external_value(PARAM_RAW, 'The file type group identifier'),
            'name' => new external_value(PARAM_RAW, 'The file type group name'),
            'selectable' => new external_value(PARAM_BOOL, 'Can it be marked as selected'),
            'selected' => new external_value(PARAM_BOOL, 'Should it be marked as selected'),
            'ext' => new external_value(PARAM_RAW, 'The list of file extensions associated with the group'),
            'expanded' => new external_value(PARAM_BOOL, 'Should the group start as expanded or collapsed'),
            'types' => new external_multiple_structure($type, 'List of file types in the group'),
        ]);

        return new external_single_structure([
            'groups' => new external_multiple_structure($group, 'List of file type groups'),
        ]);
    }
1299605
public static function create_category_parameters() {
        return new external_function_parameters(
            array(
                'component' => new external_value(PARAM_COMPONENT, 'component', VALUE_REQUIRED),
                'area' => new external_value(PARAM_ALPHANUMEXT, 'area', VALUE_REQUIRED),
                'itemid' => new external_value(PARAM_INT, 'itemid', VALUE_REQUIRED)
            )
        );
    }
1360120
public static function load_template_with_dependencies_returns() {
        $resourcestructure = new external_single_structure([
            'component' => new external_value(PARAM_COMPONENT, 'component containing the resource'),
            'name' => new external_value(PARAM_TEXT, 'name of the resource'),
            'value' => new external_value(PARAM_RAW, 'resource value')
        ]);

        return new external_single_structure([
            'templates' => new external_multiple_structure($resourcestructure),
            'strings' => new external_multiple_structure($resourcestructure)
        ]);
    }
566215
public static function get_folders_by_courses_returns() {
        return new external_single_structure(
            array(
                'folders' => new external_multiple_structure(
                    new external_single_structure(
                        array(
                            'id' => new external_value(PARAM_INT, 'Module id'),
                            'coursemodule' => new external_value(PARAM_INT, 'Course module id'),
                            'course' => new external_value(PARAM_INT, 'Course id'),
                            'name' => new external_value(PARAM_RAW, 'Page name'),
                            'intro' => new external_value(PARAM_RAW, 'Summary'),
                            'introformat' => new external_format_value('intro', 'Summary format'),
                            'introfiles' => new external_files('Files in the introduction text'),
                            'revision' => new external_value(PARAM_INT, 'Incremented when after each file changes, to avoid cache'),
                            'timemodified' => new external_value(PARAM_INT, 'Last time the folder was modified'),
                            'display' => new external_value(PARAM_INT, 'Display type of folder contents on a separate page or inline'),
                            'showexpanded' => new external_value(PARAM_INT, '1 = expanded, 0 = collapsed for sub-folders'),
                            'showdownloadfolder' => new external_value(PARAM_INT, 'Whether to show the download folder button'),
                            'section' => new external_value(PARAM_INT, 'Course section id'),
                            'visible' => new external_value(PARAM_INT, 'Module visibility'),
                            'groupmode' => new external_value(PARAM_INT, 'Group mode'),
                            'groupingid' => new external_value(PARAM_INT, 'Grouping id'),
                        )
                    )
                ),
                'warnings' => new external_warnings(),
            )
        );
    }
1107283
public static function get_category_options_parameters() {
        return new external_function_parameters([
            'includeinherit' => new external_value(PARAM_BOOL, 'Include option "Inherit"', VALUE_DEFAULT, true),
            'includenotset' => new external_value(PARAM_BOOL, 'Include option "Not set"', VALUE_DEFAULT, false),
        ]);
    }
1064927
public static function create_categories_parameters() {
        return new external_function_parameters(
            array(
                'categories' => new external_multiple_structure(
                        new external_single_structure(
                            array(
                                'name' => new external_value(PARAM_TEXT, 'new category name'),
                                'parent' => new external_value(PARAM_INT,
                                        'the parent category id inside which the new category will be created
                                         - set to 0 for a root category',
                                        VALUE_DEFAULT, 0),
                                'idnumber' => new external_value(PARAM_RAW,
                                        'the new category idnumber', VALUE_OPTIONAL),
                                'description' => new external_value(PARAM_RAW,
                                        'the new category description', VALUE_OPTIONAL),
                                'descriptionformat' => new external_format_value('description', VALUE_DEFAULT),
                                'theme' => new external_value(PARAM_THEME,
                                        'the new category theme. This option must be enabled on moodle',
                                        VALUE_OPTIONAL),
                        )
                    )
                )
            )
        );
    }
957924
public static function step_structure_returns() {
        return new external_single_structure([
            'title'             => new external_value(PARAM_RAW,
                    'Step Title'),
            'content'           => new external_value(PARAM_RAW,
                    'Step Content'),
            'element'           => new external_value(PARAM_TEXT,
                    'Step Target'),
            'placement'         => new external_value(PARAM_TEXT,
                    'Step Placement'),
            'delay'             => new external_value(PARAM_INT,
                    'Delay before showing the step (ms)', VALUE_OPTIONAL),
            'backdrop'          => new external_value(PARAM_BOOL,
                    'Whether a backdrop should be used', VALUE_OPTIONAL),
            'reflex'            => new external_value(PARAM_BOOL,
                    'Whether to move to the next step when the target element is clicked', VALUE_OPTIONAL),
            'orphan'            => new external_value(PARAM_BOOL,
                    'Whether to display the step even if it could not be found', VALUE_OPTIONAL),
            'stepid'            => new external_value(PARAM_INT,
                    'The actual ID of the step', VALUE_OPTIONAL),
        ]);
    }
801086
public static function get_discussion_posts_returns() {
        return new external_single_structure([
            'posts' => new external_multiple_structure(\mod_forum\local\exporters\post::get_read_structure()),
            'ratinginfo' => \core_rating\external\util::external_ratings_structure(),
            'warnings' => new external_warnings()
        ]);
    }
1278873
public static function get_groupings_returns() {
        return new external_multiple_structure(
            new external_single_structure(
                array(
                    'id' => new external_value(PARAM_INT, 'grouping record id'),
                    'courseid' => new external_value(PARAM_INT, 'id of course'),
                    'name' => new external_value(PARAM_TEXT, 'multilang compatible name, course unique'),
                    'description' => new external_value(PARAM_RAW, 'grouping description text'),
                    'descriptionformat' => new external_format_value('description'),
                    'idnumber' => new external_value(PARAM_RAW, 'id number'),
                    'groups' => new external_multiple_structure(
                        new external_single_structure(
                            array(
                                'id' => new external_value(PARAM_INT, 'group record id'),
                                'courseid' => new external_value(PARAM_INT, 'id of course'),
                                'name' => new external_value(PARAM_TEXT, 'multilang compatible name, course unique'),
                                'description' => new external_value(PARAM_RAW, 'group description text'),
                                'descriptionformat' => new external_format_value('description'),
                                'enrolmentkey' => new external_value(PARAM_RAW, 'group enrol secret phrase'),
                                'idnumber' => new external_value(PARAM_RAW, 'id number')
                            )
                        ),
                    'optional groups', VALUE_OPTIONAL)
                )
            )
        );
    }