<?php

defined('MOODLE_INTERNAL') || die();
$functions = array(
    'local_custom_service_update_courses_lti' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'update_courses_lti',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Update courses LTI to show in Gradebook',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_update_courses_sections' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'update_courses_sections',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Update courses sections title in DB',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_check_login' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'check_login',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Check login in DB moodle',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_activity_Section_course' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_activity_Section_course',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get all activity in course section',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_enrol_user_course' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_enrol_user_course',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get list of courses user is enrolled',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_add_role_for_parent' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'add_role_for_parent',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Add role for parent and children',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_info_children_from_laravel' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_info_children_from_laravel',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Add role for parent and children',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_info_calendar' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_info_calendar',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get info calendar',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_total_student_group' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_total_student_group',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get Student total in group',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_total_active_user' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_total_active_user',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get Total Active Users',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_data_calendar' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_data_calendar',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get Data Calendar',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_data_calendar_by_group' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_data_calendar_by_group',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get Data Calendar By Group',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_user_course' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_user_course',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get User Course',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_data_report' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_data_report',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get Report',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_filter' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'filter',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Filter',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_lp' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'lp',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'lp',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_user_course_by_all_role' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_user_course_by_all_role',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get User Course By All Role',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_user_course_learning' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_user_course_learning',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get User Course By All Role',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_user_course_complete' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_user_course_completed',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get User Course By All Role',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_new_filter' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'new_filter',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'New Filter',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_ai_get_course_content' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'ai_get_course_content',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Ai Get Course Content',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_course_completed_user_emails' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_course_completed_user_emails',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get Course Completed User Emails',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_sections' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_sections',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get settings of sections.',
        'type' => 'create',
        'capabilities' => 'moodle/course:view',
    ),
    'local_custom_service_move_section' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'move_section',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Move section to given position.',
        'type' => 'create',
        'capabilities' => 'moodle/course:update, moodle/course:movesections',
    ),
    'local_custom_service_update_sections' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'update_sections',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Update sections.',
        'type' => 'create',
        'capabilities' => 'moodle/course:update',
    ),
    'local_custom_service_delete_sections' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'delete_sections',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Delete sections.',
        'type' => 'create',
        'capabilities' => 'moodle/course:update',
    ),
    'local_custom_service_create_sections' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'create_sections',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Create sections.',
        'type' => 'create',
        'capabilities' => 'moodle/course:update',
    ),
    'local_custom_service_get_user_enrol_course' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_user_enrol_course',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get Course Image.',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_data_student_by_teacher' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_data_student_by_teacher',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get Course Image.',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_add_image_course' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'add_image_course',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Upload ảnh cho khóa học',
        'type'        => 'write',
        'capabilities'=> 'moodle/course:update',
    ),
    'local_custom_service_add_file_resource' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'add_file_resource',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Upload file to activity resource',
        'type'        => 'write',
        'capabilities'=> 'moodle/course:update',
    ),
    'local_custom_service_create_activity_label' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'create_activity_label',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Create Activity Label',
        'type'        => 'write',
        'capabilities'=> 'moodle/course:update',
    ),
    'local_custom_service_update_activity' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'update_activity',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Create Activity Label',
        'type'        => 'write',
        'capabilities'=> 'moodle/course:update',
    ),
    'local_custom_service_get_enrolled_courses' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'get_enrolled_courses',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Get Enrolled Course',
        'type'        => 'write',
        'capabilities'=> 'moodle/course:update',
    ),
    'local_custom_service_get_user_enrol_course_by_teacher' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_user_enrol_course_by_teacher',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get User Enrol Course Detail By Teacher.',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_create_activity_quiz' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'create_activity_quiz',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Create Activity Quiz',
        'type'        => 'write',
        'capabilities'=> 'moodle/course:update',
    ),
    'local_custom_service_get_user_data_certificate' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_user_data_certificate',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get User Data Certificate.',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_move_activity_to_section' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'move_activity_to_section',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Move activity to section.',
        'type' => 'create',
        'capabilities' => 'moodle/course:update',
    ),
    'local_custom_service_move_activity_before_after' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'move_activity_before_after',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Move activity to before after.',
        'type' => 'create',
        'capabilities' => 'moodle/course:update',
    ),
    'local_custom_service_update_activity_quiz' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'update_activity_quiz',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Update Activity Quiz',
        'type'        => 'write',
        'capabilities'=> 'moodle/course:update',
    ),
    'local_custom_service_update_activity_url' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'update_activity_url',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Update Activity Url',
        'type'        => 'write',
        'capabilities'=> 'moodle/course:update',
    ),
    'local_custom_service_update_activity_resource' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'update_activity_resource',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Update Activity Resource',
        'type'        => 'write',
        'capabilities'=> 'moodle/course:update',
    ),
    'local_custom_service_update_activity_assign' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'update_activity_assign',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Update Activity Assignment',
        'type'        => 'write',
        'capabilities'=> 'moodle/course:update',
    ),
    'local_custom_service_get_detail_module' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'get_detail_module',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Get Detail Module',
        'type'        => 'write',
        'capabilities'=> 'moodle/course:update',
    ),
    'local_custom_service_get_uploaded_files' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_uploaded_files',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get Uploaded Files.',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_create_course_with_json' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'create_course_with_json',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Create Course With Json',
        'type'        => 'write',
        'ajax'        => true,
    ),
    'local_custom_service_create_quiz_and_question' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'create_quiz_and_question',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Create Quiz And Question',
        'type'        => 'write',
        'ajax'        => true,
    ),
    'local_custom_service_get_activity_complete' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_activity_complete',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get Activity Complete.',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_activity_due' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_activity_due',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get activity due.',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_data_basic_course_information' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_data_basic_course_information',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get Data Basic course information.',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_data_basic_course_information_checkmate' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_data_basic_course_information_checkmate',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get Data Basic course information Checkmate.',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_get_content_course_checkmate' => array(
        'classname' => 'local_custom_service_external',
        'methodname' => 'get_content_course_checkmate',
        'classpath' => 'local/custom_service/externallib.php',
        'description' => 'Get Content Course Checkmate.',
        'type' => 'write',
        'ajax' => true,
    ),
    'local_custom_service_create_content_block_html' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'create_content_block_html',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Create Content plugin blocks html',
        'type'        => 'write',
        'ajax'        => true,
    ),
    'local_custom_service_create_activity_book' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'create_activity_book',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Create Activity Book',
        'type'        => 'write',
        'ajax'        => true,
    ),
    'local_custom_service_get_course_by_category_ids' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'get_course_by_category_ids',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Get Course By Category IDs',
        'type'        => 'write',
        'ajax'        => true,
    ),
    'local_custom_service_check_enrolled_user_course_by_courseids' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'check_enrolled_user_course_by_courseids',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Check Enrolled User Course By Course IDs',
        'type'        => 'write',
        'ajax'        => true,
    ),
    'local_custom_service_save_definitions_custom_service' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'save_definitions_custom_service',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Save definitions',
        'type'        => 'write',
        'ajax'        => true,
    ),
    'local_custom_service_reorder_category' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'reorder_category',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Reorder category',
        'type'        => 'write',
        'ajax'        => true,
    ),
    'local_custom_service_get_user_info_by_emails' => array(
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'get_user_info_by_emails',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Get User By Emails',
        'type'        => 'write',
        'ajax'        => true,
    ),
    'local_custom_service_get_h5p_embed_url' => [
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'get_h5p_embed_url',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Lấy link nhúng H5P activity',
        'type'        => 'read',
        'ajax'        => true,
        'capabilities' => 'mod/h5pactivity:view'
    ],
    'local_custom_service_get_h5p_result' => [
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'get_h5p_result',
        'classpath'   => 'local/custom_service/externallib.php',
        'description' => 'Lấy kết quả làm bài từ attempt ID',
        'type'        => 'read',
        'ajax'        => true,
        'capabilities' => 'mod/h5pactivity:submit'
    ],
    'local_custom_service_submit_h5p_result' => [
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'submit_h5p_result',
        'classpath'   => '',
        'description' => 'Submit H5P result to Moodle from external client',
        'type'        => 'write',
        'ajax'        => true,
        'capabilities' => '',
    ],
    'local_custom_service_submit_hvp_result' => [
        'classname'   => 'local_custom_service_external',
        'methodname'  => 'submit_hvp_result',
        'classpath'   => '',
        'description' => 'Submit HVP result to Moodle from external client',
        'type'        => 'write',
        'ajax'        => true,
        'capabilities' => '',
    ],
);

$services = array(
    'M-Star Custom Services' => array(
        'functions' => array(
            'local_custom_service_update_courses_lti',
            'local_custom_service_update_courses_sections',
            'local_custom_service_check_login',
            'local_custom_service_get_activity_Section_course',
            'local_custom_service_get_enrol_user_course',
            'local_custom_service_add_role_for_parent',
            'local_custom_service_get_info_children_from_laravel',
            'local_custom_service_get_info_calendar',
            'local_custom_service_get_total_student_group',
            'local_custom_service_get_total_active_user',
            'local_custom_service_get_data_calendar',
            'local_custom_service_get_data_calendar_by_group',
            'local_custom_service_get_user_course',
            'local_custom_service_get_data_report',
            'local_custom_service_filter',
            'local_custom_service_lp',
            'local_custom_service_get_user_course_by_all_role',
            'local_custom_service_get_user_course_complete',
            'local_custom_service_get_user_course_learning',
            'local_custom_service_new_filter',
            'local_custom_service_ai_get_course_content',
            'local_custom_service_get_course_completed_user_emails',
            'local_custom_service_get_sections',
            'local_custom_service_move_section',
            'local_custom_service_update_sections',
            'local_custom_service_delete_sections',
            'local_custom_service_create_sections',
            'local_custom_service_get_user_enrol_course',
            'local_custom_service_get_data_student_by_teacher',
            'local_custom_service_add_image_course',
            'local_custom_service_add_file_resource',
            'local_custom_service_create_activity_label',
            'local_custom_service_update_activity',
            'local_custom_service_get_enrolled_courses',
            'local_custom_service_get_user_enrol_course_by_teacher',
            'local_custom_service_create_activity_quiz',
            'local_custom_service_get_user_data_certificate',
            'local_custom_service_move_activity_to_section',
            'local_custom_service_move_activity_before_after',
            'local_custom_service_update_activity_quiz',
            'local_custom_service_update_activity_url',
            'local_custom_service_get_detail_module',
            'local_custom_service_update_activity_resource',
            'local_custom_service_get_uploaded_files',
            'local_custom_service_update_activity_assign',
            'local_custom_service_create_course_with_json',
            'local_custom_service_create_quiz_and_question',
            'local_custom_service_get_activity_due',
            'local_custom_service_get_activity_complete',
            'local_custom_service_get_data_basic_course_information',
            'local_custom_service_get_data_basic_course_information_checkmate',
            'local_custom_service_get_content_course_checkmate',
            'local_custom_service_create_content_block_html',
            'local_custom_service_create_activity_book',
            'local_custom_service_get_course_by_category_ids',
            'local_custom_service_check_enrolled_user_course_by_courseids',
            'local_custom_service_save_definitions_custom_service',
            'local_custom_service_reorder_category',
            'local_custom_service_get_user_info_by_emails',
            'local_custom_service_submit_h5p_result',
            'local_custom_service_submit_hvp_result'
        ),
        'restrictedusers' => 0,
        'enabled' => 1,
        'shortname' => 'custom_course_service',
    )
);
